nltk API Reference

Full documentation for nltk (3.10.0)

nltk.ARLSTem
Python Library Documentation: class ARLSTem in module nltk.stem.arlstem

class ARLSTem(nltk.stem.api.StemmerI)
 |  ARLSTem stemmer : a light Arabic Stemming algorithm without any dictionary.
 |  Department of Telecommunication & Information Processing. USTHB University,
 |  Algiers, Algeria.
 |  ARLSTem.stem(token) returns the Arabic stem for the input token.
 |  The ARLSTem Stemmer requires that all tokens are encoded using Unicode
 |  encoding.
 |
 |  Method resolution order:
 |      ARLSTem
 |      nltk.stem.api.StemmerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  fem2masc(self, token)
 |      transform the word from the feminine form to the masculine form.
 |
 |  norm(self, token)
 |      normalize the word by removing diacritics, replacing hamzated Alif
 |      with Alif replacing AlifMaqsura with Yaa and removing Waaw at the
 |      beginning.
 |
 |  plur2sing(self, token)
 |      transform the word from the plural form to the singular form.
 |
 |  pref(self, token)
 |      remove prefixes from the words' beginning.
 |
 |  stem(self, token)
 |      call this function to get the word's stem based on ARLSTem .
 |
 |  suff(self, token)
 |      remove suffixes from the word's end.
 |
 |  verb(self, token)
 |      stem the verb prefixes and suffixes or both
 |
 |  verb_t1(self, token)
 |      stem the present prefixes and suffixes
 |
 |  verb_t2(self, token)
 |      stem the future prefixes and suffixes
 |
 |  verb_t3(self, token)
 |      stem the present suffixes
 |
 |  verb_t4(self, token)
 |      stem the present prefixes
 |
 |  verb_t5(self, token)
 |      stem the future prefixes
 |
 |  verb_t6(self, token)
 |      stem the order prefixes
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.stem.api.StemmerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ARLSTem2
Python Library Documentation: class ARLSTem2 in module nltk.stem.arlstem2

class ARLSTem2(nltk.stem.api.StemmerI)
 |  Return a stemmed Arabic word after removing affixes. This an improved
 |  version of the previous algorithm, which reduces under-stemming errors.
 |  Typically used in Arabic search engine, information retrieval and NLP.
 |
 |      >>> from nltk.stem import arlstem2
 |      >>> stemmer = ARLSTem2()
 |      >>> word = stemmer.stem('يعمل')
 |      >>> print(word)
 |      عمل
 |
 |  :param token: The input Arabic word (unicode) to be stemmed
 |  :type token: unicode
 |  :return: A unicode Arabic word
 |
 |  Method resolution order:
 |      ARLSTem2
 |      nltk.stem.api.StemmerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  adjective(self, token)
 |      remove the infixes from adjectives
 |
 |  fem2masc(self, token)
 |      transform the word from the feminine form to the masculine form.
 |
 |  norm(self, token)
 |      normalize the word by removing diacritics, replace hamzated Alif
 |      with Alif bare, replace AlifMaqsura with Yaa and remove Waaw at the
 |      beginning.
 |
 |  plur2sing(self, token)
 |      transform the word from the plural form to the singular form.
 |
 |  pref(self, token)
 |      remove prefixes from the words' beginning.
 |
 |  stem(self, token)
 |      Strip affixes from the token and return the stem.
 |
 |      :param token: The token that should be stemmed.
 |      :type token: str
 |
 |  stem1(self, token)
 |      call this function to get the first stem
 |
 |  suff(self, token)
 |      remove the suffixes from the word's ending.
 |
 |  verb(self, token)
 |      stem the verb prefixes and suffixes or both
 |
 |  verb_t1(self, token)
 |      stem the present tense co-occurred prefixes and suffixes
 |
 |  verb_t2(self, token)
 |      stem the future tense co-occurred prefixes and suffixes
 |
 |  verb_t3(self, token)
 |      stem the present tense suffixes
 |
 |  verb_t4(self, token)
 |      stem the present tense prefixes
 |
 |  verb_t5(self, token)
 |      stem the future tense prefixes
 |
 |  verb_t6(self, token)
 |      stem the imperative tense prefixes
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.stem.api.StemmerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.AbstractLazySequence
Python Library Documentation: class AbstractLazySequence in module nltk.collections

class AbstractLazySequence(builtins.object)
 |  An abstract base class for read-only sequences whose values are
 |  computed as needed.  Lazy sequences act like tuples -- they can be
 |  indexed, sliced, and iterated over; but they may not be modified.
 |
 |  The most common application of lazy sequences in NLTK is for
 |  corpus view objects, which provide access to the contents of a
 |  corpus without loading the entire corpus into memory, by loading
 |  pieces of the corpus from disk as needed.
 |
 |  The result of modifying a mutable element of a lazy sequence is
 |  undefined.  In particular, the modifications made to the element
 |  may or may not persist, depending on whether and when the lazy
 |  sequence caches that element's value or reconstructs it from
 |  scratch.
 |
 |  Subclasses are required to define two methods: ``__len__()``
 |  and ``iterate_from()``.
 |
 |  Methods defined here:
 |
 |  __add__(self, other)
 |      Return a list concatenating self with other.
 |
 |  __contains__(self, value)
 |      Return true if this list contains ``value``.
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __getitem__(self, i)
 |      Return the *i* th token in the corpus file underlying this
 |      corpus view.  Negative indices and spans are both supported.
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      :raise ValueError: Corpus view objects are unhashable.
 |
 |  __iter__(self)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __len__(self)
 |      Return the number of tokens in the corpus file underlying this
 |      corpus view.
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __radd__(self, other)
 |      Return a list concatenating other with self.
 |
 |  __repr__(self)
 |      Return a string representation for this corpus view that is
 |      similar to a list's representation; but if it would be more
 |      than 60 characters long, it is truncated.
 |
 |  __rmul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  count(self, value)
 |      Return the number of times this list contains ``value``.
 |
 |  index(self, value, start=None, stop=None)
 |      Return the index of the first occurrence of ``value`` in this
 |      list that is greater than or equal to ``start`` and less than
 |      ``stop``.  Negative start and stop values are treated like negative
 |      slice bounds -- i.e., they count from the end of the list.
 |
 |  iterate_from(self, start)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view, starting at the token number
 |      ``start``.  If ``start>=len(self)``, then this iterator will
 |      generate no tokens.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.AffixTagger
Python Library Documentation: class AffixTagger in module nltk.tag.sequential

class AffixTagger(ContextTagger)
 |  AffixTagger(train=None, model=None, affix_length=-3, min_stem_length=2, backoff=None, cutoff=0, verbose=False)
 |
 |  A tagger that chooses a token's tag based on a leading or trailing
 |  substring of its word string.  (It is important to note that these
 |  substrings are not necessarily "true" morphological affixes).  In
 |  particular, a fixed-length substring of the word is looked up in a
 |  table, and the corresponding tag is returned.  Affix taggers are
 |  typically constructed by training them on a tagged corpus.
 |
 |  Construct a new affix tagger.
 |
 |  :param affix_length: The length of the affixes that should be
 |      considered during training and tagging.  Use negative
 |      numbers for suffixes.
 |  :param min_stem_length: Any words whose length is less than
 |      min_stem_length+abs(affix_length) will be assigned a
 |      tag of None by this tagger.
 |
 |  Method resolution order:
 |      AffixTagger
 |      ContextTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, train=None, model=None, affix_length=-3, min_stem_length=2, backoff=None, cutoff=0, verbose=False)
 |      :param context_to_tag: A dictionary mapping contexts to tags.
 |      :param backoff: The backoff tagger that should be used for this tagger.
 |
 |  context(self, tokens, index, history)
 |      :return: the context that should be used to look up the tag
 |          for the specified token; or None if the specified token
 |          should not be handled by this tagger.
 |      :rtype: (hashable)
 |
 |  encode_json_obj(self)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  decode_json_obj(obj)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  json_tag = 'nltk.tag.sequential.AffixTagger'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ContextTagger:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  size(self)
 |      :return: The number of entries in the table used by this
 |          tagger to map from contexts to tags.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.AlignedSent
Python Library Documentation: class AlignedSent in module nltk.translate.api

class AlignedSent(builtins.object)
 |  AlignedSent(words, mots, alignment=None)
 |
 |  Return an aligned sentence object, which encapsulates two sentences
 |  along with an ``Alignment`` between them.
 |
 |  Typically used in machine translation to represent a sentence and
 |  its translation.
 |
 |      >>> from nltk.translate import AlignedSent, Alignment
 |      >>> algnsent = AlignedSent(['klein', 'ist', 'das', 'Haus'],
 |      ...     ['the', 'house', 'is', 'small'], Alignment.fromstring('0-3 1-2 2-0 3-1'))
 |      >>> algnsent.words
 |      ['klein', 'ist', 'das', 'Haus']
 |      >>> algnsent.mots
 |      ['the', 'house', 'is', 'small']
 |      >>> algnsent.alignment
 |      Alignment([(0, 3), (1, 2), (2, 0), (3, 1)])
 |      >>> from nltk.corpus import comtrans
 |      >>> print(comtrans.aligned_sents()[54])
 |      <AlignedSent: 'Weshalb also sollten...' -> 'So why should EU arm...'>
 |      >>> print(comtrans.aligned_sents()[54].alignment)
 |      0-0 0-1 1-0 2-2 3-4 3-5 4-7 5-8 6-3 7-9 8-9 9-10 9-11 10-12 11-6 12-6 13-13
 |
 |  :param words: Words in the target language sentence
 |  :type words: list(str)
 |  :param mots: Words in the source language sentence
 |  :type mots: list(str)
 |  :param alignment: Word-level alignments between ``words`` and ``mots``.
 |      Each alignment is represented as a 2-tuple (words_index, mots_index).
 |  :type alignment: Alignment
 |
 |  Methods defined here:
 |
 |  __init__(self, words, mots, alignment=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return a string representation for this ``AlignedSent``.
 |
 |      :rtype: str
 |
 |  __str__(self)
 |      Return a human-readable string representation for this ``AlignedSent``.
 |
 |      :rtype: str
 |
 |  invert(self)
 |      Return the aligned sentence pair, reversing the directionality
 |
 |      :rtype: AlignedSent
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  mots
 |
 |  words
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  alignment
nltk.Alignment
Python Library Documentation: class Alignment in module nltk.translate.api

class Alignment(builtins.frozenset)
 |  Alignment(pairs)
 |
 |  A storage class for representing alignment between two sequences, s1, s2.
 |  In general, an alignment is a set of tuples of the form (i, j, ...)
 |  representing an alignment between the i-th element of s1 and the
 |  j-th element of s2.  Tuples are extensible (they might contain
 |  additional data, such as a boolean to indicate sure vs possible alignments).
 |
 |      >>> from nltk.translate import Alignment
 |      >>> a = Alignment([(0, 0), (0, 1), (1, 2), (2, 2)])
 |      >>> a.invert()
 |      Alignment([(0, 0), (1, 0), (2, 1), (2, 2)])
 |      >>> print(a.invert())
 |      0-0 1-0 2-1 2-2
 |      >>> a[0]
 |      [(0, 1), (0, 0)]
 |      >>> a.invert()[2]
 |      [(2, 1), (2, 2)]
 |      >>> b = Alignment([(0, 0), (0, 1)])
 |      >>> b.issubset(a)
 |      True
 |      >>> c = Alignment.fromstring('0-0 0-1')
 |      >>> b == c
 |      True
 |
 |  Method resolution order:
 |      Alignment
 |      builtins.frozenset
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __getitem__(self, key)
 |      Look up the alignments that map from a given (left) index.
 |      Returns an empty list for an index that has no alignments.
 |
 |      Only integer indices are supported. Slicing and other non-integer
 |      keys are rejected with ``TypeError`` rather than silently returning
 |      ``[]`` -- the sparse index has no contiguous range to slice, so a
 |      mistaken lookup should fail loudly instead of masking the bug.
 |
 |  __repr__(self)
 |      Produce a Giza-formatted string representing the alignment.
 |
 |  __str__(self)
 |      Produce a Giza-formatted string representing the alignment.
 |
 |  invert(self)
 |      Return an Alignment object, being the inverted mapping.
 |
 |  range(self, positions=None)
 |      Work out the range of the mapping from the given positions.
 |      If no positions are specified, compute the range of the entire mapping.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  fromstring(s)
 |      Read a giza-formatted string and return an Alignment object.
 |
 |          >>> Alignment.fromstring('0-0 2-1 9-2 21-3 10-4 7-5')
 |          Alignment([(0, 0), (2, 1), (7, 5), (9, 2), (10, 4), (21, 3)])
 |
 |      :type s: str
 |      :param s: the positional alignments in giza format
 |      :rtype: Alignment
 |      :return: An Alignment object corresponding to the string representation ``s``.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(cls, pairs)
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.frozenset:
 |
 |  __and__(self, value, /)
 |      Return self&value.
 |
 |  __contains__(...)
 |      x.__contains__(y) <==> y in x.
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __hash__(self, /)
 |      Return hash(self).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __rand__(self, value, /)
 |      Return value&self.
 |
 |  __reduce__(...)
 |      Return state information for pickling.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __rsub__(self, value, /)
 |      Return value-self.
 |
 |  __rxor__(self, value, /)
 |      Return value^self.
 |
 |  __sizeof__(...)
 |      S.__sizeof__() -> size of S in memory, in bytes
 |
 |  __sub__(self, value, /)
 |      Return self-value.
 |
 |  __xor__(self, value, /)
 |      Return self^value.
 |
 |  copy(...)
 |      Return a shallow copy of a set.
 |
 |  difference(...)
 |      Return the difference of two or more sets as a new set.
 |
 |      (i.e. all elements that are in this set but not the others.)
 |
 |  intersection(...)
 |      Return the intersection of two sets as a new set.
 |
 |      (i.e. all elements that are in both sets.)
 |
 |  isdisjoint(...)
 |      Return True if two sets have a null intersection.
 |
 |  issubset(self, other, /)
 |      Test whether every element in the set is in other.
 |
 |  issuperset(self, other, /)
 |      Test whether every element in other is in the set.
 |
 |  symmetric_difference(...)
 |      Return the symmetric difference of two sets as a new set.
 |
 |      (i.e. all elements that are in exactly one of the sets.)
 |
 |  union(...)
 |      Return the union of sets as a new set.
 |
 |      (i.e. all elements that are in either set.)
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.frozenset:
 |
 |  __class_getitem__(...)
 |      See PEP 585
nltk.AnnotationTask
Python Library Documentation: class AnnotationTask in module nltk.metrics.agreement

class AnnotationTask(builtins.object)
 |  AnnotationTask(data=None, distance=<function binary_distance at 0x0000028F85576AC0>)
 |
 |  Represents an annotation task, i.e. people assign labels to items.
 |
 |  Notation tries to match notation in Artstein and Poesio (2007).
 |
 |  In general, coders and items can be represented as any hashable object.
 |  Integers, for example, are fine, though strings are more readable.
 |  Labels must support the distance functions applied to them, so e.g.
 |  a string-edit-distance makes no sense if your labels are integers,
 |  whereas interval distance needs numeric values.  A notable case of this
 |  is the MASI metric, which requires Python sets.
 |
 |  Methods defined here:
 |
 |  Ae_kappa(self, cA, cB)
 |
 |  Ao(self, cA, cB)
 |      Observed agreement between two coders on all items.
 |
 |  Disagreement(self, label_freqs)
 |
 |  Do_Kw(self, max_distance=1.0)
 |      Averaged over all labelers
 |
 |  Do_Kw_pairwise(self, cA, cB, max_distance=1.0)
 |      The observed disagreement for the weighted kappa coefficient.
 |
 |  N(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      Implements the "n-notation" used in Artstein and Poesio (2007)
 |
 |      @deprecated: Use Nk, Nik or Nck instead
 |
 |  Nck(self, c, k)
 |
 |  Nik(self, i, k)
 |
 |  Nk(self, k)
 |
 |  S(self)
 |      Bennett, Albert and Goldstein 1954
 |
 |  __init__(self, data=None, distance=<function binary_distance at 0x0000028F85576AC0>)
 |      Initialize an annotation task.
 |
 |      The data argument can be None (to create an empty annotation task) or a sequence of 3-tuples,
 |      each representing a coder's labeling of an item:
 |      ``(coder,item,label)``
 |
 |      The distance argument is a function taking two arguments (labels) and producing a numerical distance.
 |      The distance from a label to itself should be zero:
 |      ``distance(l,l) = 0``
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  agr(self, cA, cB, i, data=None)
 |      Agreement between two coders on a given item
 |
 |  alpha(self)
 |      Krippendorff 1980
 |
 |  avg_Ao(self)
 |      Average observed agreement across all coders and items.
 |
 |  kappa(self)
 |      Cohen 1960
 |      Averages naively over kappas for each coder pair.
 |
 |  kappa_pairwise(self, cA, cB)
 |
 |  load_array(self, array)
 |      Load an sequence of annotation results, appending to any data already loaded.
 |
 |      The argument is a sequence of 3-tuples, each representing a coder's labeling of an item:
 |          (coder,item,label)
 |
 |  multi_kappa(self)
 |      Davies and Fleiss 1982
 |      Averages over observed and expected agreements for each coder pair.
 |
 |  pi(self)
 |      Scott 1955; here, multi-pi.
 |      Equivalent to K from Siegel and Castellan (1988).
 |
 |  weighted_kappa(self, max_distance=1.0)
 |      Cohen 1968
 |
 |  weighted_kappa_pairwise(self, cA, cB, max_distance=1.0)
 |      Cohen 1968
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ApplicationExpression
Python Library Documentation: class ApplicationExpression in module nltk.sem.logic

class ApplicationExpression(Expression)
 |  ApplicationExpression(function, argument)
 |
 |  This class is used to represent two related types of logical expressions.
 |
 |  The first is a Predicate Expression, such as "P(x,y)".  A predicate
 |  expression is comprised of a ``FunctionVariableExpression`` or
 |  ``ConstantExpression`` as the predicate and a list of Expressions as the
 |  arguments.
 |
 |  The second is a an application of one expression to another, such as
 |  "(\x.dog(x))(fido)".
 |
 |  The reason Predicate Expressions are treated as Application Expressions is
 |  that the Variable Expression predicate of the expression may be replaced
 |  with another Expression, such as a LambdaExpression, which would mean that
 |  the Predicate should be thought of as being applied to the arguments.
 |
 |  The logical expression reader will always curry arguments in a application expression.
 |  So, "\x y.see(x,y)(john,mary)" will be represented internally as
 |  "((\x y.(see(x))(y))(john))(mary)".  This simplifies the internals since
 |  there will always be exactly one argument in an application.
 |
 |  The str() method will usually print the curried forms of application
 |  expressions.  The one exception is when the the application expression is
 |  really a predicate expression (ie, underlying function is an
 |  ``AbstractVariableExpression``).  This means that the example from above
 |  will be returned as "(\x y.see(x,y)(john))(mary)".
 |
 |  Method resolution order:
 |      ApplicationExpression
 |      Expression
 |      SubstituteBindingsI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __hash__(self) from nltk.sem.logic.Expression
 |      Return hash(self).
 |
 |  __init__(self, function, argument)
 |      :param function: ``Expression``, for the function expression
 |      :param argument: ``Expression``, for the argument
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  constants(self)
 |      :see: Expression.constants()
 |
 |  findtype(self, variable)
 |      :see Expression.findtype()
 |
 |  is_atom(self)
 |      Is this expression an atom (as opposed to a lambda expression applied
 |      to a term)?
 |
 |  predicates(self)
 |      :see: Expression.predicates()
 |
 |  simplify(self)
 |      :return: beta-converted version of this expression
 |
 |  uncurry(self)
 |      Uncurry this application expression
 |
 |      return: A tuple (base-function, arg-list)
 |
 |  visit(self, function, combinator)
 |      :see: Expression.visit()
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  args
 |      Return uncurried arg-list
 |
 |  pred
 |      Return uncurried base-function.
 |      If this is an atom, then the result will be a variable expression.
 |      Otherwise, it will be a lambda expression.
 |
 |  type
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Expression:
 |
 |  __and__(self, other)
 |
 |  __call__(self, other, *additional)
 |      Call self as a function.
 |
 |  __gt__(self, other)
 |      Return self>value.
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __neg__(self)
 |
 |  __or__(self, other)
 |      Return self|value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  applyto(self, other)
 |
 |  equiv(self, other, prover=None)
 |      Check for logical equivalence.
 |      Pass the expression (self <-> other) to the theorem prover.
 |      If the prover says it is valid, then the self and other are equal.
 |
 |      :param other: an ``Expression`` to check equality against
 |      :param prover: a ``nltk.inference.api.Prover``
 |
 |  free(self)
 |      Return a set of all the free (non-bound) variables.  This includes
 |      both individual and predicate variables, but not constants.
 |      :return: set of ``Variable`` objects
 |
 |  make_VariableExpression(self, variable)
 |
 |  negate(self)
 |      If this is a negated expression, remove the negation.
 |      Otherwise add a negation.
 |
 |  normalize(self, newvars=None)
 |      Rename auto-generated unique variables
 |
 |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
 |      Replace every instance of 'variable' with 'expression'
 |      :param variable: ``Variable`` The variable to replace
 |      :param expression: ``Expression`` The expression with which to replace it
 |      :param replace_bound: bool Should bound variables be replaced?
 |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
 |
 |  substitute_bindings(self, bindings)
 |      :return: The object that is obtained by replacing
 |          each variable bound by ``bindings`` with its values.
 |          Aliases are already resolved. (maybe?)
 |      :rtype: (any)
 |
 |  typecheck(self, signature=None)
 |      Infer and check types.  Raise exceptions if necessary.
 |
 |      :param signature: dict that maps variable names to types (or string
 |          representations of types)
 |      :return: the signature, plus any additional type mappings
 |
 |  variables(self)
 |      Return a set of all the variables for binding substitution.
 |      The variables returned include all free (non-bound) individual
 |      variables and any variable starting with '?' or '@'.
 |      :return: set of ``Variable`` objects
 |
 |  visit_structured(self, function, combinator)
 |      Recursively visit subexpressions.  Apply 'function' to each
 |      subexpression and pass the result of each function application
 |      to the 'combinator' for aggregation.  The combinator must have
 |      the same signature as the constructor.  The function is not
 |      applied to bound variables, but they are passed to the
 |      combinator.
 |      :param function: ``Function`` to call on each subexpression
 |      :param combinator: ``Function`` with the same signature as the
 |      constructor, to combine the results of the function calls
 |      :return: result of combination
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from Expression:
 |
 |  fromstring(s, type_check=False, signature=None)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from SubstituteBindingsI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Assignment
Python Library Documentation: class Assignment in module nltk.sem.evaluate

class Assignment(builtins.dict)
 |  Assignment(domain, assign=None)
 |
 |  A dictionary which represents an assignment of values to variables.
 |
 |  An assignment can only assign values from its domain.
 |
 |  If an unknown expression *a* is passed to a model *M*\ 's
 |  interpretation function *i*, *i* will first check whether *M*\ 's
 |  valuation assigns an interpretation to *a* as a constant, and if
 |  this fails, *i* will delegate the interpretation of *a* to
 |  *g*. *g* only assigns values to individual variables (i.e.,
 |  members of the class ``IndividualVariableExpression`` in the ``logic``
 |  module. If a variable is not assigned a value by *g*, it will raise
 |  an ``Undefined`` exception.
 |
 |  A variable *Assignment* is a mapping from individual variables to
 |  entities in the domain. Individual variables are usually indicated
 |  with the letters ``'x'``, ``'y'``, ``'w'`` and ``'z'``, optionally
 |  followed by an integer (e.g., ``'x0'``, ``'y332'``).  Assignments are
 |  created using the ``Assignment`` constructor, which also takes the
 |  domain as a parameter.
 |
 |      >>> from nltk.sem.evaluate import Assignment
 |      >>> dom = set(['u1', 'u2', 'u3', 'u4'])
 |      >>> g3 = Assignment(dom, [('x', 'u1'), ('y', 'u2')])
 |      >>> g3 == {'x': 'u1', 'y': 'u2'}
 |      True
 |
 |  There is also a ``print`` format for assignments which uses a notation
 |  closer to that in logic textbooks:
 |
 |      >>> print(g3)
 |      g[u1/x][u2/y]
 |
 |  It is also possible to update an assignment using the ``add`` method:
 |
 |      >>> dom = set(['u1', 'u2', 'u3', 'u4'])
 |      >>> g4 = Assignment(dom)
 |      >>> g4.add('x', 'u1')
 |      {'x': 'u1'}
 |
 |  With no arguments, ``purge()`` is equivalent to ``clear()`` on a dictionary:
 |
 |      >>> g4.purge()
 |      >>> g4
 |      {}
 |
 |  :param domain: the domain of discourse
 |  :type domain: set
 |  :param assign: a list of (varname, value) associations
 |  :type assign: list
 |
 |  Method resolution order:
 |      Assignment
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __getitem__(self, key)
 |      Return self[key].
 |
 |  __init__(self, domain, assign=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __str__(self)
 |      Pretty printing for assignments. {'x', 'u'} appears as 'g[u/x]'
 |
 |  add(self, var, val)
 |      Add a new variable-value pair to the assignment, and update
 |      ``self.variant``.
 |
 |  copy(self)
 |      D.copy() -> a shallow copy of D
 |
 |  purge(self, var=None)
 |      Remove one or all keys (i.e. logic variables) from an
 |      assignment, and update ``self.variant``.
 |
 |      :param var: a Variable acting as a key for the assignment.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.BigramAssocMeasures
Python Library Documentation: class BigramAssocMeasures in module nltk.metrics.association

class BigramAssocMeasures(NgramAssocMeasures)
 |  A collection of bigram association measures. Each association measure
 |  is provided as a function with three arguments::
 |
 |      bigram_score_fn(n_ii, (n_ix, n_xi), n_xx)
 |
 |  The arguments constitute the marginals of a contingency table, counting
 |  the occurrences of particular events in a corpus. The letter i in the
 |  suffix refers to the appearance of the word in question, while x indicates
 |  the appearance of any word. Thus, for example:
 |
 |  - n_ii counts ``(w1, w2)``, i.e. the bigram being scored
 |  - n_ix counts ``(w1, *)``
 |  - n_xi counts ``(*, w2)``
 |  - n_xx counts ``(*, *)``, i.e. any bigram
 |
 |  This may be shown with respect to a contingency table::
 |
 |              w1    ~w1
 |           ------ ------
 |       w2 | n_ii | n_oi | = n_xi
 |           ------ ------
 |      ~w2 | n_io | n_oo |
 |           ------ ------
 |           = n_ix        TOTAL = n_xx
 |
 |  Method resolution order:
 |      BigramAssocMeasures
 |      NgramAssocMeasures
 |      builtins.object
 |
 |  Class methods defined here:
 |
 |  chi_sq(n_ii, n_ix_xi_tuple, n_xx)
 |      Scores bigrams using chi-square, i.e. phi-sq multiplied by the number
 |      of bigrams, as in Manning and Schutze 5.3.3.
 |
 |  fisher(*marginals)
 |      Scores bigrams using Fisher's Exact Test (Pedersen 1996).  Less
 |      sensitive to small counts than PMI or Chi Sq, but also more expensive
 |      to compute. Requires scipy.
 |
 |  phi_sq(*marginals)
 |      Scores bigrams using phi-square, the square of the Pearson correlation
 |      coefficient.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  dice(n_ii, n_ix_xi_tuple, n_xx)
 |      Scores bigrams using Dice's coefficient.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from NgramAssocMeasures:
 |
 |  jaccard(*marginals)
 |      Scores ngrams using the Jaccard index.
 |
 |  likelihood_ratio(*marginals)
 |      Scores ngrams using likelihood ratios as in Manning and Schutze 5.3.4.
 |
 |  pmi(*marginals)
 |      Scores ngrams by pointwise mutual information, as in Manning and
 |      Schutze 5.4.
 |
 |  poisson_stirling(*marginals)
 |      Scores ngrams using the Poisson-Stirling measure.
 |
 |  student_t(*marginals)
 |      Scores ngrams using Student's t test with independence hypothesis
 |      for unigrams, as in Manning and Schutze 5.3.1.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from NgramAssocMeasures:
 |
 |  mi_like(*marginals, **kwargs)
 |      Scores ngrams using a variant of mutual information. The keyword
 |      argument power sets an exponent (default 3) for the numerator. No
 |      logarithm of the result is calculated.
 |
 |  raw_freq(*marginals)
 |      Scores ngrams by their frequency
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from NgramAssocMeasures:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BigramCollocationFinder
Python Library Documentation: class BigramCollocationFinder in module nltk.collocations

class BigramCollocationFinder(AbstractCollocationFinder)
 |  BigramCollocationFinder(word_fd, bigram_fd, window_size=2)
 |
 |  A tool for the finding and ranking of bigram collocations or other
 |  association measures. It is often useful to use from_words() rather than
 |  constructing an instance directly.
 |
 |  Method resolution order:
 |      BigramCollocationFinder
 |      AbstractCollocationFinder
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, word_fd, bigram_fd, window_size=2)
 |      Construct a BigramCollocationFinder, given FreqDists for
 |      appearances of words and (possibly non-contiguous) bigrams.
 |
 |  score_ngram(self, score_fn, w1, w2)
 |      Returns the score for a given bigram using the given scoring
 |      function.  Following Church and Hanks (1990), counts are scaled by
 |      a factor of 1/(window_size - 1).
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  from_words(words, window_size=2)
 |      Construct a BigramCollocationFinder for all bigrams in the given
 |      sequence.  When window_size > 2, count non-contiguous bigrams, in the
 |      style of Church and Hanks's (1990) association ratio.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  default_ws = 2
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractCollocationFinder:
 |
 |  above_score(self, score_fn, min_score)
 |      Returns a sequence of ngrams, ordered by decreasing score, whose
 |      scores each exceed the given minimum score.
 |
 |  apply_freq_filter(self, min_freq)
 |      Removes candidate ngrams which have frequency less than min_freq.
 |
 |  apply_ngram_filter(self, fn)
 |      Removes candidate ngrams (w1, w2, ...) where fn(w1, w2, ...)
 |      evaluates to True.
 |
 |  apply_word_filter(self, fn)
 |      Removes candidate ngrams (w1, w2, ...) where any of (fn(w1), fn(w2),
 |      ...) evaluates to True.
 |
 |  nbest(self, score_fn, n)
 |      Returns the top n ngrams when scored by the given function.
 |
 |  score_ngrams(self, score_fn)
 |      Returns a sequence of (ngram, score) pairs ordered from highest to
 |      lowest score, as determined by the scoring function provided.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from AbstractCollocationFinder:
 |
 |  from_documents(documents)
 |      Constructs a collocation finder given a collection of documents,
 |      each of which is a list (or iterable) of tokens.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractCollocationFinder:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BigramTagger
Python Library Documentation: class BigramTagger in module nltk.tag.sequential

class BigramTagger(NgramTagger)
 |  BigramTagger(train=None, model=None, backoff=None, cutoff=0, verbose=False)
 |
 |  A tagger that chooses a token's tag based its word string and on
 |  the preceding words' tag.  In particular, a tuple consisting
 |  of the previous tag and the word is looked up in a table, and
 |  the corresponding tag is returned.
 |
 |  :param train: The corpus of training data, a list of tagged sentences
 |  :type train: list(list(tuple(str, str)))
 |  :param model: The tagger model
 |  :type model: dict
 |  :param backoff: Another tagger which this tagger will consult when it is
 |      unable to tag a word
 |  :type backoff: TaggerI
 |  :param cutoff: The number of instances of training data the tagger must see
 |      in order not to use the backoff tagger
 |  :type cutoff: int
 |
 |  Method resolution order:
 |      BigramTagger
 |      NgramTagger
 |      ContextTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, train=None, model=None, backoff=None, cutoff=0, verbose=False)
 |      :param context_to_tag: A dictionary mapping contexts to tags.
 |      :param backoff: The backoff tagger that should be used for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  json_tag = 'nltk.tag.sequential.BigramTagger'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from NgramTagger:
 |
 |  context(self, tokens, index, history)
 |      :return: the context that should be used to look up the tag
 |          for the specified token; or None if the specified token
 |          should not be handled by this tagger.
 |      :rtype: (hashable)
 |
 |  encode_json_obj(self)
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from NgramTagger:
 |
 |  decode_json_obj(obj)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ContextTagger:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  size(self)
 |      :return: The number of entries in the table used by this
 |          tagger to map from contexts to tags.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BinaryMaxentFeatureEncoding
Python Library Documentation: class BinaryMaxentFeatureEncoding in module nltk.classify.maxent

class BinaryMaxentFeatureEncoding(MaxentFeatureEncodingI)
 |  BinaryMaxentFeatureEncoding(labels, mapping, unseen_features=False, alwayson_features=False)
 |
 |  A feature encoding that generates vectors containing a binary
 |  joint-features of the form:
 |
 |  |  joint_feat(fs, l) = { 1 if (fs[fname] == fval) and (l == label)
 |  |                      {
 |  |                      { 0 otherwise
 |
 |  Where ``fname`` is the name of an input-feature, ``fval`` is a value
 |  for that input-feature, and ``label`` is a label.
 |
 |  Typically, these features are constructed based on a training
 |  corpus, using the ``train()`` method.  This method will create one
 |  feature for each combination of ``fname``, ``fval``, and ``label``
 |  that occurs at least once in the training corpus.
 |
 |  The ``unseen_features`` parameter can be used to add "unseen-value
 |  features", which are used whenever an input feature has a value
 |  that was not encountered in the training corpus.  These features
 |  have the form:
 |
 |  |  joint_feat(fs, l) = { 1 if is_unseen(fname, fs[fname])
 |  |                      {      and l == label
 |  |                      {
 |  |                      { 0 otherwise
 |
 |  Where ``is_unseen(fname, fval)`` is true if the encoding does not
 |  contain any joint features that are true when ``fs[fname]==fval``.
 |
 |  The ``alwayson_features`` parameter can be used to add "always-on
 |  features", which have the form::
 |
 |  |  joint_feat(fs, l) = { 1 if (l == label)
 |  |                      {
 |  |                      { 0 otherwise
 |
 |  These always-on features allow the maxent model to directly model
 |  the prior probabilities of each label.
 |
 |  Method resolution order:
 |      BinaryMaxentFeatureEncoding
 |      MaxentFeatureEncodingI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, labels, mapping, unseen_features=False, alwayson_features=False)
 |      :param labels: A list of the "known labels" for this encoding.
 |
 |      :param mapping: A dictionary mapping from ``(fname,fval,label)``
 |          tuples to corresponding joint-feature indexes.  These
 |          indexes must be the set of integers from 0...len(mapping).
 |          If ``mapping[fname,fval,label]=id``, then
 |          ``self.encode(..., fname:fval, ..., label)[id]`` is 1;
 |          otherwise, it is 0.
 |
 |      :param unseen_features: If true, then include unseen value
 |         features in the generated joint-feature vectors.
 |
 |      :param alwayson_features: If true, then include always-on
 |         features in the generated joint-feature vectors.
 |
 |  describe(self, f_id)
 |      :return: A string describing the value of the joint-feature
 |          whose index in the generated feature vectors is ``fid``.
 |      :rtype: str
 |
 |  encode(self, featureset, label)
 |      Given a (featureset, label) pair, return the corresponding
 |      vector of joint-feature values.  This vector is represented as
 |      a list of ``(index, value)`` tuples, specifying the value of
 |      each non-zero joint-feature.
 |
 |      :type featureset: dict
 |      :rtype: list(tuple(int, int))
 |
 |  labels(self)
 |      :return: A list of the "known labels" -- i.e., all labels
 |          ``l`` such that ``self.encode(fs,l)`` can be a nonzero
 |          joint-feature vector for some value of ``fs``.
 |      :rtype: list
 |
 |  length(self)
 |      :return: The size of the fixed-length joint-feature vectors
 |          that are generated by this encoding.
 |      :rtype: int
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  train(train_toks, count_cutoff=0, labels=None, **options)
 |      Construct and return new feature encoding, based on a given
 |      training corpus ``train_toks``.  See the class description
 |      ``BinaryMaxentFeatureEncoding`` for a description of the
 |      joint-features that will be included in this encoding.
 |
 |      :type train_toks: list(tuple(dict, str))
 |      :param train_toks: Training data, represented as a list of
 |          pairs, the first member of which is a feature dictionary,
 |          and the second of which is a classification label.
 |
 |      :type count_cutoff: int
 |      :param count_cutoff: A cutoff value that is used to discard
 |          rare joint-features.  If a joint-feature's value is 1
 |          fewer than ``count_cutoff`` times in the training corpus,
 |          then that joint-feature is not included in the generated
 |          encoding.
 |
 |      :type labels: list
 |      :param labels: A list of labels that should be used by the
 |          classifier.  If not specified, then the set of labels
 |          attested in ``train_toks`` will be used.
 |
 |      :param options: Extra parameters for the constructor, such as
 |          ``unseen_features`` and ``alwayson_features``.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from MaxentFeatureEncodingI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BlanklineTokenizer
Python Library Documentation: class BlanklineTokenizer in module nltk.tokenize.regexp

class BlanklineTokenizer(RegexpTokenizer)
 |  Tokenize a string, treating any sequence of blank lines as a delimiter.
 |  Blank lines are defined as lines containing no characters, except for
 |  space or tab characters.
 |
 |  Method resolution order:
 |      BlanklineTokenizer
 |      RegexpTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from RegexpTokenizer:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  span_tokenize(self, text)
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  tokenize(self, text)
 |      Return a tokenized copy of *s*.
 |
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BllipParser
Python Library Documentation: class BllipParser in module nltk.parse.bllip

class BllipParser(nltk.parse.api.ParserI)
 |  BllipParser(parser_model=None, reranker_features=None, reranker_weights=None, parser_options=None, reranker_options=None)
 |
 |  Interface for parsing with BLLIP Parser. BllipParser objects can be
 |  constructed with the ``BllipParser.from_unified_model_dir`` class
 |  method or manually using the ``BllipParser`` constructor.
 |
 |  Method resolution order:
 |      BllipParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, parser_model=None, reranker_features=None, reranker_weights=None, parser_options=None, reranker_options=None)
 |      Load a BLLIP Parser model from scratch. You'll typically want to
 |      use the ``from_unified_model_dir()`` class method to construct
 |      this object.
 |
 |      :param parser_model: Path to parser model directory
 |      :type parser_model: str
 |
 |      :param reranker_features: Path the reranker model's features file
 |      :type reranker_features: str
 |
 |      :param reranker_weights: Path the reranker model's weights file
 |      :type reranker_weights: str
 |
 |      :param parser_options: optional dictionary of parser options, see
 |          ``bllipparser.RerankingParser.RerankingParser.load_parser_options()``
 |          for more information.
 |      :type parser_options: dict(str)
 |
 |      :param reranker_options: optional
 |          dictionary of reranker options, see
 |          ``bllipparser.RerankingParser.RerankingParser.load_reranker_model()``
 |          for more information.
 |      :type reranker_options: dict(str)
 |
 |  parse(self, sentence)
 |      Use BLLIP Parser to parse a sentence. Takes a sentence as a list
 |      of words; it will be automatically tagged with this BLLIP Parser
 |      instance's tagger.
 |
 |      :return: An iterator that generates parse trees for the sentence
 |          from most likely to least likely.
 |
 |      :param sentence: The sentence to be parsed
 |      :type sentence: list(str)
 |      :rtype: iter(Tree)
 |
 |  tagged_parse(self, word_and_tag_pairs)
 |      Use BLLIP to parse a sentence. Takes a sentence as a list of
 |      (word, tag) tuples; the sentence must have already been tokenized
 |      and tagged. BLLIP will attempt to use the tags provided but may
 |      use others if it can't come up with a complete parse subject
 |      to those constraints. You may also specify a tag as ``None``
 |      to leave a token's tag unconstrained.
 |
 |      :return: An iterator that generates parse trees for the sentence
 |          from most likely to least likely.
 |
 |      :param sentence: Input sentence to parse as (word, tag) pairs
 |      :type sentence: list(tuple(str, str))
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  from_unified_model_dir(model_dir, parser_options=None, reranker_options=None)
 |      Create a ``BllipParser`` object from a unified parsing model
 |      directory. Unified parsing model directories are a standardized
 |      way of storing BLLIP parser and reranker models together on disk.
 |      See ``bllipparser.RerankingParser.get_unified_model_parameters()``
 |      for more information about unified model directories.
 |
 |      :return: A ``BllipParser`` object using the parser and reranker
 |          models in the model directory.
 |
 |      :param model_dir: Path to the unified model directory.
 |      :type model_dir: str
 |      :param parser_options: optional dictionary of parser options, see
 |          ``bllipparser.RerankingParser.RerankingParser.load_parser_options()``
 |          for more information.
 |      :type parser_options: dict(str)
 |      :param reranker_options: optional dictionary of reranker options, see
 |          ``bllipparser.RerankingParser.RerankingParser.load_reranker_model()``
 |          for more information.
 |      :type reranker_options: dict(str)
 |      :rtype: BllipParser
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BottomUpChartParser
Python Library Documentation: class BottomUpChartParser in module nltk.parse.chart

class BottomUpChartParser(ChartParser)
 |  BottomUpChartParser(grammar, **parser_args)
 |
 |  A ``ChartParser`` using a bottom-up parsing strategy.
 |  See ``ChartParser`` for more information.
 |
 |  Method resolution order:
 |      BottomUpChartParser
 |      ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BottomUpLeftCornerChartParser
Python Library Documentation: class BottomUpLeftCornerChartParser in module nltk.parse.chart

class BottomUpLeftCornerChartParser(ChartParser)
 |  BottomUpLeftCornerChartParser(grammar, **parser_args)
 |
 |  A ``ChartParser`` using a bottom-up left-corner parsing strategy.
 |  This strategy is often more efficient than standard bottom-up.
 |  See ``ChartParser`` for more information.
 |
 |  Method resolution order:
 |      BottomUpLeftCornerChartParser
 |      ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BottomUpProbabilisticChartParser
Python Library Documentation: class BottomUpProbabilisticChartParser in module nltk.parse.pchart

class BottomUpProbabilisticChartParser(nltk.parse.api.ParserI)
 |  BottomUpProbabilisticChartParser(grammar, beam_size=0, trace=0)
 |
 |  An abstract bottom-up parser for ``PCFG`` grammars that uses a ``Chart`` to
 |  record partial results.  ``BottomUpProbabilisticChartParser`` maintains
 |  a queue of edges that can be added to the chart.  This queue is
 |  initialized with edges for each token in the text that is being
 |  parsed.  ``BottomUpProbabilisticChartParser`` inserts these edges into
 |  the chart one at a time, starting with the most likely edges, and
 |  proceeding to less likely edges.  For each edge that is added to
 |  the chart, it may become possible to insert additional edges into
 |  the chart; these are added to the queue.  This process continues
 |  until enough complete parses have been generated, or until the
 |  queue is empty.
 |
 |  The sorting order for the queue is not specified by
 |  ``BottomUpProbabilisticChartParser``.  Different sorting orders will
 |  result in different search strategies.  The sorting order for the
 |  queue is defined by the method ``sort_queue``; subclasses are required
 |  to provide a definition for this method.
 |
 |  :type _grammar: PCFG
 |  :ivar _grammar: The grammar used to parse sentences.
 |  :type _trace: int
 |  :ivar _trace: The level of tracing output that should be generated
 |      when parsing a text.
 |
 |  Method resolution order:
 |      BottomUpProbabilisticChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, beam_size=0, trace=0)
 |      Create a new ``BottomUpProbabilisticChartParser``, that uses
 |      ``grammar`` to parse texts.
 |
 |      :type grammar: PCFG
 |      :param grammar: The grammar used to parse texts.
 |      :type beam_size: int
 |      :param beam_size: The maximum length for the parser's edge queue.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  sort_queue(self, queue, chart)
 |      Sort the given queue of ``Edge`` objects, placing the edge that should
 |      be tried first at the beginning of the queue.  This method
 |      will be called after each ``Edge`` is added to the queue.
 |
 |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
 |          this queue is an edge that could be added to the chart by
 |          the fundamental rule; but that has not yet been added.
 |      :type queue: list(Edge)
 |      :param chart: The chart being used to parse the text.  This
 |          chart can be used to provide extra information for sorting
 |          the queue.
 |      :type chart: Chart
 |      :rtype: None
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Boxer
Python Library Documentation: class Boxer in module nltk.sem.boxer

class Boxer(builtins.object)
 |  Boxer(boxer_drs_interpreter=None, elimeq=False, bin_dir=None, verbose=False, resolve=True)
 |
 |  This class is an interface to Johan Bos's program Boxer, a wide-coverage
 |  semantic parser that produces Discourse Representation Structures (DRSs).
 |
 |  Methods defined here:
 |
 |  __init__(self, boxer_drs_interpreter=None, elimeq=False, bin_dir=None, verbose=False, resolve=True)
 |      :param boxer_drs_interpreter: A class that converts from the
 |          ``AbstractBoxerDrs`` object hierarchy to a different object.  The
 |          default is ``NltkDrtBoxerDrsInterpreter``, which converts to the NLTK
 |          DRT hierarchy.
 |      :param elimeq: When set to true, Boxer removes all equalities from the
 |          DRSs and discourse referents standing in the equality relation are
 |          unified, but only if this can be done in a meaning-preserving manner.
 |      :param resolve: When set to true, Boxer will resolve all anaphoric DRSs and perform merge-reduction.
 |          Resolution follows Van der Sandt's theory of binding and accommodation.
 |
 |  interpret(self, input, discourse_id=None, question=False, verbose=False)
 |      Use Boxer to give a first order representation.
 |
 |      :param input: str Input sentence to parse
 |      :param occur_index: bool Should predicates be occurrence indexed?
 |      :param discourse_id: str An identifier to be inserted to each occurrence-indexed predicate.
 |      :return: ``drt.DrtExpression``
 |
 |  interpret_multi(self, input, discourse_id=None, question=False, verbose=False)
 |      Use Boxer to give a first order representation.
 |
 |      :param input: list of str Input sentences to parse as a single discourse
 |      :param occur_index: bool Should predicates be occurrence indexed?
 |      :param discourse_id: str An identifier to be inserted to each occurrence-indexed predicate.
 |      :return: ``drt.DrtExpression``
 |
 |  interpret_multi_sents(self, inputs, discourse_ids=None, question=False, verbose=False)
 |      Use Boxer to give a first order representation.
 |
 |      :param inputs: list of list of str Input discourses to parse
 |      :param occur_index: bool Should predicates be occurrence indexed?
 |      :param discourse_ids: list of str Identifiers to be inserted to each occurrence-indexed predicate.
 |      :return: ``drt.DrtExpression``
 |
 |  interpret_sents(self, inputs, discourse_ids=None, question=False, verbose=False)
 |      Use Boxer to give a first order representation.
 |
 |      :param inputs: list of str Input sentences to parse as individual discourses
 |      :param occur_index: bool Should predicates be occurrence indexed?
 |      :param discourse_ids: list of str Identifiers to be inserted to each occurrence-indexed predicate.
 |      :return: list of ``drt.DrtExpression``
 |
 |  set_bin_dir(self, bin_dir, verbose=False)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BrillTagger
Python Library Documentation: class BrillTagger in module nltk.tag.brill

class BrillTagger(nltk.tag.api.TaggerI)
 |  BrillTagger(initial_tagger, rules, training_stats=None)
 |
 |  Brill's transformational rule-based tagger.  Brill taggers use an
 |  initial tagger (such as ``tag.DefaultTagger``) to assign an initial
 |  tag sequence to a text; and then apply an ordered list of
 |  transformational rules to correct the tags of individual tokens.
 |  These transformation rules are specified by the ``TagRule``
 |  interface.
 |
 |  Brill taggers can be created directly, from an initial tagger and
 |  a list of transformational rules; but more often, Brill taggers
 |  are created by learning rules from a training corpus, using one
 |  of the TaggerTrainers available.
 |
 |  Method resolution order:
 |      BrillTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, initial_tagger, rules, training_stats=None)
 |      :param initial_tagger: The initial tagger
 |      :type initial_tagger: TaggerI
 |
 |      :param rules: An ordered list of transformation rules that
 |          should be used to correct the initial tagging.
 |      :type rules: list(TagRule)
 |
 |      :param training_stats: A dictionary of statistics collected
 |          during training, for possible later use
 |      :type training_stats: dict
 |
 |  batch_tag_incremental(self, sequences, gold)
 |      Tags by applying each rule to the entire corpus (rather than all rules to a
 |      single sequence). The point is to collect statistics on the test set for
 |      individual rules.
 |
 |      NOTE: This is inefficient (does not build any index, so will traverse the entire
 |      corpus N times for N rules) -- usually you would not care about statistics for
 |      individual rules and thus use batch_tag() instead
 |
 |      :param sequences: lists of token sequences (sentences, in some applications) to be tagged
 |      :type sequences: list of list of strings
 |      :param gold: the gold standard
 |      :type gold: list of list of strings
 |      :returns: tuple of (tagged_sequences, ordered list of rule scores (one for each rule))
 |
 |  encode_json_obj(self)
 |
 |  print_template_statistics(self, test_stats=None, printunused=True)
 |      Print a list of all templates, ranked according to efficiency.
 |
 |      If test_stats is available, the templates are ranked according to their
 |      relative contribution (summed for all rules created from a given template,
 |      weighted by score) to the performance on the test set. If no test_stats, then
 |      statistics collected during training are used instead. There is also
 |      an unweighted measure (just counting the rules). This is less informative,
 |      though, as many low-score rules will appear towards end of training.
 |
 |      :param test_stats: dictionary of statistics collected during testing
 |      :type test_stats: dict of str -> any (but usually numbers)
 |      :param printunused: if True, print a list of all unused templates
 |      :type printunused: bool
 |      :return: None
 |      :rtype: None
 |
 |  rules(self)
 |      Return the ordered list of  transformation rules that this tagger has learnt
 |
 |      :return: the ordered list of transformation rules that correct the initial tagging
 |      :rtype: list of Rules
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  train_stats(self, statistic=None)
 |      Return a named statistic collected during training, or a dictionary of all
 |      available statistics if no name given
 |
 |      :param statistic: name of statistic
 |      :type statistic: str
 |      :return: some statistic collected during training of this tagger
 |      :rtype: any (but usually a number)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  decode_json_obj(obj)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  json_tag = 'nltk.tag.BrillTagger'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.BrillTaggerTrainer
Python Library Documentation: class BrillTaggerTrainer in module nltk.tag.brill_trainer

class BrillTaggerTrainer(builtins.object)
 |  BrillTaggerTrainer(initial_tagger, templates, trace=0, deterministic=None, ruleformat='str')
 |
 |  A trainer for tbl taggers.
 |
 |  Methods defined here:
 |
 |  __init__(self, initial_tagger, templates, trace=0, deterministic=None, ruleformat='str')
 |      Construct a Brill tagger from a baseline tagger and a
 |      set of templates
 |
 |      :param initial_tagger: the baseline tagger
 |      :type initial_tagger: Tagger
 |      :param templates: templates to be used in training
 |      :type templates: list of Templates
 |      :param trace: verbosity level
 |      :type trace: int
 |      :param deterministic: if True, adjudicate ties deterministically
 |      :type deterministic: bool
 |      :param ruleformat: format of reported Rules
 |      :type ruleformat: str
 |      :return: An untrained BrillTagger
 |      :rtype: BrillTagger
 |
 |  train(self, train_sents, max_rules=200, min_score=2, min_acc=None)
 |      Trains the Brill tagger on the corpus *train_sents*,
 |      producing at most *max_rules* transformations, each of which
 |      reduces the net number of errors in the corpus by at least
 |      *min_score*, and each of which has accuracy not lower than
 |      *min_acc*.
 |
 |      >>> # Relevant imports
 |      >>> from nltk.tbl.template import Template
 |      >>> from nltk.tag.brill import Pos, Word
 |      >>> from nltk.tag import untag, RegexpTagger, BrillTaggerTrainer
 |
 |      >>> # Load some data
 |      >>> from nltk.corpus import treebank
 |      >>> training_data = treebank.tagged_sents()[:100]
 |      >>> baseline_data = treebank.tagged_sents()[100:200]
 |      >>> gold_data = treebank.tagged_sents()[200:300]
 |      >>> testing_data = [untag(s) for s in gold_data]
 |
 |      >>> backoff = RegexpTagger([
 |      ... (r'^-?[0-9]+(\.[0-9]+)?$', 'CD'),  # cardinal numbers
 |      ... (r'(The|the|A|a|An|an)$', 'AT'),   # articles
 |      ... (r'.*able$', 'JJ'),                # adjectives
 |      ... (r'.*ness$', 'NN'),                # nouns formed from adjectives
 |      ... (r'.*ly$', 'RB'),                  # adverbs
 |      ... (r'.*s$', 'NNS'),                  # plural nouns
 |      ... (r'.*ing$', 'VBG'),                # gerunds
 |      ... (r'.*ed$', 'VBD'),                 # past tense verbs
 |      ... (r'.*', 'NN')                      # nouns (default)
 |      ... ])
 |
 |      >>> baseline = backoff #see NOTE1
 |      >>> baseline.accuracy(gold_data) #doctest: +ELLIPSIS
 |      0.243...
 |
 |      >>> # Set up templates
 |      >>> Template._cleartemplates() #clear any templates created in earlier tests
 |      >>> templates = [Template(Pos([-1])), Template(Pos([-1]), Word([0]))]
 |
 |      >>> # Construct a BrillTaggerTrainer
 |      >>> tt = BrillTaggerTrainer(baseline, templates, trace=3)
 |
 |      >>> tagger1 = tt.train(training_data, max_rules=10)
 |      TBL train (fast) (seqs: 100; tokens: 2417; tpls: 2; min score: 2; min acc: None)
 |      Finding initial useful rules...
 |          Found 847 useful rules.
 |      <BLANKLINE>
 |                 B      |
 |         S   F   r   O  |        Score = Fixed - Broken
 |         c   i   o   t  |  R     Fixed = num tags changed incorrect -> correct
 |         o   x   k   h  |  u     Broken = num tags changed correct -> incorrect
 |         r   e   e   e  |  l     Other = num tags changed incorrect -> incorrect
 |         e   d   n   r  |  e
 |      ------------------+-------------------------------------------------------
 |       132 132   0   0  | AT->DT if Pos:NN@[-1]
 |        85  85   0   0  | NN->, if Pos:NN@[-1] & Word:,@[0]
 |        69  69   0   0  | NN->. if Pos:NN@[-1] & Word:.@[0]
 |        51  51   0   0  | NN->IN if Pos:NN@[-1] & Word:of@[0]
 |        47  63  16 162  | NN->IN if Pos:NNS@[-1]
 |        33  33   0   0  | NN->TO if Pos:NN@[-1] & Word:to@[0]
 |        26  26   0   0  | IN->. if Pos:NNS@[-1] & Word:.@[0]
 |        24  24   0   0  | IN->, if Pos:NNS@[-1] & Word:,@[0]
 |        22  27   5  24  | NN->-NONE- if Pos:VBD@[-1]
 |        17  17   0   0  | NN->CC if Pos:NN@[-1] & Word:and@[0]
 |
 |      >>> tagger1.rules()[1:3]
 |      (Rule('001', 'NN', ',', [(Pos([-1]),'NN'), (Word([0]),',')]), Rule('001', 'NN', '.', [(Pos([-1]),'NN'), (Word([0]),'.')]))
 |
 |      >>> train_stats = tagger1.train_stats()
 |      >>> [train_stats[stat] for stat in ['initialerrors', 'finalerrors', 'rulescores']]
 |      [1776, 1270, [132, 85, 69, 51, 47, 33, 26, 24, 22, 17]]
 |
 |      >>> tagger1.print_template_statistics(printunused=False)
 |      TEMPLATE STATISTICS (TRAIN)  2 templates, 10 rules)
 |      TRAIN (   2417 tokens) initial  1776 0.2652 final:  1270 0.4746
 |      #ID | Score (train) |  #Rules     | Template
 |      --------------------------------------------
 |      001 |   305   0.603 |   7   0.700 | Template(Pos([-1]),Word([0]))
 |      000 |   201   0.397 |   3   0.300 | Template(Pos([-1]))
 |      <BLANKLINE>
 |      <BLANKLINE>
 |
 |      >>> round(tagger1.accuracy(gold_data),5)
 |      0.43834
 |
 |      >>> tagged, test_stats = tagger1.batch_tag_incremental(testing_data, gold_data)
 |
 |      >>> tagged[33][12:] == [('foreign', 'IN'), ('debt', 'NN'), ('of', 'IN'), ('$', 'NN'), ('64', 'CD'),
 |      ... ('billion', 'NN'), ('*U*', 'NN'), ('--', 'NN'), ('the', 'DT'), ('third-highest', 'NN'), ('in', 'NN'),
 |      ... ('the', 'DT'), ('developing', 'VBG'), ('world', 'NN'), ('.', '.')]
 |      True
 |
 |      >>> [test_stats[stat] for stat in ['initialerrors', 'finalerrors', 'rulescores']]
 |      [1859, 1380, [100, 85, 67, 58, 27, 36, 27, 16, 31, 32]]
 |
 |      >>> # A high-accuracy tagger
 |      >>> tagger2 = tt.train(training_data, max_rules=10, min_acc=0.99)
 |      TBL train (fast) (seqs: 100; tokens: 2417; tpls: 2; min score: 2; min acc: 0.99)
 |      Finding initial useful rules...
 |          Found 847 useful rules.
 |      <BLANKLINE>
 |                 B      |
 |         S   F   r   O  |        Score = Fixed - Broken
 |         c   i   o   t  |  R     Fixed = num tags changed incorrect -> correct
 |         o   x   k   h  |  u     Broken = num tags changed correct -> incorrect
 |         r   e   e   e  |  l     Other = num tags changed incorrect -> incorrect
 |         e   d   n   r  |  e
 |      ------------------+-------------------------------------------------------
 |       132 132   0   0  | AT->DT if Pos:NN@[-1]
 |        85  85   0   0  | NN->, if Pos:NN@[-1] & Word:,@[0]
 |        69  69   0   0  | NN->. if Pos:NN@[-1] & Word:.@[0]
 |        51  51   0   0  | NN->IN if Pos:NN@[-1] & Word:of@[0]
 |        36  36   0   0  | NN->TO if Pos:NN@[-1] & Word:to@[0]
 |        26  26   0   0  | NN->. if Pos:NNS@[-1] & Word:.@[0]
 |        24  24   0   0  | NN->, if Pos:NNS@[-1] & Word:,@[0]
 |        19  19   0   6  | NN->VB if Pos:TO@[-1]
 |        18  18   0   0  | CD->-NONE- if Pos:NN@[-1] & Word:0@[0]
 |        18  18   0   0  | NN->CC if Pos:NN@[-1] & Word:and@[0]
 |
 |      >>> round(tagger2.accuracy(gold_data), 8)
 |      0.43996744
 |
 |      >>> tagger2.rules()[2:4]
 |      (Rule('001', 'NN', '.', [(Pos([-1]),'NN'), (Word([0]),'.')]), Rule('001', 'NN', 'IN', [(Pos([-1]),'NN'), (Word([0]),'of')]))
 |
 |      # NOTE1: (!!FIXME) A far better baseline uses nltk.tag.UnigramTagger,
 |      # with a RegexpTagger only as backoff. For instance,
 |      # >>> baseline = UnigramTagger(baseline_data, backoff=backoff)
 |      # However, as of Nov 2013, nltk.tag.UnigramTagger does not yield consistent results
 |      # between python versions. The simplistic backoff above is a workaround to make doctests
 |      # get consistent input.
 |
 |      :param train_sents: training data
 |      :type train_sents: list(list(tuple))
 |      :param max_rules: output at most max_rules rules
 |      :type max_rules: int
 |      :param min_score: stop training when no rules better than min_score can be found
 |      :type min_score: int
 |      :param min_acc: discard any rule with lower accuracy than min_acc
 |      :type min_acc: float or None
 |      :return: the learned tagger
 |      :rtype: BrillTagger
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.CFG
Python Library Documentation: class CFG in module nltk.grammar

class CFG(builtins.object)
 |  CFG(start, productions, calculate_leftcorners=True)
 |
 |  A context-free grammar.  A grammar consists of a start state and
 |  a set of productions.  The set of terminals and nonterminals is
 |  implicitly specified by the productions.
 |
 |  If you need efficient key-based access to productions, you
 |  can use a subclass to implement it.
 |
 |  Methods defined here:
 |
 |  __init__(self, start, productions, calculate_leftcorners=True)
 |      Create a new context-free grammar, from the given start state
 |      and set of ``Production`` instances.
 |
 |      :param start: The start symbol
 |      :type start: Nonterminal
 |      :param productions: The list of productions that defines the grammar
 |      :type productions: list(Production)
 |      :param calculate_leftcorners: False if we don't want to calculate the
 |          leftcorner relation. In that case, some optimized chart parsers won't work.
 |      :type calculate_leftcorners: bool
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  check_coverage(self, tokens)
 |      Check whether the grammar rules cover the given list of tokens.
 |      If not, then raise an exception.
 |
 |      :type tokens: list(str)
 |
 |  chomsky_normal_form(self, new_token_padding='@$@', flexible=False)
 |      Returns a new Grammar that is in chomsky normal
 |
 |      :param: new_token_padding
 |          Customise new rule formation during binarisation
 |
 |  is_binarised(self)
 |      Return True if all productions are at most binary.
 |      Note that there can still be empty and unary productions.
 |
 |  is_chomsky_normal_form(self)
 |      Return True if the grammar is of Chomsky Normal Form, i.e. all productions
 |      are of the form A -> B C, or A -> "s".
 |
 |  is_flexible_chomsky_normal_form(self)
 |      Return True if all productions are of the forms
 |      A -> B C, A -> B, or A -> "s".
 |
 |  is_leftcorner(self, cat, left)
 |      True if left is a leftcorner of cat, where left can be a
 |      terminal or a nonterminal.
 |
 |      :param cat: the parent of the leftcorner
 |      :type cat: Nonterminal
 |      :param left: the suggested leftcorner
 |      :type left: Terminal or Nonterminal
 |      :rtype: bool
 |
 |  is_lexical(self)
 |      Return True if all productions are lexicalised.
 |
 |  is_nonempty(self)
 |      Return True if there are no empty productions.
 |
 |  is_nonlexical(self)
 |      Return True if all lexical rules are "preterminals", that is,
 |      unary rules which can be separated in a preprocessing step.
 |
 |      This means that all productions are of the forms
 |      A -> B1 ... Bn (n>=0), or A -> "s".
 |
 |      Note: is_lexical() and is_nonlexical() are not opposites.
 |      There are grammars which are neither, and grammars which are both.
 |
 |  leftcorner_parents(self, cat)
 |      Return the set of all nonterminals for which the given category
 |      is a left corner. This is the inverse of the leftcorner relation.
 |
 |      :param cat: the suggested leftcorner
 |      :type cat: Nonterminal
 |      :return: the set of all parents to the leftcorner
 |      :rtype: set(Nonterminal)
 |
 |  leftcorners(self, cat)
 |      Return the set of all nonterminals that the given nonterminal
 |      can start with, including itself.
 |
 |      This is the reflexive, transitive closure of the immediate
 |      leftcorner relation:  (A > B)  iff  (A -> B beta)
 |
 |      :param cat: the parent of the leftcorners
 |      :type cat: Nonterminal
 |      :return: the set of all leftcorners
 |      :rtype: set(Nonterminal)
 |
 |  max_len(self)
 |      Return the right-hand side length of the longest grammar production.
 |
 |  min_len(self)
 |      Return the right-hand side length of the shortest grammar production.
 |
 |  productions(self, lhs=None, rhs=None, empty=False)
 |      Return the grammar productions, filtered by the left-hand side
 |      or the first item in the right-hand side.
 |
 |      :param lhs: Only return productions with the given left-hand side.
 |      :param rhs: Only return productions with the given first item
 |          in the right-hand side.
 |      :param empty: Only return productions with an empty right-hand side.
 |      :return: A list of productions matching the given constraints.
 |      :rtype: list(Production)
 |
 |  start(self)
 |      Return the start symbol of the grammar
 |
 |      :rtype: Nonterminal
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  binarize(grammar, padding='@$@')
 |      Convert all non-binary rules into binary by introducing
 |      new tokens.
 |      Example::
 |
 |          Original:
 |              A => B C D
 |          After Conversion:
 |              A => B A@$@B
 |              A@$@B => C D
 |
 |  eliminate_start(grammar)
 |      Eliminate start rule in case it appears on RHS
 |      Example: S -> S0 S1 and S0 -> S1 S
 |      Then another rule S0_Sigma -> S is added
 |
 |  fromstring(input, encoding=None)
 |      Return the grammar instance corresponding to the input string(s).
 |
 |      :param input: a grammar, either in the form of a string or as a list of strings.
 |
 |  remove_mixed_rules(grammar, padding='@$@')
 |      Convert all mixed rules containing terminals and non-terminals
 |      into dummy non-terminals.
 |      Example::
 |
 |          Original:
 |              A => term B
 |          After Conversion:
 |              A => TERM@$@TERM B
 |              TERM@$@TERM => term
 |
 |  remove_unitary_rules(grammar)
 |      Remove nonlexical unitary rules and convert them to
 |      lexical
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.CRFTagger
Python Library Documentation: class CRFTagger in module nltk.tag.crf

class CRFTagger(nltk.tag.api.TaggerI)
 |  CRFTagger(feature_func=None, verbose=False, training_opt=None)
 |
 |  A module for POS tagging using CRFSuite https://pypi.python.org/pypi/python-crfsuite
 |
 |  >>> from nltk.tag import CRFTagger
 |  >>> ct = CRFTagger()  # doctest: +SKIP
 |
 |  >>> train_data = [
 |  ...     [('University','Noun'), ('is','Verb'), ('a','Det'),
 |  ...      ('good','Adj'), ('place','Noun')],
 |  ...     [('dog','Noun'), ('eat','Verb'), ('meat','Noun')],
 |  ... ]
 |
 |  >>> ct.train(train_data, 'model.crf.tagger')  # doctest: +SKIP
 |  >>> ct.tag_sents([['dog','is','good'], ['Cat','eat','meat']])  # doctest: +SKIP
 |  [[('dog', 'Noun'), ('is', 'Verb'), ('good', 'Adj')],
 |   [('Cat', 'Noun'), ('eat', 'Verb'), ('meat', 'Noun')]]
 |
 |  >>> gold_sentences = [
 |  ...     [('dog','Noun'), ('is','Verb'), ('good','Adj')],
 |  ...     [('Cat','Noun'), ('eat','Verb'), ('meat','Noun')],
 |  ... ]
 |  >>> ct.accuracy(gold_sentences)  # doctest: +SKIP
 |  1.0
 |
 |  Setting learned model file
 |  >>> ct = CRFTagger()  # doctest: +SKIP
 |  >>> ct.set_model_file('model.crf.tagger')  # doctest: +SKIP
 |  >>> ct.accuracy(gold_sentences)  # doctest: +SKIP
 |  1.0
 |
 |  Default features are cached by token surface form. Call
 |  ``clear_feature_cache()`` to drop the cache (e.g. between long-running
 |  open-vocabulary tagging passes). A custom ``feature_func`` bypasses
 |  the cache.
 |
 |  Method resolution order:
 |      CRFTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, feature_func=None, verbose=False, training_opt=None)
 |      Initialize the CRFSuite tagger
 |
 |      :param feature_func: Function that extracts features for each token
 |          of a sentence. Takes two parameters (``tokens``, ``idx``) and
 |          returns the feature list for ``tokens[idx]``. See the built-in
 |          ``_get_features`` for an example.
 |      :param verbose: Emit debugging messages during training.
 |      :type verbose: bool
 |      :param training_opt: python-crfsuite training options.
 |      :type training_opt: dict
 |
 |      Set of possible training options (using LBFGS training algorithm).
 |          :'feature.minfreq': Minimum frequency of features.
 |          :'feature.possible_states': Force generating possible state features.
 |          :'feature.possible_transitions': Force generating possible transition
 |              features.
 |          :'c1': Coefficient for L1 regularization.
 |          :'c2': Coefficient for L2 regularization.
 |          :'max_iterations': Maximum number of iterations for L-BFGS.
 |          :'num_memories': Number of limited memories for approximating the
 |              inverse Hessian matrix.
 |          :'epsilon': Epsilon for testing the convergence of the objective.
 |          :'period': Duration of iterations for the stopping criterion.
 |          :'delta': Threshold for the stopping criterion; L-BFGS stops when
 |              the log-likelihood improvement over the last ${period}
 |              iterations is no greater than this threshold.
 |          :'linesearch': Line search algorithm used in L-BFGS updates:
 |
 |              - 'MoreThuente': More and Thuente's method,
 |              - 'Backtracking': Backtracking method with regular Wolfe condition,
 |              - 'StrongBacktracking': Backtracking method with strong Wolfe condition
 |          :'max_linesearch':  Maximum number of trials for the line search.
 |
 |  clear_feature_cache(self)
 |      Drop the default-feature cache.
 |
 |      The cache is vocabulary-bounded, but long-running processes that
 |      ingest open-vocabulary streams (URLs, tweets, generated text) may
 |      want to reset it explicitly. A custom ``feature_func`` bypasses
 |      the cache, so this is a no-op for non-default extractors.
 |
 |  set_model_file(self, model_file)
 |
 |  tag(self, tokens)
 |      Tag a sentence using the python-crfsuite tagger. Before using this
 |      function, the model file must be specified by either:
 |
 |      - Train a new model using ``train`` function
 |      - Use the pre-trained model which is set via ``set_model_file`` function
 |
 |      :param tokens: tokens to tag.
 |      :type tokens: list(str)
 |      :return: list of tagged tokens.
 |      :rtype: list(tuple(str,str))
 |
 |  tag_sents(self, sentences=None, **kwargs)
 |      Tag a list of sentences. Before using this function, the model file
 |      must be specified by either:
 |
 |      - Train a new model using ``train`` function
 |      - Use the pre-trained model which is set via ``set_model_file`` function
 |
 |      :param sentences: sentences to tag.
 |      :type sentences: list(list(str))
 |      :param sents: deprecated alias for ``sentences``; emits ``DeprecationWarning``.
 |      :return: list of tagged sentences.
 |      :rtype: list(list(tuple(str,str)))
 |
 |  train(self, train_data, model_file)
 |      Train the CRF tagger using CRFSuite
 |
 |      :param train_data: list of annotated sentences.
 |      :type train_data: list(list(tuple(str,str)))
 |      :param model_file: path where the trained model will be written.
 |      :type model_file: str
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.CfgReadingCommand
Python Library Documentation: class CfgReadingCommand in module nltk.inference.discourse

class CfgReadingCommand(ReadingCommand)
 |  CfgReadingCommand(gramfile=None)
 |
 |  Method resolution order:
 |      CfgReadingCommand
 |      ReadingCommand
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, gramfile=None)
 |      :param gramfile: name of file where grammar can be loaded
 |      :type gramfile: str
 |
 |  combine_readings(self, readings)
 |      :see: ReadingCommand.combine_readings()
 |
 |  parse_to_readings(self, sentence)
 |      :see: ReadingCommand.parse_to_readings()
 |
 |  to_fol(self, expression)
 |      :see: ReadingCommand.to_fol()
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ReadingCommand:
 |
 |  process_thread(self, sentence_readings)
 |      This method should be used to handle dependencies between readings such
 |      as resolving anaphora.
 |
 |      :param sentence_readings: readings to process
 |      :type sentence_readings: list(Expression)
 |      :return: the list of readings after processing
 |      :rtype: list(Expression)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ReadingCommand:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ChartParser
Python Library Documentation: class ChartParser in module nltk.parse.chart

class ChartParser(nltk.parse.api.ParserI)
 |  ChartParser(grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C01340>, <nltk.parse.chart.EmptyPredictRule object at 0x0000028F98C01370>, <nltk.parse.chart.BottomUpPredictCombineRule object at 0x0000028F98C013A0>, <nltk.parse.chart.SingleEdgeFundamentalRule object at 0x0000028F98C013D0>], trace=0, trace_chart_width=50, use_agenda=True, chart_class=<class 'nltk.parse.chart.Chart'>)
 |
 |  A generic chart parser.  A "strategy", or list of
 |  ``ChartRuleI`` instances, is used to decide what edges to add to
 |  the chart.  In particular, ``ChartParser`` uses the following
 |  algorithm to parse texts:
 |
 |  | Until no new edges are added:
 |  |   For each *rule* in *strategy*:
 |  |     Apply *rule* to any applicable edges in the chart.
 |  | Return any complete parses in the chart
 |
 |  Method resolution order:
 |      ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C01340>, <nltk.parse.chart.EmptyPredictRule object at 0x0000028F98C01370>, <nltk.parse.chart.BottomUpPredictCombineRule object at 0x0000028F98C013A0>, <nltk.parse.chart.SingleEdgeFundamentalRule object at 0x0000028F98C013D0>], trace=0, trace_chart_width=50, use_agenda=True, chart_class=<class 'nltk.parse.chart.Chart'>)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ChunkParserI
Python Library Documentation: class ChunkParserI in module nltk.chunk.api

class ChunkParserI(nltk.parse.api.ParserI)
 |  A processing interface for identifying non-overlapping groups in
 |  unrestricted text.  Typically, chunk parsers are used to find base
 |  syntactic constituents, such as base noun phrases.  Unlike
 |  ``ParserI``, ``ChunkParserI`` guarantees that the ``parse()`` method
 |  will always generate a parse.
 |
 |  Method resolution order:
 |      ChunkParserI
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the chunker against the gold standard.
 |      Remove the chunking the gold standard text, rechunk it using
 |      the chunker, and return a ``ChunkScore`` object
 |      reflecting the performance of this chunk parser.
 |
 |      :type gold: list(Tree)
 |      :param gold: The list of chunked sentences to score the chunker on.
 |      :rtype: ChunkScore
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  parse(self, tokens)
 |      Return the best chunk structure for the given tokens
 |      and return a tree.
 |
 |      :param tokens: The list of (word, tag) tokens to be chunked.
 |      :type tokens: list(tuple)
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ChunkScore
Python Library Documentation: class ChunkScore in module nltk.chunk.util

class ChunkScore(builtins.object)
 |  ChunkScore(**kwargs)
 |
 |  A utility class for scoring chunk parsers.  ``ChunkScore`` can
 |  evaluate a chunk parser's output, based on a number of statistics
 |  (precision, recall, f-measure, misssed chunks, incorrect chunks).
 |  It can also combine the scores from the parsing of multiple texts;
 |  this makes it significantly easier to evaluate a chunk parser that
 |  operates one sentence at a time.
 |
 |  Texts are evaluated with the ``score`` method.  The results of
 |  evaluation can be accessed via a number of accessor methods, such
 |  as ``precision`` and ``f_measure``.  A typical use of the
 |  ``ChunkScore`` class is::
 |
 |      >>> chunkscore = ChunkScore()           # doctest: +SKIP
 |      >>> for correct in correct_sentences:   # doctest: +SKIP
 |      ...     guess = chunkparser.parse(correct.leaves())   # doctest: +SKIP
 |      ...     chunkscore.score(correct, guess)              # doctest: +SKIP
 |      >>> print('F Measure:', chunkscore.f_measure())       # doctest: +SKIP
 |      F Measure: 0.823
 |
 |  :ivar kwargs: Keyword arguments:
 |
 |      - max_tp_examples: The maximum number actual examples of true
 |        positives to record.  This affects the ``correct`` member
 |        function: ``correct`` will not return more than this number
 |        of true positive examples.  This does *not* affect any of
 |        the numerical metrics (precision, recall, or f-measure)
 |
 |      - max_fp_examples: The maximum number actual examples of false
 |        positives to record.  This affects the ``incorrect`` member
 |        function and the ``guessed`` member function: ``incorrect``
 |        will not return more than this number of examples, and
 |        ``guessed`` will not return more than this number of true
 |        positive examples.  This does *not* affect any of the
 |        numerical metrics (precision, recall, or f-measure)
 |
 |      - max_fn_examples: The maximum number actual examples of false
 |        negatives to record.  This affects the ``missed`` member
 |        function and the ``correct`` member function: ``missed``
 |        will not return more than this number of examples, and
 |        ``correct`` will not return more than this number of true
 |        negative examples.  This does *not* affect any of the
 |        numerical metrics (precision, recall, or f-measure)
 |
 |      - chunk_label: A regular expression indicating which chunks
 |        should be compared.  Defaults to ``'.*'`` (i.e., all chunks).
 |
 |  :type _tp: list(Token)
 |  :ivar _tp: List of true positives
 |  :type _fp: list(Token)
 |  :ivar _fp: List of false positives
 |  :type _fn: list(Token)
 |  :ivar _fn: List of false negatives
 |
 |  :type _tp_num: int
 |  :ivar _tp_num: Number of true positives
 |  :type _fp_num: int
 |  :ivar _fp_num: Number of false positives
 |  :type _fn_num: int
 |  :ivar _fn_num: Number of false negatives.
 |
 |  Methods defined here:
 |
 |  __init__(self, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __len__(self)
 |
 |  __repr__(self)
 |      Return a concise representation of this ``ChunkScoring``.
 |
 |      :rtype: str
 |
 |  __str__(self)
 |      Return a verbose representation of this ``ChunkScoring``.
 |      This representation includes the precision, recall, and
 |      f-measure scores.  For other information about the score,
 |      use the accessor methods (e.g., ``missed()`` and ``incorrect()``).
 |
 |      :rtype: str
 |
 |  accuracy(self)
 |      Return the overall tag-based accuracy for all text that have
 |      been scored by this ``ChunkScore``, using the IOB (conll2000)
 |      tag encoding.
 |
 |      :rtype: float
 |
 |  correct(self)
 |      Return the chunks which were included in the correct
 |      chunk structures, listed in input order.
 |
 |      :rtype: list of chunks
 |
 |  f_measure(self, alpha=0.5)
 |      Return the overall F measure for all texts that have been
 |      scored by this ``ChunkScore``.
 |
 |      :param alpha: the relative weighting of precision and recall.
 |          Larger alpha biases the score towards the precision value,
 |          while smaller alpha biases the score towards the recall
 |          value.  ``alpha`` should have a value in the range [0,1].
 |      :type alpha: float
 |      :rtype: float
 |
 |  guessed(self)
 |      Return the chunks which were included in the guessed
 |      chunk structures, listed in input order.
 |
 |      :rtype: list of chunks
 |
 |  incorrect(self)
 |      Return the chunks which were included in the guessed chunk structures,
 |      but not in the correct chunk structures, listed in input order.
 |
 |      :rtype: list of chunks
 |
 |  missed(self)
 |      Return the chunks which were included in the
 |      correct chunk structures, but not in the guessed chunk
 |      structures, listed in input order.
 |
 |      :rtype: list of chunks
 |
 |  precision(self)
 |      Return the overall precision for all texts that have been
 |      scored by this ``ChunkScore``.
 |
 |      :rtype: float
 |
 |  recall(self)
 |      Return the overall recall for all texts that have been
 |      scored by this ``ChunkScore``.
 |
 |      :rtype: float
 |
 |  score(self, correct, guessed)
 |      Given a correctly chunked sentence, score another chunked
 |      version of the same sentence.
 |
 |      :type correct: chunk structure
 |      :param correct: The known-correct ("gold standard") chunked
 |          sentence.
 |      :type guessed: chunk structure
 |      :param guessed: The chunked sentence to be scored.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Cistem
Python Library Documentation: class Cistem in module nltk.stem.cistem

class Cistem(nltk.stem.api.StemmerI)
 |  Cistem(case_insensitive: bool = False)
 |
 |  CISTEM Stemmer for German
 |
 |  This is the official Python implementation of the CISTEM stemmer.
 |  It is based on the paper
 |  Leonie Weissweiler, Alexander Fraser (2017). Developing a Stemmer for German
 |  Based on a Comparative Analysis of Publicly Available Stemmers.
 |  In Proceedings of the German Society for Computational Linguistics and Language
 |  Technology (GSCL)
 |  which can be read here:
 |  https://www.cis.lmu.de/~weissweiler/cistem/
 |
 |  In the paper, we conducted an analysis of publicly available stemmers,
 |  developed two gold standards for German stemming and evaluated the stemmers
 |  based on the two gold standards. We then proposed the stemmer implemented here
 |  and show that it achieves slightly better f-measure than the other stemmers and
 |  is thrice as fast as the Snowball stemmer for German while being about as fast
 |  as most other stemmers.
 |
 |  case_insensitive is a a boolean specifying if case-insensitive stemming
 |  should be used. Case insensitivity improves performance only if words in the
 |  text may be incorrectly upper case. For all-lowercase and correctly cased
 |  text, best performance is achieved by setting case_insensitive for false.
 |
 |  :param case_insensitive: if True, the stemming is case insensitive. False by default.
 |  :type case_insensitive: bool
 |
 |  Method resolution order:
 |      Cistem
 |      nltk.stem.api.StemmerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, case_insensitive: bool = False)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  segment(self, word: str) -> tuple[str, str]
 |      This method works very similarly to stem (:func:'cistem.stem'). The difference is that in
 |      addition to returning the stem, it also returns the rest that was removed at
 |      the end. To be able to return the stem unchanged so the stem and the rest
 |      can be concatenated to form the original word, all subsitutions that altered
 |      the stem in any other way than by removing letters at the end were left out.
 |
 |      :param word: The word that is to be stemmed.
 |      :type word: str
 |      :return: A tuple of the stemmed word and the removed suffix.
 |      :rtype: Tuple[str, str]
 |
 |      >>> from nltk.stem.cistem import Cistem
 |      >>> stemmer = Cistem()
 |      >>> s1 = "Speicherbehältern"
 |      >>> stemmer.segment(s1)
 |      ('speicherbehält', 'ern')
 |      >>> s2 = "Grenzpostens"
 |      >>> stemmer.segment(s2)
 |      ('grenzpost', 'ens')
 |      >>> s3 = "Ausgefeiltere"
 |      >>> stemmer.segment(s3)
 |      ('ausgefeilt', 'ere')
 |      >>> stemmer = Cistem(True)
 |      >>> stemmer.segment(s1)
 |      ('speicherbehäl', 'tern')
 |      >>> stemmer.segment(s2)
 |      ('grenzpo', 'stens')
 |      >>> stemmer.segment(s3)
 |      ('ausgefeil', 'tere')
 |
 |  stem(self, word: str) -> str
 |      Stems the input word.
 |
 |      :param word: The word that is to be stemmed.
 |      :type word: str
 |      :return: The stemmed word.
 |      :rtype: str
 |
 |      >>> from nltk.stem.cistem import Cistem
 |      >>> stemmer = Cistem()
 |      >>> s1 = "Speicherbehältern"
 |      >>> stemmer.stem(s1)
 |      'speicherbehalt'
 |      >>> s2 = "Grenzpostens"
 |      >>> stemmer.stem(s2)
 |      'grenzpost'
 |      >>> s3 = "Ausgefeiltere"
 |      >>> stemmer.stem(s3)
 |      'ausgefeilt'
 |      >>> stemmer = Cistem(True)
 |      >>> stemmer.stem(s1)
 |      'speicherbehal'
 |      >>> stemmer.stem(s2)
 |      'grenzpo'
 |      >>> stemmer.stem(s3)
 |      'ausgefeil'
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  replace_back(word: str) -> str
 |
 |  replace_to(word: str) -> str
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  repl_xx = re.compile('(.)\\1')
 |
 |  repl_xx_back = re.compile('(.)\\*')
 |
 |  strip_ge = re.compile('^ge(.{4,})')
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.stem.api.StemmerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ClassifierBasedPOSTagger
Python Library Documentation: class ClassifierBasedPOSTagger in module nltk.tag.sequential

class ClassifierBasedPOSTagger(ClassifierBasedTagger)
 |  ClassifierBasedPOSTagger(feature_detector=None, train=None, classifier_builder=<bound method NaiveBayesClassifier.train of <class 'nltk.classify.naivebayes.NaiveBayesClassifier'>>, classifier=None, backoff=None, cutoff_prob=None, verbose=False)
 |
 |  A classifier based part of speech tagger.
 |
 |  Method resolution order:
 |      ClassifierBasedPOSTagger
 |      ClassifierBasedTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.FeaturesetTaggerI
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  feature_detector(self, tokens, index, history)
 |      Return the feature detector that this tagger uses to generate
 |      featuresets for its classifier.  The feature detector is a
 |      function with the signature::
 |
 |        feature_detector(tokens, index, history) -> featureset
 |
 |      See ``classifier()``
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ClassifierBasedTagger:
 |
 |  __init__(self, feature_detector=None, train=None, classifier_builder=<bound method NaiveBayesClassifier.train of <class 'nltk.classify.naivebayes.NaiveBayesClassifier'>>, classifier=None, backoff=None, cutoff_prob=None, verbose=False)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  classifier(self)
 |      Return the classifier that this tagger uses to choose a tag
 |      for each word in a sentence.  The input for this classifier is
 |      generated using this tagger's feature detector.
 |      See ``feature_detector()``
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ClassifierBasedTagger
Python Library Documentation: class ClassifierBasedTagger in module nltk.tag.sequential

class ClassifierBasedTagger(SequentialBackoffTagger, nltk.tag.api.FeaturesetTaggerI)
 |  ClassifierBasedTagger(feature_detector=None, train=None, classifier_builder=<bound method NaiveBayesClassifier.train of <class 'nltk.classify.naivebayes.NaiveBayesClassifier'>>, classifier=None, backoff=None, cutoff_prob=None, verbose=False)
 |
 |  A sequential tagger that uses a classifier to choose the tag for
 |  each token in a sentence.  The featureset input for the classifier
 |  is generated by a feature detector function::
 |
 |      feature_detector(tokens, index, history) -> featureset
 |
 |  Where tokens is the list of unlabeled tokens in the sentence;
 |  index is the index of the token for which feature detection
 |  should be performed; and history is list of the tags for all
 |  tokens before index.
 |
 |  Construct a new classifier-based sequential tagger.
 |
 |  :param feature_detector: A function used to generate the
 |      featureset input for the classifier::
 |      feature_detector(tokens, index, history) -> featureset
 |
 |  :param train: A tagged corpus consisting of a list of tagged
 |      sentences, where each sentence is a list of (word, tag) tuples.
 |
 |  :param backoff: A backoff tagger, to be used by the new tagger
 |      if it encounters an unknown context.
 |
 |  :param classifier_builder: A function used to train a new
 |      classifier based on the data in *train*.  It should take
 |      one argument, a list of labeled featuresets (i.e.,
 |      (featureset, label) tuples).
 |
 |  :param classifier: The classifier that should be used by the
 |      tagger.  This is only useful if you want to manually
 |      construct the classifier; normally, you would use *train*
 |      instead.
 |
 |  :param backoff: A backoff tagger, used if this tagger is
 |      unable to determine a tag for a given token.
 |
 |  :param cutoff_prob: If specified, then this tagger will fall
 |      back on its backoff tagger if the probability of the most
 |      likely tag is less than *cutoff_prob*.
 |
 |  Method resolution order:
 |      ClassifierBasedTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.FeaturesetTaggerI
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, feature_detector=None, train=None, classifier_builder=<bound method NaiveBayesClassifier.train of <class 'nltk.classify.naivebayes.NaiveBayesClassifier'>>, classifier=None, backoff=None, cutoff_prob=None, verbose=False)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  classifier(self)
 |      Return the classifier that this tagger uses to choose a tag
 |      for each word in a sentence.  The input for this classifier is
 |      generated using this tagger's feature detector.
 |      See ``feature_detector()``
 |
 |  feature_detector(self, tokens, index, history)
 |      Return the feature detector that this tagger uses to generate
 |      featuresets for its classifier.  The feature detector is a
 |      function with the signature::
 |
 |        feature_detector(tokens, index, history) -> featureset
 |
 |      See ``classifier()``
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ClassifierI
Python Library Documentation: class ClassifierI in module nltk.classify.api

class ClassifierI(builtins.object)
 |  A processing interface for labeling tokens with a single category
 |  label (or "class").  Labels are typically strs or
 |  ints, but can be any immutable type.  The set of labels
 |  that the classifier chooses from must be fixed and finite.
 |
 |  Subclasses must define:
 |    - ``labels()``
 |    - either ``classify()`` or ``classify_many()`` (or both)
 |
 |  Subclasses may define:
 |    - either ``prob_classify()`` or ``prob_classify_many()`` (or both)
 |
 |  Methods defined here:
 |
 |  classify(self, featureset)
 |      :return: the most appropriate label for the given featureset.
 |      :rtype: label
 |
 |  classify_many(self, featuresets)
 |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.classify(fs) for fs in featuresets]
 |
 |      :rtype: list(label)
 |
 |  labels(self)
 |      :return: the list of category labels used by this classifier.
 |      :rtype: list of (immutable)
 |
 |  prob_classify(self, featureset)
 |      :return: a probability distribution over labels for the given
 |          featureset.
 |      :rtype: ProbDistI
 |
 |  prob_classify_many(self, featuresets)
 |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.prob_classify(fs) for fs in featuresets]
 |
 |      :rtype: list(ProbDistI)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ConcordanceIndex
Python Library Documentation: class ConcordanceIndex in module nltk.text

class ConcordanceIndex(builtins.object)
 |  ConcordanceIndex(tokens, key=<function ConcordanceIndex.<lambda> at 0x0000028F96303E20>)
 |
 |  An index that can be used to look up the offset locations at which
 |  a given word occurs in a document.
 |
 |  Methods defined here:
 |
 |  __init__(self, tokens, key=<function ConcordanceIndex.<lambda> at 0x0000028F96303E20>)
 |      Construct a new concordance index.
 |
 |      :param tokens: The document (list of tokens) that this
 |          concordance index was created from.  This list can be used
 |          to access the context of a given word occurrence.
 |      :param key: A function that maps each token to a normalized
 |          version that will be used as a key in the index.  E.g., if
 |          you use ``key=lambda s:s.lower()``, then the index will be
 |          case-insensitive.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  find_concordance(self, word, width=80)
 |      Find all concordance lines given the query word.
 |
 |      Provided with a list of words, these will be found as a phrase.
 |
 |  offsets(self, word)
 |      :rtype: list(int)
 |      :return: A list of the offset positions at which the given
 |          word occurs.  If a key function was specified for the
 |          index, then given word's key will be looked up.
 |
 |  print_concordance(self, word, width=80, lines=25)
 |      Print concordance lines given the query word.
 |      :param word: The target word or phrase (a list of strings)
 |      :type word: str or list
 |      :param lines: The number of lines to display (default=25)
 |      :type lines: int
 |      :param width: The width of each line, in characters (default=80)
 |      :type width: int
 |      :param save: The option to save the concordance.
 |      :type save: bool
 |
 |  tokens(self)
 |      :rtype: list(str)
 |      :return: The document that this concordance index was
 |          created from.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ConditionalExponentialClassifier
Python Library Documentation: class MaxentClassifier in module nltk.classify.maxent

class MaxentClassifier(nltk.classify.api.ClassifierI)
 |  MaxentClassifier(encoding, weights, logarithmic=True)
 |
 |  A maximum entropy classifier (also known as a "conditional
 |  exponential classifier").  This classifier is parameterized by a
 |  set of "weights", which are used to combine the joint-features
 |  that are generated from a featureset by an "encoding".  In
 |  particular, the encoding maps each ``(featureset, label)`` pair to
 |  a vector.  The probability of each label is then computed using
 |  the following equation::
 |
 |                              dotprod(weights, encode(fs,label))
 |    prob(fs|label) = ---------------------------------------------------
 |                     sum(dotprod(weights, encode(fs,l)) for l in labels)
 |
 |  Where ``dotprod`` is the dot product::
 |
 |    dotprod(a,b) = sum(x*y for (x,y) in zip(a,b))
 |
 |  Method resolution order:
 |      MaxentClassifier
 |      nltk.classify.api.ClassifierI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, encoding, weights, logarithmic=True)
 |      Construct a new maxent classifier model.  Typically, new
 |      classifier models are created using the ``train()`` method.
 |
 |      :type encoding: MaxentFeatureEncodingI
 |      :param encoding: An encoding that is used to convert the
 |          featuresets that are given to the ``classify`` method into
 |          joint-feature vectors, which are used by the maxent
 |          classifier model.
 |
 |      :type weights: list of float
 |      :param weights:  The feature weight vector for this classifier.
 |
 |      :type logarithmic: bool
 |      :param logarithmic: If false, then use non-logarithmic weights.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  classify(self, featureset)
 |      :return: the most appropriate label for the given featureset.
 |      :rtype: label
 |
 |  explain(self, featureset, columns=4)
 |      Print a table showing the effect of each of the features in
 |      the given feature set, and how they combine to determine the
 |      probabilities of each label for that featureset.
 |
 |  labels(self)
 |      :return: the list of category labels used by this classifier.
 |      :rtype: list of (immutable)
 |
 |  most_informative_features(self, n=10)
 |      Generates the ranked list of informative features from most to least.
 |
 |  prob_classify(self, featureset)
 |      :return: a probability distribution over labels for the given
 |          featureset.
 |      :rtype: ProbDistI
 |
 |  set_weights(self, new_weights)
 |      Set the feature weight vector for this classifier.
 |      :param new_weights: The new feature weight vector.
 |      :type new_weights: list of float
 |
 |  show_most_informative_features(self, n=10, show='all')
 |      :param show: all, neg, or pos (for negative-only or positive-only)
 |      :type show: str
 |      :param n: The no. of top features
 |      :type n: int
 |
 |  weights(self)
 |      :return: The feature weight vector for this classifier.
 |      :rtype: list of float
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  train(train_toks, algorithm=None, trace=3, encoding=None, labels=None, gaussian_prior_sigma=0, **cutoffs)
 |      Train a new maxent classifier based on the given corpus of
 |      training samples.  This classifier will have its weights
 |      chosen to maximize entropy while remaining empirically
 |      consistent with the training corpus.
 |
 |      :rtype: MaxentClassifier
 |      :return: The new maxent classifier
 |
 |      :type train_toks: list
 |      :param train_toks: Training data, represented as a list of
 |          pairs, the first member of which is a featureset,
 |          and the second of which is a classification label.
 |
 |      :type algorithm: str
 |      :param algorithm: A case-insensitive string, specifying which
 |          algorithm should be used to train the classifier.  The
 |          following algorithms are currently available.
 |
 |          - Iterative Scaling Methods: Generalized Iterative Scaling (``'GIS'``),
 |            Improved Iterative Scaling (``'IIS'``)
 |          - External Libraries (requiring megam):
 |            LM-BFGS algorithm, with training performed by Megam (``'megam'``)
 |
 |          The default algorithm is ``'IIS'``.
 |
 |      :type trace: int
 |      :param trace: The level of diagnostic tracing output to produce.
 |          Higher values produce more verbose output.
 |      :type encoding: MaxentFeatureEncodingI
 |      :param encoding: A feature encoding, used to convert featuresets
 |          into feature vectors.  If none is specified, then a
 |          ``BinaryMaxentFeatureEncoding`` will be built based on the
 |          features that are attested in the training corpus.
 |      :type labels: list(str)
 |      :param labels: The set of possible labels.  If none is given, then
 |          the set of all labels attested in the training data will be
 |          used instead.
 |      :param gaussian_prior_sigma: The sigma value for a gaussian
 |          prior on model weights.  Currently, this is supported by
 |          ``megam``. For other algorithms, its value is ignored.
 |      :param cutoffs: Arguments specifying various conditions under
 |          which the training should be halted.  (Some of the cutoff
 |          conditions are not supported by some algorithms.)
 |
 |          - ``max_iter=v``: Terminate after ``v`` iterations.
 |          - ``min_ll=v``: Terminate after the negative average
 |            log-likelihood drops under ``v``.
 |          - ``min_lldelta=v``: Terminate if a single iteration improves
 |            log likelihood by less than ``v``.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  ALGORITHMS = ['GIS', 'IIS', 'MEGAM', 'TADM']
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.api.ClassifierI:
 |
 |  classify_many(self, featuresets)
 |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.classify(fs) for fs in featuresets]
 |
 |      :rtype: list(label)
 |
 |  prob_classify_many(self, featuresets)
 |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.prob_classify(fs) for fs in featuresets]
 |
 |      :rtype: list(ProbDistI)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.classify.api.ClassifierI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ConditionalFreqDist
Python Library Documentation: class ConditionalFreqDist in module nltk.probability

class ConditionalFreqDist(collections.defaultdict)
 |  ConditionalFreqDist(cond_samples=None)
 |
 |  A collection of frequency distributions for a single experiment
 |  run under different conditions.  Conditional frequency
 |  distributions are used to record the number of times each sample
 |  occurred, given the condition under which the experiment was run.
 |  For example, a conditional frequency distribution could be used to
 |  record the frequency of each word (type) in a document, given its
 |  length.  Formally, a conditional frequency distribution can be
 |  defined as a function that maps from each condition to the
 |  FreqDist for the experiment under that condition.
 |
 |  Conditional frequency distributions are typically constructed by
 |  repeatedly running an experiment under a variety of conditions,
 |  and incrementing the sample outcome counts for the appropriate
 |  conditions.  For example, the following code will produce a
 |  conditional frequency distribution that encodes how often each
 |  word type occurs, given the length of that word type:
 |
 |      >>> from nltk.probability import ConditionalFreqDist
 |      >>> from nltk.tokenize import word_tokenize
 |      >>> sent = "the the the dog dog some other words that we do not care about"
 |      >>> cfdist = ConditionalFreqDist()
 |      >>> for word in word_tokenize(sent):
 |      ...     condition = len(word)
 |      ...     cfdist[condition][word] += 1
 |
 |  An equivalent way to do this is with the initializer:
 |
 |      >>> cfdist = ConditionalFreqDist((len(word), word) for word in word_tokenize(sent))
 |
 |  The frequency distribution for each condition is accessed using
 |  the indexing operator:
 |
 |      >>> cfdist[3]
 |      FreqDist({'the': 3, 'dog': 2, 'not': 1})
 |      >>> cfdist[3].freq('the')
 |      0.5
 |      >>> cfdist[3]['dog']
 |      2
 |
 |  When the indexing operator is used to access the frequency
 |  distribution for a condition that has not been accessed before,
 |  ``ConditionalFreqDist`` creates a new empty FreqDist for that
 |  condition.
 |
 |  Method resolution order:
 |      ConditionalFreqDist
 |      collections.defaultdict
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  N(self)
 |      Return the total number of sample outcomes that have been
 |      recorded by this ``ConditionalFreqDist``.
 |
 |      :rtype: int
 |
 |  __add__(self, other)
 |      Add counts from two ConditionalFreqDists.
 |
 |  __and__(self, other)
 |      Intersection is the minimum of corresponding counts.
 |
 |  __ge__(self, other)
 |      Return self>=value.
 |
 |  __gt__(self, other)
 |      Return self>value.
 |
 |  __init__(self, cond_samples=None)
 |      Construct a new empty conditional frequency distribution.  In
 |      particular, the count for every sample, under every condition,
 |      is zero.
 |
 |      :param cond_samples: The samples to initialize the conditional
 |          frequency distribution with
 |      :type cond_samples: Sequence of (condition, sample) tuples
 |
 |  __le__(self, other)
 |      Return self<=value.
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __or__(self, other)
 |      Union is the maximum of value in either of the input counters.
 |
 |  __reduce__(self)
 |      Return state information for pickling.
 |
 |  __repr__(self)
 |      Return a string representation of this ``ConditionalFreqDist``.
 |
 |      :rtype: str
 |
 |  __sub__(self, other)
 |      Subtract count, but keep only results with positive counts.
 |
 |  conditions(self)
 |      Return a list of the conditions that have been accessed for
 |      this ``ConditionalFreqDist``.  Use the indexing operator to
 |      access the frequency distribution for a given condition.
 |      Note that the frequency distributions for some conditions
 |      may contain zero sample outcomes.
 |
 |      :rtype: list
 |
 |  copy = deepcopy(self)
 |
 |  deepcopy(self)
 |
 |  plot(self, *args, samples=None, title='', cumulative=False, percents=False, conditions=None, show=False, **kwargs)
 |      Plot the given samples from the conditional frequency distribution.
 |      For a cumulative plot, specify cumulative=True. Additional ``*args`` and
 |      ``**kwargs`` are passed to matplotlib's plot function.
 |      (Requires Matplotlib to be installed.)
 |
 |      :param samples: The samples to plot
 |      :type samples: list
 |      :param title: The title for the graph
 |      :type title: str
 |      :param cumulative: Whether the plot is cumulative. (default = False)
 |      :type cumulative: bool
 |      :param percents: Whether the plot uses percents instead of counts. (default = False)
 |      :type percents: bool
 |      :param conditions: The conditions to plot (default is all)
 |      :type conditions: list
 |      :param show: Whether to show the plot, or only return the ax.
 |      :type show: bool
 |
 |  tabulate(self, *args, **kwargs)
 |      Tabulate the given samples from the conditional frequency distribution.
 |
 |      :param samples: The samples to plot
 |      :type samples: list
 |      :param conditions: The conditions to plot (default is all)
 |      :type conditions: list
 |      :param cumulative: A flag to specify whether the freqs are cumulative (default = False)
 |      :type title: bool
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from collections.defaultdict:
 |
 |  __copy__(...)
 |      D.copy() -> a shallow copy of D.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __missing__(...)
 |      __missing__(key) # Called by __getitem__ for missing key; pseudo-code:
 |      if self.default_factory is None: raise KeyError((key,))
 |      self[key] = value = self.default_factory()
 |      return value
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from collections.defaultdict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from collections.defaultdict:
 |
 |  default_factory
 |      Factory for default value called by __missing__().
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.ConditionalProbDist
Python Library Documentation: class ConditionalProbDist in module nltk.probability

class ConditionalProbDist(ConditionalProbDistI)
 |  ConditionalProbDist(cfdist, probdist_factory, *factory_args, **factory_kw_args)
 |
 |  A conditional probability distribution modeling the experiments
 |  that were used to generate a conditional frequency distribution.
 |  A ConditionalProbDist is constructed from a
 |  ``ConditionalFreqDist`` and a ``ProbDist`` factory:
 |
 |  - The ``ConditionalFreqDist`` specifies the frequency
 |    distribution for each condition.
 |  - The ``ProbDist`` factory is a function that takes a
 |    condition's frequency distribution, and returns its
 |    probability distribution.  A ``ProbDist`` class's name (such as
 |    ``MLEProbDist`` or ``HeldoutProbDist``) can be used to specify
 |    that class's constructor.
 |
 |  The first argument to the ``ProbDist`` factory is the frequency
 |  distribution that it should model; and the remaining arguments are
 |  specified by the ``factory_args`` parameter to the
 |  ``ConditionalProbDist`` constructor.  For example, the following
 |  code constructs a ``ConditionalProbDist``, where the probability
 |  distribution for each condition is an ``ELEProbDist`` with 10 bins:
 |
 |      >>> from nltk.corpus import brown
 |      >>> from nltk.probability import ConditionalFreqDist
 |      >>> from nltk.probability import ConditionalProbDist, ELEProbDist
 |      >>> cfdist = ConditionalFreqDist(brown.tagged_words()[:5000])
 |      >>> cpdist = ConditionalProbDist(cfdist, ELEProbDist, 10)
 |      >>> cpdist['passed'].max()
 |      'VBD'
 |      >>> cpdist['passed'].prob('VBD') #doctest: +ELLIPSIS
 |      0.423...
 |
 |  Method resolution order:
 |      ConditionalProbDist
 |      ConditionalProbDistI
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, cfdist, probdist_factory, *factory_args, **factory_kw_args)
 |      Construct a new conditional probability distribution, based on
 |      the given conditional frequency distribution and ``ProbDist``
 |      factory.
 |
 |      :type cfdist: ConditionalFreqDist
 |      :param cfdist: The ``ConditionalFreqDist`` specifying the
 |          frequency distribution for each condition.
 |      :type probdist_factory: class or function
 |      :param probdist_factory: The function or class that maps
 |          a condition's frequency distribution to its probability
 |          distribution.  The function is called with the frequency
 |          distribution as its first argument,
 |          ``factory_args`` as its remaining arguments, and
 |          ``factory_kw_args`` as keyword arguments.
 |      :type factory_args: (any)
 |      :param factory_args: Extra arguments for ``probdist_factory``.
 |          These arguments are usually used to specify extra
 |          properties for the probability distributions of individual
 |          conditions, such as the number of bins they contain.
 |      :type factory_kw_args: (any)
 |      :param factory_kw_args: Extra keyword arguments for ``probdist_factory``.
 |
 |  __missing__(self, key)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ConditionalProbDistI:
 |
 |  __repr__(self)
 |      Return a string representation of this ``ConditionalProbDist``.
 |
 |      :rtype: str
 |
 |  conditions(self)
 |      Return a list of the conditions that are represented by
 |      this ``ConditionalProbDist``.  Use the indexing operator to
 |      access the probability distribution for a given condition.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ConditionalProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.ConditionalProbDistI
Python Library Documentation: class ConditionalProbDistI in module nltk.probability

class ConditionalProbDistI(builtins.dict)
 |  A collection of probability distributions for a single experiment
 |  run under different conditions.  Conditional probability
 |  distributions are used to estimate the likelihood of each sample,
 |  given the condition under which the experiment was run.  For
 |  example, a conditional probability distribution could be used to
 |  estimate the probability of each word type in a document, given
 |  the length of the word type.  Formally, a conditional probability
 |  distribution can be defined as a function that maps from each
 |  condition to the ``ProbDist`` for the experiment under that
 |  condition.
 |
 |  Method resolution order:
 |      ConditionalProbDistI
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Classes inheriting from ConditionalProbDistI should implement __init__.
 |
 |  __repr__(self)
 |      Return a string representation of this ``ConditionalProbDist``.
 |
 |      :rtype: str
 |
 |  conditions(self)
 |      Return a list of the conditions that are represented by
 |      this ``ConditionalProbDist``.  Use the indexing operator to
 |      access the probability distribution for a given condition.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset({'__init__'})
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.ConfusionMatrix
Python Library Documentation: class ConfusionMatrix in module nltk.metrics.confusionmatrix

class ConfusionMatrix(builtins.object)
 |  ConfusionMatrix(reference, test, sort_by_count=False)
 |
 |  The confusion matrix between a list of reference values and a
 |  corresponding list of test values.  Entry *[r,t]* of this
 |  matrix is a count of the number of times that the reference value
 |  *r* corresponds to the test value *t*.  E.g.:
 |
 |      >>> from nltk.metrics import ConfusionMatrix
 |      >>> ref  = 'DET NN VB DET JJ NN NN IN DET NN'.split()
 |      >>> test = 'DET VB VB DET NN NN NN IN DET NN'.split()
 |      >>> cm = ConfusionMatrix(ref, test)
 |      >>> print(cm['NN', 'NN'])
 |      3
 |
 |  Note that the diagonal entries *Ri=Tj* of this matrix
 |  corresponds to correct values; and the off-diagonal entries
 |  correspond to incorrect values.
 |
 |  Methods defined here:
 |
 |  __getitem__(self, li_lj_tuple)
 |      :return: The number of times that value ``li`` was expected and
 |      value ``lj`` was given.
 |      :rtype: int
 |
 |  __init__(self, reference, test, sort_by_count=False)
 |      Construct a new confusion matrix from a list of reference
 |      values and a corresponding list of test values.
 |
 |      :type reference: list
 |      :param reference: An ordered list of reference values.
 |      :type test: list
 |      :param test: A list of values to compare against the
 |          corresponding reference values.
 |      :raise ValueError: If ``reference`` and ``length`` do not have
 |          the same length.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  evaluate(self, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each value in this confusion matrix.
 |
 |      >>> reference = "DET NN VB DET JJ NN NN IN DET NN".split()
 |      >>> test = "DET VB VB DET NN NN NN IN DET NN".split()
 |      >>> cm = ConfusionMatrix(reference, test)
 |      >>> print(cm.evaluate())
 |      Tag | Prec.  | Recall | F-measure
 |      ----+--------+--------+-----------
 |      DET | 1.0000 | 1.0000 | 1.0000
 |       IN | 1.0000 | 1.0000 | 1.0000
 |       JJ | 0.0000 | 0.0000 | 0.0000
 |       NN | 0.7500 | 0.7500 | 0.7500
 |       VB | 0.5000 | 1.0000 | 0.6667
 |      <BLANKLINE>
 |
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values. Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on frequency
 |          in the reference label. Defaults to False.
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, value, alpha=0.5)
 |      Given a value used in the confusion matrix, return the f-measure
 |      that corresponds to this value. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param value: value used in the ConfusionMatrix
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: the F-measure corresponding to ``value``.
 |      :rtype: float
 |
 |  key(self)
 |
 |  precision(self, value)
 |      Given a value in the confusion matrix, return the precision
 |      that corresponds to this value. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      and can loosely be considered the ratio of how often ``value``
 |      was predicted correctly relative to the number of predictions
 |      for ``value``.
 |
 |      :param value: value used in the ConfusionMatrix
 |      :return: the precision corresponding to ``value``.
 |      :rtype: float
 |
 |  pretty_format(self, show_percents=False, values_in_chart=True, truncate=None, sort_by_count=False)
 |      :return: A multi-line string representation of this confusion matrix.
 |      :type truncate: int
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation.
 |      :param sort_by_count: If true, then sort by the count of each
 |          label in the reference data.  I.e., labels that occur more
 |          frequently in the reference label will be towards the left
 |          edge of the matrix, and labels that occur less frequently
 |          will be towards the right edge.
 |
 |      @todo: add marginals?
 |
 |  recall(self, value)
 |      Given a value in the confusion matrix, return the recall
 |      that corresponds to this value. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      and can loosely be considered the ratio of how often ``value``
 |      was predicted correctly relative to how often ``value`` was
 |      the true result.
 |
 |      :param value: value used in the ConfusionMatrix
 |      :return: the recall corresponding to ``value``.
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ContextIndex
Python Library Documentation: class ContextIndex in module nltk.text

class ContextIndex(builtins.object)
 |  ContextIndex(tokens, context_func=None, filter=None, key=<function ContextIndex.<lambda> at 0x0000028F96303A60>)
 |
 |  A bidirectional index between words and their 'contexts' in a text.
 |  The context of a word is usually defined to be the words that occur
 |  in a fixed window around the word; but other definitions may also
 |  be used by providing a custom context function.
 |
 |  Methods defined here:
 |
 |  __init__(self, tokens, context_func=None, filter=None, key=<function ContextIndex.<lambda> at 0x0000028F96303A60>)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  common_contexts(self, words, fail_on_unknown=False)
 |      Find contexts where the specified words can all appear; and
 |      return a frequency distribution mapping each context to the
 |      number of times that context was used.
 |
 |      :param words: The words used to seed the similarity search
 |      :type words: str
 |      :param fail_on_unknown: If true, then raise a value error if
 |          any of the given words do not occur at all in the index.
 |
 |  similar_words(self, word, n=20)
 |
 |  tokens(self)
 |      :rtype: list(str)
 |      :return: The document that this context index was
 |          created from.
 |
 |  word_similarity_dict(self, word)
 |      Return a dictionary mapping from words to 'similarity scores,'
 |      indicating how often these two words occur in the same
 |      context.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ContextTagger
Python Library Documentation: class ContextTagger in module nltk.tag.sequential

class ContextTagger(SequentialBackoffTagger)
 |  ContextTagger(context_to_tag, backoff=None)
 |
 |  An abstract base class for sequential backoff taggers that choose
 |  a tag for a token based on the value of its "context".  Different
 |  subclasses are used to define different contexts.
 |
 |  A ContextTagger chooses the tag for a token by calculating the
 |  token's context, and looking up the corresponding tag in a table.
 |  This table can be constructed manually; or it can be automatically
 |  constructed based on a training corpus, using the ``_train()``
 |  factory method.
 |
 |  :ivar _context_to_tag: Dictionary mapping contexts to tags.
 |
 |  Method resolution order:
 |      ContextTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, context_to_tag, backoff=None)
 |      :param context_to_tag: A dictionary mapping contexts to tags.
 |      :param backoff: The backoff tagger that should be used for this tagger.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  context(self, tokens, index, history)
 |      :return: the context that should be used to look up the tag
 |          for the specified token; or None if the specified token
 |          should not be handled by this tagger.
 |      :rtype: (hashable)
 |
 |  size(self)
 |      :return: The number of entries in the table used by this
 |          tagger to map from contexts to tags.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset({'context'})
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ContingencyMeasures
Python Library Documentation: class ContingencyMeasures in module nltk.metrics.association

class ContingencyMeasures(builtins.object)
 |  ContingencyMeasures(measures)
 |
 |  Wraps NgramAssocMeasures classes such that the arguments of association
 |  measures are contingency table values rather than marginals.
 |
 |  Methods defined here:
 |
 |  __init__(self, measures)
 |      Constructs a ContingencyMeasures given a NgramAssocMeasures class
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.CoreNLPDependencyParser
Python Library Documentation: class CoreNLPDependencyParser in module nltk.parse.corenlp

class CoreNLPDependencyParser(GenericCoreNLPParser)
 |  CoreNLPDependencyParser(url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
 |
 |  Dependency parser.
 |
 |  Skip these tests if CoreNLP is likely not ready.
 |  >>> from nltk.test.setup_fixt import check_jar
 |  >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
 |
 |  The recommended usage of `CoreNLPParser` is using the context manager notation:
 |  >>> with CoreNLPServer() as server:
 |  ...     dep_parser = CoreNLPDependencyParser(url=server.url)
 |  ...     parse, = dep_parser.raw_parse(
 |  ...         'The quick brown fox jumps over the lazy dog.'
 |  ...     )
 |  ...     print(parse.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
 |  The        DT      4       det
 |  quick      JJ      4       amod
 |  brown      JJ      4       amod
 |  fox        NN      5       nsubj
 |  jumps      VBZ     0       ROOT
 |  over       IN      9       case
 |  the        DT      9       det
 |  lazy       JJ      9       amod
 |  dog        NN      5       obl
 |  .  .       5       punct
 |
 |  Alternatively, the server can be started using the following notation.
 |  Note that `CoreNLPServer` does not need to be used if the CoreNLP server is started
 |  outside of Python.
 |  >>> server = CoreNLPServer()
 |  >>> server.start()
 |  >>> dep_parser = CoreNLPDependencyParser(url=server.url)
 |  >>> parse, = dep_parser.raw_parse('The quick brown fox jumps over the lazy dog.')
 |  >>> print(parse.tree())  # doctest: +NORMALIZE_WHITESPACE
 |  (jumps (fox The quick brown) (dog over the lazy) .)
 |
 |  >>> for governor, dep, dependent in parse.triples():
 |  ...     print(governor, dep, dependent)  # doctest: +NORMALIZE_WHITESPACE
 |  ('jumps', 'VBZ') nsubj ('fox', 'NN')
 |  ('fox', 'NN') det ('The', 'DT')
 |  ('fox', 'NN') amod ('quick', 'JJ')
 |  ('fox', 'NN') amod ('brown', 'JJ')
 |  ('jumps', 'VBZ') obl ('dog', 'NN')
 |  ('dog', 'NN') case ('over', 'IN')
 |  ('dog', 'NN') det ('the', 'DT')
 |  ('dog', 'NN') amod ('lazy', 'JJ')
 |  ('jumps', 'VBZ') punct ('.', '.')
 |
 |  >>> (parse_fox, ), (parse_dog, ) = dep_parser.raw_parse_sents(
 |  ...     [
 |  ...         'The quick brown fox jumps over the lazy dog.',
 |  ...         'The quick grey wolf jumps over the lazy fox.',
 |  ...     ]
 |  ... )
 |  >>> print(parse_fox.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
 |  The        DT      4       det
 |  quick      JJ      4       amod
 |  brown      JJ      4       amod
 |  fox        NN      5       nsubj
 |  jumps      VBZ     0       ROOT
 |  over       IN      9       case
 |  the        DT      9       det
 |  lazy       JJ      9       amod
 |  dog        NN      5       obl
 |  .  .       5       punct
 |
 |  >>> print(parse_dog.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
 |  The        DT      4       det
 |  quick      JJ      4       amod
 |  grey       JJ      4       amod
 |  wolf       NN      5       nsubj
 |  jumps      VBZ     0       ROOT
 |  over       IN      9       case
 |  the        DT      9       det
 |  lazy       JJ      9       amod
 |  fox        NN      5       obl
 |  .  .       5       punct
 |
 |  >>> (parse_dog, ), (parse_friends, ) = dep_parser.parse_sents(
 |  ...     [
 |  ...         "I 'm a dog".split(),
 |  ...         "This is my friends ' cat ( the tabby )".split(),
 |  ...     ]
 |  ... )
 |  >>> print(parse_dog.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
 |  I   PRP     4       nsubj
 |  'm  VBP     4       cop
 |  a   DT      4       det
 |  dog NN      0       ROOT
 |
 |  >>> print(parse_friends.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
 |  This       DT      6       nsubj
 |  is VBZ     6       cop
 |  my PRP$    4       nmod:poss
 |  friends    NNS     6       nmod:poss
 |  '  POS     4       case
 |  cat        NN      0       ROOT
 |  (  -LRB-   9       punct
 |  the        DT      9       det
 |  tabby      NN      6       dep
 |  )  -RRB-   9       punct
 |
 |  >>> parse_john, parse_mary, = dep_parser.parse_text(
 |  ...     'John loves Mary. Mary walks.'
 |  ... )
 |
 |  >>> print(parse_john.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
 |  John       NNP     2       nsubj
 |  loves      VBZ     0       ROOT
 |  Mary       NNP     2       obj
 |  .  .       2       punct
 |
 |  >>> print(parse_mary.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
 |  Mary        NNP     2       nsubj
 |  walks       VBZ     0       ROOT
 |  .   .       2       punct
 |
 |  Special cases
 |
 |  Non-breaking space inside of a token.
 |
 |  >>> len(
 |  ...     next(
 |  ...         dep_parser.raw_parse(
 |  ...             'Anhalt said children typically treat a 20-ounce soda bottle as one '
 |  ...             'serving, while it actually contains 2 1/2 servings.'
 |  ...         )
 |  ...     ).nodes
 |  ... )
 |  23
 |
 |  Phone  numbers.
 |
 |  >>> len(
 |  ...     next(
 |  ...         dep_parser.raw_parse('This is not going to crash: 01 111 555.')
 |  ...     ).nodes
 |  ... )
 |  10
 |
 |  >>> print(
 |  ...     next(
 |  ...         dep_parser.raw_parse('The underscore _ should not simply disappear.')
 |  ...     ).to_conll(4)
 |  ... )  # doctest: +NORMALIZE_WHITESPACE
 |  The        DT      2       det
 |  underscore NN      7       nsubj
 |  _  NFP     7       punct
 |  should     MD      7       aux
 |  not        RB      7       advmod
 |  simply     RB      7       advmod
 |  disappear  VB      0       ROOT
 |  .  .       7       punct
 |
 |  >>> print(
 |  ...     next(
 |  ...         dep_parser.raw_parse(
 |  ...             'for all of its insights into the dream world of teen life , and its electronic expression through '
 |  ...             'cyber culture , the film gives no quarter to anyone seeking to pull a cohesive story out of its 2 '
 |  ...             '1/2-hour running time .'
 |  ...         )
 |  ...     ).to_conll(4)
 |  ... )  # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
 |  for        IN      2       case
 |  all        DT      24      obl
 |  of IN      5       case
 |  its        PRP$    5       nmod:poss
 |  insights   NNS     2       nmod
 |  into       IN      9       case
 |  the        DT      9       det
 |  dream      NN      9       compound
 |  world      NN      5       nmod
 |  of IN      12      case
 |  teen       NN      12      compound
 |  ...
 |
 |  >>> server.stop()
 |
 |  Method resolution order:
 |      CoreNLPDependencyParser
 |      GenericCoreNLPParser
 |      nltk.parse.api.ParserI
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  make_tree(self, result)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  parser_annotator = 'depparse'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from GenericCoreNLPParser:
 |
 |  __init__(self, url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  api_call(self, data, properties=None, timeout=60)
 |
 |  parse_sents(self, sentences, *args, **kwargs)
 |      Parse multiple sentences.
 |
 |      Takes multiple sentences as a list where each sentence is a list of
 |      words. Each sentence will be automatically tagged with this
 |      CoreNLPParser instance's tagger.
 |
 |      If a whitespace exists inside a token, then the token will be treated as
 |      several tokens.
 |
 |      :param sentences: Input sentences to parse
 |      :type sentences: list(list(str))
 |      :rtype: iter(iter(Tree))
 |
 |  parse_text(self, text, *args, **kwargs)
 |      Parse a piece of text.
 |
 |      The text might contain several sentences which will be split by CoreNLP.
 |
 |      :param str text: text to be split.
 |      :returns: an iterable of syntactic structures.  # TODO: should it be an iterable of iterables?
 |
 |  raw_parse(self, sentence, properties=None, *args, **kwargs)
 |      Parse a sentence.
 |
 |      Takes a sentence as a string; before parsing, it will be automatically
 |      tokenized and tagged by the CoreNLP Parser.
 |
 |      :param sentence: Input sentence to parse
 |      :type sentence: str
 |      :rtype: iter(Tree)
 |
 |  raw_parse_sents(self, sentences, verbose=False, properties=None, *args, **kwargs)
 |      Parse multiple sentences.
 |
 |      Takes multiple sentences as a list of strings. Each sentence will be
 |      automatically tokenized and tagged.
 |
 |      :param sentences: Input sentences to parse.
 |      :type sentences: list(str)
 |      :rtype: iter(iter(Tree))
 |
 |  raw_tag_sents(self, sentences, properties=None)
 |      Tag multiple sentences.
 |
 |      Takes multiple sentences as a list where each sentence is a string.
 |
 |      :param sentences: Input sentences to tag
 |      :type sentences: list(str)
 |      :rtype: list(list(list(tuple(str, str)))
 |
 |  tag(self, sentence: str, properties=None) -> list[tuple[str, str]]
 |      Tag a list of tokens.
 |
 |      :rtype: list(tuple(str, str))
 |
 |      Skip these tests if CoreNLP is likely not ready.
 |      >>> from nltk.test.setup_fixt import check_jar
 |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
 |
 |      The CoreNLP server can be started using the following notation, although
 |      we recommend the `with CoreNLPServer() as server:` context manager notation
 |      to ensure that the server is always stopped.
 |      >>> server = CoreNLPServer()
 |      >>> server.start()
 |      >>> parser = CoreNLPParser(url=server.url, tagtype='ner')
 |      >>> tokens = 'Rami Eid is studying at Stony Brook University in NY'.split()
 |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
 |      [('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'), ('at', 'O'), ('Stony', 'ORGANIZATION'),
 |      ('Brook', 'ORGANIZATION'), ('University', 'ORGANIZATION'), ('in', 'O'), ('NY', 'STATE_OR_PROVINCE')]
 |
 |      >>> parser = CoreNLPParser(url=server.url, tagtype='pos')
 |      >>> tokens = "What is the airspeed of an unladen swallow ?".split()
 |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
 |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'),
 |      ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'),
 |      ('unladen', 'JJ'), ('swallow', 'VB'), ('?', '.')]
 |      >>> server.stop()
 |
 |  tag_sents(self, sentences, properties=None)
 |      Tag multiple sentences.
 |
 |      Takes multiple sentences as a list where each sentence is a list of
 |      tokens.
 |
 |      :param sentences: Input sentences to tag
 |      :type sentences: list(list(str))
 |      :rtype: list(list(tuple(str, str))
 |
 |  tokenize(self, text, properties=None)
 |      Tokenize a string of text.
 |
 |      Skip these tests if CoreNLP is likely not ready.
 |      >>> from nltk.test.setup_fixt import check_jar
 |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
 |
 |      The CoreNLP server can be started using the following notation, although
 |      we recommend the `with CoreNLPServer() as server:` context manager notation
 |      to ensure that the server is always stopped.
 |      >>> server = CoreNLPServer()
 |      >>> server.start()
 |      >>> parser = CoreNLPParser(url=server.url)
 |
 |      >>> text = 'Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\nThanks.'
 |      >>> list(parser.tokenize(text))
 |      ['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York', '.', 'Please', 'buy', 'me', 'two', 'of', 'them', '.', 'Thanks', '.']
 |
 |      >>> s = "The colour of the wall is blue."
 |      >>> list(
 |      ...     parser.tokenize(
 |      ...         'The colour of the wall is blue.',
 |      ...             properties={'tokenize.options': 'americanize=true'},
 |      ...     )
 |      ... )
 |      ['The', 'colour', 'of', 'the', 'wall', 'is', 'blue', '.']
 |      >>> server.stop()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, sent, *args, **kwargs)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
nltk.CoreNLPParser
Python Library Documentation: class CoreNLPParser in module nltk.parse.corenlp

class CoreNLPParser(GenericCoreNLPParser)
 |  CoreNLPParser(url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
 |
 |  Skip these tests if CoreNLP is likely not ready.
 |  >>> from nltk.test.setup_fixt import check_jar
 |  >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
 |
 |  The recommended usage of `CoreNLPParser` is using the context manager notation:
 |  >>> with CoreNLPServer() as server:
 |  ...     parser = CoreNLPParser(url=server.url)
 |  ...     next(
 |  ...         parser.raw_parse('The quick brown fox jumps over the lazy dog.')
 |  ...     ).pretty_print()  # doctest: +NORMALIZE_WHITESPACE
 |                          ROOT
 |                          |
 |                          S
 |          _______________|__________________________
 |          |                         VP               |
 |          |                _________|___             |
 |          |               |             PP           |
 |          |               |     ________|___         |
 |          NP              |    |            NP       |
 |      ____|__________     |    |     _______|____    |
 |      DT   JJ    JJ   NN  VBZ   IN   DT      JJ   NN  .
 |      |    |     |    |    |    |    |       |    |   |
 |      The quick brown fox jumps over the     lazy dog  .
 |
 |  Alternatively, the server can be started using the following notation.
 |  Note that `CoreNLPServer` does not need to be used if the CoreNLP server is started
 |  outside of Python.
 |  >>> server = CoreNLPServer()
 |  >>> server.start()
 |  >>> parser = CoreNLPParser(url=server.url)
 |
 |  >>> (parse_fox, ), (parse_wolf, ) = parser.raw_parse_sents(
 |  ...     [
 |  ...         'The quick brown fox jumps over the lazy dog.',
 |  ...         'The quick grey wolf jumps over the lazy fox.',
 |  ...     ]
 |  ... )
 |
 |  >>> parse_fox.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
 |                       ROOT
 |                        |
 |                        S
 |         _______________|__________________________
 |        |                         VP               |
 |        |                _________|___             |
 |        |               |             PP           |
 |        |               |     ________|___         |
 |        NP              |    |            NP       |
 |    ____|__________     |    |     _______|____    |
 |   DT   JJ    JJ   NN  VBZ   IN   DT      JJ   NN  .
 |   |    |     |    |    |    |    |       |    |   |
 |  The quick brown fox jumps over the     lazy dog  .
 |
 |  >>> parse_wolf.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
 |                       ROOT
 |                        |
 |                        S
 |         _______________|__________________________
 |        |                         VP               |
 |        |                _________|___             |
 |        |               |             PP           |
 |        |               |     ________|___         |
 |        NP              |    |            NP       |
 |    ____|_________      |    |     _______|____    |
 |   DT   JJ   JJ   NN   VBZ   IN   DT      JJ   NN  .
 |   |    |    |    |     |    |    |       |    |   |
 |  The quick grey wolf jumps over the     lazy fox  .
 |
 |  >>> (parse_dog, ), (parse_friends, ) = parser.parse_sents(
 |  ...     [
 |  ...         "I 'm a dog".split(),
 |  ...         "This is my friends ' cat ( the tabby )".split(),
 |  ...     ]
 |  ... )
 |
 |  >>> parse_dog.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
 |          ROOT
 |           |
 |           S
 |    _______|____
 |   |            VP
 |   |    ________|___
 |   NP  |            NP
 |   |   |         ___|___
 |  PRP VBP       DT      NN
 |   |   |        |       |
 |   I   'm       a      dog
 |
 |  >>> parse_friends.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
 |       ROOT
 |        |
 |        S
 |    ____|___________
 |   |                VP
 |   |     ___________|_____________
 |   |    |                         NP
 |   |    |                  _______|________________________
 |   |    |                 NP           |        |          |
 |   |    |            _____|_______     |        |          |
 |   NP   |           NP            |    |        NP         |
 |   |    |     ______|_________    |    |     ___|____      |
 |   DT  VBZ  PRP$   NNS       POS  NN -LRB-  DT       NN  -RRB-
 |   |    |    |      |         |   |    |    |        |     |
 |  This  is   my  friends      '  cat -LRB- the     tabby -RRB-
 |
 |  >>> parse_john, parse_mary, = parser.parse_text(
 |  ...     'John loves Mary. Mary walks.'
 |  ... )
 |
 |  >>> parse_john.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
 |        ROOT
 |         |
 |         S
 |    _____|_____________
 |   |          VP       |
 |   |      ____|___     |
 |   NP    |        NP   |
 |   |     |        |    |
 |  NNP   VBZ      NNP   .
 |   |     |        |    |
 |  John loves     Mary  .
 |
 |  >>> parse_mary.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
 |        ROOT
 |         |
 |         S
 |    _____|____
 |   NP    VP   |
 |   |     |    |
 |  NNP   VBZ   .
 |   |     |    |
 |  Mary walks  .
 |
 |  Special cases
 |
 |  >>> next(
 |  ...     parser.raw_parse(
 |  ...         'NASIRIYA, Iraq—Iraqi doctors who treated former prisoner of war '
 |  ...         'Jessica Lynch have angrily dismissed claims made in her biography '
 |  ...         'that she was raped by her Iraqi captors.'
 |  ...     )
 |  ... ).height()
 |  14
 |
 |  >>> next(
 |  ...     parser.raw_parse(
 |  ...         "The broader Standard & Poor's 500 Index <.SPX> was 0.46 points lower, or "
 |  ...         '0.05 percent, at 997.02.'
 |  ...     )
 |  ... ).height()
 |  11
 |
 |  >>> server.stop()
 |
 |  Method resolution order:
 |      CoreNLPParser
 |      GenericCoreNLPParser
 |      nltk.parse.api.ParserI
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  make_tree(self, result)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  parser_annotator = 'parse'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from GenericCoreNLPParser:
 |
 |  __init__(self, url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  api_call(self, data, properties=None, timeout=60)
 |
 |  parse_sents(self, sentences, *args, **kwargs)
 |      Parse multiple sentences.
 |
 |      Takes multiple sentences as a list where each sentence is a list of
 |      words. Each sentence will be automatically tagged with this
 |      CoreNLPParser instance's tagger.
 |
 |      If a whitespace exists inside a token, then the token will be treated as
 |      several tokens.
 |
 |      :param sentences: Input sentences to parse
 |      :type sentences: list(list(str))
 |      :rtype: iter(iter(Tree))
 |
 |  parse_text(self, text, *args, **kwargs)
 |      Parse a piece of text.
 |
 |      The text might contain several sentences which will be split by CoreNLP.
 |
 |      :param str text: text to be split.
 |      :returns: an iterable of syntactic structures.  # TODO: should it be an iterable of iterables?
 |
 |  raw_parse(self, sentence, properties=None, *args, **kwargs)
 |      Parse a sentence.
 |
 |      Takes a sentence as a string; before parsing, it will be automatically
 |      tokenized and tagged by the CoreNLP Parser.
 |
 |      :param sentence: Input sentence to parse
 |      :type sentence: str
 |      :rtype: iter(Tree)
 |
 |  raw_parse_sents(self, sentences, verbose=False, properties=None, *args, **kwargs)
 |      Parse multiple sentences.
 |
 |      Takes multiple sentences as a list of strings. Each sentence will be
 |      automatically tokenized and tagged.
 |
 |      :param sentences: Input sentences to parse.
 |      :type sentences: list(str)
 |      :rtype: iter(iter(Tree))
 |
 |  raw_tag_sents(self, sentences, properties=None)
 |      Tag multiple sentences.
 |
 |      Takes multiple sentences as a list where each sentence is a string.
 |
 |      :param sentences: Input sentences to tag
 |      :type sentences: list(str)
 |      :rtype: list(list(list(tuple(str, str)))
 |
 |  tag(self, sentence: str, properties=None) -> list[tuple[str, str]]
 |      Tag a list of tokens.
 |
 |      :rtype: list(tuple(str, str))
 |
 |      Skip these tests if CoreNLP is likely not ready.
 |      >>> from nltk.test.setup_fixt import check_jar
 |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
 |
 |      The CoreNLP server can be started using the following notation, although
 |      we recommend the `with CoreNLPServer() as server:` context manager notation
 |      to ensure that the server is always stopped.
 |      >>> server = CoreNLPServer()
 |      >>> server.start()
 |      >>> parser = CoreNLPParser(url=server.url, tagtype='ner')
 |      >>> tokens = 'Rami Eid is studying at Stony Brook University in NY'.split()
 |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
 |      [('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'), ('at', 'O'), ('Stony', 'ORGANIZATION'),
 |      ('Brook', 'ORGANIZATION'), ('University', 'ORGANIZATION'), ('in', 'O'), ('NY', 'STATE_OR_PROVINCE')]
 |
 |      >>> parser = CoreNLPParser(url=server.url, tagtype='pos')
 |      >>> tokens = "What is the airspeed of an unladen swallow ?".split()
 |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
 |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'),
 |      ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'),
 |      ('unladen', 'JJ'), ('swallow', 'VB'), ('?', '.')]
 |      >>> server.stop()
 |
 |  tag_sents(self, sentences, properties=None)
 |      Tag multiple sentences.
 |
 |      Takes multiple sentences as a list where each sentence is a list of
 |      tokens.
 |
 |      :param sentences: Input sentences to tag
 |      :type sentences: list(list(str))
 |      :rtype: list(list(tuple(str, str))
 |
 |  tokenize(self, text, properties=None)
 |      Tokenize a string of text.
 |
 |      Skip these tests if CoreNLP is likely not ready.
 |      >>> from nltk.test.setup_fixt import check_jar
 |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
 |
 |      The CoreNLP server can be started using the following notation, although
 |      we recommend the `with CoreNLPServer() as server:` context manager notation
 |      to ensure that the server is always stopped.
 |      >>> server = CoreNLPServer()
 |      >>> server.start()
 |      >>> parser = CoreNLPParser(url=server.url)
 |
 |      >>> text = 'Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\nThanks.'
 |      >>> list(parser.tokenize(text))
 |      ['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York', '.', 'Please', 'buy', 'me', 'two', 'of', 'them', '.', 'Thanks', '.']
 |
 |      >>> s = "The colour of the wall is blue."
 |      >>> list(
 |      ...     parser.tokenize(
 |      ...         'The colour of the wall is blue.',
 |      ...             properties={'tokenize.options': 'americanize=true'},
 |      ...     )
 |      ... )
 |      ['The', 'colour', 'of', 'the', 'wall', 'is', 'blue', '.']
 |      >>> server.stop()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, sent, *args, **kwargs)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
nltk.CrossValidationProbDist
Python Library Documentation: class CrossValidationProbDist in module nltk.probability

class CrossValidationProbDist(ProbDistI)
 |  CrossValidationProbDist(freqdists, bins)
 |
 |  The cross-validation estimate for the probability distribution of
 |  the experiment used to generate a set of frequency distribution.
 |  The "cross-validation estimate" for the probability of a sample
 |  is found by averaging the held-out estimates for the sample in
 |  each pair of frequency distributions.
 |
 |  Method resolution order:
 |      CrossValidationProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, freqdists, bins)
 |      Use the cross-validation estimate to create a probability
 |      distribution for the experiment used to generate
 |      ``freqdists``.
 |
 |      :type freqdists: list(FreqDist)
 |      :param freqdists: A list of the frequency distributions
 |          generated by the experiment.
 |      :type bins: int
 |      :param bins: The number of sample values that can be generated
 |          by the experiment that is described by the probability
 |          distribution.  This value must be correctly set for the
 |          probabilities of the sample values to sum to one.  If
 |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
 |
 |  __repr__(self)
 |      Return a string representation of this ``ProbDist``.
 |
 |      :rtype: str
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  freqdists(self)
 |      Return the list of frequency distributions that this ``ProbDist`` is based on.
 |
 |      :rtype: list(FreqDist)
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  SUM_TO_ONE = False
 |
 |  __abstractmethods__ = frozenset({'max'})
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.DRS
Python Library Documentation: class DRS in module nltk.sem.drt

class DRS(DrtExpression, nltk.sem.logic.Expression)
 |  DRS(refs, conds, consequent=None)
 |
 |  A Discourse Representation Structure.
 |
 |  Method resolution order:
 |      DRS
 |      DrtExpression
 |      nltk.sem.logic.Expression
 |      nltk.sem.logic.SubstituteBindingsI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |      Defines equality modulo alphabetic variance.
 |      If we are comparing \x.M  and \y.N, then check equality of M and N[x/y].
 |
 |  __hash__(self) from nltk.sem.logic.Expression
 |      Return hash(self).
 |
 |  __init__(self, refs, conds, consequent=None)
 |      :param refs: list of ``DrtIndividualVariableExpression`` for the
 |          discourse referents
 |      :param conds: list of ``Expression`` for the conditions
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  eliminate_equality(self)
 |
 |  fol(self)
 |
 |  free(self)
 |      :see: Expression.free()
 |
 |  get_refs(self, recursive=False)
 |      :see: AbstractExpression.get_refs()
 |
 |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
 |      Replace all instances of variable v with expression E in self,
 |      where v is free in self.
 |
 |  visit(self, function, combinator)
 |      :see: Expression.visit()
 |
 |  visit_structured(self, function, combinator)
 |      :see: Expression.visit_structured()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from DrtExpression:
 |
 |  __add__(self, other)
 |
 |  __and__(self, other)
 |
 |  __gt__(self, other)
 |      Return self>value.
 |
 |  __neg__(self)
 |
 |  __or__(self, other)
 |      Return self|value.
 |
 |  applyto(self, other)
 |
 |  draw(self)
 |
 |  equiv(self, other, prover=None)
 |      Check for logical equivalence.
 |      Pass the expression (self <-> other) to the theorem prover.
 |      If the prover says it is valid, then the self and other are equal.
 |
 |      :param other: an ``DrtExpression`` to check equality against
 |      :param prover: a ``nltk.inference.api.Prover``
 |
 |  is_pronoun_function(self)
 |      Is self of the form "PRO(x)"?
 |
 |  make_EqualityExpression(self, first, second)
 |
 |  make_VariableExpression(self, variable)
 |
 |  pretty_format(self)
 |      Draw the DRS
 |      :return: the pretty print string
 |
 |  pretty_print(self)
 |
 |  resolve_anaphora(self)
 |
 |  typecheck(self, signature=None)
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from DrtExpression:
 |
 |  fromstring(s)
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from DrtExpression:
 |
 |  type
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from DrtExpression:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.sem.logic.Expression:
 |
 |  __call__(self, other, *additional)
 |      Call self as a function.
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  constants(self)
 |      Return a set of individual constants (non-predicates).
 |      :return: set of ``Variable`` objects
 |
 |  findtype(self, variable)
 |      Find the type of the given variable as it is used in this expression.
 |      For example, finding the type of "P" in "P(x) & Q(x,y)" yields "<e,t>"
 |
 |      :param variable: Variable
 |
 |  negate(self)
 |      If this is a negated expression, remove the negation.
 |      Otherwise add a negation.
 |
 |  normalize(self, newvars=None)
 |      Rename auto-generated unique variables
 |
 |  predicates(self)
 |      Return a set of predicates (constants, not variables).
 |      :return: set of ``Variable`` objects
 |
 |  simplify(self)
 |      :return: beta-converted version of this expression
 |
 |  substitute_bindings(self, bindings)
 |      :return: The object that is obtained by replacing
 |          each variable bound by ``bindings`` with its values.
 |          Aliases are already resolved. (maybe?)
 |      :rtype: (any)
 |
 |  variables(self)
 |      Return a set of all the variables for binding substitution.
 |      The variables returned include all free (non-bound) individual
 |      variables and any variable starting with '?' or '@'.
 |      :return: set of ``Variable`` objects
nltk.DecisionTreeClassifier
Python Library Documentation: class DecisionTreeClassifier in module nltk.classify.decisiontree

class DecisionTreeClassifier(nltk.classify.api.ClassifierI)
 |  DecisionTreeClassifier(label, feature_name=None, decisions=None, default=None)
 |
 |  Method resolution order:
 |      DecisionTreeClassifier
 |      nltk.classify.api.ClassifierI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, label, feature_name=None, decisions=None, default=None)
 |      :param label: The most likely label for tokens that reach
 |          this node in the decision tree.  If this decision tree
 |          has no children, then this label will be assigned to
 |          any token that reaches this decision tree.
 |      :param feature_name: The name of the feature that this
 |          decision tree selects for.
 |      :param decisions: A dictionary mapping from feature values
 |          for the feature identified by ``feature_name`` to
 |          child decision trees.
 |      :param default: The child that will be used if the value of
 |          feature ``feature_name`` does not match any of the keys in
 |          ``decisions``.  This is used when constructing binary
 |          decision trees.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  classify(self, featureset)
 |      :return: the most appropriate label for the given featureset.
 |      :rtype: label
 |
 |  error(self, labeled_featuresets)
 |
 |  labels(self)
 |      :return: the list of category labels used by this classifier.
 |      :rtype: list of (immutable)
 |
 |  pretty_format(self, width=70, prefix='', depth=4)
 |      Return a string containing a pretty-printed version of this
 |      decision tree.  Each line in this string corresponds to a
 |      single decision tree node or leaf, and indentation is used to
 |      display the structure of the decision tree.
 |
 |  pseudocode(self, prefix='', depth=4)
 |      Return a string representation of this decision tree that
 |      expresses the decisions it makes as a nested set of pseudocode
 |      if statements.
 |
 |  refine(self, labeled_featuresets, entropy_cutoff, depth_cutoff, support_cutoff, binary=False, feature_values=None, verbose=False)
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  best_binary_stump(feature_names, labeled_featuresets, feature_values, verbose=False)
 |
 |  best_stump(feature_names, labeled_featuresets, verbose=False)
 |
 |  binary_stump(feature_name, feature_value, labeled_featuresets)
 |
 |  leaf(labeled_featuresets)
 |
 |  stump(feature_name, labeled_featuresets)
 |
 |  train(labeled_featuresets, entropy_cutoff=0.05, depth_cutoff=100, support_cutoff=10, binary=False, feature_values=None, verbose=False)
 |      :param binary: If true, then treat all feature/value pairs as
 |          individual binary features, rather than using a single n-way
 |          branch for each feature.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.api.ClassifierI:
 |
 |  classify_many(self, featuresets)
 |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.classify(fs) for fs in featuresets]
 |
 |      :rtype: list(label)
 |
 |  prob_classify(self, featureset)
 |      :return: a probability distribution over labels for the given
 |          featureset.
 |      :rtype: ProbDistI
 |
 |  prob_classify_many(self, featuresets)
 |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.prob_classify(fs) for fs in featuresets]
 |
 |      :rtype: list(ProbDistI)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.classify.api.ClassifierI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.DefaultTagger
Python Library Documentation: class DefaultTagger in module nltk.tag.sequential

class DefaultTagger(SequentialBackoffTagger)
 |  DefaultTagger(tag)
 |
 |  A tagger that assigns the same tag to every token.
 |
 |      >>> from nltk.tag import DefaultTagger
 |      >>> default_tagger = DefaultTagger('NN')
 |      >>> list(default_tagger.tag('This is a test'.split()))
 |      [('This', 'NN'), ('is', 'NN'), ('a', 'NN'), ('test', 'NN')]
 |
 |  This tagger is recommended as a backoff tagger, in cases where
 |  a more powerful tagger is unable to assign a tag to the word
 |  (e.g. because the word was not seen during training).
 |
 |  :param tag: The tag to assign to each token
 |  :type tag: str
 |
 |  Method resolution order:
 |      DefaultTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, tag)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  encode_json_obj(self)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  decode_json_obj(obj)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  json_tag = 'nltk.tag.sequential.DefaultTagger'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.DependencyEvaluator
Python Library Documentation: class DependencyEvaluator in module nltk.parse.evaluate

class DependencyEvaluator(builtins.object)
 |  DependencyEvaluator(parsed_sents, gold_sents)
 |
 |  Class for measuring labelled and unlabelled attachment score for
 |  dependency parsing. Note that the evaluation ignores punctuation.
 |
 |  >>> from nltk.parse import DependencyGraph, DependencyEvaluator
 |
 |  >>> gold_sent = DependencyGraph("""
 |  ... Pierre  NNP     2       NMOD
 |  ... Vinken  NNP     8       SUB
 |  ... ,       ,       2       P
 |  ... 61      CD      5       NMOD
 |  ... years   NNS     6       AMOD
 |  ... old     JJ      2       NMOD
 |  ... ,       ,       2       P
 |  ... will    MD      0       ROOT
 |  ... join    VB      8       VC
 |  ... the     DT      11      NMOD
 |  ... board   NN      9       OBJ
 |  ... as      IN      9       VMOD
 |  ... a       DT      15      NMOD
 |  ... nonexecutive    JJ      15      NMOD
 |  ... director        NN      12      PMOD
 |  ... Nov.    NNP     9       VMOD
 |  ... 29      CD      16      NMOD
 |  ... .       .       9       VMOD
 |  ... """)
 |
 |  >>> parsed_sent = DependencyGraph("""
 |  ... Pierre  NNP     8       NMOD
 |  ... Vinken  NNP     1       SUB
 |  ... ,       ,       3       P
 |  ... 61      CD      6       NMOD
 |  ... years   NNS     6       AMOD
 |  ... old     JJ      2       NMOD
 |  ... ,       ,       3       AMOD
 |  ... will    MD      0       ROOT
 |  ... join    VB      8       VC
 |  ... the     DT      11      AMOD
 |  ... board   NN      9       OBJECT
 |  ... as      IN      9       NMOD
 |  ... a       DT      15      NMOD
 |  ... nonexecutive    JJ      15      NMOD
 |  ... director        NN      12      PMOD
 |  ... Nov.    NNP     9       VMOD
 |  ... 29      CD      16      NMOD
 |  ... .       .       9       VMOD
 |  ... """)
 |
 |  >>> de = DependencyEvaluator([parsed_sent],[gold_sent])
 |  >>> las, uas = de.eval()
 |  >>> las
 |  0.6
 |  >>> uas
 |  0.8
 |  >>> abs(uas - 0.8) < 0.00001
 |  True
 |
 |  Methods defined here:
 |
 |  __init__(self, parsed_sents, gold_sents)
 |      :param parsed_sents: the list of parsed_sents as the output of parser
 |      :type parsed_sents: list(DependencyGraph)
 |
 |  eval(self)
 |      Return the Labeled Attachment Score (LAS) and Unlabeled Attachment Score (UAS)
 |
 |      :return : tuple(float,float)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.DependencyGrammar
Python Library Documentation: class DependencyGrammar in module nltk.grammar

class DependencyGrammar(builtins.object)
 |  DependencyGrammar(productions)
 |
 |  A dependency grammar.  A DependencyGrammar consists of a set of
 |  productions.  Each production specifies a head/modifier relationship
 |  between a pair of words.
 |
 |  Methods defined here:
 |
 |  __contains__(self, head_mod)
 |      Return True if this ``DependencyGrammar`` contains a
 |      ``DependencyProduction`` mapping 'head' to 'mod'.
 |
 |      :param head_mod: A tuple of a head word and a mod word,
 |          to test as a modifier of 'head'.
 |      :type head: Tuple[str, str]
 |      :rtype: bool
 |
 |  __init__(self, productions)
 |      Create a new dependency grammar, from the set of ``Productions``.
 |
 |      :param productions: The list of productions that defines the grammar
 |      :type productions: list(Production)
 |
 |  __repr__(self)
 |      Return a concise string representation of the ``DependencyGrammar``
 |
 |  __str__(self)
 |      Return a verbose string representation of the ``DependencyGrammar``
 |
 |      :rtype: str
 |
 |  contains(self, head, mod)
 |      :param head: A head word.
 |      :type head: str
 |      :param mod: A mod word, to test as a modifier of 'head'.
 |      :type mod: str
 |
 |      :return: true if this ``DependencyGrammar`` contains a
 |          ``DependencyProduction`` mapping 'head' to 'mod'.
 |      :rtype: bool
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  fromstring(input)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.DependencyGraph
Python Library Documentation: class DependencyGraph in module nltk.parse.dependencygraph

class DependencyGraph(builtins.object)
 |  DependencyGraph(tree_str=None, cell_extractor=None, zero_based=False, cell_separator=None, top_relation_label='ROOT')
 |
 |  A container for the nodes and labelled edges of a dependency structure.
 |
 |  Methods defined here:
 |
 |  __init__(self, tree_str=None, cell_extractor=None, zero_based=False, cell_separator=None, top_relation_label='ROOT')
 |      Dependency graph.
 |
 |      We place a dummy `TOP` node with the index 0, since the root node is
 |      often assigned 0 as its head. This also means that the indexing of the
 |      nodes corresponds directly to the Malt-TAB format, which starts at 1.
 |
 |      If zero-based is True, then Malt-TAB-like input with node numbers
 |      starting at 0 and the root node assigned -1 (as produced by, e.g.,
 |      zpar).
 |
 |      :param str cell_separator: the cell separator. If not provided, cells
 |          are split by whitespace.
 |
 |      :param str top_relation_label: the label by which the top relation is
 |          identified, for examlple, `ROOT`, `null` or `TOP`.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  add_arc(self, head_address, mod_address)
 |      Adds an arc from the node specified by head_address to the
 |      node specified by the mod address.
 |
 |  add_node(self, node)
 |
 |  connect_graph(self)
 |      Fully connects all non-root nodes.  All nodes are set to be dependents
 |      of the root node.
 |
 |  contains_address(self, node_address)
 |      Returns true if the graph contains a node with the given node
 |      address, false otherwise.
 |
 |  contains_cycle(self)
 |      Check whether there are cycles.
 |
 |      >>> dg = DependencyGraph(treebank_data)
 |      >>> dg.contains_cycle()
 |      False
 |
 |      >>> cyclic_dg = DependencyGraph()
 |      >>> top = {'word': None, 'deps': [1], 'rel': 'TOP', 'address': 0}
 |      >>> child1 = {'word': None, 'deps': [2], 'rel': 'NTOP', 'address': 1}
 |      >>> child2 = {'word': None, 'deps': [4], 'rel': 'NTOP', 'address': 2}
 |      >>> child3 = {'word': None, 'deps': [1], 'rel': 'NTOP', 'address': 3}
 |      >>> child4 = {'word': None, 'deps': [3], 'rel': 'NTOP', 'address': 4}
 |      >>> cyclic_dg.nodes = {
 |      ...     0: top,
 |      ...     1: child1,
 |      ...     2: child2,
 |      ...     3: child3,
 |      ...     4: child4,
 |      ... }
 |      >>> cyclic_dg.root = top
 |
 |      >>> cyclic_dg.contains_cycle()
 |      [1, 2, 4, 3]
 |
 |  get_by_address(self, node_address)
 |      Return the node with the given address.
 |
 |  get_cycle_path(self, curr_node, goal_node_index)
 |
 |  left_children(self, node_index)
 |      Returns the number of left children under the node specified
 |      by the given address.
 |
 |  nx_graph(self)
 |      Convert the data in a ``nodelist`` into a networkx labeled directed graph.
 |
 |  redirect_arcs(self, originals, redirect)
 |      Redirects arcs to any of the nodes in the originals list
 |      to the redirect node address.
 |
 |  remove_by_address(self, address)
 |      Removes the node with the given address.  References
 |      to this node in others will still exist.
 |
 |  right_children(self, node_index)
 |      Returns the number of right children under the node specified
 |      by the given address.
 |
 |  to_conll(self, style)
 |      The dependency graph in CoNLL format.
 |
 |      :param style: the style to use for the format (3, 4, 10 columns)
 |      :type style: int
 |      :rtype: str
 |
 |  to_dot(self)
 |      Return a dot representation suitable for using with Graphviz.
 |
 |      >>> dg = DependencyGraph(
 |      ...     'John N 2\n'
 |      ...     'loves V 0\n'
 |      ...     'Mary N 2'
 |      ... )
 |      >>> print(dg.to_dot())
 |      digraph G{
 |      edge [dir=forward]
 |      node [shape=plaintext]
 |      <BLANKLINE>
 |      0 [label="0 (None)"]
 |      0 -> 2 [label="ROOT"]
 |      1 [label="1 (John)"]
 |      2 [label="2 (loves)"]
 |      2 -> 1 [label=""]
 |      2 -> 3 [label=""]
 |      3 [label="3 (Mary)"]
 |      }
 |
 |  tree(self)
 |      Starting with the ``root`` node, build a dependency tree using the NLTK
 |      ``Tree`` constructor. Dependency labels are omitted.
 |
 |  triples(self, node=None)
 |      Extract dependency triples of the form:
 |      ((head word, head tag), rel, (dep word, dep tag))
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  load(filename, zero_based=False, cell_separator=None, top_relation_label='ROOT')
 |      :param filename: a name of a file in Malt-TAB format
 |      :param zero_based: nodes in the input file are numbered starting from 0
 |          rather than 1 (as produced by, e.g., zpar)
 |      :param str cell_separator: the cell separator. If not provided, cells
 |          are split by whitespace.
 |      :param str top_relation_label: the label by which the top relation is
 |          identified, for examlple, `ROOT`, `null` or `TOP`.
 |
 |      :return: a list of DependencyGraphs
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.DependencyProduction
Python Library Documentation: class DependencyProduction in module nltk.grammar

class DependencyProduction(Production)
 |  DependencyProduction(lhs, rhs)
 |
 |  A dependency grammar production.  Each production maps a single
 |  head word to an unordered list of one or more modifier words.
 |
 |  Method resolution order:
 |      DependencyProduction
 |      Production
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __str__(self)
 |      Return a verbose string representation of the ``DependencyProduction``.
 |
 |      :rtype: str
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Production:
 |
 |  __eq__(self, other)
 |      Return True if this ``Production`` is equal to ``other``.
 |
 |      :rtype: bool
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      Return a hash value for the ``Production``.
 |
 |      :rtype: int
 |
 |  __init__(self, lhs, rhs)
 |      Construct a new ``Production``.
 |
 |      :param lhs: The left-hand side of the new ``Production``.
 |      :type lhs: Nonterminal
 |      :param rhs: The right-hand side of the new ``Production``.
 |      :type rhs: sequence(Nonterminal and terminal)
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __len__(self)
 |      Return the length of the right-hand side.
 |
 |      :rtype: int
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Return a concise string representation of the ``Production``.
 |
 |      :rtype: str
 |
 |  is_lexical(self)
 |      Return True if the right-hand contain at least one terminal token.
 |
 |      :rtype: bool
 |
 |  is_nonlexical(self)
 |      Return True if the right-hand side only contains ``Nonterminals``
 |
 |      :rtype: bool
 |
 |  lhs(self)
 |      Return the left-hand side of this ``Production``.
 |
 |      :rtype: Nonterminal
 |
 |  rhs(self)
 |      Return the right-hand side of this ``Production``.
 |
 |      :rtype: sequence(Nonterminal and terminal)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Production:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.DictionaryConditionalProbDist
Python Library Documentation: class DictionaryConditionalProbDist in module nltk.probability

class DictionaryConditionalProbDist(ConditionalProbDistI)
 |  DictionaryConditionalProbDist(probdist_dict)
 |
 |  An alternative ConditionalProbDist that simply wraps a dictionary of
 |  ProbDists rather than creating these from FreqDists.
 |
 |  Method resolution order:
 |      DictionaryConditionalProbDist
 |      ConditionalProbDistI
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, probdist_dict)
 |      :param probdist_dict: a dictionary containing the probdists indexed
 |          by the conditions
 |      :type probdist_dict: dict any -> probdist
 |
 |  __missing__(self, key)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ConditionalProbDistI:
 |
 |  __repr__(self)
 |      Return a string representation of this ``ConditionalProbDist``.
 |
 |      :rtype: str
 |
 |  conditions(self)
 |      Return a list of the conditions that are represented by
 |      this ``ConditionalProbDist``.  Use the indexing operator to
 |      access the probability distribution for a given condition.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ConditionalProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.DictionaryProbDist
Python Library Documentation: class DictionaryProbDist in module nltk.probability

class DictionaryProbDist(ProbDistI)
 |  DictionaryProbDist(prob_dict=None, log=False, normalize=False)
 |
 |  A probability distribution whose probabilities are directly
 |  specified by a given dictionary.  The given dictionary maps
 |  samples to probabilities.
 |
 |  Method resolution order:
 |      DictionaryProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, prob_dict=None, log=False, normalize=False)
 |      Construct a new probability distribution from the given
 |      dictionary, which maps values to probabilities (or to log
 |      probabilities, if ``log`` is true).  If ``normalize`` is
 |      true, then the probability values are scaled by a constant
 |      factor such that they sum to 1.
 |
 |      If called without arguments, the resulting probability
 |      distribution assigns zero probability to all values.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from ProbDistI:
 |
 |  SUM_TO_ONE = True
nltk.DiscourseTester
Python Library Documentation: class DiscourseTester in module nltk.inference.discourse

class DiscourseTester(builtins.object)
 |  DiscourseTester(input, reading_command=None, background=None)
 |
 |  Check properties of an ongoing discourse.
 |
 |  Methods defined here:
 |
 |  __init__(self, input, reading_command=None, background=None)
 |      Initialize a ``DiscourseTester``.
 |
 |      :param input: the discourse sentences
 |      :type input: list of str
 |      :param background: Formulas which express background assumptions
 |      :type background: list(Expression)
 |
 |  add_background(self, background, verbose=False)
 |      Add a list of background assumptions for reasoning about the discourse.
 |
 |      When called,  this method also updates the discourse model's set of readings and threads.
 |      :param background: Formulas which contain background information
 |      :type background: list(Expression)
 |
 |  add_sentence(self, sentence, informchk=False, consistchk=False)
 |      Add a sentence to the current discourse.
 |
 |      Updates ``self._input`` and ``self._sentences``.
 |      :param sentence: An input sentence
 |      :type sentence: str
 |      :param informchk: if ``True``, check that the result of adding the sentence is thread-informative. Updates ``self._readings``.
 |      :param consistchk: if ``True``, check that the result of adding the sentence is thread-consistent. Updates ``self._readings``.
 |
 |  background(self)
 |      Show the current background assumptions.
 |
 |  expand_threads(self, thread_id, threads=None)
 |      Given a thread ID, find the list of ``logic.Expression`` objects corresponding to the reading IDs in that thread.
 |
 |      :param thread_id: thread ID
 |      :type thread_id: str
 |      :param threads: a mapping from thread IDs to lists of reading IDs
 |      :type threads: dict
 |      :return: A list of pairs ``(rid, reading)`` where reading is the ``logic.Expression`` associated with a reading ID
 |      :rtype: list of tuple
 |
 |  grammar(self)
 |      Print out the grammar in use for parsing input sentences
 |
 |  models(self, thread_id=None, show=True, verbose=False)
 |      Call Mace4 to build a model for each current discourse thread.
 |
 |      :param thread_id: thread ID
 |      :type thread_id: str
 |      :param show: If ``True``, display the model that has been found.
 |
 |  readings(self, sentence=None, threaded=False, verbose=True, filter=False, show_thread_readings=False)
 |      Construct and show the readings of the discourse (or of a single sentence).
 |
 |      :param sentence: test just this sentence
 |      :type sentence: str
 |      :param threaded: if ``True``, print out each thread ID and the corresponding thread.
 |      :param filter: if ``True``, only print out consistent thread IDs and threads.
 |
 |  retract_sentence(self, sentence, verbose=True)
 |      Remove a sentence from the current discourse.
 |
 |      Updates ``self._input``, ``self._sentences`` and ``self._readings``.
 |      :param sentence: An input sentence
 |      :type sentence: str
 |      :param verbose: If ``True``,  report on the updated list of sentences.
 |
 |  sentences(self)
 |      Display the list of sentences in the current discourse.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  multiply(discourse, readings)
 |      Multiply every thread in ``discourse`` by every reading in ``readings``.
 |
 |      Given discourse = [['A'], ['B']], readings = ['a', 'b', 'c'] , returns
 |      [['A', 'a'], ['A', 'b'], ['A', 'c'], ['B', 'a'], ['B', 'b'], ['B', 'c']]
 |
 |      :param discourse: the current list of readings
 |      :type discourse: list of lists
 |      :param readings: an additional list of readings
 |      :type readings: list(Expression)
 |      :rtype: A list of lists
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.DrtExpression
Python Library Documentation: class DrtExpression in module nltk.sem.drt

class DrtExpression(builtins.object)
 |  This is the base abstract DRT Expression from which every DRT
 |  Expression extends.
 |
 |  Methods defined here:
 |
 |  __add__(self, other)
 |
 |  __and__(self, other)
 |
 |  __gt__(self, other)
 |      Return self>value.
 |
 |  __neg__(self)
 |
 |  __or__(self, other)
 |      Return self|value.
 |
 |  applyto(self, other)
 |
 |  draw(self)
 |
 |  eliminate_equality(self)
 |
 |  equiv(self, other, prover=None)
 |      Check for logical equivalence.
 |      Pass the expression (self <-> other) to the theorem prover.
 |      If the prover says it is valid, then the self and other are equal.
 |
 |      :param other: an ``DrtExpression`` to check equality against
 |      :param prover: a ``nltk.inference.api.Prover``
 |
 |  get_refs(self, recursive=False)
 |      Return the set of discourse referents in this DRS.
 |      :param recursive: bool Also find discourse referents in subterms?
 |      :return: list of ``Variable`` objects
 |
 |  is_pronoun_function(self)
 |      Is self of the form "PRO(x)"?
 |
 |  make_EqualityExpression(self, first, second)
 |
 |  make_VariableExpression(self, variable)
 |
 |  pretty_format(self)
 |      Draw the DRS
 |      :return: the pretty print string
 |
 |  pretty_print(self)
 |
 |  resolve_anaphora(self)
 |
 |  typecheck(self, signature=None)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  fromstring(s)
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  type
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.DrtGlueReadingCommand
Python Library Documentation: class DrtGlueReadingCommand in module nltk.inference.discourse

class DrtGlueReadingCommand(ReadingCommand)
 |  DrtGlueReadingCommand(semtype_file=None, remove_duplicates=False, depparser=None)
 |
 |  Method resolution order:
 |      DrtGlueReadingCommand
 |      ReadingCommand
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, semtype_file=None, remove_duplicates=False, depparser=None)
 |      :param semtype_file: name of file where grammar can be loaded
 |      :param remove_duplicates: should duplicates be removed?
 |      :param depparser: the dependency parser
 |
 |  combine_readings(self, readings)
 |      :see: ReadingCommand.combine_readings()
 |
 |  parse_to_readings(self, sentence)
 |      :see: ReadingCommand.parse_to_readings()
 |
 |  process_thread(self, sentence_readings)
 |      :see: ReadingCommand.process_thread()
 |
 |  to_fol(self, expression)
 |      :see: ReadingCommand.to_fol()
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ReadingCommand:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ELEProbDist
Python Library Documentation: class ELEProbDist in module nltk.probability

class ELEProbDist(LidstoneProbDist)
 |  ELEProbDist(freqdist, bins=None)
 |
 |  The expected likelihood estimate for the probability distribution
 |  of the experiment used to generate a frequency distribution.  The
 |  "expected likelihood estimate" approximates the probability of a
 |  sample with count *c* from an experiment with *N* outcomes and
 |  *B* bins as *(c+0.5)/(N+B/2)*.  This is equivalent to adding 0.5
 |  to the count for each bin, and taking the maximum likelihood
 |  estimate of the resulting frequency distribution.
 |
 |  Method resolution order:
 |      ELEProbDist
 |      LidstoneProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, freqdist, bins=None)
 |      Use the expected likelihood estimate to create a probability
 |      distribution for the experiment used to generate ``freqdist``.
 |
 |      :type freqdist: FreqDist
 |      :param freqdist: The frequency distribution that the
 |          probability estimates should be based on.
 |      :type bins: int
 |      :param bins: The number of sample values that can be generated
 |          by the experiment that is described by the probability
 |          distribution.  This value must be correctly set for the
 |          probabilities of the sample values to sum to one.  If
 |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
 |
 |  __repr__(self)
 |      Return a string representation of this ``ProbDist``.
 |
 |      :rtype: str
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from LidstoneProbDist:
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  freqdist(self)
 |      Return the frequency distribution that this probability
 |      distribution is based on.
 |
 |      :rtype: FreqDist
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from LidstoneProbDist:
 |
 |  SUM_TO_ONE = False
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.EarleyChartParser
Python Library Documentation: class EarleyChartParser in module nltk.parse.earleychart

class EarleyChartParser(IncrementalChartParser)
 |  EarleyChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      EarleyChartParser
 |      IncrementalChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Expression
Python Library Documentation: class Expression in module nltk.sem.logic

class Expression(SubstituteBindingsI)
 |  This is the base abstract object for all logical expressions
 |
 |  Method resolution order:
 |      Expression
 |      SubstituteBindingsI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __and__(self, other)
 |
 |  __call__(self, other, *additional)
 |      Call self as a function.
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __gt__(self, other)
 |      Return self>value.
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __neg__(self)
 |
 |  __or__(self, other)
 |      Return self|value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  applyto(self, other)
 |
 |  constants(self)
 |      Return a set of individual constants (non-predicates).
 |      :return: set of ``Variable`` objects
 |
 |  equiv(self, other, prover=None)
 |      Check for logical equivalence.
 |      Pass the expression (self <-> other) to the theorem prover.
 |      If the prover says it is valid, then the self and other are equal.
 |
 |      :param other: an ``Expression`` to check equality against
 |      :param prover: a ``nltk.inference.api.Prover``
 |
 |  findtype(self, variable)
 |      Find the type of the given variable as it is used in this expression.
 |      For example, finding the type of "P" in "P(x) & Q(x,y)" yields "<e,t>"
 |
 |      :param variable: Variable
 |
 |  free(self)
 |      Return a set of all the free (non-bound) variables.  This includes
 |      both individual and predicate variables, but not constants.
 |      :return: set of ``Variable`` objects
 |
 |  make_VariableExpression(self, variable)
 |
 |  negate(self)
 |      If this is a negated expression, remove the negation.
 |      Otherwise add a negation.
 |
 |  normalize(self, newvars=None)
 |      Rename auto-generated unique variables
 |
 |  predicates(self)
 |      Return a set of predicates (constants, not variables).
 |      :return: set of ``Variable`` objects
 |
 |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
 |      Replace every instance of 'variable' with 'expression'
 |      :param variable: ``Variable`` The variable to replace
 |      :param expression: ``Expression`` The expression with which to replace it
 |      :param replace_bound: bool Should bound variables be replaced?
 |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
 |
 |  simplify(self)
 |      :return: beta-converted version of this expression
 |
 |  substitute_bindings(self, bindings)
 |      :return: The object that is obtained by replacing
 |          each variable bound by ``bindings`` with its values.
 |          Aliases are already resolved. (maybe?)
 |      :rtype: (any)
 |
 |  typecheck(self, signature=None)
 |      Infer and check types.  Raise exceptions if necessary.
 |
 |      :param signature: dict that maps variable names to types (or string
 |          representations of types)
 |      :return: the signature, plus any additional type mappings
 |
 |  variables(self)
 |      Return a set of all the variables for binding substitution.
 |      The variables returned include all free (non-bound) individual
 |      variables and any variable starting with '?' or '@'.
 |      :return: set of ``Variable`` objects
 |
 |  visit(self, function, combinator)
 |      Recursively visit subexpressions.  Apply 'function' to each
 |      subexpression and pass the result of each function application
 |      to the 'combinator' for aggregation:
 |
 |          return combinator(map(function, self.subexpressions))
 |
 |      Bound variables are neither applied upon by the function nor given to
 |      the combinator.
 |      :param function: ``Function<Expression,T>`` to call on each subexpression
 |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
 |      function calls
 |      :return: result of combination ``R``
 |
 |  visit_structured(self, function, combinator)
 |      Recursively visit subexpressions.  Apply 'function' to each
 |      subexpression and pass the result of each function application
 |      to the 'combinator' for aggregation.  The combinator must have
 |      the same signature as the constructor.  The function is not
 |      applied to bound variables, but they are passed to the
 |      combinator.
 |      :param function: ``Function`` to call on each subexpression
 |      :param combinator: ``Function`` with the same signature as the
 |      constructor, to combine the results of the function calls
 |      :return: result of combination
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  fromstring(s, type_check=False, signature=None)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from SubstituteBindingsI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FStructure
Python Library Documentation: class FStructure in module nltk.sem.lfg

class FStructure(builtins.dict)
 |  Method resolution order:
 |      FStructure
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __contains__(self, key)
 |      True if the dictionary has the specified key, else False.
 |
 |  __getitem__(self, key)
 |      Return self[key].
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __setitem__(self, key, value)
 |      Set self[key] to value.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  pretty_format(self, indent=3)
 |
 |  safeappend(self, key, item)
 |      Append 'item' to the list at 'key'.  If no list exists for 'key', then
 |      construct one.
 |
 |  to_depgraph(self, rel=None)
 |
 |  to_glueformula_list(self, glue_dict)
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  read_depgraph(depgraph)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __init__(self, /, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.FeatDict
Python Library Documentation: class FeatDict in module nltk.featstruct

class FeatDict(FeatStruct, builtins.dict)
 |  FeatDict(features=None, **morefeatures)
 |
 |  A feature structure that acts like a Python dictionary.  I.e., a
 |  mapping from feature identifiers to feature values, where a feature
 |  identifier can be a string or a ``Feature``; and where a feature value
 |  can be either a basic value (such as a string or an integer), or a nested
 |  feature structure.  A feature identifiers for a ``FeatDict`` is
 |  sometimes called a "feature name".
 |
 |  Two feature dicts are considered equal if they assign the same
 |  values to all features, and have the same reentrances.
 |
 |  :see: ``FeatStruct`` for information about feature paths, reentrance,
 |      cyclic feature structures, mutability, freezing, and hashing.
 |
 |  Method resolution order:
 |      FeatDict
 |      FeatStruct
 |      nltk.sem.logic.SubstituteBindingsI
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __contains__(self, name_or_path)
 |      Return true if a feature with the given name or path exists.
 |
 |  __deepcopy__(self, memo)
 |
 |  __delitem__(self, name_or_path)
 |      If the feature with the given name or path exists, delete
 |      its value; otherwise, raise ``KeyError``.
 |
 |  __getitem__(self, name_or_path)
 |      If the feature with the given name or path exists, return
 |      its value; otherwise, raise ``KeyError``.
 |
 |  __init__(self, features=None, **morefeatures)
 |      Create a new feature dictionary, with the specified features.
 |
 |      :param features: The initial value for this feature
 |          dictionary.  If ``features`` is a ``FeatStruct``, then its
 |          features are copied (shallow copy).  If ``features`` is a
 |          dict, then a feature is created for each item, mapping its
 |          key to its value.  If ``features`` is a string, then it is
 |          processed using ``FeatStructReader``.  If ``features`` is a list of
 |          tuples ``(name, val)``, then a feature is created for each tuple.
 |      :param morefeatures: Additional features for the new feature
 |          dictionary.  If a feature is listed under both ``features`` and
 |          ``morefeatures``, then the value from ``morefeatures`` will be
 |          used.
 |
 |  __setitem__(self, name_or_path, value)
 |      Set the value for the feature with the given name or path
 |      to ``value``.  If ``name_or_path`` is an invalid path, raise
 |      ``KeyError``.
 |
 |  __str__(self)
 |      Display a multi-line representation of this feature dictionary
 |      as an FVM (feature value matrix).
 |
 |  clear(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      D.clear() -> None.  Remove all items from D.
 |      If self is frozen, raise ValueError.
 |
 |  get(self, name_or_path, default=None)
 |      If the feature with the given name or path exists, return its
 |      value; otherwise, return ``default``.
 |
 |  has_key(self, name_or_path)
 |      Return true if a feature with the given name or path exists.
 |
 |  pop(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |      If self is frozen, raise ValueError.
 |
 |  popitem(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |      If self is frozen, raise ValueError.
 |
 |  setdefault(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |      If self is frozen, raise ValueError.
 |
 |  update(self, features=None, **morefeatures)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from FeatStruct:
 |
 |  __eq__(self, other)
 |      Return true if ``self`` and ``other`` are both feature structures,
 |      assign the same values to all features, and contain the same
 |      reentrances.  I.e., return
 |      ``self.equal_values(other, check_reentrance=True)``.
 |
 |      :see: ``equal_values()``
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      If this feature structure is frozen, return its hash value;
 |      otherwise, raise ``TypeError``.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Display a single-line representation of this feature structure,
 |      suitable for embedding in other representations.
 |
 |  copy(self, deep=True)
 |      Return a new copy of ``self``.  The new copy will not be frozen.
 |
 |      :param deep: If true, create a deep copy; if false, create
 |          a shallow copy.
 |
 |  cyclic(self)
 |      Return True if this feature structure contains itself.
 |
 |  equal_values(self, other, check_reentrance=False)
 |      Return True if ``self`` and ``other`` assign the same value to
 |      to every feature.  In particular, return true if
 |      ``self[p]==other[p]`` for every feature path *p* such
 |      that ``self[p]`` or ``other[p]`` is a base value (i.e.,
 |      not a nested feature structure).
 |
 |      :param check_reentrance: If True, then also return False if
 |          there is any difference between the reentrances of ``self``
 |          and ``other``.
 |      :note: the ``==`` is equivalent to ``equal_values()`` with
 |          ``check_reentrance=True``.
 |
 |  freeze(self)
 |      Make this feature structure, and any feature structures it
 |      contains, immutable.  Note: this method does not attempt to
 |      'freeze' any feature value that is not a ``FeatStruct``; it
 |      is recommended that you use only immutable feature values.
 |
 |  frozen(self)
 |      Return True if this feature structure is immutable.  Feature
 |      structures can be made immutable with the ``freeze()`` method.
 |      Immutable feature structures may not be made mutable again,
 |      but new mutable copies can be produced with the ``copy()`` method.
 |
 |  remove_variables(self)
 |      Return the feature structure that is obtained by deleting
 |      any feature whose value is a ``Variable``.
 |
 |      :rtype: FeatStruct
 |
 |  rename_variables(self, vars=None, used_vars=(), new_vars=None)
 |      :see: ``nltk.featstruct.rename_variables()``
 |
 |  retract_bindings(self, bindings)
 |      :see: ``nltk.featstruct.retract_bindings()``
 |
 |  substitute_bindings(self, bindings)
 |      :see: ``nltk.featstruct.substitute_bindings()``
 |
 |  subsumes(self, other)
 |      Return True if ``self`` subsumes ``other``.  I.e., return true
 |      If unifying ``self`` with ``other`` would result in a feature
 |      structure equal to ``other``.
 |
 |  unify(self, other, bindings=None, trace=False, fail=None, rename_vars=True)
 |
 |  variables(self)
 |      :see: ``nltk.featstruct.find_variables()``
 |
 |  walk(self)
 |      Return an iterator that generates this feature structure, and
 |      each feature structure it contains.  Each feature structure will
 |      be generated exactly once.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from FeatStruct:
 |
 |  __new__(cls, features=None, **morefeatures)
 |      Construct and return a new feature structure.  If this
 |      constructor is called directly, then the returned feature
 |      structure will be an instance of either the ``FeatDict`` class
 |      or the ``FeatList`` class.
 |
 |      :param features: The initial feature values for this feature
 |          structure:
 |
 |          - FeatStruct(string) -> FeatStructReader().read(string)
 |          - FeatStruct(mapping) -> FeatDict(mapping)
 |          - FeatStruct(sequence) -> FeatList(sequence)
 |          - FeatStruct() -> FeatDict()
 |      :param morefeatures: If ``features`` is a mapping or None,
 |          then ``morefeatures`` provides additional features for the
 |          ``FeatDict`` constructor.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
nltk.FeatList
Python Library Documentation: class FeatList in module nltk.featstruct

class FeatList(FeatStruct, builtins.list)
 |  FeatList(features=())
 |
 |  A list of feature values, where each feature value is either a
 |  basic value (such as a string or an integer), or a nested feature
 |  structure.
 |
 |  Feature lists may contain reentrant feature values.  A "reentrant
 |  feature value" is a single feature value that can be accessed via
 |  multiple feature paths.  Feature lists may also be cyclic.
 |
 |  Two feature lists are considered equal if they assign the same
 |  values to all features, and have the same reentrances.
 |
 |  :see: ``FeatStruct`` for information about feature paths, reentrance,
 |      cyclic feature structures, mutability, freezing, and hashing.
 |
 |  Method resolution order:
 |      FeatList
 |      FeatStruct
 |      nltk.sem.logic.SubstituteBindingsI
 |      builtins.list
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __deepcopy__(self, memo)
 |
 |  __delitem__(self, name_or_path)
 |      If the feature with the given name or path exists, delete
 |      its value; otherwise, raise ``KeyError``.
 |
 |  __getitem__(self, name_or_path)
 |      Return self[index].
 |
 |  __iadd__(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Implement self+=value.
 |      If self is frozen, raise ValueError.
 |
 |  __imul__(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Implement self*=value.
 |      If self is frozen, raise ValueError.
 |
 |  __init__(self, features=())
 |      Create a new feature list, with the specified features.
 |
 |      :param features: The initial list of features for this feature
 |          list.  If ``features`` is a string, then it is paresd using
 |          ``FeatStructReader``.  Otherwise, it should be a sequence
 |          of basic values and nested feature structures.
 |
 |  __setitem__(self, name_or_path, value)
 |      Set the value for the feature with the given name or path
 |      to ``value``.  If ``name_or_path`` is an invalid path, raise
 |      ``KeyError``.
 |
 |  append(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Append object to the end of the list.
 |      If self is frozen, raise ValueError.
 |
 |  extend(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Extend list by appending elements from the iterable.
 |      If self is frozen, raise ValueError.
 |
 |  insert(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Insert object before index.
 |      If self is frozen, raise ValueError.
 |
 |  pop(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Remove and return item at index (default last).
 |
 |      Raises IndexError if list is empty or index is out of range.
 |      If self is frozen, raise ValueError.
 |
 |  remove(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Remove first occurrence of value.
 |
 |      Raises ValueError if the value is not present.
 |      If self is frozen, raise ValueError.
 |
 |  reverse(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Reverse *IN PLACE*.
 |      If self is frozen, raise ValueError.
 |
 |  sort(self, *args, **kwargs) from nltk.featstruct._check_frozen.<locals>
 |      Sort the list in ascending order and return None.
 |
 |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
 |      order of two equal elements is maintained).
 |
 |      If a key function is given, apply it once to each list item and sort them,
 |      ascending or descending, according to their function values.
 |
 |      The reverse flag can be set to sort in descending order.
 |      If self is frozen, raise ValueError.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from FeatStruct:
 |
 |  __eq__(self, other)
 |      Return true if ``self`` and ``other`` are both feature structures,
 |      assign the same values to all features, and contain the same
 |      reentrances.  I.e., return
 |      ``self.equal_values(other, check_reentrance=True)``.
 |
 |      :see: ``equal_values()``
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      If this feature structure is frozen, return its hash value;
 |      otherwise, raise ``TypeError``.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Display a single-line representation of this feature structure,
 |      suitable for embedding in other representations.
 |
 |  copy(self, deep=True)
 |      Return a new copy of ``self``.  The new copy will not be frozen.
 |
 |      :param deep: If true, create a deep copy; if false, create
 |          a shallow copy.
 |
 |  cyclic(self)
 |      Return True if this feature structure contains itself.
 |
 |  equal_values(self, other, check_reentrance=False)
 |      Return True if ``self`` and ``other`` assign the same value to
 |      to every feature.  In particular, return true if
 |      ``self[p]==other[p]`` for every feature path *p* such
 |      that ``self[p]`` or ``other[p]`` is a base value (i.e.,
 |      not a nested feature structure).
 |
 |      :param check_reentrance: If True, then also return False if
 |          there is any difference between the reentrances of ``self``
 |          and ``other``.
 |      :note: the ``==`` is equivalent to ``equal_values()`` with
 |          ``check_reentrance=True``.
 |
 |  freeze(self)
 |      Make this feature structure, and any feature structures it
 |      contains, immutable.  Note: this method does not attempt to
 |      'freeze' any feature value that is not a ``FeatStruct``; it
 |      is recommended that you use only immutable feature values.
 |
 |  frozen(self)
 |      Return True if this feature structure is immutable.  Feature
 |      structures can be made immutable with the ``freeze()`` method.
 |      Immutable feature structures may not be made mutable again,
 |      but new mutable copies can be produced with the ``copy()`` method.
 |
 |  remove_variables(self)
 |      Return the feature structure that is obtained by deleting
 |      any feature whose value is a ``Variable``.
 |
 |      :rtype: FeatStruct
 |
 |  rename_variables(self, vars=None, used_vars=(), new_vars=None)
 |      :see: ``nltk.featstruct.rename_variables()``
 |
 |  retract_bindings(self, bindings)
 |      :see: ``nltk.featstruct.retract_bindings()``
 |
 |  substitute_bindings(self, bindings)
 |      :see: ``nltk.featstruct.substitute_bindings()``
 |
 |  subsumes(self, other)
 |      Return True if ``self`` subsumes ``other``.  I.e., return true
 |      If unifying ``self`` with ``other`` would result in a feature
 |      structure equal to ``other``.
 |
 |  unify(self, other, bindings=None, trace=False, fail=None, rename_vars=True)
 |
 |  variables(self)
 |      :see: ``nltk.featstruct.find_variables()``
 |
 |  walk(self)
 |      Return an iterator that generates this feature structure, and
 |      each feature structure it contains.  Each feature structure will
 |      be generated exactly once.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from FeatStruct:
 |
 |  __new__(cls, features=None, **morefeatures)
 |      Construct and return a new feature structure.  If this
 |      constructor is called directly, then the returned feature
 |      structure will be an instance of either the ``FeatDict`` class
 |      or the ``FeatList`` class.
 |
 |      :param features: The initial feature values for this feature
 |          structure:
 |
 |          - FeatStruct(string) -> FeatStructReader().read(string)
 |          - FeatStruct(mapping) -> FeatDict(mapping)
 |          - FeatStruct(sequence) -> FeatList(sequence)
 |          - FeatStruct() -> FeatDict()
 |      :param morefeatures: If ``features`` is a mapping or None,
 |          then ``morefeatures`` provides additional features for the
 |          ``FeatDict`` constructor.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.list:
 |
 |  __add__(self, value, /)
 |      Return self+value.
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __mul__(self, value, /)
 |      Return self*value.
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the list.
 |
 |  __rmul__(self, value, /)
 |      Return value*self.
 |
 |  __sizeof__(self, /)
 |      Return the size of the list in memory, in bytes.
 |
 |  clear(self, /)
 |      Remove all items from list.
 |
 |  count(self, value, /)
 |      Return number of occurrences of value.
 |
 |  index(self, value, start=0, stop=9223372036854775807, /)
 |      Return first index of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.list:
 |
 |  __class_getitem__(...)
 |      See PEP 585
nltk.FeatStruct
Python Library Documentation: class FeatStruct in module nltk.featstruct

class FeatStruct(nltk.sem.logic.SubstituteBindingsI)
 |  FeatStruct(features=None, **morefeatures)
 |
 |  A mapping from feature identifiers to feature values, where each
 |  feature value is either a basic value (such as a string or an
 |  integer), or a nested feature structure.  There are two types of
 |  feature structure:
 |
 |    - feature dictionaries, implemented by ``FeatDict``, act like
 |      Python dictionaries.  Feature identifiers may be strings or
 |      instances of the ``Feature`` class.
 |    - feature lists, implemented by ``FeatList``, act like Python
 |      lists.  Feature identifiers are integers.
 |
 |  Feature structures may be indexed using either simple feature
 |  identifiers or 'feature paths.'  A feature path is a sequence
 |  of feature identifiers that stand for a corresponding sequence of
 |  indexing operations.  In particular, ``fstruct[(f1,f2,...,fn)]`` is
 |  equivalent to ``fstruct[f1][f2]...[fn]``.
 |
 |  Feature structures may contain reentrant feature structures.  A
 |  "reentrant feature structure" is a single feature structure
 |  object that can be accessed via multiple feature paths.  Feature
 |  structures may also be cyclic.  A feature structure is "cyclic"
 |  if there is any feature path from the feature structure to itself.
 |
 |  Two feature structures are considered equal if they assign the
 |  same values to all features, and have the same reentrancies.
 |
 |  By default, feature structures are mutable.  They may be made
 |  immutable with the ``freeze()`` method.  Once they have been
 |  frozen, they may be hashed, and thus used as dictionary keys.
 |
 |  Method resolution order:
 |      FeatStruct
 |      nltk.sem.logic.SubstituteBindingsI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __deepcopy__(self, memo)
 |      # Subclasses should define __deepcopy__ to ensure that the new
 |      # copy will not be frozen.
 |
 |  __eq__(self, other)
 |      Return true if ``self`` and ``other`` are both feature structures,
 |      assign the same values to all features, and contain the same
 |      reentrances.  I.e., return
 |      ``self.equal_values(other, check_reentrance=True)``.
 |
 |      :see: ``equal_values()``
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      If this feature structure is frozen, return its hash value;
 |      otherwise, raise ``TypeError``.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Display a single-line representation of this feature structure,
 |      suitable for embedding in other representations.
 |
 |  copy(self, deep=True)
 |      Return a new copy of ``self``.  The new copy will not be frozen.
 |
 |      :param deep: If true, create a deep copy; if false, create
 |          a shallow copy.
 |
 |  cyclic(self)
 |      Return True if this feature structure contains itself.
 |
 |  equal_values(self, other, check_reentrance=False)
 |      Return True if ``self`` and ``other`` assign the same value to
 |      to every feature.  In particular, return true if
 |      ``self[p]==other[p]`` for every feature path *p* such
 |      that ``self[p]`` or ``other[p]`` is a base value (i.e.,
 |      not a nested feature structure).
 |
 |      :param check_reentrance: If True, then also return False if
 |          there is any difference between the reentrances of ``self``
 |          and ``other``.
 |      :note: the ``==`` is equivalent to ``equal_values()`` with
 |          ``check_reentrance=True``.
 |
 |  freeze(self)
 |      Make this feature structure, and any feature structures it
 |      contains, immutable.  Note: this method does not attempt to
 |      'freeze' any feature value that is not a ``FeatStruct``; it
 |      is recommended that you use only immutable feature values.
 |
 |  frozen(self)
 |      Return True if this feature structure is immutable.  Feature
 |      structures can be made immutable with the ``freeze()`` method.
 |      Immutable feature structures may not be made mutable again,
 |      but new mutable copies can be produced with the ``copy()`` method.
 |
 |  remove_variables(self)
 |      Return the feature structure that is obtained by deleting
 |      any feature whose value is a ``Variable``.
 |
 |      :rtype: FeatStruct
 |
 |  rename_variables(self, vars=None, used_vars=(), new_vars=None)
 |      :see: ``nltk.featstruct.rename_variables()``
 |
 |  retract_bindings(self, bindings)
 |      :see: ``nltk.featstruct.retract_bindings()``
 |
 |  substitute_bindings(self, bindings)
 |      :see: ``nltk.featstruct.substitute_bindings()``
 |
 |  subsumes(self, other)
 |      Return True if ``self`` subsumes ``other``.  I.e., return true
 |      If unifying ``self`` with ``other`` would result in a feature
 |      structure equal to ``other``.
 |
 |  unify(self, other, bindings=None, trace=False, fail=None, rename_vars=True)
 |
 |  variables(self)
 |      :see: ``nltk.featstruct.find_variables()``
 |
 |  walk(self)
 |      Return an iterator that generates this feature structure, and
 |      each feature structure it contains.  Each feature structure will
 |      be generated exactly once.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(cls, features=None, **morefeatures)
 |      Construct and return a new feature structure.  If this
 |      constructor is called directly, then the returned feature
 |      structure will be an instance of either the ``FeatDict`` class
 |      or the ``FeatList`` class.
 |
 |      :param features: The initial feature values for this feature
 |          structure:
 |
 |          - FeatStruct(string) -> FeatStructReader().read(string)
 |          - FeatStruct(mapping) -> FeatDict(mapping)
 |          - FeatStruct(sequence) -> FeatList(sequence)
 |          - FeatStruct() -> FeatDict()
 |      :param morefeatures: If ``features`` is a mapping or None,
 |          then ``morefeatures`` provides additional features for the
 |          ``FeatDict`` constructor.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.sem.logic.SubstituteBindingsI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatStructReader
Python Library Documentation: class FeatStructReader in module nltk.featstruct

class FeatStructReader(builtins.object)
 |  FeatStructReader(features=(*slash*, *type*), fdict_class=<class 'nltk.featstruct.FeatStruct'>, flist_class=<class 'nltk.featstruct.FeatList'>, logic_parser=None)
 |
 |  Methods defined here:
 |
 |  __init__(self, features=(*slash*, *type*), fdict_class=<class 'nltk.featstruct.FeatStruct'>, flist_class=<class 'nltk.featstruct.FeatList'>, logic_parser=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  fromstring(self, s, fstruct=None)
 |      Convert a string representation of a feature structure (as
 |      displayed by repr) into a ``FeatStruct``.  This process
 |      imposes the following restrictions on the string
 |      representation:
 |
 |      - Feature names cannot contain any of the following:
 |        whitespace, parentheses, quote marks, equals signs,
 |        dashes, commas, and square brackets.  Feature names may
 |        not begin with plus signs or minus signs.
 |      - Only the following basic feature value are supported:
 |        strings, integers, variables, None, and unquoted
 |        alphanumeric strings.
 |      - For reentrant values, the first mention must specify
 |        a reentrance identifier and a value; and any subsequent
 |        mentions must use arrows (``'->'``) to reference the
 |        reentrance identifier.
 |
 |  read_app_value(self, s, position, reentrances, match)
 |      Mainly included for backwards compat.
 |
 |  read_fstruct_value(self, s, position, reentrances, match)
 |
 |  read_int_value(self, s, position, reentrances, match)
 |
 |  read_logic_value(self, s, position, reentrances, match)
 |
 |  read_partial(self, s, position=0, reentrances=None, fstruct=None)
 |      Helper function that reads in a feature structure.
 |
 |      :param s: The string to read.
 |      :param position: The position in the string to start parsing.
 |      :param reentrances: A dictionary from reentrance ids to values.
 |          Defaults to an empty dictionary.
 |      :return: A tuple (val, pos) of the feature structure created by
 |          parsing and the position where the parsed feature structure ends.
 |      :rtype: bool
 |
 |  read_set_value(self, s, position, reentrances, match)
 |
 |  read_str_value(self, s, position, reentrances, match)
 |
 |  read_sym_value(self, s, position, reentrances, match)
 |
 |  read_tuple_value(self, s, position, reentrances, match)
 |
 |  read_value(self, s, position, reentrances)
 |
 |  read_var_value(self, s, position, reentrances, match)
 |      # Note: the '?' is included in the variable name.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  VALUE_HANDLERS = [('read_fstruct_value', re.compile('\\s*(?:\\((\\d+)\...
nltk.Feature
Python Library Documentation: class Feature in module nltk.featstruct

class Feature(builtins.object)
 |  Feature(name, default=None, display=None)
 |
 |  A feature identifier that's specialized to put additional
 |  constraints, default values, etc.
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __init__(self, name, default=None, display=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  read_value(self, s, position, reentrances, parser)
 |
 |  unify_base_values(self, fval1, fval2, bindings)
 |      If possible, return a single value..  If not, return
 |      the value ``UnificationFailure``.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  default
 |      Default value for this feature.
 |
 |  display
 |      Custom display location: can be prefix, or slash.
 |
 |  name
 |      The name of this feature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatureBottomUpChartParser
Python Library Documentation: class FeatureBottomUpChartParser in module nltk.parse.featurechart

class FeatureBottomUpChartParser(FeatureChartParser)
 |  FeatureBottomUpChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      FeatureBottomUpChartParser
 |      FeatureChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatureBottomUpLeftCornerChartParser
Python Library Documentation: class FeatureBottomUpLeftCornerChartParser in module nltk.parse.featurechart

class FeatureBottomUpLeftCornerChartParser(FeatureChartParser)
 |  FeatureBottomUpLeftCornerChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      FeatureBottomUpLeftCornerChartParser
 |      FeatureChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatureChartParser
Python Library Documentation: class FeatureChartParser in module nltk.parse.featurechart

class FeatureChartParser(nltk.parse.chart.ChartParser)
 |  FeatureChartParser(grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2D3A0>, <nltk.parse.featurechart.FeatureEmptyPredictRule object at 0x0000028F98C2D3D0>, <nltk.parse.featurechart.FeatureBottomUpPredictCombineRule object at 0x0000028F98C2D400>, <nltk.parse.featurechart.FeatureSingleEdgeFundamentalRule object at 0x0000028F98C2D430>], trace_chart_width=20, chart_class=<class 'nltk.parse.featurechart.FeatureChart'>, **parser_args)
 |
 |  Method resolution order:
 |      FeatureChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2D3A0>, <nltk.parse.featurechart.FeatureEmptyPredictRule object at 0x0000028F98C2D3D0>, <nltk.parse.featurechart.FeatureBottomUpPredictCombineRule object at 0x0000028F98C2D400>, <nltk.parse.featurechart.FeatureSingleEdgeFundamentalRule object at 0x0000028F98C2D430>], trace_chart_width=20, chart_class=<class 'nltk.parse.featurechart.FeatureChart'>, **parser_args)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatureEarleyChartParser
Python Library Documentation: class FeatureEarleyChartParser in module nltk.parse.earleychart

class FeatureEarleyChartParser(FeatureIncrementalChartParser)
 |  FeatureEarleyChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      FeatureEarleyChartParser
 |      FeatureIncrementalChartParser
 |      IncrementalChartParser
 |      nltk.parse.featurechart.FeatureChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatureIncrementalBottomUpChartParser
Python Library Documentation: class FeatureIncrementalBottomUpChartParser in module nltk.parse.earleychart

class FeatureIncrementalBottomUpChartParser(FeatureIncrementalChartParser)
 |  FeatureIncrementalBottomUpChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      FeatureIncrementalBottomUpChartParser
 |      FeatureIncrementalChartParser
 |      IncrementalChartParser
 |      nltk.parse.featurechart.FeatureChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatureIncrementalBottomUpLeftCornerChartParser
Python Library Documentation: class FeatureIncrementalBottomUpLeftCornerChartParser in module nltk.parse.earleychart

class FeatureIncrementalBottomUpLeftCornerChartParser(FeatureIncrementalChartParser)
 |  FeatureIncrementalBottomUpLeftCornerChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      FeatureIncrementalBottomUpLeftCornerChartParser
 |      FeatureIncrementalChartParser
 |      IncrementalChartParser
 |      nltk.parse.featurechart.FeatureChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatureIncrementalChartParser
Python Library Documentation: class FeatureIncrementalChartParser in module nltk.parse.earleychart

class FeatureIncrementalChartParser(IncrementalChartParser, nltk.parse.featurechart.FeatureChartParser)
 |  FeatureIncrementalChartParser(grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2DC40>, <nltk.parse.featurechart.FeatureEmptyPredictRule object at 0x0000028F98C2DC70>, <nltk.parse.featurechart.FeatureBottomUpPredictCombineRule object at 0x0000028F98C2DCA0>, <nltk.parse.earleychart.FeatureCompleteFundamentalRule object at 0x0000028F98C2DCD0>], trace_chart_width=20, chart_class=<class 'nltk.parse.earleychart.FeatureIncrementalChart'>, **parser_args)
 |
 |  Method resolution order:
 |      FeatureIncrementalChartParser
 |      IncrementalChartParser
 |      nltk.parse.featurechart.FeatureChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2DC40>, <nltk.parse.featurechart.FeatureEmptyPredictRule object at 0x0000028F98C2DC70>, <nltk.parse.featurechart.FeatureBottomUpPredictCombineRule object at 0x0000028F98C2DCA0>, <nltk.parse.earleychart.FeatureCompleteFundamentalRule object at 0x0000028F98C2DCD0>], trace_chart_width=20, chart_class=<class 'nltk.parse.earleychart.FeatureIncrementalChart'>, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatureIncrementalTopDownChartParser
Python Library Documentation: class FeatureIncrementalTopDownChartParser in module nltk.parse.earleychart

class FeatureIncrementalTopDownChartParser(FeatureIncrementalChartParser)
 |  FeatureIncrementalTopDownChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      FeatureIncrementalTopDownChartParser
 |      FeatureIncrementalChartParser
 |      IncrementalChartParser
 |      nltk.parse.featurechart.FeatureChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FeatureTopDownChartParser
Python Library Documentation: class FeatureTopDownChartParser in module nltk.parse.featurechart

class FeatureTopDownChartParser(FeatureChartParser)
 |  FeatureTopDownChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      FeatureTopDownChartParser
 |      FeatureChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.FreqDist
Python Library Documentation: class FreqDist in module nltk.probability

class FreqDist(collections.Counter)
 |  FreqDist(samples=None)
 |
 |  A frequency distribution for the outcomes of an experiment.  A
 |  frequency distribution records the number of times each outcome of
 |  an experiment has occurred.  For example, a frequency distribution
 |  could be used to record the frequency of each word type in a
 |  document.  Formally, a frequency distribution can be defined as a
 |  function mapping from each sample to the number of times that
 |  sample occurred as an outcome.
 |
 |  Frequency distributions are generally constructed by running a
 |  number of experiments, and incrementing the count for a sample
 |  every time it is an outcome of an experiment.  For example, the
 |  following code will produce a frequency distribution that encodes
 |  how often each word occurs in a text:
 |
 |      >>> from nltk.tokenize import word_tokenize
 |      >>> from nltk.probability import FreqDist
 |      >>> sent = 'This is an example sentence'
 |      >>> fdist = FreqDist()
 |      >>> for word in word_tokenize(sent):
 |      ...    fdist[word.lower()] += 1
 |
 |  An equivalent way to do this is with the initializer:
 |
 |      >>> fdist = FreqDist(word.lower() for word in word_tokenize(sent))
 |
 |  Method resolution order:
 |      FreqDist
 |      collections.Counter
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  B(self)
 |      Return the total number of sample values (or "bins") that
 |      have counts greater than zero.  For the total
 |      number of sample outcomes recorded, use ``FreqDist.N()``.
 |      (FreqDist.B() is the same as len(FreqDist).)
 |
 |      :rtype: int
 |
 |  N(self)
 |      Return the total number of sample outcomes that have been
 |      recorded by this FreqDist.  For the number of unique
 |      sample values (or bins) with counts greater than zero, use
 |      ``FreqDist.B()``.
 |
 |      :rtype: int
 |
 |  Nr(self, r, bins=None)
 |
 |  __add__(self, other)
 |      Add counts from two counters.
 |
 |      >>> FreqDist('abbb') + FreqDist('bcc')
 |      FreqDist({'b': 4, 'c': 2, 'a': 1})
 |
 |  __and__(self, other)
 |      Intersection is the minimum of corresponding counts.
 |
 |      >>> FreqDist('abbb') & FreqDist('bcc')
 |      FreqDist({'b': 1})
 |
 |  __delitem__(self, key)
 |      Override ``Counter.__delitem__()`` to invalidate the cached N
 |
 |  __ge__(self, other)
 |      True if all counts in self are a superset of those in other.
 |
 |  __gt__ lambda self, other
 |
 |  __init__(self, samples=None)
 |      Construct a new frequency distribution.  If ``samples`` is
 |      given, then the frequency distribution will be initialized
 |      with the count of each object in ``samples``; otherwise, it
 |      will be initialized to be empty.
 |
 |      In particular, ``FreqDist()`` returns an empty frequency
 |      distribution; and ``FreqDist(samples)`` first creates an empty
 |      frequency distribution, and then calls ``update`` with the
 |      list ``samples``.
 |
 |      :param samples: The samples to initialize the frequency
 |          distribution with.
 |      :type samples: Sequence
 |
 |  __iter__(self)
 |      Return an iterator which yields tokens ordered by frequency.
 |
 |      :rtype: iterator
 |
 |  __le__(self, other)
 |      Returns True if this frequency distribution is a subset of the other
 |      and for no key the value exceeds the value of the same key from
 |      the other frequency distribution.
 |
 |      The <= operator forms partial order and satisfying the axioms
 |      reflexivity, antisymmetry and transitivity.
 |
 |      >>> FreqDist('a') <= FreqDist('a')
 |      True
 |      >>> a = FreqDist('abc')
 |      >>> b = FreqDist('aabc')
 |      >>> (a <= b, b <= a)
 |      (True, False)
 |      >>> FreqDist('a') <= FreqDist('abcd')
 |      True
 |      >>> FreqDist('abc') <= FreqDist('xyz')
 |      False
 |      >>> FreqDist('xyz') <= FreqDist('abc')
 |      False
 |      >>> c = FreqDist('a')
 |      >>> d = FreqDist('aa')
 |      >>> e = FreqDist('aaa')
 |      >>> c <= d and d <= e and c <= e
 |      True
 |
 |  __lt__ lambda self, other
 |
 |  __or__(self, other)
 |      Union is the maximum of value in either of the input counters.
 |
 |      >>> FreqDist('abbb') | FreqDist('bcc')
 |      FreqDist({'b': 3, 'c': 2, 'a': 1})
 |
 |  __repr__(self)
 |      Return a string representation of this FreqDist.
 |
 |      :rtype: string
 |
 |  __setitem__(self, key, val)
 |      Override ``Counter.__setitem__()`` to invalidate the cached N
 |
 |  __str__(self)
 |      Return a string representation of this FreqDist.
 |
 |      :rtype: string
 |
 |  __sub__(self, other)
 |      Subtract count, but keep only results with positive counts.
 |
 |      >>> FreqDist('abbbc') - FreqDist('bccd')
 |      FreqDist({'b': 2, 'a': 1})
 |
 |  copy(self)
 |      Create a copy of this frequency distribution.
 |
 |      :rtype: FreqDist
 |
 |  freq(self, sample)
 |      Return the frequency of a given sample.  The frequency of a
 |      sample is defined as the count of that sample divided by the
 |      total number of sample outcomes that have been recorded by
 |      this FreqDist.  The count of a sample is defined as the
 |      number of times that sample outcome was recorded by this
 |      FreqDist.  Frequencies are always real numbers in the range
 |      [0, 1].
 |
 |      :param sample: the sample whose frequency
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  hapaxes(self)
 |      Return a list of all samples that occur once (hapax legomena)
 |
 |      :rtype: list
 |
 |  max(self)
 |      Return the sample with the greatest number of outcomes in this
 |      frequency distribution.  If two or more samples have the same
 |      number of outcomes, return one of them; which sample is
 |      returned is undefined.  If no outcomes have occurred in this
 |      frequency distribution, return None.
 |
 |      :return: The sample with the maximum number of outcomes in this
 |              frequency distribution.
 |      :rtype: any or None
 |
 |  pformat(self, maxlen=10)
 |      Return a string representation of this FreqDist.
 |
 |      :param maxlen: The maximum number of items to display
 |      :type maxlen: int
 |      :rtype: string
 |
 |  plot(self, *args, title='', cumulative=False, percents=False, show=False, **kwargs)
 |      Plot samples from the frequency distribution
 |      displaying the most frequent sample first.  If an integer
 |      parameter is supplied, stop after this many samples have been
 |      plotted.  For a cumulative plot, specify cumulative=True. Additional
 |      ``**kwargs`` are passed to matplotlib's plot function.
 |      (Requires Matplotlib to be installed.)
 |
 |      :param title: The title for the graph.
 |      :type title: str
 |      :param cumulative: Whether the plot is cumulative. (default = False)
 |      :type cumulative: bool
 |      :param percents: Whether the plot uses percents instead of counts. (default = False)
 |      :type percents: bool
 |      :param show: Whether to show the plot, or only return the ax.
 |      :type show: bool
 |
 |  pprint(self, maxlen=10, stream=None)
 |      Print a string representation of this FreqDist to 'stream'
 |
 |      :param maxlen: The maximum number of items to print
 |      :type maxlen: int
 |      :param stream: The stream to print to. stdout by default
 |
 |  r_Nr(self, bins=None)
 |      Return the dictionary mapping r to Nr, the number of samples with frequency r, where Nr > 0.
 |
 |      :type bins: int
 |      :param bins: The number of possible sample outcomes.  ``bins``
 |          is used to calculate Nr(0).  In particular, Nr(0) is
 |          ``bins-self.B()``.  If ``bins`` is not specified, it
 |          defaults to ``self.B()`` (so Nr(0) will be 0).
 |      :rtype: int
 |
 |  setdefault(self, key, val)
 |      Override ``Counter.setdefault()`` to invalidate the cached N
 |
 |  tabulate(self, *args, **kwargs)
 |      Tabulate the given samples from the frequency distribution (cumulative),
 |      displaying the most frequent sample first.  If an integer
 |      parameter is supplied, stop after this many samples have been
 |      plotted.
 |
 |      :param samples: The samples to plot (default is all samples)
 |      :type samples: list
 |      :param cumulative: A flag to specify whether the freqs are cumulative (default = False)
 |      :type title: bool
 |
 |  update(self, *args, **kwargs)
 |      Override ``Counter.update()`` to invalidate the cached N
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from collections.Counter:
 |
 |  __eq__(self, other)
 |      True if all counts agree. Missing counts are treated as zero.
 |
 |  __iadd__(self, other)
 |      Inplace add from another counter, keeping only positive counts.
 |
 |      >>> c = Counter('abbb')
 |      >>> c += Counter('bcc')
 |      >>> c
 |      Counter({'b': 4, 'c': 2, 'a': 1})
 |
 |  __iand__(self, other)
 |      Inplace intersection is the minimum of corresponding counts.
 |
 |      >>> c = Counter('abbb')
 |      >>> c &= Counter('bcc')
 |      >>> c
 |      Counter({'b': 1})
 |
 |  __ior__(self, other)
 |      Inplace union is the maximum of value from either counter.
 |
 |      >>> c = Counter('abbb')
 |      >>> c |= Counter('bcc')
 |      >>> c
 |      Counter({'b': 3, 'c': 2, 'a': 1})
 |
 |  __isub__(self, other)
 |      Inplace subtract counter, but keep only results with positive counts.
 |
 |      >>> c = Counter('abbbc')
 |      >>> c -= Counter('bccd')
 |      >>> c
 |      Counter({'b': 2, 'a': 1})
 |
 |  __missing__(self, key)
 |      The count of elements not in the Counter is zero.
 |
 |  __ne__(self, other)
 |      True if any counts disagree. Missing counts are treated as zero.
 |
 |  __neg__(self)
 |      Subtracts from an empty counter.  Strips positive and zero counts,
 |      and flips the sign on negative counts.
 |
 |  __pos__(self)
 |      Adds an empty counter, effectively stripping negative and zero counts
 |
 |  __reduce__(self)
 |      Helper for pickle.
 |
 |  elements(self)
 |      Iterator over elements repeating each as many times as its count.
 |
 |      >>> c = Counter('ABCABC')
 |      >>> sorted(c.elements())
 |      ['A', 'A', 'B', 'B', 'C', 'C']
 |
 |      Knuth's example for prime factors of 1836:  2**2 * 3**3 * 17**1
 |
 |      >>> import math
 |      >>> prime_factors = Counter({2: 2, 3: 3, 17: 1})
 |      >>> math.prod(prime_factors.elements())
 |      1836
 |
 |      Note, if an element's count has been set to zero or is a negative
 |      number, elements() will ignore it.
 |
 |  most_common(self, n=None)
 |      List the n most common elements and their counts from the most
 |      common to the least.  If n is None, then list all element counts.
 |
 |      >>> Counter('abracadabra').most_common(3)
 |      [('a', 5), ('b', 2), ('r', 2)]
 |
 |  subtract(self, iterable=None, /, **kwds)
 |      Like dict.update() but subtracts counts instead of replacing them.
 |      Counts can be reduced below zero.  Both the inputs and outputs are
 |      allowed to contain zero and negative counts.
 |
 |      Source can be an iterable, a dictionary, or another Counter instance.
 |
 |      >>> c = Counter('which')
 |      >>> c.subtract('witch')             # subtract elements from another iterable
 |      >>> c.subtract(Counter('watch'))    # subtract elements from another counter
 |      >>> c['h']                          # 2 in which, minus 1 in witch, minus 1 in watch
 |      0
 |      >>> c['w']                          # 1 in which, minus 1 in witch, minus 1 in watch
 |      -1
 |
 |  total(self)
 |      Sum of the counts
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from collections.Counter:
 |
 |  fromkeys(iterable, v=None)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from collections.Counter:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from collections.Counter:
 |
 |  __hash__ = None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.HTTPPasswordMgrWithDefaultRealm
Python Library Documentation: class HTTPPasswordMgrWithDefaultRealm in module urllib.request

class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr)
 |  Method resolution order:
 |      HTTPPasswordMgrWithDefaultRealm
 |      HTTPPasswordMgr
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  find_user_password(self, realm, authuri)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from HTTPPasswordMgr:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  add_password(self, realm, uri, user, passwd)
 |
 |  is_suburi(self, base, test)
 |      Check if test is below base in a URI tree
 |
 |      Both args must be URIs in reduced form.
 |
 |  reduce_uri(self, uri, default_port=True)
 |      Accept authority or URI and extract only the authority and path.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from HTTPPasswordMgr:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.HeldoutProbDist
Python Library Documentation: class HeldoutProbDist in module nltk.probability

class HeldoutProbDist(ProbDistI)
 |  HeldoutProbDist(base_fdist, heldout_fdist, bins=None)
 |
 |  The heldout estimate for the probability distribution of the
 |  experiment used to generate two frequency distributions.  These
 |  two frequency distributions are called the "heldout frequency
 |  distribution" and the "base frequency distribution."  The
 |  "heldout estimate" uses uses the "heldout frequency
 |  distribution" to predict the probability of each sample, given its
 |  frequency in the "base frequency distribution".
 |
 |  In particular, the heldout estimate approximates the probability
 |  for a sample that occurs *r* times in the base distribution as
 |  the average frequency in the heldout distribution of all samples
 |  that occur *r* times in the base distribution.
 |
 |  This average frequency is *Tr[r]/(Nr[r].N)*, where:
 |
 |  - *Tr[r]* is the total count in the heldout distribution for
 |    all samples that occur *r* times in the base distribution.
 |  - *Nr[r]* is the number of samples that occur *r* times in
 |    the base distribution.
 |  - *N* is the number of outcomes recorded by the heldout
 |    frequency distribution.
 |
 |  In order to increase the efficiency of the ``prob`` member
 |  function, *Tr[r]/(Nr[r].N)* is precomputed for each value of *r*
 |  when the ``HeldoutProbDist`` is created.
 |
 |  :type _estimate: list(float)
 |  :ivar _estimate: A list mapping from *r*, the number of
 |      times that a sample occurs in the base distribution, to the
 |      probability estimate for that sample.  ``_estimate[r]`` is
 |      calculated by finding the average frequency in the heldout
 |      distribution of all samples that occur *r* times in the base
 |      distribution.  In particular, ``_estimate[r]`` =
 |      *Tr[r]/(Nr[r].N)*.
 |  :type _max_r: int
 |  :ivar _max_r: The maximum number of times that any sample occurs
 |      in the base distribution.  ``_max_r`` is used to decide how
 |      large ``_estimate`` must be.
 |
 |  Method resolution order:
 |      HeldoutProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, base_fdist, heldout_fdist, bins=None)
 |      Use the heldout estimate to create a probability distribution
 |      for the experiment used to generate ``base_fdist`` and
 |      ``heldout_fdist``.
 |
 |      :type base_fdist: FreqDist
 |      :param base_fdist: The base frequency distribution.
 |      :type heldout_fdist: FreqDist
 |      :param heldout_fdist: The heldout frequency distribution.
 |      :type bins: int
 |      :param bins: The number of sample values that can be generated
 |          by the experiment that is described by the probability
 |          distribution.  This value must be correctly set for the
 |          probabilities of the sample values to sum to one.  If
 |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
 |
 |  __repr__(self)
 |      :rtype: str
 |      :return: A string representation of this ``ProbDist``.
 |
 |  base_fdist(self)
 |      Return the base frequency distribution that this probability
 |      distribution is based on.
 |
 |      :rtype: FreqDist
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  heldout_fdist(self)
 |      Return the heldout frequency distribution that this
 |      probability distribution is based on.
 |
 |      :rtype: FreqDist
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  SUM_TO_ONE = False
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.HiddenMarkovModelTagger
Python Library Documentation: class HiddenMarkovModelTagger in module nltk.tag.hmm

class HiddenMarkovModelTagger(nltk.tag.api.TaggerI)
 |  HiddenMarkovModelTagger(symbols, states, transitions, outputs, priors, transform=<function _identity at 0x0000028F98B92480>)
 |
 |  Hidden Markov model class, a generative model for labelling sequence data.
 |  These models define the joint probability of a sequence of symbols and
 |  their labels (state transitions) as the product of the starting state
 |  probability, the probability of each state transition, and the probability
 |  of each observation being generated from each state. This is described in
 |  more detail in the module documentation.
 |
 |  This implementation is based on the HMM description in Chapter 8, Huang,
 |  Acero and Hon, Spoken Language Processing and includes an extension for
 |  training shallow HMM parsers or specialized HMMs as in Molina et.
 |  al, 2002.  A specialized HMM modifies training data by applying a
 |  specialization function to create a new training set that is more
 |  appropriate for sequential tagging with an HMM.  A typical use case is
 |  chunking.
 |
 |  :param symbols: the set of output symbols (alphabet)
 |  :type symbols: seq of any
 |  :param states: a set of states representing state space
 |  :type states: seq of any
 |  :param transitions: transition probabilities; Pr(s_i | s_j) is the
 |      probability of transition from state i given the model is in
 |      state_j
 |  :type transitions: ConditionalProbDistI
 |  :param outputs: output probabilities; Pr(o_k | s_i) is the probability
 |      of emitting symbol k when entering state i
 |  :type outputs: ConditionalProbDistI
 |  :param priors: initial state distribution; Pr(s_i) is the probability
 |      of starting in state i
 |  :type priors: ProbDistI
 |  :param transform: an optional function for transforming training
 |      instances, defaults to the identity function.
 |  :type transform: callable
 |
 |  Method resolution order:
 |      HiddenMarkovModelTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, symbols, states, transitions, outputs, priors, transform=<function _identity at 0x0000028F98B92480>)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  best_path(self, unlabeled_sequence)
 |      Returns the state sequence of the optimal (most probable) path through
 |      the HMM. Uses the Viterbi algorithm to calculate this part by dynamic
 |      programming.
 |
 |      :return: the state sequence
 |      :rtype: sequence of any
 |      :param unlabeled_sequence: the sequence of unlabeled symbols
 |      :type unlabeled_sequence: list
 |
 |  best_path_simple(self, unlabeled_sequence)
 |      Returns the state sequence of the optimal (most probable) path through
 |      the HMM. Uses the Viterbi algorithm to calculate this part by dynamic
 |      programming.  This uses a simple, direct method, and is included for
 |      teaching purposes.
 |
 |      :return: the state sequence
 |      :rtype: sequence of any
 |      :param unlabeled_sequence: the sequence of unlabeled symbols
 |      :type unlabeled_sequence: list
 |
 |  entropy(self, unlabeled_sequence)
 |      Returns the entropy over labellings of the given sequence. This is
 |      given by::
 |
 |          H(O) = - sum_S Pr(S | O) log Pr(S | O)
 |
 |      where the summation ranges over all state sequences, S. Let
 |      *Z = Pr(O) = sum_S Pr(S, O)}* where the summation ranges over all state
 |      sequences and O is the observation sequence. As such the entropy can
 |      be re-expressed as::
 |
 |          H = - sum_S Pr(S | O) log [ Pr(S, O) / Z ]
 |          = log Z - sum_S Pr(S | O) log Pr(S, 0)
 |          = log Z - sum_S Pr(S | O) [ log Pr(S_0) + sum_t Pr(S_t | S_{t-1}) + sum_t Pr(O_t | S_t) ]
 |
 |      The order of summation for the log terms can be flipped, allowing
 |      dynamic programming to be used to calculate the entropy. Specifically,
 |      we use the forward and backward probabilities (alpha, beta) giving::
 |
 |          H = log Z - sum_s0 alpha_0(s0) beta_0(s0) / Z * log Pr(s0)
 |          + sum_t,si,sj alpha_t(si) Pr(sj | si) Pr(O_t+1 | sj) beta_t(sj) / Z * log Pr(sj | si)
 |          + sum_t,st alpha_t(st) beta_t(st) / Z * log Pr(O_t | st)
 |
 |      This simply uses alpha and beta to find the probabilities of partial
 |      sequences, constrained to include the given state(s) at some point in
 |      time.
 |
 |  log_probability(self, sequence)
 |      Returns the log-probability of the given symbol sequence. If the
 |      sequence is labelled, then returns the joint log-probability of the
 |      symbol, state sequence. Otherwise, uses the forward algorithm to find
 |      the log-probability over all label sequences.
 |
 |      :return: the log-probability of the sequence
 |      :rtype: float
 |      :param sequence: the sequence of symbols which must contain the TEXT
 |          property, and optionally the TAG property
 |      :type sequence:  Token
 |
 |  point_entropy(self, unlabeled_sequence)
 |      Returns the pointwise entropy over the possible states at each
 |      position in the chain, given the observation sequence.
 |
 |  probability(self, sequence)
 |      Returns the probability of the given symbol sequence. If the sequence
 |      is labelled, then returns the joint probability of the symbol, state
 |      sequence. Otherwise, uses the forward algorithm to find the
 |      probability over all label sequences.
 |
 |      :return: the probability of the sequence
 |      :rtype: float
 |      :param sequence: the sequence of symbols which must contain the TEXT
 |          property, and optionally the TAG property
 |      :type sequence:  Token
 |
 |  random_sample(self, rng, length)
 |      Randomly sample the HMM to generate a sentence of a given length. This
 |      samples the prior distribution then the observation distribution and
 |      transition distribution for each subsequent observation and state.
 |      This will mostly generate unintelligible garbage, but can provide some
 |      amusement.
 |
 |      :return:        the randomly created state/observation sequence,
 |                      generated according to the HMM's probability
 |                      distributions. The SUBTOKENS have TEXT and TAG
 |                      properties containing the observation and state
 |                      respectively.
 |      :rtype:         list
 |      :param rng:     random number generator
 |      :type rng:      Random (or any object with a random() method)
 |      :param length:  desired output length
 |      :type length:   int
 |
 |  reset_cache(self)
 |
 |  tag(self, unlabeled_sequence)
 |      Tags the sequence with the highest probability state sequence. This
 |      uses the best_path method to find the Viterbi path.
 |
 |      :return: a labelled sequence of symbols
 |      :rtype: list
 |      :param unlabeled_sequence: the sequence of unlabeled symbols
 |      :type unlabeled_sequence: list
 |
 |  test(self, test_sequence, verbose=False, **kwargs)
 |      Tests the HiddenMarkovModelTagger instance.
 |
 |      :param test_sequence: a sequence of labeled test instances
 |      :type test_sequence: list(list)
 |      :param verbose: boolean flag indicating whether training should be
 |          verbose or include printed output
 |      :type verbose: bool
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  train(labeled_sequence, test_sequence=None, unlabeled_sequence=None, **kwargs)
 |      Train a new HiddenMarkovModelTagger using the given labeled and
 |      unlabeled training instances. Testing will be performed if test
 |      instances are provided.
 |
 |      :return: a hidden markov model tagger
 |      :rtype: HiddenMarkovModelTagger
 |      :param labeled_sequence: a sequence of labeled training instances,
 |          i.e. a list of sentences represented as tuples
 |      :type labeled_sequence: list(list)
 |      :param test_sequence: a sequence of labeled test instances
 |      :type test_sequence: list(list)
 |      :param unlabeled_sequence: a sequence of unlabeled training instances,
 |          i.e. a list of sentences represented as words
 |      :type unlabeled_sequence: list(list)
 |      :param transform: an optional function for transforming training
 |          instances, defaults to the identity function, see ``transform()``
 |      :type transform: function
 |      :param estimator: an optional function or class that maps a
 |          condition's frequency distribution to its probability
 |          distribution, defaults to a Lidstone distribution with gamma = 0.1
 |      :type estimator: class or function
 |      :param verbose: boolean flag indicating whether training should be
 |          verbose or include printed output
 |      :type verbose: bool
 |      :param max_iterations: number of Baum-Welch iterations to perform
 |      :type max_iterations: int
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.HiddenMarkovModelTrainer
Python Library Documentation: class HiddenMarkovModelTrainer in module nltk.tag.hmm

class HiddenMarkovModelTrainer(builtins.object)
 |  HiddenMarkovModelTrainer(states=None, symbols=None)
 |
 |  Algorithms for learning HMM parameters from training data. These include
 |  both supervised learning (MLE) and unsupervised learning (Baum-Welch).
 |
 |  Creates an HMM trainer to induce an HMM with the given states and
 |  output symbol alphabet. A supervised and unsupervised training
 |  method may be used. If either of the states or symbols are not given,
 |  these may be derived from supervised training.
 |
 |  :param states:  the set of state labels
 |  :type states:   sequence of any
 |  :param symbols: the set of observation symbols
 |  :type symbols:  sequence of any
 |
 |  Methods defined here:
 |
 |  __init__(self, states=None, symbols=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  train(self, labeled_sequences=None, unlabeled_sequences=None, **kwargs)
 |      Trains the HMM using both (or either of) supervised and unsupervised
 |      techniques.
 |
 |      :return: the trained model
 |      :rtype: HiddenMarkovModelTagger
 |      :param labelled_sequences: the supervised training data, a set of
 |          labelled sequences of observations
 |          ex: [ (word_1, tag_1),...,(word_n,tag_n) ]
 |      :type labelled_sequences: list
 |      :param unlabeled_sequences: the unsupervised training data, a set of
 |          sequences of observations
 |          ex: [ word_1, ..., word_n ]
 |      :type unlabeled_sequences: list
 |      :param kwargs: additional arguments to pass to the training methods
 |
 |  train_supervised(self, labelled_sequences, estimator=None)
 |      Supervised training maximising the joint probability of the symbol and
 |      state sequences. This is done via collecting frequencies of
 |      transitions between states, symbol observations while within each
 |      state and which states start a sentence. These frequency distributions
 |      are then normalised into probability estimates, which can be
 |      smoothed if desired.
 |
 |      :return: the trained model
 |      :rtype: HiddenMarkovModelTagger
 |      :param labelled_sequences: the training data, a set of
 |          labelled sequences of observations
 |      :type labelled_sequences: list
 |      :param estimator: a function taking
 |          a FreqDist and a number of bins and returning a CProbDistI;
 |          otherwise a MLE estimate is used
 |
 |  train_unsupervised(self, unlabeled_sequences, update_outputs=True, **kwargs)
 |      Trains the HMM using the Baum-Welch algorithm to maximise the
 |      probability of the data sequence. This is a variant of the EM
 |      algorithm, and is unsupervised in that it doesn't need the state
 |      sequences for the symbols. The code is based on 'A Tutorial on Hidden
 |      Markov Models and Selected Applications in Speech Recognition',
 |      Lawrence Rabiner, IEEE, 1989.
 |
 |      :return: the trained model
 |      :rtype: HiddenMarkovModelTagger
 |      :param unlabeled_sequences: the training data, a set of
 |          sequences of observations
 |      :type unlabeled_sequences: list
 |
 |      kwargs may include following parameters:
 |
 |      :param model: a HiddenMarkovModelTagger instance used to begin
 |          the Baum-Welch algorithm
 |      :param max_iterations: the maximum number of EM iterations
 |      :param convergence_logprob: the maximum change in log probability to
 |          allow convergence
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.HunposTagger
Python Library Documentation: class HunposTagger in module nltk.tag.hunpos

class HunposTagger(nltk.tag.api.TaggerI)
 |  HunposTagger(path_to_model, path_to_bin=None, encoding='ISO-8859-1', verbose=False)
 |
 |  A class for pos tagging with HunPos. The input is the paths to:
 |   - a model trained on training data
 |   - (optionally) the path to the hunpos-tag binary
 |   - (optionally) the encoding of the training data (default: ISO-8859-1)
 |
 |  Check whether the required "hunpos-tag" binary is available:
 |
 |      >>> from nltk.test.setup_fixt import check_binary
 |      >>> check_binary('hunpos-tag')
 |
 |  Example:
 |      >>> from nltk.tag import HunposTagger
 |      >>> ht = HunposTagger('en_wsj.model')
 |      >>> ht.tag('What is the airspeed of an unladen swallow ?'.split())
 |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'), ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'), ('unladen', 'NN'), ('swallow', 'VB'), ('?', '.')]
 |      >>> ht.close()
 |
 |  This class communicates with the hunpos-tag binary via pipes. When the
 |  tagger object is no longer needed, the close() method should be called to
 |  free system resources. The class supports the context manager interface; if
 |  used in a with statement, the close() method is invoked automatically:
 |
 |      >>> with HunposTagger('en_wsj.model') as ht:
 |      ...     ht.tag('What is the airspeed of an unladen swallow ?'.split())
 |      ...
 |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'), ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'), ('unladen', 'NN'), ('swallow', 'VB'), ('?', '.')]
 |
 |  Method resolution order:
 |      HunposTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __del__(self)
 |
 |  __enter__(self)
 |
 |  __exit__(self, exc_type, exc_value, traceback)
 |
 |  __init__(self, path_to_model, path_to_bin=None, encoding='ISO-8859-1', verbose=False)
 |      Starts the hunpos-tag executable and establishes a connection with it.
 |
 |      :param path_to_model: The model file.
 |      :param path_to_bin: The hunpos-tag binary.
 |      :param encoding: The encoding used by the model. Unicode tokens
 |          passed to the tag() and tag_sents() methods are converted to
 |          this charset when they are sent to hunpos-tag.
 |          The default is ISO-8859-1 (Latin-1).
 |
 |          This parameter is ignored for str tokens, which are sent as-is.
 |          The caller must ensure that tokens are encoded in the right charset.
 |
 |  close(self)
 |      Closes the pipe to the hunpos executable.
 |
 |  tag(self, tokens)
 |      Tags a single sentence: a list of words.
 |      The tokens should not contain any newline characters.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.IBMModel
Python Library Documentation: class IBMModel in module nltk.translate.ibm_model

class IBMModel(builtins.object)
 |  IBMModel(sentence_aligned_corpus)
 |
 |  Abstract base class for all IBM models
 |
 |  Methods defined here:
 |
 |  __init__(self, sentence_aligned_corpus)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
 |      Finds the best alignment according to IBM Model 2
 |
 |      Used as a starting point for hill climbing in Models 3 and
 |      above, because it is easier to compute than the best alignments
 |      in higher models
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to be word-aligned
 |      :type sentence_pair: AlignedSent
 |
 |      :param j_pegged: If specified, the alignment point of j_pegged
 |          will be fixed to i_pegged
 |      :type j_pegged: int
 |
 |      :param i_pegged: Alignment point to j_pegged
 |      :type i_pegged: int
 |
 |  hillclimb(self, alignment_info, j_pegged=None)
 |      Starting from the alignment in ``alignment_info``, look at
 |      neighboring alignments iteratively for the best one
 |
 |      There is no guarantee that the best alignment in the alignment
 |      space will be found, because the algorithm might be stuck in a
 |      local maximum.
 |
 |      :param j_pegged: If specified, the search will be constrained to
 |          alignments where ``j_pegged`` remains unchanged
 |      :type j_pegged: int
 |
 |      :return: The best alignment found from hill climbing
 |      :rtype: AlignmentInfo
 |
 |  init_vocab(self, sentence_aligned_corpus)
 |
 |  maximize_fertility_probabilities(self, counts)
 |
 |  maximize_lexical_translation_probabilities(self, counts)
 |
 |  maximize_null_generation_probabilities(self, counts)
 |
 |  neighboring(self, alignment_info, j_pegged=None)
 |      Determine the neighbors of ``alignment_info``, obtained by
 |      moving or swapping one alignment point
 |
 |      :param j_pegged: If specified, neighbors that have a different
 |          alignment point from j_pegged will not be considered
 |      :type j_pegged: int
 |
 |      :return: A set neighboring alignments represented by their
 |          ``AlignmentInfo``
 |      :rtype: set(AlignmentInfo)
 |
 |  prob_of_alignments(self, alignments)
 |
 |  prob_t_a_given_s(self, alignment_info)
 |      Probability of target sentence and an alignment given the
 |      source sentence
 |
 |      All required information is assumed to be in ``alignment_info``
 |      and self.
 |
 |      Derived classes should override this method
 |
 |  reset_probabilities(self)
 |
 |  sample(self, sentence_pair)
 |      Sample the most probable alignments from the entire alignment
 |      space
 |
 |      First, determine the best alignment according to IBM Model 2.
 |      With this initial alignment, use hill climbing to determine the
 |      best alignment according to a higher IBM Model. Add this
 |      alignment and its neighbors to the sample set. Repeat this
 |      process with other initial alignments obtained by pegging an
 |      alignment point.
 |
 |      Hill climbing may be stuck in a local maxima, hence the pegging
 |      and trying out of different alignments.
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to generate a sample of alignments from
 |      :type sentence_pair: AlignedSent
 |
 |      :return: A set of best alignments represented by their ``AlignmentInfo``
 |          and the best alignment of the set for convenience
 |      :rtype: set(AlignmentInfo), AlignmentInfo
 |
 |  set_uniform_probabilities(self, sentence_aligned_corpus)
 |      Initialize probability tables to a uniform distribution
 |
 |      Derived classes should implement this accordingly.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MIN_PROB = 1e-12
nltk.IBMModel1
Python Library Documentation: class IBMModel1 in module nltk.translate.ibm1

class IBMModel1(nltk.translate.ibm_model.IBMModel)
 |  IBMModel1(sentence_aligned_corpus, iterations, probability_tables=None)
 |
 |  Lexical translation model that ignores word order
 |
 |  >>> bitext = []
 |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus', 'ist', 'ja', 'groß'], ['the', 'house', 'is', 'big']))
 |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
 |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
 |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
 |
 |  >>> ibm1 = IBMModel1(bitext, 5)
 |
 |  >>> print(round(ibm1.translation_table['buch']['book'], 3))
 |  0.889
 |  >>> print(round(ibm1.translation_table['das']['book'], 3))
 |  0.062
 |  >>> print(round(ibm1.translation_table['buch'][None], 3))
 |  0.113
 |  >>> print(round(ibm1.translation_table['ja'][None], 3))
 |  0.073
 |
 |  >>> test_sentence = bitext[2]
 |  >>> test_sentence.words
 |  ['das', 'buch', 'ist', 'ja', 'klein']
 |  >>> test_sentence.mots
 |  ['the', 'book', 'is', 'small']
 |  >>> test_sentence.alignment
 |  Alignment([(0, 0), (1, 1), (2, 2), (3, 2), (4, 3)])
 |
 |  Method resolution order:
 |      IBMModel1
 |      nltk.translate.ibm_model.IBMModel
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, sentence_aligned_corpus, iterations, probability_tables=None)
 |      Train on ``sentence_aligned_corpus`` and create a lexical
 |      translation model.
 |
 |      Translation direction is from ``AlignedSent.mots`` to
 |      ``AlignedSent.words``.
 |
 |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
 |      :type sentence_aligned_corpus: list(AlignedSent)
 |
 |      :param iterations: Number of iterations to run training algorithm
 |      :type iterations: int
 |
 |      :param probability_tables: Optional. Use this to pass in custom
 |          probability values. If not specified, probabilities will be
 |          set to a uniform distribution, or some other sensible value.
 |          If specified, the following entry must be present:
 |          ``translation_table``.
 |          See ``IBMModel`` for the type and purpose of this table.
 |      :type probability_tables: dict[str]: object
 |
 |  align(self, sentence_pair)
 |      Determines the best word alignment for one sentence pair from
 |      the corpus that the model was trained on.
 |
 |      The best alignment will be set in ``sentence_pair`` when the
 |      method returns. In contrast with the internal implementation of
 |      IBM models, the word indices in the ``Alignment`` are zero-
 |      indexed, not one-indexed.
 |
 |      :param sentence_pair: A sentence in the source language and its
 |          counterpart sentence in the target language
 |      :type sentence_pair: AlignedSent
 |
 |  align_all(self, parallel_corpus)
 |
 |  prob_alignment_point(self, s, t)
 |      Probability that word ``t`` in the target sentence is aligned to
 |      word ``s`` in the source sentence
 |
 |  prob_all_alignments(self, src_sentence, trg_sentence)
 |      Computes the probability of all possible word alignments,
 |      expressed as a marginal distribution over target words t
 |
 |      Each entry in the return value represents the contribution to
 |      the total alignment probability by the target word t.
 |
 |      To obtain probability(alignment | src_sentence, trg_sentence),
 |      simply sum the entries in the return value.
 |
 |      :return: Probability of t for all s in ``src_sentence``
 |      :rtype: dict(str): float
 |
 |  prob_t_a_given_s(self, alignment_info)
 |      Probability of target sentence and an alignment given the
 |      source sentence
 |
 |  set_uniform_probabilities(self, sentence_aligned_corpus)
 |      Initialize probability tables to a uniform distribution
 |
 |      Derived classes should implement this accordingly.
 |
 |  train(self, parallel_corpus)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
 |      Finds the best alignment according to IBM Model 2
 |
 |      Used as a starting point for hill climbing in Models 3 and
 |      above, because it is easier to compute than the best alignments
 |      in higher models
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to be word-aligned
 |      :type sentence_pair: AlignedSent
 |
 |      :param j_pegged: If specified, the alignment point of j_pegged
 |          will be fixed to i_pegged
 |      :type j_pegged: int
 |
 |      :param i_pegged: Alignment point to j_pegged
 |      :type i_pegged: int
 |
 |  hillclimb(self, alignment_info, j_pegged=None)
 |      Starting from the alignment in ``alignment_info``, look at
 |      neighboring alignments iteratively for the best one
 |
 |      There is no guarantee that the best alignment in the alignment
 |      space will be found, because the algorithm might be stuck in a
 |      local maximum.
 |
 |      :param j_pegged: If specified, the search will be constrained to
 |          alignments where ``j_pegged`` remains unchanged
 |      :type j_pegged: int
 |
 |      :return: The best alignment found from hill climbing
 |      :rtype: AlignmentInfo
 |
 |  init_vocab(self, sentence_aligned_corpus)
 |
 |  maximize_fertility_probabilities(self, counts)
 |
 |  maximize_lexical_translation_probabilities(self, counts)
 |
 |  maximize_null_generation_probabilities(self, counts)
 |
 |  neighboring(self, alignment_info, j_pegged=None)
 |      Determine the neighbors of ``alignment_info``, obtained by
 |      moving or swapping one alignment point
 |
 |      :param j_pegged: If specified, neighbors that have a different
 |          alignment point from j_pegged will not be considered
 |      :type j_pegged: int
 |
 |      :return: A set neighboring alignments represented by their
 |          ``AlignmentInfo``
 |      :rtype: set(AlignmentInfo)
 |
 |  prob_of_alignments(self, alignments)
 |
 |  reset_probabilities(self)
 |
 |  sample(self, sentence_pair)
 |      Sample the most probable alignments from the entire alignment
 |      space
 |
 |      First, determine the best alignment according to IBM Model 2.
 |      With this initial alignment, use hill climbing to determine the
 |      best alignment according to a higher IBM Model. Add this
 |      alignment and its neighbors to the sample set. Repeat this
 |      process with other initial alignments obtained by pegging an
 |      alignment point.
 |
 |      Hill climbing may be stuck in a local maxima, hence the pegging
 |      and trying out of different alignments.
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to generate a sample of alignments from
 |      :type sentence_pair: AlignedSent
 |
 |      :return: A set of best alignments represented by their ``AlignmentInfo``
 |          and the best alignment of the set for convenience
 |      :rtype: set(AlignmentInfo), AlignmentInfo
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  MIN_PROB = 1e-12
nltk.IBMModel2
Python Library Documentation: class IBMModel2 in module nltk.translate.ibm2

class IBMModel2(nltk.translate.ibm_model.IBMModel)
 |  IBMModel2(sentence_aligned_corpus, iterations, probability_tables=None)
 |
 |  Lexical translation model that considers word order
 |
 |  >>> bitext = []
 |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus', 'ist', 'ja', 'groß'], ['the', 'house', 'is', 'big']))
 |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
 |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
 |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
 |
 |  >>> ibm2 = IBMModel2(bitext, 5)
 |
 |  >>> print(round(ibm2.translation_table['buch']['book'], 3))
 |  1.0
 |  >>> print(round(ibm2.translation_table['das']['book'], 3))
 |  0.0
 |  >>> print(round(ibm2.translation_table['buch'][None], 3))
 |  0.0
 |  >>> print(round(ibm2.translation_table['ja'][None], 3))
 |  0.0
 |
 |  >>> print(round(ibm2.alignment_table[1][1][2][2], 3))
 |  0.939
 |  >>> print(round(ibm2.alignment_table[1][2][2][2], 3))
 |  0.0
 |  >>> print(round(ibm2.alignment_table[2][2][4][5], 3))
 |  1.0
 |
 |  >>> test_sentence = bitext[2]
 |  >>> test_sentence.words
 |  ['das', 'buch', 'ist', 'ja', 'klein']
 |  >>> test_sentence.mots
 |  ['the', 'book', 'is', 'small']
 |  >>> test_sentence.alignment
 |  Alignment([(0, 0), (1, 1), (2, 2), (3, 2), (4, 3)])
 |
 |  Method resolution order:
 |      IBMModel2
 |      nltk.translate.ibm_model.IBMModel
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, sentence_aligned_corpus, iterations, probability_tables=None)
 |      Train on ``sentence_aligned_corpus`` and create a lexical
 |      translation model and an alignment model.
 |
 |      Translation direction is from ``AlignedSent.mots`` to
 |      ``AlignedSent.words``.
 |
 |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
 |      :type sentence_aligned_corpus: list(AlignedSent)
 |
 |      :param iterations: Number of iterations to run training algorithm
 |      :type iterations: int
 |
 |      :param probability_tables: Optional. Use this to pass in custom
 |          probability values. If not specified, probabilities will be
 |          set to a uniform distribution, or some other sensible value.
 |          If specified, all the following entries must be present:
 |          ``translation_table``, ``alignment_table``.
 |          See ``IBMModel`` for the type and purpose of these tables.
 |      :type probability_tables: dict[str]: object
 |
 |  align(self, sentence_pair)
 |      Determines the best word alignment for one sentence pair from
 |      the corpus that the model was trained on.
 |
 |      The best alignment will be set in ``sentence_pair`` when the
 |      method returns. In contrast with the internal implementation of
 |      IBM models, the word indices in the ``Alignment`` are zero-
 |      indexed, not one-indexed.
 |
 |      :param sentence_pair: A sentence in the source language and its
 |          counterpart sentence in the target language
 |      :type sentence_pair: AlignedSent
 |
 |  align_all(self, parallel_corpus)
 |
 |  maximize_alignment_probabilities(self, counts)
 |
 |  prob_alignment_point(self, i, j, src_sentence, trg_sentence)
 |      Probability that position j in ``trg_sentence`` is aligned to
 |      position i in the ``src_sentence``
 |
 |  prob_all_alignments(self, src_sentence, trg_sentence)
 |      Computes the probability of all possible word alignments,
 |      expressed as a marginal distribution over target words t
 |
 |      Each entry in the return value represents the contribution to
 |      the total alignment probability by the target word t.
 |
 |      To obtain probability(alignment | src_sentence, trg_sentence),
 |      simply sum the entries in the return value.
 |
 |      :return: Probability of t for all s in ``src_sentence``
 |      :rtype: dict(str): float
 |
 |  prob_t_a_given_s(self, alignment_info)
 |      Probability of target sentence and an alignment given the
 |      source sentence
 |
 |  set_uniform_probabilities(self, sentence_aligned_corpus)
 |      Initialize probability tables to a uniform distribution
 |
 |      Derived classes should implement this accordingly.
 |
 |  train(self, parallel_corpus)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
 |      Finds the best alignment according to IBM Model 2
 |
 |      Used as a starting point for hill climbing in Models 3 and
 |      above, because it is easier to compute than the best alignments
 |      in higher models
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to be word-aligned
 |      :type sentence_pair: AlignedSent
 |
 |      :param j_pegged: If specified, the alignment point of j_pegged
 |          will be fixed to i_pegged
 |      :type j_pegged: int
 |
 |      :param i_pegged: Alignment point to j_pegged
 |      :type i_pegged: int
 |
 |  hillclimb(self, alignment_info, j_pegged=None)
 |      Starting from the alignment in ``alignment_info``, look at
 |      neighboring alignments iteratively for the best one
 |
 |      There is no guarantee that the best alignment in the alignment
 |      space will be found, because the algorithm might be stuck in a
 |      local maximum.
 |
 |      :param j_pegged: If specified, the search will be constrained to
 |          alignments where ``j_pegged`` remains unchanged
 |      :type j_pegged: int
 |
 |      :return: The best alignment found from hill climbing
 |      :rtype: AlignmentInfo
 |
 |  init_vocab(self, sentence_aligned_corpus)
 |
 |  maximize_fertility_probabilities(self, counts)
 |
 |  maximize_lexical_translation_probabilities(self, counts)
 |
 |  maximize_null_generation_probabilities(self, counts)
 |
 |  neighboring(self, alignment_info, j_pegged=None)
 |      Determine the neighbors of ``alignment_info``, obtained by
 |      moving or swapping one alignment point
 |
 |      :param j_pegged: If specified, neighbors that have a different
 |          alignment point from j_pegged will not be considered
 |      :type j_pegged: int
 |
 |      :return: A set neighboring alignments represented by their
 |          ``AlignmentInfo``
 |      :rtype: set(AlignmentInfo)
 |
 |  prob_of_alignments(self, alignments)
 |
 |  reset_probabilities(self)
 |
 |  sample(self, sentence_pair)
 |      Sample the most probable alignments from the entire alignment
 |      space
 |
 |      First, determine the best alignment according to IBM Model 2.
 |      With this initial alignment, use hill climbing to determine the
 |      best alignment according to a higher IBM Model. Add this
 |      alignment and its neighbors to the sample set. Repeat this
 |      process with other initial alignments obtained by pegging an
 |      alignment point.
 |
 |      Hill climbing may be stuck in a local maxima, hence the pegging
 |      and trying out of different alignments.
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to generate a sample of alignments from
 |      :type sentence_pair: AlignedSent
 |
 |      :return: A set of best alignments represented by their ``AlignmentInfo``
 |          and the best alignment of the set for convenience
 |      :rtype: set(AlignmentInfo), AlignmentInfo
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  MIN_PROB = 1e-12
nltk.IBMModel3
Python Library Documentation: class IBMModel3 in module nltk.translate.ibm3

class IBMModel3(nltk.translate.ibm_model.IBMModel)
 |  IBMModel3(sentence_aligned_corpus, iterations, probability_tables=None)
 |
 |  Translation model that considers how a word can be aligned to
 |  multiple words in another language
 |
 |  >>> bitext = []
 |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus', 'war', 'ja', 'groß'], ['the', 'house', 'was', 'big']))
 |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['ein', 'haus', 'ist', 'klein'], ['a', 'house', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
 |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
 |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
 |  >>> bitext.append(AlignedSent(['ich', 'fasse', 'das', 'buch', 'zusammen'], ['i', 'summarize', 'the', 'book']))
 |  >>> bitext.append(AlignedSent(['fasse', 'zusammen'], ['summarize']))
 |
 |  >>> ibm3 = IBMModel3(bitext, 5)
 |
 |  >>> print(round(ibm3.translation_table['buch']['book'], 3))
 |  1.0
 |  >>> print(round(ibm3.translation_table['das']['book'], 3))
 |  0.0
 |  >>> print(round(ibm3.translation_table['ja'][None], 3))
 |  1.0
 |
 |  >>> print(round(ibm3.distortion_table[1][1][2][2], 3))
 |  1.0
 |  >>> print(round(ibm3.distortion_table[1][2][2][2], 3))
 |  0.0
 |  >>> print(round(ibm3.distortion_table[2][2][4][5], 3))
 |  0.75
 |
 |  >>> print(round(ibm3.fertility_table[2]['summarize'], 3))
 |  1.0
 |  >>> print(round(ibm3.fertility_table[1]['book'], 3))
 |  1.0
 |
 |  >>> print(round(ibm3.p1, 3))
 |  0.054
 |
 |  >>> test_sentence = bitext[2]
 |  >>> test_sentence.words
 |  ['das', 'buch', 'ist', 'ja', 'klein']
 |  >>> test_sentence.mots
 |  ['the', 'book', 'is', 'small']
 |  >>> test_sentence.alignment
 |  Alignment([(0, 0), (1, 1), (2, 2), (3, None), (4, 3)])
 |
 |  Method resolution order:
 |      IBMModel3
 |      nltk.translate.ibm_model.IBMModel
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, sentence_aligned_corpus, iterations, probability_tables=None)
 |      Train on ``sentence_aligned_corpus`` and create a lexical
 |      translation model, a distortion model, a fertility model, and a
 |      model for generating NULL-aligned words.
 |
 |      Translation direction is from ``AlignedSent.mots`` to
 |      ``AlignedSent.words``.
 |
 |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
 |      :type sentence_aligned_corpus: list(AlignedSent)
 |
 |      :param iterations: Number of iterations to run training algorithm
 |      :type iterations: int
 |
 |      :param probability_tables: Optional. Use this to pass in custom
 |          probability values. If not specified, probabilities will be
 |          set to a uniform distribution, or some other sensible value.
 |          If specified, all the following entries must be present:
 |          ``translation_table``, ``alignment_table``,
 |          ``fertility_table``, ``p1``, ``distortion_table``.
 |          See ``IBMModel`` for the type and purpose of these tables.
 |      :type probability_tables: dict[str]: object
 |
 |  maximize_distortion_probabilities(self, counts)
 |
 |  prob_t_a_given_s(self, alignment_info)
 |      Probability of target sentence and an alignment given the
 |      source sentence
 |
 |  reset_probabilities(self)
 |
 |  set_uniform_probabilities(self, sentence_aligned_corpus)
 |      Initialize probability tables to a uniform distribution
 |
 |      Derived classes should implement this accordingly.
 |
 |  train(self, parallel_corpus)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
 |      Finds the best alignment according to IBM Model 2
 |
 |      Used as a starting point for hill climbing in Models 3 and
 |      above, because it is easier to compute than the best alignments
 |      in higher models
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to be word-aligned
 |      :type sentence_pair: AlignedSent
 |
 |      :param j_pegged: If specified, the alignment point of j_pegged
 |          will be fixed to i_pegged
 |      :type j_pegged: int
 |
 |      :param i_pegged: Alignment point to j_pegged
 |      :type i_pegged: int
 |
 |  hillclimb(self, alignment_info, j_pegged=None)
 |      Starting from the alignment in ``alignment_info``, look at
 |      neighboring alignments iteratively for the best one
 |
 |      There is no guarantee that the best alignment in the alignment
 |      space will be found, because the algorithm might be stuck in a
 |      local maximum.
 |
 |      :param j_pegged: If specified, the search will be constrained to
 |          alignments where ``j_pegged`` remains unchanged
 |      :type j_pegged: int
 |
 |      :return: The best alignment found from hill climbing
 |      :rtype: AlignmentInfo
 |
 |  init_vocab(self, sentence_aligned_corpus)
 |
 |  maximize_fertility_probabilities(self, counts)
 |
 |  maximize_lexical_translation_probabilities(self, counts)
 |
 |  maximize_null_generation_probabilities(self, counts)
 |
 |  neighboring(self, alignment_info, j_pegged=None)
 |      Determine the neighbors of ``alignment_info``, obtained by
 |      moving or swapping one alignment point
 |
 |      :param j_pegged: If specified, neighbors that have a different
 |          alignment point from j_pegged will not be considered
 |      :type j_pegged: int
 |
 |      :return: A set neighboring alignments represented by their
 |          ``AlignmentInfo``
 |      :rtype: set(AlignmentInfo)
 |
 |  prob_of_alignments(self, alignments)
 |
 |  sample(self, sentence_pair)
 |      Sample the most probable alignments from the entire alignment
 |      space
 |
 |      First, determine the best alignment according to IBM Model 2.
 |      With this initial alignment, use hill climbing to determine the
 |      best alignment according to a higher IBM Model. Add this
 |      alignment and its neighbors to the sample set. Repeat this
 |      process with other initial alignments obtained by pegging an
 |      alignment point.
 |
 |      Hill climbing may be stuck in a local maxima, hence the pegging
 |      and trying out of different alignments.
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to generate a sample of alignments from
 |      :type sentence_pair: AlignedSent
 |
 |      :return: A set of best alignments represented by their ``AlignmentInfo``
 |          and the best alignment of the set for convenience
 |      :rtype: set(AlignmentInfo), AlignmentInfo
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  MIN_PROB = 1e-12
nltk.IBMModel4
Python Library Documentation: class IBMModel4 in module nltk.translate.ibm4

class IBMModel4(nltk.translate.ibm_model.IBMModel)
 |  IBMModel4(sentence_aligned_corpus, iterations, source_word_classes, target_word_classes, probability_tables=None)
 |
 |  Translation model that reorders output words based on their type and
 |  their distance from other related words in the output sentence
 |
 |  >>> bitext = []
 |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus', 'war', 'ja', 'groß'], ['the', 'house', 'was', 'big']))
 |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['ein', 'haus', 'ist', 'klein'], ['a', 'house', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
 |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
 |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
 |  >>> bitext.append(AlignedSent(['ich', 'fasse', 'das', 'buch', 'zusammen'], ['i', 'summarize', 'the', 'book']))
 |  >>> bitext.append(AlignedSent(['fasse', 'zusammen'], ['summarize']))
 |  >>> src_classes = {'the': 0, 'a': 0, 'small': 1, 'big': 1, 'house': 2, 'book': 2, 'is': 3, 'was': 3, 'i': 4, 'summarize': 5 }
 |  >>> trg_classes = {'das': 0, 'ein': 0, 'haus': 1, 'buch': 1, 'klein': 2, 'groß': 2, 'ist': 3, 'war': 3, 'ja': 4, 'ich': 5, 'fasse': 6, 'zusammen': 6 }
 |
 |  >>> ibm4 = IBMModel4(bitext, 5, src_classes, trg_classes)
 |
 |  >>> print(round(ibm4.translation_table['buch']['book'], 3))
 |  1.0
 |  >>> print(round(ibm4.translation_table['das']['book'], 3))
 |  0.0
 |  >>> print(round(ibm4.translation_table['ja'][None], 3))
 |  1.0
 |
 |  >>> print(round(ibm4.head_distortion_table[1][0][1], 3))
 |  1.0
 |  >>> print(round(ibm4.head_distortion_table[2][0][1], 3))
 |  0.0
 |  >>> print(round(ibm4.non_head_distortion_table[3][6], 3))
 |  0.5
 |
 |  >>> print(round(ibm4.fertility_table[2]['summarize'], 3))
 |  1.0
 |  >>> print(round(ibm4.fertility_table[1]['book'], 3))
 |  1.0
 |
 |  >>> print(round(ibm4.p1, 3))
 |  0.033
 |
 |  >>> test_sentence = bitext[2]
 |  >>> test_sentence.words
 |  ['das', 'buch', 'ist', 'ja', 'klein']
 |  >>> test_sentence.mots
 |  ['the', 'book', 'is', 'small']
 |  >>> test_sentence.alignment
 |  Alignment([(0, 0), (1, 1), (2, 2), (3, None), (4, 3)])
 |
 |  Method resolution order:
 |      IBMModel4
 |      nltk.translate.ibm_model.IBMModel
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, sentence_aligned_corpus, iterations, source_word_classes, target_word_classes, probability_tables=None)
 |      Train on ``sentence_aligned_corpus`` and create a lexical
 |      translation model, distortion models, a fertility model, and a
 |      model for generating NULL-aligned words.
 |
 |      Translation direction is from ``AlignedSent.mots`` to
 |      ``AlignedSent.words``.
 |
 |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
 |      :type sentence_aligned_corpus: list(AlignedSent)
 |
 |      :param iterations: Number of iterations to run training algorithm
 |      :type iterations: int
 |
 |      :param source_word_classes: Lookup table that maps a source word
 |          to its word class, the latter represented by an integer id
 |      :type source_word_classes: dict[str]: int
 |
 |      :param target_word_classes: Lookup table that maps a target word
 |          to its word class, the latter represented by an integer id
 |      :type target_word_classes: dict[str]: int
 |
 |      :param probability_tables: Optional. Use this to pass in custom
 |          probability values. If not specified, probabilities will be
 |          set to a uniform distribution, or some other sensible value.
 |          If specified, all the following entries must be present:
 |          ``translation_table``, ``alignment_table``,
 |          ``fertility_table``, ``p1``, ``head_distortion_table``,
 |          ``non_head_distortion_table``. See ``IBMModel`` and
 |          ``IBMModel4`` for the type and purpose of these tables.
 |      :type probability_tables: dict[str]: object
 |
 |  maximize_distortion_probabilities(self, counts)
 |
 |  prob_t_a_given_s(self, alignment_info)
 |      Probability of target sentence and an alignment given the
 |      source sentence
 |
 |  reset_probabilities(self)
 |
 |  set_uniform_probabilities(self, sentence_aligned_corpus)
 |      Set distortion probabilities uniformly to
 |      1 / cardinality of displacement values
 |
 |  train(self, parallel_corpus)
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  model4_prob_t_a_given_s(alignment_info, ibm_model)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
 |      Finds the best alignment according to IBM Model 2
 |
 |      Used as a starting point for hill climbing in Models 3 and
 |      above, because it is easier to compute than the best alignments
 |      in higher models
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to be word-aligned
 |      :type sentence_pair: AlignedSent
 |
 |      :param j_pegged: If specified, the alignment point of j_pegged
 |          will be fixed to i_pegged
 |      :type j_pegged: int
 |
 |      :param i_pegged: Alignment point to j_pegged
 |      :type i_pegged: int
 |
 |  hillclimb(self, alignment_info, j_pegged=None)
 |      Starting from the alignment in ``alignment_info``, look at
 |      neighboring alignments iteratively for the best one
 |
 |      There is no guarantee that the best alignment in the alignment
 |      space will be found, because the algorithm might be stuck in a
 |      local maximum.
 |
 |      :param j_pegged: If specified, the search will be constrained to
 |          alignments where ``j_pegged`` remains unchanged
 |      :type j_pegged: int
 |
 |      :return: The best alignment found from hill climbing
 |      :rtype: AlignmentInfo
 |
 |  init_vocab(self, sentence_aligned_corpus)
 |
 |  maximize_fertility_probabilities(self, counts)
 |
 |  maximize_lexical_translation_probabilities(self, counts)
 |
 |  maximize_null_generation_probabilities(self, counts)
 |
 |  neighboring(self, alignment_info, j_pegged=None)
 |      Determine the neighbors of ``alignment_info``, obtained by
 |      moving or swapping one alignment point
 |
 |      :param j_pegged: If specified, neighbors that have a different
 |          alignment point from j_pegged will not be considered
 |      :type j_pegged: int
 |
 |      :return: A set neighboring alignments represented by their
 |          ``AlignmentInfo``
 |      :rtype: set(AlignmentInfo)
 |
 |  prob_of_alignments(self, alignments)
 |
 |  sample(self, sentence_pair)
 |      Sample the most probable alignments from the entire alignment
 |      space
 |
 |      First, determine the best alignment according to IBM Model 2.
 |      With this initial alignment, use hill climbing to determine the
 |      best alignment according to a higher IBM Model. Add this
 |      alignment and its neighbors to the sample set. Repeat this
 |      process with other initial alignments obtained by pegging an
 |      alignment point.
 |
 |      Hill climbing may be stuck in a local maxima, hence the pegging
 |      and trying out of different alignments.
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to generate a sample of alignments from
 |      :type sentence_pair: AlignedSent
 |
 |      :return: A set of best alignments represented by their ``AlignmentInfo``
 |          and the best alignment of the set for convenience
 |      :rtype: set(AlignmentInfo), AlignmentInfo
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  MIN_PROB = 1e-12
nltk.IBMModel5
Python Library Documentation: class IBMModel5 in module nltk.translate.ibm5

class IBMModel5(nltk.translate.ibm_model.IBMModel)
 |  IBMModel5(sentence_aligned_corpus, iterations, source_word_classes, target_word_classes, probability_tables=None)
 |
 |  Translation model that keeps track of vacant positions in the target
 |  sentence to decide where to place translated words
 |
 |  >>> bitext = []
 |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus', 'war', 'ja', 'groß'], ['the', 'house', 'was', 'big']))
 |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['ein', 'haus', 'ist', 'klein'], ['a', 'house', 'is', 'small']))
 |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
 |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
 |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
 |  >>> bitext.append(AlignedSent(['ich', 'fasse', 'das', 'buch', 'zusammen'], ['i', 'summarize', 'the', 'book']))
 |  >>> bitext.append(AlignedSent(['fasse', 'zusammen'], ['summarize']))
 |  >>> src_classes = {'the': 0, 'a': 0, 'small': 1, 'big': 1, 'house': 2, 'book': 2, 'is': 3, 'was': 3, 'i': 4, 'summarize': 5 }
 |  >>> trg_classes = {'das': 0, 'ein': 0, 'haus': 1, 'buch': 1, 'klein': 2, 'groß': 2, 'ist': 3, 'war': 3, 'ja': 4, 'ich': 5, 'fasse': 6, 'zusammen': 6 }
 |
 |  >>> ibm5 = IBMModel5(bitext, 5, src_classes, trg_classes)
 |
 |  >>> print(round(ibm5.head_vacancy_table[1][1][1], 3))
 |  1.0
 |  >>> print(round(ibm5.head_vacancy_table[2][1][1], 3))
 |  0.0
 |  >>> print(round(ibm5.non_head_vacancy_table[3][3][6], 3))
 |  1.0
 |
 |  >>> print(round(ibm5.fertility_table[2]['summarize'], 3))
 |  1.0
 |  >>> print(round(ibm5.fertility_table[1]['book'], 3))
 |  1.0
 |
 |  >>> print(round(ibm5.p1, 3))
 |  0.033
 |
 |  >>> test_sentence = bitext[2]
 |  >>> test_sentence.words
 |  ['das', 'buch', 'ist', 'ja', 'klein']
 |  >>> test_sentence.mots
 |  ['the', 'book', 'is', 'small']
 |  >>> test_sentence.alignment
 |  Alignment([(0, 0), (1, 1), (2, 2), (3, None), (4, 3)])
 |
 |  Method resolution order:
 |      IBMModel5
 |      nltk.translate.ibm_model.IBMModel
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, sentence_aligned_corpus, iterations, source_word_classes, target_word_classes, probability_tables=None)
 |      Train on ``sentence_aligned_corpus`` and create a lexical
 |      translation model, vacancy models, a fertility model, and a
 |      model for generating NULL-aligned words.
 |
 |      Translation direction is from ``AlignedSent.mots`` to
 |      ``AlignedSent.words``.
 |
 |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
 |      :type sentence_aligned_corpus: list(AlignedSent)
 |
 |      :param iterations: Number of iterations to run training algorithm
 |      :type iterations: int
 |
 |      :param source_word_classes: Lookup table that maps a source word
 |          to its word class, the latter represented by an integer id
 |      :type source_word_classes: dict[str]: int
 |
 |      :param target_word_classes: Lookup table that maps a target word
 |          to its word class, the latter represented by an integer id
 |      :type target_word_classes: dict[str]: int
 |
 |      :param probability_tables: Optional. Use this to pass in custom
 |          probability values. If not specified, probabilities will be
 |          set to a uniform distribution, or some other sensible value.
 |          If specified, all the following entries must be present:
 |          ``translation_table``, ``alignment_table``,
 |          ``fertility_table``, ``p1``, ``head_distortion_table``,
 |          ``non_head_distortion_table``, ``head_vacancy_table``,
 |          ``non_head_vacancy_table``. See ``IBMModel``, ``IBMModel4``,
 |          and ``IBMModel5`` for the type and purpose of these tables.
 |      :type probability_tables: dict[str]: object
 |
 |  hillclimb(self, alignment_info, j_pegged=None)
 |      Starting from the alignment in ``alignment_info``, look at
 |      neighboring alignments iteratively for the best one, according
 |      to Model 4
 |
 |      Note that Model 4 scoring is used instead of Model 5 because the
 |      latter is too expensive to compute.
 |
 |      There is no guarantee that the best alignment in the alignment
 |      space will be found, because the algorithm might be stuck in a
 |      local maximum.
 |
 |      :param j_pegged: If specified, the search will be constrained to
 |          alignments where ``j_pegged`` remains unchanged
 |      :type j_pegged: int
 |
 |      :return: The best alignment found from hill climbing
 |      :rtype: AlignmentInfo
 |
 |  maximize_vacancy_probabilities(self, counts)
 |
 |  prob_t_a_given_s(self, alignment_info)
 |      Probability of target sentence and an alignment given the
 |      source sentence
 |
 |  prune(self, alignment_infos)
 |      Removes alignments from ``alignment_infos`` that have
 |      substantially lower Model 4 scores than the best alignment
 |
 |      :return: Pruned alignments
 |      :rtype: set(AlignmentInfo)
 |
 |  reset_probabilities(self)
 |
 |  sample(self, sentence_pair)
 |      Sample the most probable alignments from the entire alignment
 |      space according to Model 4
 |
 |      Note that Model 4 scoring is used instead of Model 5 because the
 |      latter is too expensive to compute.
 |
 |      First, determine the best alignment according to IBM Model 2.
 |      With this initial alignment, use hill climbing to determine the
 |      best alignment according to a IBM Model 4. Add this
 |      alignment and its neighbors to the sample set. Repeat this
 |      process with other initial alignments obtained by pegging an
 |      alignment point. Finally, prune alignments that have
 |      substantially lower Model 4 scores than the best alignment.
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to generate a sample of alignments from
 |      :type sentence_pair: AlignedSent
 |
 |      :return: A set of best alignments represented by their ``AlignmentInfo``
 |          and the best alignment of the set for convenience
 |      :rtype: set(AlignmentInfo), AlignmentInfo
 |
 |  set_uniform_probabilities(self, sentence_aligned_corpus)
 |      Set vacancy probabilities uniformly to
 |      1 / cardinality of vacancy difference values
 |
 |  train(self, parallel_corpus)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MIN_SCORE_FACTOR = 0.2
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
 |      Finds the best alignment according to IBM Model 2
 |
 |      Used as a starting point for hill climbing in Models 3 and
 |      above, because it is easier to compute than the best alignments
 |      in higher models
 |
 |      :param sentence_pair: Source and target language sentence pair
 |          to be word-aligned
 |      :type sentence_pair: AlignedSent
 |
 |      :param j_pegged: If specified, the alignment point of j_pegged
 |          will be fixed to i_pegged
 |      :type j_pegged: int
 |
 |      :param i_pegged: Alignment point to j_pegged
 |      :type i_pegged: int
 |
 |  init_vocab(self, sentence_aligned_corpus)
 |
 |  maximize_fertility_probabilities(self, counts)
 |
 |  maximize_lexical_translation_probabilities(self, counts)
 |
 |  maximize_null_generation_probabilities(self, counts)
 |
 |  neighboring(self, alignment_info, j_pegged=None)
 |      Determine the neighbors of ``alignment_info``, obtained by
 |      moving or swapping one alignment point
 |
 |      :param j_pegged: If specified, neighbors that have a different
 |          alignment point from j_pegged will not be considered
 |      :type j_pegged: int
 |
 |      :return: A set neighboring alignments represented by their
 |          ``AlignmentInfo``
 |      :rtype: set(AlignmentInfo)
 |
 |  prob_of_alignments(self, alignments)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
 |
 |  MIN_PROB = 1e-12
nltk.ISRIStemmer
Python Library Documentation: class ISRIStemmer in module nltk.stem.isri

class ISRIStemmer(nltk.stem.api.StemmerI)
 |  ISRI Arabic stemmer based on algorithm: Arabic Stemming without a root dictionary.
 |  Information Science Research Institute. University of Nevada, Las Vegas, USA.
 |
 |  A few minor modifications have been made to ISRI basic algorithm.
 |  See the source code of this module for more information.
 |
 |  isri.stem(token) returns Arabic root for the given token.
 |
 |  The ISRI Stemmer requires that all tokens have Unicode string types.
 |  If you use Python IDLE on Arabic Windows you have to decode text first
 |  using Arabic '1256' coding.
 |
 |  Method resolution order:
 |      ISRIStemmer
 |      nltk.stem.api.StemmerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  end_w5(self, word)
 |      ending step (word of length five)
 |
 |  end_w6(self, word)
 |      ending step (word of length six)
 |
 |  norm(self, word, num=3)
 |      normalization:
 |      num=1  normalize diacritics
 |      num=2  normalize initial hamza
 |      num=3  both 1&2
 |
 |  pre1(self, word)
 |      normalize short prefix
 |
 |  pre32(self, word)
 |      remove length three and length two prefixes in this order
 |
 |  pro_w4(self, word)
 |      process length four patterns and extract length three roots
 |
 |  pro_w53(self, word)
 |      process length five patterns and extract length three roots
 |
 |  pro_w54(self, word)
 |      process length five patterns and extract length four roots
 |
 |  pro_w6(self, word)
 |      process length six patterns and extract length three roots
 |
 |  pro_w64(self, word)
 |      process length six patterns and extract length four roots
 |
 |  stem(self, token)
 |      Stemming a word token using the ISRI stemmer.
 |
 |  suf1(self, word)
 |      normalize short sufix
 |
 |  suf32(self, word)
 |      remove length three and length two suffixes in this order
 |
 |  waw(self, word)
 |      remove connective ‘و’ if it precedes a word beginning with ‘و’
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.stem.api.StemmerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ImmutableMultiParentedTree
Python Library Documentation: class ImmutableMultiParentedTree in module nltk.tree.immutable

class ImmutableMultiParentedTree(ImmutableTree, nltk.tree.parented.MultiParentedTree)
 |  ImmutableMultiParentedTree(node, children=None)
 |
 |  Method resolution order:
 |      ImmutableMultiParentedTree
 |      ImmutableTree
 |      nltk.tree.parented.MultiParentedTree
 |      nltk.tree.parented.AbstractParentedTree
 |      nltk.tree.tree.Tree
 |      builtins.list
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ImmutableTree:
 |
 |  __delitem__(self, index)
 |      Delete self[key].
 |
 |  __delslice__(self, i, j)
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __iadd__(self, other)
 |      Implement self+=value.
 |
 |  __imul__(self, other)
 |      Implement self*=value.
 |
 |  __init__(self, node, children=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __setitem__(self, index, value)
 |      Set self[key] to value.
 |
 |  __setslice__(self, i, j, value)
 |
 |  append(self, v)
 |      Append object to the end of the list.
 |
 |  extend(self, v)
 |      Extend list by appending elements from the iterable.
 |
 |  pop(self, v=None)
 |      Remove and return item at index (default last).
 |
 |      Raises IndexError if list is empty or index is out of range.
 |
 |  remove(self, v)
 |      Remove first occurrence of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  reverse(self)
 |      Reverse *IN PLACE*.
 |
 |  set_label(self, value)
 |      Set the node label.  This will only succeed the first time the
 |      node label is set, which should occur in ImmutableTree.__init__().
 |
 |  sort(self)
 |      Sort the list in ascending order and return None.
 |
 |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
 |      order of two equal elements is maintained).
 |
 |      If a key function is given, apply it once to each list item and sort them,
 |      ascending or descending, according to their function values.
 |
 |      The reverse flag can be set to sort in descending order.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.parented.MultiParentedTree:
 |
 |  left_siblings(self)
 |      A list of all left siblings of this tree, in any of its parent
 |      trees.  A tree may be its own left sibling if it is used as
 |      multiple contiguous children of the same parent.  A tree may
 |      appear multiple times in this list if it is the left sibling
 |      of this tree with respect to multiple parents.
 |
 |      :type: list(MultiParentedTree)
 |
 |  parent_indices(self, parent)
 |      Return a list of the indices where this tree occurs as a child
 |      of ``parent``.  If this child does not occur as a child of
 |      ``parent``, then the empty list is returned.  The following is
 |      always true::
 |
 |        for parent_index in ptree.parent_indices(parent):
 |            parent[parent_index] is ptree
 |
 |  parents(self)
 |      The set of parents of this tree.  If this tree has no parents,
 |      then ``parents`` is the empty set.  To check if a tree is used
 |      as multiple children of the same parent, use the
 |      ``parent_indices()`` method.
 |
 |      :type: list(MultiParentedTree)
 |
 |  right_siblings(self)
 |      A list of all right siblings of this tree, in any of its parent
 |      trees.  A tree may be its own right sibling if it is used as
 |      multiple contiguous children of the same parent.  A tree may
 |      appear multiple times in this list if it is the right sibling
 |      of this tree with respect to multiple parents.
 |
 |      :type: list(MultiParentedTree)
 |
 |  roots(self)
 |      The set of all roots of this tree.  This set is formed by
 |      tracing all possible parent paths until trees with no parents
 |      are found.
 |
 |      :type: list(MultiParentedTree)
 |
 |  treepositions(self, root)
 |      Return a list of all tree positions that can be used to reach
 |      this multi-parented tree starting from ``root``.  I.e., the
 |      following is always true::
 |
 |        for treepos in ptree.treepositions(root):
 |            root[treepos] is ptree
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.parented.AbstractParentedTree:
 |
 |  __getnewargs__(self)
 |      Method used by the pickle module when un-pickling.
 |      This method provides the arguments passed to ``__new__``
 |      upon un-pickling. Without this method, ParentedTree instances
 |      cannot be pickled and unpickled in Python 3.7+ onwards.
 |
 |      :return: Tuple of arguments for ``__new__``, i.e. the label
 |          and the children of this node.
 |      :rtype: Tuple[Any, List[AbstractParentedTree]]
 |
 |  insert(self, index, child)
 |      Insert object before index.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.tree.Tree:
 |
 |  __add__(self, v)
 |      Return self+value.
 |
 |  __copy__(self)
 |
 |  __deepcopy__(self, memo)
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__ lambda self, other
 |
 |  __getitem__(self, index)
 |      Return self[index].
 |
 |  __gt__ lambda self, other
 |
 |  __le__ lambda self, other
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, v)
 |      Return self*value.
 |
 |  __ne__ lambda self, other
 |      # @total_ordering doesn't work here, since the class inherits from a builtin class
 |
 |  __radd__(self, v)
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __rmul__(self, v)
 |      Return value*self.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
 |      This method can modify a tree in three ways:
 |
 |        1. Convert a tree into its Chomsky Normal Form (CNF)
 |           equivalent -- Every subtree has either two non-terminals
 |           or one terminal as its children.  This process requires
 |           the creation of more"artificial" non-terminal nodes.
 |        2. Markov (vertical) smoothing of children in new artificial
 |           nodes
 |        3. Horizontal (parent) annotation of nodes
 |
 |      :param factor: Right or left factoring method (default = "right")
 |      :type  factor: str = [left|right]
 |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
 |      :type  horzMarkov: int | None
 |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
 |      :type  vertMarkov: int | None
 |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
 |                        original subtree from the child nodes that have yet to be expanded (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string used to separate the node representation from its vertical annotation
 |      :type  parentChar: str
 |
 |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
 |      Collapse subtrees with a single child (ie. unary productions)
 |      into a new non-terminal (Tree node) joined by 'joinChar'.
 |      This is useful when working with algorithms that do not allow
 |      unary productions, and completely removing the unary productions
 |      would require loss of useful information.  The Tree is modified
 |      directly (since it is passed by reference) and no value is returned.
 |
 |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
 |                          Part-of-Speech tags) since they are always unary productions
 |      :type  collapsePOS: bool
 |      :param collapseRoot: 'False' (default) will not modify the root production
 |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
 |                           to the TOP -> productions.
 |      :type collapseRoot: bool
 |      :param joinChar: A string used to connect collapsed node values (default = "+")
 |      :type  joinChar: str
 |
 |  copy(self, deep=False)
 |      Return a shallow copy of the list.
 |
 |  draw(self)
 |      Open a new window containing a graphical diagram of this tree.
 |
 |  flatten(self)
 |      Return a flat version of the tree, with all non-root non-terminals removed.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> print(t.flatten())
 |          (S the dog chased the cat)
 |
 |      :return: a tree consisting of this tree's root connected directly to
 |          its leaves, omitting all intervening non-terminal nodes.
 |      :rtype: Tree
 |
 |  freeze(self, leaf_freezer=None)
 |
 |  height(self)
 |      Return the height of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.height()
 |          5
 |          >>> print(t[0,0])
 |          (D the)
 |          >>> t[0,0].height()
 |          2
 |
 |      :return: The height of this tree.  The height of a tree
 |          containing no children is 1; the height of a tree
 |          containing only leaves is 2; and the height of any other
 |          tree is one plus the maximum of its children's
 |          heights.
 |      :rtype: int
 |
 |  label(self)
 |      Return the node label of the tree.
 |
 |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
 |          >>> t.label()
 |          'S'
 |
 |      :return: the node label (typically a string)
 |      :rtype: any
 |
 |  leaf_treeposition(self, index)
 |      :return: The tree position of the ``index``-th leaf in this
 |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
 |          ``self[tp]==self.leaves()[i]``.
 |
 |      :raise IndexError: If this tree contains fewer than ``index+1``
 |          leaves, or if ``index<0``.
 |
 |  leaves(self)
 |      Return the leaves of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.leaves()
 |          ['the', 'dog', 'chased', 'the', 'cat']
 |
 |      :return: a list containing this tree's leaves.
 |          The order reflects the order of the
 |          leaves in the tree's hierarchical structure.
 |      :rtype: list
 |
 |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
 |      :return: A pretty-printed string representation of this tree.
 |      :rtype: str
 |      :param margin: The right margin at which to do line-wrapping.
 |      :type margin: int
 |      :param indent: The indentation level at which printing
 |          begins.  This number is used to decide how far to indent
 |          subsequent lines.
 |      :type indent: int
 |      :param nodesep: A string that is used to separate the node
 |          from the children.  E.g., the default value ``':'`` gives
 |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
 |
 |  pformat_latex_qtree(self)
 |      Returns a representation of the tree compatible with the
 |      LaTeX qtree package. This consists of the string ``\Tree``
 |      followed by the tree represented in bracketed notation.
 |
 |      For example, the following result was generated from a parse tree of
 |      the sentence ``The announcement astounded us``::
 |
 |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
 |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
 |
 |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
 |      style file for the qtree package.
 |
 |      :return: A latex qtree representation of this tree.
 |      :rtype: str
 |
 |  pos(self)
 |      Return a sequence of pos-tagged words extracted from the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.pos()
 |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
 |
 |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
 |          The order reflects the order of the leaves in the tree's hierarchical structure.
 |      :rtype: list(tuple)
 |
 |  pprint(self, **kwargs)
 |      Print a string representation of this Tree to 'stream'
 |
 |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
 |      Pretty-print this tree as ASCII or Unicode art.
 |      For explanation of the arguments, see the documentation for
 |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
 |
 |  productions(self)
 |      Generate the productions that correspond to the non-terminal nodes of the tree.
 |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
 |      form P -> C1 C2 ... Cn.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
 |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
 |          NP -> D N, D -> 'the', N -> 'cat']
 |
 |      :rtype: list(Production)
 |
 |  subtrees(self, filter=None)
 |      Generate all the subtrees of this tree, optionally restricted
 |      to trees matching the filter function.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> for s in t.subtrees(lambda t: t.height() == 2):
 |          ...     print(s)
 |          (D the)
 |          (N dog)
 |          (V chased)
 |          (D the)
 |          (N cat)
 |
 |      :type filter: function
 |      :param filter: the function to filter all local trees
 |
 |  treeposition_spanning_leaves(self, start, end)
 |      :return: The tree position of the lowest descendant of this
 |          tree that dominates ``self.leaves()[start:end]``.
 |      :raise ValueError: if ``end <= start``
 |
 |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
 |      This method modifies the tree in three ways:
 |
 |        1. Transforms a tree in Chomsky Normal Form back to its
 |           original structure (branching greater than two)
 |        2. Removes any parent annotation (if it exists)
 |        3. (optional) expands unary subtrees (if previously
 |           collapsed with collapseUnary(...) )
 |
 |      :param expandUnary: Flag to expand unary or not (default = True)
 |      :type  expandUnary: bool
 |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
 |      :type  parentChar: str
 |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
 |      :type  unaryChar: str
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from nltk.tree.tree.Tree:
 |
 |  convert(tree)
 |      Convert a tree between different subtypes of Tree.  ``cls`` determines
 |      which class will be used to encode the new tree.
 |
 |      :type tree: Tree
 |      :param tree: The tree that should be converted.
 |      :return: The new Tree.
 |
 |  fromlist(l)
 |      :type l: list
 |      :param l: a tree represented as nested lists
 |
 |      :return: A tree corresponding to the list representation ``l``.
 |      :rtype: Tree
 |
 |      Convert nested lists to a NLTK Tree
 |
 |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
 |      Read a bracketed tree string and return the resulting tree.
 |      Trees are represented as nested brackettings, such as::
 |
 |        (S (NP (NNP John)) (VP (V runs)))
 |
 |      :type s: str
 |      :param s: The string to read
 |
 |      :type brackets: str (length=2)
 |      :param brackets: The bracket characters used to mark the
 |          beginning and end of trees and subtrees.
 |
 |      :type read_node: function
 |      :type read_leaf: function
 |      :param read_node, read_leaf: If specified, these functions
 |          are applied to the substrings of ``s`` corresponding to
 |          nodes and leaves (respectively) to obtain the values for
 |          those nodes and leaves.  They should have the following
 |          signature:
 |
 |             read_node(str) -> value
 |
 |          For example, these functions could be used to process nodes
 |          and leaves whose values should be some type other than
 |          string (such as ``FeatStruct``).
 |          Note that by default, node strings and leaf strings are
 |          delimited by whitespace and brackets; to override this
 |          default, use the ``node_pattern`` and ``leaf_pattern``
 |          arguments.
 |
 |      :type node_pattern: str
 |      :type leaf_pattern: str
 |      :param node_pattern, leaf_pattern: Regular expression patterns
 |          used to find node and leaf substrings in ``s``.  By
 |          default, both nodes patterns are defined to match any
 |          sequence of non-whitespace non-bracket characters.
 |
 |      :type remove_empty_top_bracketing: bool
 |      :param remove_empty_top_bracketing: If the resulting tree has
 |          an empty node label, and is length one, then return its
 |          single child instead.  This is useful for treebank trees,
 |          which sometimes contain an extra level of bracketing.
 |
 |      :return: A tree corresponding to the string representation ``s``.
 |          If this class method is called using a subclass of Tree,
 |          then it will return a tree of that type.
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tree.tree.Tree:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  node
 |      Outdated method to access the node value; use the label() method instead.
 |
 |      @deprecated: Use label() instead
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.list:
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the list.
 |
 |  __sizeof__(self, /)
 |      Return the size of the list in memory, in bytes.
 |
 |  clear(self, /)
 |      Remove all items from list.
 |
 |  count(self, value, /)
 |      Return number of occurrences of value.
 |
 |  index(self, value, start=0, stop=9223372036854775807, /)
 |      Return first index of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.list:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.list:
 |
 |  __new__(*args, **kwargs) class method of builtins.list
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.ImmutableParentedTree
Python Library Documentation: class ImmutableParentedTree in module nltk.tree.immutable

class ImmutableParentedTree(ImmutableTree, nltk.tree.parented.ParentedTree)
 |  ImmutableParentedTree(node, children=None)
 |
 |  Method resolution order:
 |      ImmutableParentedTree
 |      ImmutableTree
 |      nltk.tree.parented.ParentedTree
 |      nltk.tree.parented.AbstractParentedTree
 |      nltk.tree.tree.Tree
 |      builtins.list
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ImmutableTree:
 |
 |  __delitem__(self, index)
 |      Delete self[key].
 |
 |  __delslice__(self, i, j)
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __iadd__(self, other)
 |      Implement self+=value.
 |
 |  __imul__(self, other)
 |      Implement self*=value.
 |
 |  __init__(self, node, children=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __setitem__(self, index, value)
 |      Set self[key] to value.
 |
 |  __setslice__(self, i, j, value)
 |
 |  append(self, v)
 |      Append object to the end of the list.
 |
 |  extend(self, v)
 |      Extend list by appending elements from the iterable.
 |
 |  pop(self, v=None)
 |      Remove and return item at index (default last).
 |
 |      Raises IndexError if list is empty or index is out of range.
 |
 |  remove(self, v)
 |      Remove first occurrence of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  reverse(self)
 |      Reverse *IN PLACE*.
 |
 |  set_label(self, value)
 |      Set the node label.  This will only succeed the first time the
 |      node label is set, which should occur in ImmutableTree.__init__().
 |
 |  sort(self)
 |      Sort the list in ascending order and return None.
 |
 |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
 |      order of two equal elements is maintained).
 |
 |      If a key function is given, apply it once to each list item and sort them,
 |      ascending or descending, according to their function values.
 |
 |      The reverse flag can be set to sort in descending order.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.parented.ParentedTree:
 |
 |  copy(self, deep=False)
 |      Return a shallow copy of the list.
 |
 |  left_sibling(self)
 |      The left sibling of this tree, or None if it has none.
 |
 |  parent(self)
 |      The parent of this tree, or None if it has no parent.
 |
 |  parent_index(self)
 |      The index of this tree in its parent.  I.e.,
 |      ``ptree.parent()[ptree.parent_index()] is ptree``.  Note that
 |      ``ptree.parent_index()`` is not necessarily equal to
 |      ``ptree.parent.index(ptree)``, since the ``index()`` method
 |      returns the first child that is equal to its argument.
 |
 |  right_sibling(self)
 |      The right sibling of this tree, or None if it has none.
 |
 |  root(self)
 |      The root of this tree.  I.e., the unique ancestor of this tree
 |      whose parent is None.  If ``ptree.parent()`` is None, then
 |      ``ptree`` is its own root.
 |
 |  treeposition(self)
 |      The tree position of this tree, relative to the root of the
 |      tree.  I.e., ``ptree.root[ptree.treeposition] is ptree``.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.parented.AbstractParentedTree:
 |
 |  __getnewargs__(self)
 |      Method used by the pickle module when un-pickling.
 |      This method provides the arguments passed to ``__new__``
 |      upon un-pickling. Without this method, ParentedTree instances
 |      cannot be pickled and unpickled in Python 3.7+ onwards.
 |
 |      :return: Tuple of arguments for ``__new__``, i.e. the label
 |          and the children of this node.
 |      :rtype: Tuple[Any, List[AbstractParentedTree]]
 |
 |  insert(self, index, child)
 |      Insert object before index.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.tree.Tree:
 |
 |  __add__(self, v)
 |      Return self+value.
 |
 |  __copy__(self)
 |
 |  __deepcopy__(self, memo)
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__ lambda self, other
 |
 |  __getitem__(self, index)
 |      Return self[index].
 |
 |  __gt__ lambda self, other
 |
 |  __le__ lambda self, other
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, v)
 |      Return self*value.
 |
 |  __ne__ lambda self, other
 |      # @total_ordering doesn't work here, since the class inherits from a builtin class
 |
 |  __radd__(self, v)
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __rmul__(self, v)
 |      Return value*self.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
 |      This method can modify a tree in three ways:
 |
 |        1. Convert a tree into its Chomsky Normal Form (CNF)
 |           equivalent -- Every subtree has either two non-terminals
 |           or one terminal as its children.  This process requires
 |           the creation of more"artificial" non-terminal nodes.
 |        2. Markov (vertical) smoothing of children in new artificial
 |           nodes
 |        3. Horizontal (parent) annotation of nodes
 |
 |      :param factor: Right or left factoring method (default = "right")
 |      :type  factor: str = [left|right]
 |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
 |      :type  horzMarkov: int | None
 |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
 |      :type  vertMarkov: int | None
 |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
 |                        original subtree from the child nodes that have yet to be expanded (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string used to separate the node representation from its vertical annotation
 |      :type  parentChar: str
 |
 |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
 |      Collapse subtrees with a single child (ie. unary productions)
 |      into a new non-terminal (Tree node) joined by 'joinChar'.
 |      This is useful when working with algorithms that do not allow
 |      unary productions, and completely removing the unary productions
 |      would require loss of useful information.  The Tree is modified
 |      directly (since it is passed by reference) and no value is returned.
 |
 |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
 |                          Part-of-Speech tags) since they are always unary productions
 |      :type  collapsePOS: bool
 |      :param collapseRoot: 'False' (default) will not modify the root production
 |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
 |                           to the TOP -> productions.
 |      :type collapseRoot: bool
 |      :param joinChar: A string used to connect collapsed node values (default = "+")
 |      :type  joinChar: str
 |
 |  draw(self)
 |      Open a new window containing a graphical diagram of this tree.
 |
 |  flatten(self)
 |      Return a flat version of the tree, with all non-root non-terminals removed.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> print(t.flatten())
 |          (S the dog chased the cat)
 |
 |      :return: a tree consisting of this tree's root connected directly to
 |          its leaves, omitting all intervening non-terminal nodes.
 |      :rtype: Tree
 |
 |  freeze(self, leaf_freezer=None)
 |
 |  height(self)
 |      Return the height of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.height()
 |          5
 |          >>> print(t[0,0])
 |          (D the)
 |          >>> t[0,0].height()
 |          2
 |
 |      :return: The height of this tree.  The height of a tree
 |          containing no children is 1; the height of a tree
 |          containing only leaves is 2; and the height of any other
 |          tree is one plus the maximum of its children's
 |          heights.
 |      :rtype: int
 |
 |  label(self)
 |      Return the node label of the tree.
 |
 |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
 |          >>> t.label()
 |          'S'
 |
 |      :return: the node label (typically a string)
 |      :rtype: any
 |
 |  leaf_treeposition(self, index)
 |      :return: The tree position of the ``index``-th leaf in this
 |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
 |          ``self[tp]==self.leaves()[i]``.
 |
 |      :raise IndexError: If this tree contains fewer than ``index+1``
 |          leaves, or if ``index<0``.
 |
 |  leaves(self)
 |      Return the leaves of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.leaves()
 |          ['the', 'dog', 'chased', 'the', 'cat']
 |
 |      :return: a list containing this tree's leaves.
 |          The order reflects the order of the
 |          leaves in the tree's hierarchical structure.
 |      :rtype: list
 |
 |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
 |      :return: A pretty-printed string representation of this tree.
 |      :rtype: str
 |      :param margin: The right margin at which to do line-wrapping.
 |      :type margin: int
 |      :param indent: The indentation level at which printing
 |          begins.  This number is used to decide how far to indent
 |          subsequent lines.
 |      :type indent: int
 |      :param nodesep: A string that is used to separate the node
 |          from the children.  E.g., the default value ``':'`` gives
 |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
 |
 |  pformat_latex_qtree(self)
 |      Returns a representation of the tree compatible with the
 |      LaTeX qtree package. This consists of the string ``\Tree``
 |      followed by the tree represented in bracketed notation.
 |
 |      For example, the following result was generated from a parse tree of
 |      the sentence ``The announcement astounded us``::
 |
 |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
 |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
 |
 |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
 |      style file for the qtree package.
 |
 |      :return: A latex qtree representation of this tree.
 |      :rtype: str
 |
 |  pos(self)
 |      Return a sequence of pos-tagged words extracted from the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.pos()
 |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
 |
 |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
 |          The order reflects the order of the leaves in the tree's hierarchical structure.
 |      :rtype: list(tuple)
 |
 |  pprint(self, **kwargs)
 |      Print a string representation of this Tree to 'stream'
 |
 |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
 |      Pretty-print this tree as ASCII or Unicode art.
 |      For explanation of the arguments, see the documentation for
 |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
 |
 |  productions(self)
 |      Generate the productions that correspond to the non-terminal nodes of the tree.
 |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
 |      form P -> C1 C2 ... Cn.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
 |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
 |          NP -> D N, D -> 'the', N -> 'cat']
 |
 |      :rtype: list(Production)
 |
 |  subtrees(self, filter=None)
 |      Generate all the subtrees of this tree, optionally restricted
 |      to trees matching the filter function.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> for s in t.subtrees(lambda t: t.height() == 2):
 |          ...     print(s)
 |          (D the)
 |          (N dog)
 |          (V chased)
 |          (D the)
 |          (N cat)
 |
 |      :type filter: function
 |      :param filter: the function to filter all local trees
 |
 |  treeposition_spanning_leaves(self, start, end)
 |      :return: The tree position of the lowest descendant of this
 |          tree that dominates ``self.leaves()[start:end]``.
 |      :raise ValueError: if ``end <= start``
 |
 |  treepositions(self, order='preorder')
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.treepositions() # doctest: +ELLIPSIS
 |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
 |          >>> for pos in t.treepositions('leaves'):
 |          ...     t[pos] = t[pos][::-1].upper()
 |          >>> print(t)
 |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
 |
 |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
 |          ``leaves``.
 |
 |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
 |      This method modifies the tree in three ways:
 |
 |        1. Transforms a tree in Chomsky Normal Form back to its
 |           original structure (branching greater than two)
 |        2. Removes any parent annotation (if it exists)
 |        3. (optional) expands unary subtrees (if previously
 |           collapsed with collapseUnary(...) )
 |
 |      :param expandUnary: Flag to expand unary or not (default = True)
 |      :type  expandUnary: bool
 |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
 |      :type  parentChar: str
 |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
 |      :type  unaryChar: str
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from nltk.tree.tree.Tree:
 |
 |  convert(tree)
 |      Convert a tree between different subtypes of Tree.  ``cls`` determines
 |      which class will be used to encode the new tree.
 |
 |      :type tree: Tree
 |      :param tree: The tree that should be converted.
 |      :return: The new Tree.
 |
 |  fromlist(l)
 |      :type l: list
 |      :param l: a tree represented as nested lists
 |
 |      :return: A tree corresponding to the list representation ``l``.
 |      :rtype: Tree
 |
 |      Convert nested lists to a NLTK Tree
 |
 |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
 |      Read a bracketed tree string and return the resulting tree.
 |      Trees are represented as nested brackettings, such as::
 |
 |        (S (NP (NNP John)) (VP (V runs)))
 |
 |      :type s: str
 |      :param s: The string to read
 |
 |      :type brackets: str (length=2)
 |      :param brackets: The bracket characters used to mark the
 |          beginning and end of trees and subtrees.
 |
 |      :type read_node: function
 |      :type read_leaf: function
 |      :param read_node, read_leaf: If specified, these functions
 |          are applied to the substrings of ``s`` corresponding to
 |          nodes and leaves (respectively) to obtain the values for
 |          those nodes and leaves.  They should have the following
 |          signature:
 |
 |             read_node(str) -> value
 |
 |          For example, these functions could be used to process nodes
 |          and leaves whose values should be some type other than
 |          string (such as ``FeatStruct``).
 |          Note that by default, node strings and leaf strings are
 |          delimited by whitespace and brackets; to override this
 |          default, use the ``node_pattern`` and ``leaf_pattern``
 |          arguments.
 |
 |      :type node_pattern: str
 |      :type leaf_pattern: str
 |      :param node_pattern, leaf_pattern: Regular expression patterns
 |          used to find node and leaf substrings in ``s``.  By
 |          default, both nodes patterns are defined to match any
 |          sequence of non-whitespace non-bracket characters.
 |
 |      :type remove_empty_top_bracketing: bool
 |      :param remove_empty_top_bracketing: If the resulting tree has
 |          an empty node label, and is length one, then return its
 |          single child instead.  This is useful for treebank trees,
 |          which sometimes contain an extra level of bracketing.
 |
 |      :return: A tree corresponding to the string representation ``s``.
 |          If this class method is called using a subclass of Tree,
 |          then it will return a tree of that type.
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tree.tree.Tree:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  node
 |      Outdated method to access the node value; use the label() method instead.
 |
 |      @deprecated: Use label() instead
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.list:
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the list.
 |
 |  __sizeof__(self, /)
 |      Return the size of the list in memory, in bytes.
 |
 |  clear(self, /)
 |      Remove all items from list.
 |
 |  count(self, value, /)
 |      Return number of occurrences of value.
 |
 |  index(self, value, start=0, stop=9223372036854775807, /)
 |      Return first index of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.list:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.list:
 |
 |  __new__(*args, **kwargs) class method of builtins.list
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.ImmutableProbabilisticMixIn
Python Library Documentation: class ImmutableProbabilisticMixIn in module nltk.probability

class ImmutableProbabilisticMixIn(ProbabilisticMixIn)
 |  ImmutableProbabilisticMixIn(**kwargs)
 |
 |  Method resolution order:
 |      ImmutableProbabilisticMixIn
 |      ProbabilisticMixIn
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  set_logprob(self, prob)
 |      Set the log probability associated with this object to
 |      ``logprob``.  I.e., set the probability associated with this
 |      object to ``2**(logprob)``.
 |
 |      :param logprob: The new log probability
 |      :type logprob: float
 |
 |  set_prob(self, prob)
 |      Set the probability associated with this object to ``prob``.
 |
 |      :param prob: The new probability
 |      :type prob: float
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbabilisticMixIn:
 |
 |  __init__(self, **kwargs)
 |      Initialize this object's probability.  This initializer should
 |      be called by subclass constructors.  ``prob`` should generally be
 |      the first argument for those constructors.
 |
 |      :param prob: The probability associated with the object.
 |      :type prob: float
 |      :param logprob: The log of the probability associated with
 |          the object.
 |      :type logprob: float
 |
 |  logprob(self)
 |      Return ``log(p)``, where ``p`` is the probability associated
 |      with this object.
 |
 |      :rtype: float
 |
 |  prob(self)
 |      Return the probability associated with this object.
 |
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbabilisticMixIn:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ImmutableProbabilisticTree
Python Library Documentation: class ImmutableProbabilisticTree in module nltk.tree.immutable

class ImmutableProbabilisticTree(ImmutableTree, nltk.probability.ProbabilisticMixIn)
 |  ImmutableProbabilisticTree(node, children=None, **prob_kwargs)
 |
 |  Method resolution order:
 |      ImmutableProbabilisticTree
 |      ImmutableTree
 |      nltk.tree.tree.Tree
 |      builtins.list
 |      nltk.probability.ProbabilisticMixIn
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, node, children=None, **prob_kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  copy(self, deep=False)
 |      Return a shallow copy of the list.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  convert(val)
 |      Convert a tree between different subtypes of Tree.  ``cls`` determines
 |      which class will be used to encode the new tree.
 |
 |      :type tree: Tree
 |      :param tree: The tree that should be converted.
 |      :return: The new Tree.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ImmutableTree:
 |
 |  __delitem__(self, index)
 |      Delete self[key].
 |
 |  __delslice__(self, i, j)
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __iadd__(self, other)
 |      Implement self+=value.
 |
 |  __imul__(self, other)
 |      Implement self*=value.
 |
 |  __setitem__(self, index, value)
 |      Set self[key] to value.
 |
 |  __setslice__(self, i, j, value)
 |
 |  append(self, v)
 |      Append object to the end of the list.
 |
 |  extend(self, v)
 |      Extend list by appending elements from the iterable.
 |
 |  pop(self, v=None)
 |      Remove and return item at index (default last).
 |
 |      Raises IndexError if list is empty or index is out of range.
 |
 |  remove(self, v)
 |      Remove first occurrence of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  reverse(self)
 |      Reverse *IN PLACE*.
 |
 |  set_label(self, value)
 |      Set the node label.  This will only succeed the first time the
 |      node label is set, which should occur in ImmutableTree.__init__().
 |
 |  sort(self)
 |      Sort the list in ascending order and return None.
 |
 |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
 |      order of two equal elements is maintained).
 |
 |      If a key function is given, apply it once to each list item and sort them,
 |      ascending or descending, according to their function values.
 |
 |      The reverse flag can be set to sort in descending order.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.tree.Tree:
 |
 |  __add__(self, v)
 |      Return self+value.
 |
 |  __copy__(self)
 |
 |  __deepcopy__(self, memo)
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__ lambda self, other
 |
 |  __getitem__(self, index)
 |      Return self[index].
 |
 |  __gt__ lambda self, other
 |
 |  __le__ lambda self, other
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, v)
 |      Return self*value.
 |
 |  __ne__ lambda self, other
 |      # @total_ordering doesn't work here, since the class inherits from a builtin class
 |
 |  __radd__(self, v)
 |
 |  __rmul__(self, v)
 |      Return value*self.
 |
 |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
 |      This method can modify a tree in three ways:
 |
 |        1. Convert a tree into its Chomsky Normal Form (CNF)
 |           equivalent -- Every subtree has either two non-terminals
 |           or one terminal as its children.  This process requires
 |           the creation of more"artificial" non-terminal nodes.
 |        2. Markov (vertical) smoothing of children in new artificial
 |           nodes
 |        3. Horizontal (parent) annotation of nodes
 |
 |      :param factor: Right or left factoring method (default = "right")
 |      :type  factor: str = [left|right]
 |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
 |      :type  horzMarkov: int | None
 |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
 |      :type  vertMarkov: int | None
 |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
 |                        original subtree from the child nodes that have yet to be expanded (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string used to separate the node representation from its vertical annotation
 |      :type  parentChar: str
 |
 |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
 |      Collapse subtrees with a single child (ie. unary productions)
 |      into a new non-terminal (Tree node) joined by 'joinChar'.
 |      This is useful when working with algorithms that do not allow
 |      unary productions, and completely removing the unary productions
 |      would require loss of useful information.  The Tree is modified
 |      directly (since it is passed by reference) and no value is returned.
 |
 |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
 |                          Part-of-Speech tags) since they are always unary productions
 |      :type  collapsePOS: bool
 |      :param collapseRoot: 'False' (default) will not modify the root production
 |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
 |                           to the TOP -> productions.
 |      :type collapseRoot: bool
 |      :param joinChar: A string used to connect collapsed node values (default = "+")
 |      :type  joinChar: str
 |
 |  draw(self)
 |      Open a new window containing a graphical diagram of this tree.
 |
 |  flatten(self)
 |      Return a flat version of the tree, with all non-root non-terminals removed.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> print(t.flatten())
 |          (S the dog chased the cat)
 |
 |      :return: a tree consisting of this tree's root connected directly to
 |          its leaves, omitting all intervening non-terminal nodes.
 |      :rtype: Tree
 |
 |  freeze(self, leaf_freezer=None)
 |
 |  height(self)
 |      Return the height of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.height()
 |          5
 |          >>> print(t[0,0])
 |          (D the)
 |          >>> t[0,0].height()
 |          2
 |
 |      :return: The height of this tree.  The height of a tree
 |          containing no children is 1; the height of a tree
 |          containing only leaves is 2; and the height of any other
 |          tree is one plus the maximum of its children's
 |          heights.
 |      :rtype: int
 |
 |  label(self)
 |      Return the node label of the tree.
 |
 |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
 |          >>> t.label()
 |          'S'
 |
 |      :return: the node label (typically a string)
 |      :rtype: any
 |
 |  leaf_treeposition(self, index)
 |      :return: The tree position of the ``index``-th leaf in this
 |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
 |          ``self[tp]==self.leaves()[i]``.
 |
 |      :raise IndexError: If this tree contains fewer than ``index+1``
 |          leaves, or if ``index<0``.
 |
 |  leaves(self)
 |      Return the leaves of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.leaves()
 |          ['the', 'dog', 'chased', 'the', 'cat']
 |
 |      :return: a list containing this tree's leaves.
 |          The order reflects the order of the
 |          leaves in the tree's hierarchical structure.
 |      :rtype: list
 |
 |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
 |      :return: A pretty-printed string representation of this tree.
 |      :rtype: str
 |      :param margin: The right margin at which to do line-wrapping.
 |      :type margin: int
 |      :param indent: The indentation level at which printing
 |          begins.  This number is used to decide how far to indent
 |          subsequent lines.
 |      :type indent: int
 |      :param nodesep: A string that is used to separate the node
 |          from the children.  E.g., the default value ``':'`` gives
 |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
 |
 |  pformat_latex_qtree(self)
 |      Returns a representation of the tree compatible with the
 |      LaTeX qtree package. This consists of the string ``\Tree``
 |      followed by the tree represented in bracketed notation.
 |
 |      For example, the following result was generated from a parse tree of
 |      the sentence ``The announcement astounded us``::
 |
 |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
 |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
 |
 |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
 |      style file for the qtree package.
 |
 |      :return: A latex qtree representation of this tree.
 |      :rtype: str
 |
 |  pos(self)
 |      Return a sequence of pos-tagged words extracted from the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.pos()
 |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
 |
 |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
 |          The order reflects the order of the leaves in the tree's hierarchical structure.
 |      :rtype: list(tuple)
 |
 |  pprint(self, **kwargs)
 |      Print a string representation of this Tree to 'stream'
 |
 |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
 |      Pretty-print this tree as ASCII or Unicode art.
 |      For explanation of the arguments, see the documentation for
 |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
 |
 |  productions(self)
 |      Generate the productions that correspond to the non-terminal nodes of the tree.
 |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
 |      form P -> C1 C2 ... Cn.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
 |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
 |          NP -> D N, D -> 'the', N -> 'cat']
 |
 |      :rtype: list(Production)
 |
 |  subtrees(self, filter=None)
 |      Generate all the subtrees of this tree, optionally restricted
 |      to trees matching the filter function.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> for s in t.subtrees(lambda t: t.height() == 2):
 |          ...     print(s)
 |          (D the)
 |          (N dog)
 |          (V chased)
 |          (D the)
 |          (N cat)
 |
 |      :type filter: function
 |      :param filter: the function to filter all local trees
 |
 |  treeposition_spanning_leaves(self, start, end)
 |      :return: The tree position of the lowest descendant of this
 |          tree that dominates ``self.leaves()[start:end]``.
 |      :raise ValueError: if ``end <= start``
 |
 |  treepositions(self, order='preorder')
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.treepositions() # doctest: +ELLIPSIS
 |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
 |          >>> for pos in t.treepositions('leaves'):
 |          ...     t[pos] = t[pos][::-1].upper()
 |          >>> print(t)
 |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
 |
 |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
 |          ``leaves``.
 |
 |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
 |      This method modifies the tree in three ways:
 |
 |        1. Transforms a tree in Chomsky Normal Form back to its
 |           original structure (branching greater than two)
 |        2. Removes any parent annotation (if it exists)
 |        3. (optional) expands unary subtrees (if previously
 |           collapsed with collapseUnary(...) )
 |
 |      :param expandUnary: Flag to expand unary or not (default = True)
 |      :type  expandUnary: bool
 |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
 |      :type  parentChar: str
 |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
 |      :type  unaryChar: str
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from nltk.tree.tree.Tree:
 |
 |  fromlist(l)
 |      :type l: list
 |      :param l: a tree represented as nested lists
 |
 |      :return: A tree corresponding to the list representation ``l``.
 |      :rtype: Tree
 |
 |      Convert nested lists to a NLTK Tree
 |
 |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
 |      Read a bracketed tree string and return the resulting tree.
 |      Trees are represented as nested brackettings, such as::
 |
 |        (S (NP (NNP John)) (VP (V runs)))
 |
 |      :type s: str
 |      :param s: The string to read
 |
 |      :type brackets: str (length=2)
 |      :param brackets: The bracket characters used to mark the
 |          beginning and end of trees and subtrees.
 |
 |      :type read_node: function
 |      :type read_leaf: function
 |      :param read_node, read_leaf: If specified, these functions
 |          are applied to the substrings of ``s`` corresponding to
 |          nodes and leaves (respectively) to obtain the values for
 |          those nodes and leaves.  They should have the following
 |          signature:
 |
 |             read_node(str) -> value
 |
 |          For example, these functions could be used to process nodes
 |          and leaves whose values should be some type other than
 |          string (such as ``FeatStruct``).
 |          Note that by default, node strings and leaf strings are
 |          delimited by whitespace and brackets; to override this
 |          default, use the ``node_pattern`` and ``leaf_pattern``
 |          arguments.
 |
 |      :type node_pattern: str
 |      :type leaf_pattern: str
 |      :param node_pattern, leaf_pattern: Regular expression patterns
 |          used to find node and leaf substrings in ``s``.  By
 |          default, both nodes patterns are defined to match any
 |          sequence of non-whitespace non-bracket characters.
 |
 |      :type remove_empty_top_bracketing: bool
 |      :param remove_empty_top_bracketing: If the resulting tree has
 |          an empty node label, and is length one, then return its
 |          single child instead.  This is useful for treebank trees,
 |          which sometimes contain an extra level of bracketing.
 |
 |      :return: A tree corresponding to the string representation ``s``.
 |          If this class method is called using a subclass of Tree,
 |          then it will return a tree of that type.
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tree.tree.Tree:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  node
 |      Outdated method to access the node value; use the label() method instead.
 |
 |      @deprecated: Use label() instead
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.list:
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the list.
 |
 |  __sizeof__(self, /)
 |      Return the size of the list in memory, in bytes.
 |
 |  clear(self, /)
 |      Remove all items from list.
 |
 |  count(self, value, /)
 |      Return number of occurrences of value.
 |
 |  index(self, value, start=0, stop=9223372036854775807, /)
 |      Return first index of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  insert(self, index, object, /)
 |      Insert object before index.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.list:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.list:
 |
 |  __new__(*args, **kwargs) class method of builtins.list
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.probability.ProbabilisticMixIn:
 |
 |  logprob(self)
 |      Return ``log(p)``, where ``p`` is the probability associated
 |      with this object.
 |
 |      :rtype: float
 |
 |  prob(self)
 |      Return the probability associated with this object.
 |
 |      :rtype: float
 |
 |  set_logprob(self, logprob)
 |      Set the log probability associated with this object to
 |      ``logprob``.  I.e., set the probability associated with this
 |      object to ``2**(logprob)``.
 |
 |      :param logprob: The new log probability
 |      :type logprob: float
 |
 |  set_prob(self, prob)
 |      Set the probability associated with this object to ``prob``.
 |
 |      :param prob: The new probability
 |      :type prob: float
nltk.ImmutableTree
Python Library Documentation: class ImmutableTree in module nltk.tree.immutable

class ImmutableTree(nltk.tree.tree.Tree)
 |  ImmutableTree(node, children=None)
 |
 |  Method resolution order:
 |      ImmutableTree
 |      nltk.tree.tree.Tree
 |      builtins.list
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __delitem__(self, index)
 |      Delete self[key].
 |
 |  __delslice__(self, i, j)
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __iadd__(self, other)
 |      Implement self+=value.
 |
 |  __imul__(self, other)
 |      Implement self*=value.
 |
 |  __init__(self, node, children=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __setitem__(self, index, value)
 |      Set self[key] to value.
 |
 |  __setslice__(self, i, j, value)
 |
 |  append(self, v)
 |      Append object to the end of the list.
 |
 |  extend(self, v)
 |      Extend list by appending elements from the iterable.
 |
 |  pop(self, v=None)
 |      Remove and return item at index (default last).
 |
 |      Raises IndexError if list is empty or index is out of range.
 |
 |  remove(self, v)
 |      Remove first occurrence of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  reverse(self)
 |      Reverse *IN PLACE*.
 |
 |  set_label(self, value)
 |      Set the node label.  This will only succeed the first time the
 |      node label is set, which should occur in ImmutableTree.__init__().
 |
 |  sort(self)
 |      Sort the list in ascending order and return None.
 |
 |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
 |      order of two equal elements is maintained).
 |
 |      If a key function is given, apply it once to each list item and sort them,
 |      ascending or descending, according to their function values.
 |
 |      The reverse flag can be set to sort in descending order.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.tree.Tree:
 |
 |  __add__(self, v)
 |      Return self+value.
 |
 |  __copy__(self)
 |
 |  __deepcopy__(self, memo)
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__ lambda self, other
 |
 |  __getitem__(self, index)
 |      Return self[index].
 |
 |  __gt__ lambda self, other
 |
 |  __le__ lambda self, other
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, v)
 |      Return self*value.
 |
 |  __ne__ lambda self, other
 |      # @total_ordering doesn't work here, since the class inherits from a builtin class
 |
 |  __radd__(self, v)
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __rmul__(self, v)
 |      Return value*self.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
 |      This method can modify a tree in three ways:
 |
 |        1. Convert a tree into its Chomsky Normal Form (CNF)
 |           equivalent -- Every subtree has either two non-terminals
 |           or one terminal as its children.  This process requires
 |           the creation of more"artificial" non-terminal nodes.
 |        2. Markov (vertical) smoothing of children in new artificial
 |           nodes
 |        3. Horizontal (parent) annotation of nodes
 |
 |      :param factor: Right or left factoring method (default = "right")
 |      :type  factor: str = [left|right]
 |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
 |      :type  horzMarkov: int | None
 |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
 |      :type  vertMarkov: int | None
 |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
 |                        original subtree from the child nodes that have yet to be expanded (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string used to separate the node representation from its vertical annotation
 |      :type  parentChar: str
 |
 |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
 |      Collapse subtrees with a single child (ie. unary productions)
 |      into a new non-terminal (Tree node) joined by 'joinChar'.
 |      This is useful when working with algorithms that do not allow
 |      unary productions, and completely removing the unary productions
 |      would require loss of useful information.  The Tree is modified
 |      directly (since it is passed by reference) and no value is returned.
 |
 |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
 |                          Part-of-Speech tags) since they are always unary productions
 |      :type  collapsePOS: bool
 |      :param collapseRoot: 'False' (default) will not modify the root production
 |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
 |                           to the TOP -> productions.
 |      :type collapseRoot: bool
 |      :param joinChar: A string used to connect collapsed node values (default = "+")
 |      :type  joinChar: str
 |
 |  copy(self, deep=False)
 |      Return a shallow copy of the list.
 |
 |  draw(self)
 |      Open a new window containing a graphical diagram of this tree.
 |
 |  flatten(self)
 |      Return a flat version of the tree, with all non-root non-terminals removed.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> print(t.flatten())
 |          (S the dog chased the cat)
 |
 |      :return: a tree consisting of this tree's root connected directly to
 |          its leaves, omitting all intervening non-terminal nodes.
 |      :rtype: Tree
 |
 |  freeze(self, leaf_freezer=None)
 |
 |  height(self)
 |      Return the height of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.height()
 |          5
 |          >>> print(t[0,0])
 |          (D the)
 |          >>> t[0,0].height()
 |          2
 |
 |      :return: The height of this tree.  The height of a tree
 |          containing no children is 1; the height of a tree
 |          containing only leaves is 2; and the height of any other
 |          tree is one plus the maximum of its children's
 |          heights.
 |      :rtype: int
 |
 |  label(self)
 |      Return the node label of the tree.
 |
 |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
 |          >>> t.label()
 |          'S'
 |
 |      :return: the node label (typically a string)
 |      :rtype: any
 |
 |  leaf_treeposition(self, index)
 |      :return: The tree position of the ``index``-th leaf in this
 |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
 |          ``self[tp]==self.leaves()[i]``.
 |
 |      :raise IndexError: If this tree contains fewer than ``index+1``
 |          leaves, or if ``index<0``.
 |
 |  leaves(self)
 |      Return the leaves of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.leaves()
 |          ['the', 'dog', 'chased', 'the', 'cat']
 |
 |      :return: a list containing this tree's leaves.
 |          The order reflects the order of the
 |          leaves in the tree's hierarchical structure.
 |      :rtype: list
 |
 |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
 |      :return: A pretty-printed string representation of this tree.
 |      :rtype: str
 |      :param margin: The right margin at which to do line-wrapping.
 |      :type margin: int
 |      :param indent: The indentation level at which printing
 |          begins.  This number is used to decide how far to indent
 |          subsequent lines.
 |      :type indent: int
 |      :param nodesep: A string that is used to separate the node
 |          from the children.  E.g., the default value ``':'`` gives
 |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
 |
 |  pformat_latex_qtree(self)
 |      Returns a representation of the tree compatible with the
 |      LaTeX qtree package. This consists of the string ``\Tree``
 |      followed by the tree represented in bracketed notation.
 |
 |      For example, the following result was generated from a parse tree of
 |      the sentence ``The announcement astounded us``::
 |
 |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
 |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
 |
 |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
 |      style file for the qtree package.
 |
 |      :return: A latex qtree representation of this tree.
 |      :rtype: str
 |
 |  pos(self)
 |      Return a sequence of pos-tagged words extracted from the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.pos()
 |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
 |
 |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
 |          The order reflects the order of the leaves in the tree's hierarchical structure.
 |      :rtype: list(tuple)
 |
 |  pprint(self, **kwargs)
 |      Print a string representation of this Tree to 'stream'
 |
 |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
 |      Pretty-print this tree as ASCII or Unicode art.
 |      For explanation of the arguments, see the documentation for
 |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
 |
 |  productions(self)
 |      Generate the productions that correspond to the non-terminal nodes of the tree.
 |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
 |      form P -> C1 C2 ... Cn.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
 |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
 |          NP -> D N, D -> 'the', N -> 'cat']
 |
 |      :rtype: list(Production)
 |
 |  subtrees(self, filter=None)
 |      Generate all the subtrees of this tree, optionally restricted
 |      to trees matching the filter function.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> for s in t.subtrees(lambda t: t.height() == 2):
 |          ...     print(s)
 |          (D the)
 |          (N dog)
 |          (V chased)
 |          (D the)
 |          (N cat)
 |
 |      :type filter: function
 |      :param filter: the function to filter all local trees
 |
 |  treeposition_spanning_leaves(self, start, end)
 |      :return: The tree position of the lowest descendant of this
 |          tree that dominates ``self.leaves()[start:end]``.
 |      :raise ValueError: if ``end <= start``
 |
 |  treepositions(self, order='preorder')
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.treepositions() # doctest: +ELLIPSIS
 |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
 |          >>> for pos in t.treepositions('leaves'):
 |          ...     t[pos] = t[pos][::-1].upper()
 |          >>> print(t)
 |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
 |
 |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
 |          ``leaves``.
 |
 |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
 |      This method modifies the tree in three ways:
 |
 |        1. Transforms a tree in Chomsky Normal Form back to its
 |           original structure (branching greater than two)
 |        2. Removes any parent annotation (if it exists)
 |        3. (optional) expands unary subtrees (if previously
 |           collapsed with collapseUnary(...) )
 |
 |      :param expandUnary: Flag to expand unary or not (default = True)
 |      :type  expandUnary: bool
 |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
 |      :type  parentChar: str
 |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
 |      :type  unaryChar: str
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from nltk.tree.tree.Tree:
 |
 |  convert(tree)
 |      Convert a tree between different subtypes of Tree.  ``cls`` determines
 |      which class will be used to encode the new tree.
 |
 |      :type tree: Tree
 |      :param tree: The tree that should be converted.
 |      :return: The new Tree.
 |
 |  fromlist(l)
 |      :type l: list
 |      :param l: a tree represented as nested lists
 |
 |      :return: A tree corresponding to the list representation ``l``.
 |      :rtype: Tree
 |
 |      Convert nested lists to a NLTK Tree
 |
 |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
 |      Read a bracketed tree string and return the resulting tree.
 |      Trees are represented as nested brackettings, such as::
 |
 |        (S (NP (NNP John)) (VP (V runs)))
 |
 |      :type s: str
 |      :param s: The string to read
 |
 |      :type brackets: str (length=2)
 |      :param brackets: The bracket characters used to mark the
 |          beginning and end of trees and subtrees.
 |
 |      :type read_node: function
 |      :type read_leaf: function
 |      :param read_node, read_leaf: If specified, these functions
 |          are applied to the substrings of ``s`` corresponding to
 |          nodes and leaves (respectively) to obtain the values for
 |          those nodes and leaves.  They should have the following
 |          signature:
 |
 |             read_node(str) -> value
 |
 |          For example, these functions could be used to process nodes
 |          and leaves whose values should be some type other than
 |          string (such as ``FeatStruct``).
 |          Note that by default, node strings and leaf strings are
 |          delimited by whitespace and brackets; to override this
 |          default, use the ``node_pattern`` and ``leaf_pattern``
 |          arguments.
 |
 |      :type node_pattern: str
 |      :type leaf_pattern: str
 |      :param node_pattern, leaf_pattern: Regular expression patterns
 |          used to find node and leaf substrings in ``s``.  By
 |          default, both nodes patterns are defined to match any
 |          sequence of non-whitespace non-bracket characters.
 |
 |      :type remove_empty_top_bracketing: bool
 |      :param remove_empty_top_bracketing: If the resulting tree has
 |          an empty node label, and is length one, then return its
 |          single child instead.  This is useful for treebank trees,
 |          which sometimes contain an extra level of bracketing.
 |
 |      :return: A tree corresponding to the string representation ``s``.
 |          If this class method is called using a subclass of Tree,
 |          then it will return a tree of that type.
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tree.tree.Tree:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  node
 |      Outdated method to access the node value; use the label() method instead.
 |
 |      @deprecated: Use label() instead
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.list:
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the list.
 |
 |  __sizeof__(self, /)
 |      Return the size of the list in memory, in bytes.
 |
 |  clear(self, /)
 |      Remove all items from list.
 |
 |  count(self, value, /)
 |      Return number of occurrences of value.
 |
 |  index(self, value, start=0, stop=9223372036854775807, /)
 |      Return first index of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  insert(self, index, object, /)
 |      Insert object before index.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.list:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.list:
 |
 |  __new__(*args, **kwargs) class method of builtins.list
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.IncrementalBottomUpChartParser
Python Library Documentation: class IncrementalBottomUpChartParser in module nltk.parse.earleychart

class IncrementalBottomUpChartParser(IncrementalChartParser)
 |  IncrementalBottomUpChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      IncrementalBottomUpChartParser
 |      IncrementalChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.IncrementalBottomUpLeftCornerChartParser
Python Library Documentation: class IncrementalBottomUpLeftCornerChartParser in module nltk.parse.earleychart

class IncrementalBottomUpLeftCornerChartParser(IncrementalChartParser)
 |  IncrementalBottomUpLeftCornerChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      IncrementalBottomUpLeftCornerChartParser
 |      IncrementalChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.IncrementalChartParser
Python Library Documentation: class IncrementalChartParser in module nltk.parse.earleychart

class IncrementalChartParser(nltk.parse.chart.ChartParser)
 |  IncrementalChartParser(grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2D730>, <nltk.parse.chart.EmptyPredictRule object at 0x0000028F98C2D760>, <nltk.parse.chart.BottomUpPredictCombineRule object at 0x0000028F98C2D790>, <nltk.parse.earleychart.CompleteFundamentalRule object at 0x0000028F98C2D7C0>], trace=0, trace_chart_width=50, chart_class=<class 'nltk.parse.earleychart.IncrementalChart'>)
 |
 |  An *incremental* chart parser implementing Jay Earley's
 |  parsing algorithm:
 |
 |  | For each index end in [0, 1, ..., N]:
 |  |   For each edge such that edge.end = end:
 |  |     If edge is incomplete and edge.next is not a part of speech:
 |  |       Apply PredictorRule to edge
 |  |     If edge is incomplete and edge.next is a part of speech:
 |  |       Apply ScannerRule to edge
 |  |     If edge is complete:
 |  |       Apply CompleterRule to edge
 |  | Return any complete parses in the chart
 |
 |  Method resolution order:
 |      IncrementalChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2D730>, <nltk.parse.chart.EmptyPredictRule object at 0x0000028F98C2D760>, <nltk.parse.chart.BottomUpPredictCombineRule object at 0x0000028F98C2D790>, <nltk.parse.earleychart.CompleteFundamentalRule object at 0x0000028F98C2D7C0>], trace=0, trace_chart_width=50, chart_class=<class 'nltk.parse.earleychart.IncrementalChart'>)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.IncrementalLeftCornerChartParser
Python Library Documentation: class IncrementalLeftCornerChartParser in module nltk.parse.earleychart

class IncrementalLeftCornerChartParser(IncrementalChartParser)
 |  IncrementalLeftCornerChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      IncrementalLeftCornerChartParser
 |      IncrementalChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.IncrementalTopDownChartParser
Python Library Documentation: class IncrementalTopDownChartParser in module nltk.parse.earleychart

class IncrementalTopDownChartParser(IncrementalChartParser)
 |  IncrementalTopDownChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      IncrementalTopDownChartParser
 |      IncrementalChartParser
 |      nltk.parse.chart.ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new Earley chart parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :param chart_class: The class that should be used to create
 |          the charts used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from IncrementalChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.chart.ChartParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Index
Python Library Documentation: class Index in module nltk.util

class Index(collections.defaultdict)
 |  Index(pairs)
 |
 |  Method resolution order:
 |      Index
 |      collections.defaultdict
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, pairs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from collections.defaultdict:
 |
 |  __copy__(...)
 |      D.copy() -> a shallow copy of D.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __missing__(...)
 |      __missing__(key) # Called by __getitem__ for missing key; pseudo-code:
 |      if self.default_factory is None: raise KeyError((key,))
 |      self[key] = value = self.default_factory()
 |      return value
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __reduce__(...)
 |      Return state information for pickling.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from collections.defaultdict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from collections.defaultdict:
 |
 |  default_factory
 |      Factory for default value called by __missing__().
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.InsideChartParser
Python Library Documentation: class InsideChartParser in module nltk.parse.pchart

class InsideChartParser(BottomUpProbabilisticChartParser)
 |  InsideChartParser(grammar, beam_size=0, trace=0)
 |
 |  A bottom-up parser for ``PCFG`` grammars that tries edges in descending
 |  order of the inside probabilities of their trees.  The "inside
 |  probability" of a tree is simply the
 |  probability of the entire tree, ignoring its context.  In
 |  particular, the inside probability of a tree generated by
 |  production *p* with children *c[1], c[2], ..., c[n]* is
 |  *P(p)P(c[1])P(c[2])...P(c[n])*; and the inside
 |  probability of a token is 1 if it is present in the text, and 0 if
 |  it is absent.
 |
 |  This sorting order results in a type of lowest-cost-first search
 |  strategy.
 |
 |  Method resolution order:
 |      InsideChartParser
 |      BottomUpProbabilisticChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  sort_queue(self, queue, chart)
 |      Sort the given queue of edges, in descending order of the
 |      inside probabilities of the edges' trees.
 |
 |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
 |          this queue is an edge that could be added to the chart by
 |          the fundamental rule; but that has not yet been added.
 |      :type queue: list(Edge)
 |      :param chart: The chart being used to parse the text.  This
 |          chart can be used to provide extra information for sorting
 |          the queue.
 |      :type chart: Chart
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BottomUpProbabilisticChartParser:
 |
 |  __init__(self, grammar, beam_size=0, trace=0)
 |      Create a new ``BottomUpProbabilisticChartParser``, that uses
 |      ``grammar`` to parse texts.
 |
 |      :type grammar: PCFG
 |      :param grammar: The grammar used to parse texts.
 |      :type beam_size: int
 |      :param beam_size: The maximum length for the parser's edge queue.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.JSONTaggedDecoder
Python Library Documentation: class JSONTaggedDecoder in module nltk.jsontags

class JSONTaggedDecoder(json.decoder.JSONDecoder)
 |  JSONTaggedDecoder(*, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
 |
 |  Method resolution order:
 |      JSONTaggedDecoder
 |      json.decoder.JSONDecoder
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  decode(self, s)
 |      Return the Python representation of ``s`` (a ``str`` instance
 |      containing a JSON document).
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  decode_obj(obj, _depth=0)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MAX_DECODE_DEPTH = 200
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from json.decoder.JSONDecoder:
 |
 |  __init__(self, *, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
 |      ``object_hook``, if specified, will be called with the result
 |      of every JSON object decoded and its return value will be used in
 |      place of the given ``dict``.  This can be used to provide custom
 |      deserializations (e.g. to support JSON-RPC class hinting).
 |
 |      ``object_pairs_hook``, if specified will be called with the result of
 |      every JSON object decoded with an ordered list of pairs.  The return
 |      value of ``object_pairs_hook`` will be used instead of the ``dict``.
 |      This feature can be used to implement custom decoders.
 |      If ``object_hook`` is also defined, the ``object_pairs_hook`` takes
 |      priority.
 |
 |      ``parse_float``, if specified, will be called with the string
 |      of every JSON float to be decoded. By default this is equivalent to
 |      float(num_str). This can be used to use another datatype or parser
 |      for JSON floats (e.g. decimal.Decimal).
 |
 |      ``parse_int``, if specified, will be called with the string
 |      of every JSON int to be decoded. By default this is equivalent to
 |      int(num_str). This can be used to use another datatype or parser
 |      for JSON integers (e.g. float).
 |
 |      ``parse_constant``, if specified, will be called with one of the
 |      following strings: -Infinity, Infinity, NaN.
 |      This can be used to raise an exception if invalid JSON numbers
 |      are encountered.
 |
 |      If ``strict`` is false (true is the default), then control
 |      characters will be allowed inside strings.  Control characters in
 |      this context are those with character codes in the 0-31 range,
 |      including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``.
 |
 |  raw_decode(self, s, idx=0)
 |      Decode a JSON document from ``s`` (a ``str`` beginning with
 |      a JSON document) and return a 2-tuple of the Python
 |      representation and the index in ``s`` where the document ended.
 |
 |      This can be used to decode a JSON document from a string that may
 |      have extraneous data at the end.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from json.decoder.JSONDecoder:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.JSONTaggedEncoder
Python Library Documentation: class JSONTaggedEncoder in module nltk.jsontags

class JSONTaggedEncoder(json.encoder.JSONEncoder)
 |  JSONTaggedEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
 |
 |  Method resolution order:
 |      JSONTaggedEncoder
 |      json.encoder.JSONEncoder
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  default(self, obj)
 |      Implement this method in a subclass such that it returns
 |      a serializable object for ``o``, or calls the base implementation
 |      (to raise a ``TypeError``).
 |
 |      For example, to support arbitrary iterators, you could
 |      implement default like this::
 |
 |          def default(self, o):
 |              try:
 |                  iterable = iter(o)
 |              except TypeError:
 |                  pass
 |              else:
 |                  return list(iterable)
 |              # Let the base class default method raise the TypeError
 |              return super().default(o)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from json.encoder.JSONEncoder:
 |
 |  __init__(self, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
 |      Constructor for JSONEncoder, with sensible defaults.
 |
 |      If skipkeys is false, then it is a TypeError to attempt
 |      encoding of keys that are not str, int, float or None.  If
 |      skipkeys is True, such items are simply skipped.
 |
 |      If ensure_ascii is true, the output is guaranteed to be str
 |      objects with all incoming non-ASCII characters escaped.  If
 |      ensure_ascii is false, the output can contain non-ASCII characters.
 |
 |      If check_circular is true, then lists, dicts, and custom encoded
 |      objects will be checked for circular references during encoding to
 |      prevent an infinite recursion (which would cause an RecursionError).
 |      Otherwise, no such check takes place.
 |
 |      If allow_nan is true, then NaN, Infinity, and -Infinity will be
 |      encoded as such.  This behavior is not JSON specification compliant,
 |      but is consistent with most JavaScript based encoders and decoders.
 |      Otherwise, it will be a ValueError to encode such floats.
 |
 |      If sort_keys is true, then the output of dictionaries will be
 |      sorted by key; this is useful for regression tests to ensure
 |      that JSON serializations can be compared on a day-to-day basis.
 |
 |      If indent is a non-negative integer, then JSON array
 |      elements and object members will be pretty-printed with that
 |      indent level.  An indent level of 0 will only insert newlines.
 |      None is the most compact representation.
 |
 |      If specified, separators should be an (item_separator, key_separator)
 |      tuple.  The default is (', ', ': ') if *indent* is ``None`` and
 |      (',', ': ') otherwise.  To get the most compact JSON representation,
 |      you should specify (',', ':') to eliminate whitespace.
 |
 |      If specified, default is a function that gets called for objects
 |      that can't otherwise be serialized.  It should return a JSON encodable
 |      version of the object or raise a ``TypeError``.
 |
 |  encode(self, o)
 |      Return a JSON string representation of a Python data structure.
 |
 |      >>> from json.encoder import JSONEncoder
 |      >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
 |      '{"foo": ["bar", "baz"]}'
 |
 |  iterencode(self, o, _one_shot=False)
 |      Encode the given object and yield each string
 |      representation as available.
 |
 |      For example::
 |
 |          for chunk in JSONEncoder().iterencode(bigobject):
 |              mysocket.write(chunk)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from json.encoder.JSONEncoder:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from json.encoder.JSONEncoder:
 |
 |  item_separator = ', '
 |
 |  key_separator = ': '
nltk.KneserNeyProbDist
Python Library Documentation: class KneserNeyProbDist in module nltk.probability

class KneserNeyProbDist(ProbDistI)
 |  KneserNeyProbDist(freqdist, bins=None, discount=0.75)
 |
 |  Kneser-Ney estimate of a probability distribution. This is a version of
 |  back-off that counts how likely an n-gram is provided the n-1-gram had
 |  been seen in training. Extends the ProbDistI interface, requires a trigram
 |  FreqDist instance to train on. Optionally, a different from default discount
 |  value can be specified. The default discount is set to 0.75.
 |
 |  Method resolution order:
 |      KneserNeyProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, freqdist, bins=None, discount=0.75)
 |      :param freqdist: The trigram frequency distribution upon which to base
 |          the estimation
 |      :type freqdist: FreqDist
 |      :param bins: Included for compatibility with nltk.tag.hmm
 |      :type bins: int or float
 |      :param discount: The discount applied when retrieving counts of
 |          trigrams
 |      :type discount: float (preferred, but can be set to int)
 |
 |  __repr__(self)
 |      Return a string representation of this ProbDist
 |
 |      :rtype: str
 |
 |  discount(self)
 |      Return the value by which counts are discounted. By default set to 0.75.
 |
 |      :rtype: float
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, trigram)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  set_discount(self, discount)
 |      Set the value by which counts are discounted to the value of discount.
 |
 |      :param discount: the new value to discount counts by
 |      :type discount: float (preferred, but int possible)
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from ProbDistI:
 |
 |  SUM_TO_ONE = True
nltk.LancasterStemmer
Python Library Documentation: class LancasterStemmer in module nltk.stem.lancaster

class LancasterStemmer(nltk.stem.api.StemmerI)
 |  LancasterStemmer(rule_tuple=None, strip_prefix_flag=False)
 |
 |  Lancaster Stemmer
 |
 |      >>> from nltk.stem.lancaster import LancasterStemmer
 |      >>> st = LancasterStemmer()
 |      >>> st.stem('maximum')     # Remove "-um" when word is intact
 |      'maxim'
 |      >>> st.stem('presumably')  # Don't remove "-um" when word is not intact
 |      'presum'
 |      >>> st.stem('multiply')    # No action taken if word ends with "-ply"
 |      'multiply'
 |      >>> st.stem('provision')   # Replace "-sion" with "-j" to trigger "j" set of rules
 |      'provid'
 |      >>> st.stem('owed')        # Word starting with vowel must contain at least 2 letters
 |      'ow'
 |      >>> st.stem('ear')         # ditto
 |      'ear'
 |      >>> st.stem('saying')      # Words starting with consonant must contain at least 3
 |      'say'
 |      >>> st.stem('crying')      #     letters and one of those letters must be a vowel
 |      'cry'
 |      >>> st.stem('string')      # ditto
 |      'string'
 |      >>> st.stem('meant')       # ditto
 |      'meant'
 |      >>> st.stem('cement')      # ditto
 |      'cem'
 |      >>> st_pre = LancasterStemmer(strip_prefix_flag=True)
 |      >>> st_pre.stem('kilometer') # Test Prefix
 |      'met'
 |      >>> st_custom = LancasterStemmer(rule_tuple=("ssen4>", "s1t."))
 |      >>> st_custom.stem("ness") # Change s to t
 |      'nest'
 |
 |  Method resolution order:
 |      LancasterStemmer
 |      nltk.stem.api.StemmerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, rule_tuple=None, strip_prefix_flag=False)
 |      Create an instance of the Lancaster stemmer.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  parseRules(self, rule_tuple=None)
 |      Validate the set of rules used in this stemmer.
 |
 |      If this function is called as an individual method, without using stem
 |      method, rule_tuple argument will be compiled into self.rule_dictionary.
 |      If this function is called within stem, self._rule_tuple will be used.
 |
 |  stem(self, word)
 |      Stem a word using the Lancaster stemmer.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  default_rule_tuple = ('ai*2.', 'a*1.', 'bb1.', 'city3s.', 'ci2>', 'cn1...
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.stem.api.StemmerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LaplaceProbDist
Python Library Documentation: class LaplaceProbDist in module nltk.probability

class LaplaceProbDist(LidstoneProbDist)
 |  LaplaceProbDist(freqdist, bins=None)
 |
 |  The Laplace estimate for the probability distribution of the
 |  experiment used to generate a frequency distribution.  The
 |  "Laplace estimate" approximates the probability of a sample with
 |  count *c* from an experiment with *N* outcomes and *B* bins as
 |  *(c+1)/(N+B)*.  This is equivalent to adding one to the count for
 |  each bin, and taking the maximum likelihood estimate of the
 |  resulting frequency distribution.
 |
 |  Method resolution order:
 |      LaplaceProbDist
 |      LidstoneProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, freqdist, bins=None)
 |      Use the Laplace estimate to create a probability distribution
 |      for the experiment used to generate ``freqdist``.
 |
 |      :type freqdist: FreqDist
 |      :param freqdist: The frequency distribution that the
 |          probability estimates should be based on.
 |      :type bins: int
 |      :param bins: The number of sample values that can be generated
 |          by the experiment that is described by the probability
 |          distribution.  This value must be correctly set for the
 |          probabilities of the sample values to sum to one.  If
 |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
 |
 |  __repr__(self)
 |      :rtype: str
 |      :return: A string representation of this ``ProbDist``.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from LidstoneProbDist:
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  freqdist(self)
 |      Return the frequency distribution that this probability
 |      distribution is based on.
 |
 |      :rtype: FreqDist
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from LidstoneProbDist:
 |
 |  SUM_TO_ONE = False
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LazyConcatenation
Python Library Documentation: class LazyConcatenation in module nltk.collections

class LazyConcatenation(AbstractLazySequence)
 |  LazyConcatenation(list_of_lists)
 |
 |  A lazy sequence formed by concatenating a list of lists.  This
 |  underlying list of lists may itself be lazy.  ``LazyConcatenation``
 |  maintains an index that it uses to keep track of the relationship
 |  between offsets in the concatenated lists and offsets in the
 |  sublists.
 |
 |  Method resolution order:
 |      LazyConcatenation
 |      AbstractLazySequence
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, list_of_lists)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __len__(self)
 |      Return the number of tokens in the corpus file underlying this
 |      corpus view.
 |
 |  iterate_from(self, start_index)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view, starting at the token number
 |      ``start``.  If ``start>=len(self)``, then this iterator will
 |      generate no tokens.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractLazySequence:
 |
 |  __add__(self, other)
 |      Return a list concatenating self with other.
 |
 |  __contains__(self, value)
 |      Return true if this list contains ``value``.
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __getitem__(self, i)
 |      Return the *i* th token in the corpus file underlying this
 |      corpus view.  Negative indices and spans are both supported.
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      :raise ValueError: Corpus view objects are unhashable.
 |
 |  __iter__(self)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __radd__(self, other)
 |      Return a list concatenating other with self.
 |
 |  __repr__(self)
 |      Return a string representation for this corpus view that is
 |      similar to a list's representation; but if it would be more
 |      than 60 characters long, it is truncated.
 |
 |  __rmul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  count(self, value)
 |      Return the number of times this list contains ``value``.
 |
 |  index(self, value, start=None, stop=None)
 |      Return the index of the first occurrence of ``value`` in this
 |      list that is greater than or equal to ``start`` and less than
 |      ``stop``.  Negative start and stop values are treated like negative
 |      slice bounds -- i.e., they count from the end of the list.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractLazySequence:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LazyEnumerate
Python Library Documentation: class LazyEnumerate in module nltk.collections

class LazyEnumerate(LazyZip)
 |  LazyEnumerate(lst)
 |
 |  A lazy sequence whose elements are tuples, each containing a count (from
 |  zero) and a value yielded by underlying sequence.  ``LazyEnumerate`` is
 |  useful for obtaining an indexed list. The tuples are constructed lazily
 |  -- i.e., when you read a value from the list, ``LazyEnumerate`` will
 |  calculate that value by forming a tuple from the count of the i-th
 |  element and the i-th element of the underlying sequence.
 |
 |  ``LazyEnumerate`` is essentially a lazy version of the Python primitive
 |  function ``enumerate``.  In particular, the following two expressions are
 |  equivalent:
 |
 |      >>> from nltk.collections import LazyEnumerate
 |      >>> sequence = ['first', 'second', 'third']
 |      >>> list(enumerate(sequence))
 |      [(0, 'first'), (1, 'second'), (2, 'third')]
 |      >>> list(LazyEnumerate(sequence))
 |      [(0, 'first'), (1, 'second'), (2, 'third')]
 |
 |  Lazy enumerations can be useful for conserving memory in cases where the
 |  argument sequences are particularly long.
 |
 |  A typical example of a use case for this class is obtaining an indexed
 |  list for a long sequence of values.  By constructing tuples lazily and
 |  avoiding the creation of an additional long sequence, memory usage can be
 |  significantly reduced.
 |
 |  Method resolution order:
 |      LazyEnumerate
 |      LazyZip
 |      LazyMap
 |      AbstractLazySequence
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, lst)
 |      :param lst: the underlying list
 |      :type lst: list
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from LazyZip:
 |
 |  __len__(self)
 |      Return the number of tokens in the corpus file underlying this
 |      corpus view.
 |
 |  iterate_from(self, index)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view, starting at the token number
 |      ``start``.  If ``start>=len(self)``, then this iterator will
 |      generate no tokens.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from LazyMap:
 |
 |  __getitem__(self, index)
 |      Return the *i* th token in the corpus file underlying this
 |      corpus view.  Negative indices and spans are both supported.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractLazySequence:
 |
 |  __add__(self, other)
 |      Return a list concatenating self with other.
 |
 |  __contains__(self, value)
 |      Return true if this list contains ``value``.
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      :raise ValueError: Corpus view objects are unhashable.
 |
 |  __iter__(self)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __radd__(self, other)
 |      Return a list concatenating other with self.
 |
 |  __repr__(self)
 |      Return a string representation for this corpus view that is
 |      similar to a list's representation; but if it would be more
 |      than 60 characters long, it is truncated.
 |
 |  __rmul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  count(self, value)
 |      Return the number of times this list contains ``value``.
 |
 |  index(self, value, start=None, stop=None)
 |      Return the index of the first occurrence of ``value`` in this
 |      list that is greater than or equal to ``start`` and less than
 |      ``stop``.  Negative start and stop values are treated like negative
 |      slice bounds -- i.e., they count from the end of the list.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractLazySequence:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LazyIteratorList
Python Library Documentation: class LazyIteratorList in module nltk.collections

class LazyIteratorList(AbstractLazySequence)
 |  LazyIteratorList(it, known_len=None)
 |
 |  Wraps an iterator, loading its elements on demand
 |  and making them subscriptable.
 |  __repr__ displays only the first few elements.
 |
 |  Method resolution order:
 |      LazyIteratorList
 |      AbstractLazySequence
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __add__(self, other)
 |      Return a list concatenating self with other.
 |
 |  __init__(self, it, known_len=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __len__(self)
 |      Return the number of tokens in the corpus file underlying this
 |      corpus view.
 |
 |  __radd__(self, other)
 |      Return a list concatenating other with self.
 |
 |  iterate_from(self, start)
 |      Create a new iterator over this list starting at the given offset.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractLazySequence:
 |
 |  __contains__(self, value)
 |      Return true if this list contains ``value``.
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __getitem__(self, i)
 |      Return the *i* th token in the corpus file underlying this
 |      corpus view.  Negative indices and spans are both supported.
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      :raise ValueError: Corpus view objects are unhashable.
 |
 |  __iter__(self)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Return a string representation for this corpus view that is
 |      similar to a list's representation; but if it would be more
 |      than 60 characters long, it is truncated.
 |
 |  __rmul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  count(self, value)
 |      Return the number of times this list contains ``value``.
 |
 |  index(self, value, start=None, stop=None)
 |      Return the index of the first occurrence of ``value`` in this
 |      list that is greater than or equal to ``start`` and less than
 |      ``stop``.  Negative start and stop values are treated like negative
 |      slice bounds -- i.e., they count from the end of the list.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractLazySequence:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LazyMap
Python Library Documentation: class LazyMap in module nltk.collections

class LazyMap(AbstractLazySequence)
 |  LazyMap(function, *lists, **config)
 |
 |  A lazy sequence whose elements are formed by applying a given
 |  function to each element in one or more underlying lists.  The
 |  function is applied lazily -- i.e., when you read a value from the
 |  list, ``LazyMap`` will calculate that value by applying its
 |  function to the underlying lists' value(s).  ``LazyMap`` is
 |  essentially a lazy version of the Python primitive function
 |  ``map``.  In particular, the following two expressions are
 |  equivalent:
 |
 |      >>> from nltk.collections import LazyMap
 |      >>> function = str
 |      >>> sequence = [1,2,3]
 |      >>> map(function, sequence) # doctest: +SKIP
 |      ['1', '2', '3']
 |      >>> list(LazyMap(function, sequence))
 |      ['1', '2', '3']
 |
 |  Like the Python ``map`` primitive, if the source lists do not have
 |  equal size, then the value None will be supplied for the
 |  'missing' elements.
 |
 |  Lazy maps can be useful for conserving memory, in cases where
 |  individual values take up a lot of space.  This is especially true
 |  if the underlying list's values are constructed lazily, as is the
 |  case with many corpus readers.
 |
 |  A typical example of a use case for this class is performing
 |  feature detection on the tokens in a corpus.  Since featuresets
 |  are encoded as dictionaries, which can take up a lot of memory,
 |  using a ``LazyMap`` can significantly reduce memory usage when
 |  training and running classifiers.
 |
 |  Method resolution order:
 |      LazyMap
 |      AbstractLazySequence
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __getitem__(self, index)
 |      Return the *i* th token in the corpus file underlying this
 |      corpus view.  Negative indices and spans are both supported.
 |
 |  __init__(self, function, *lists, **config)
 |      :param function: The function that should be applied to
 |          elements of ``lists``.  It should take as many arguments
 |          as there are ``lists``.
 |      :param lists: The underlying lists.
 |      :param cache_size: Determines the size of the cache used
 |          by this lazy map.  (default=5)
 |
 |  __len__(self)
 |      Return the number of tokens in the corpus file underlying this
 |      corpus view.
 |
 |  iterate_from(self, index)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view, starting at the token number
 |      ``start``.  If ``start>=len(self)``, then this iterator will
 |      generate no tokens.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractLazySequence:
 |
 |  __add__(self, other)
 |      Return a list concatenating self with other.
 |
 |  __contains__(self, value)
 |      Return true if this list contains ``value``.
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      :raise ValueError: Corpus view objects are unhashable.
 |
 |  __iter__(self)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __radd__(self, other)
 |      Return a list concatenating other with self.
 |
 |  __repr__(self)
 |      Return a string representation for this corpus view that is
 |      similar to a list's representation; but if it would be more
 |      than 60 characters long, it is truncated.
 |
 |  __rmul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  count(self, value)
 |      Return the number of times this list contains ``value``.
 |
 |  index(self, value, start=None, stop=None)
 |      Return the index of the first occurrence of ``value`` in this
 |      list that is greater than or equal to ``start`` and less than
 |      ``stop``.  Negative start and stop values are treated like negative
 |      slice bounds -- i.e., they count from the end of the list.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractLazySequence:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LazySubsequence
Python Library Documentation: class LazySubsequence in module nltk.collections

class LazySubsequence(AbstractLazySequence)
 |  LazySubsequence(source, start, stop)
 |
 |  A subsequence produced by slicing a lazy sequence.  This slice
 |  keeps a reference to its source sequence, and generates its values
 |  by looking them up in the source sequence.
 |
 |  Method resolution order:
 |      LazySubsequence
 |      AbstractLazySequence
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, source, start, stop)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __len__(self)
 |      Return the number of tokens in the corpus file underlying this
 |      corpus view.
 |
 |  iterate_from(self, start)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view, starting at the token number
 |      ``start``.  If ``start>=len(self)``, then this iterator will
 |      generate no tokens.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(cls, source, start, stop)
 |      Construct a new slice from a given underlying sequence.  The
 |      ``start`` and ``stop`` indices should be absolute indices --
 |      i.e., they should not be negative (for indexing from the back
 |      of a list) or greater than the length of ``source``.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MIN_SIZE = 100
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractLazySequence:
 |
 |  __add__(self, other)
 |      Return a list concatenating self with other.
 |
 |  __contains__(self, value)
 |      Return true if this list contains ``value``.
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __getitem__(self, i)
 |      Return the *i* th token in the corpus file underlying this
 |      corpus view.  Negative indices and spans are both supported.
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      :raise ValueError: Corpus view objects are unhashable.
 |
 |  __iter__(self)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __radd__(self, other)
 |      Return a list concatenating other with self.
 |
 |  __repr__(self)
 |      Return a string representation for this corpus view that is
 |      similar to a list's representation; but if it would be more
 |      than 60 characters long, it is truncated.
 |
 |  __rmul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  count(self, value)
 |      Return the number of times this list contains ``value``.
 |
 |  index(self, value, start=None, stop=None)
 |      Return the index of the first occurrence of ``value`` in this
 |      list that is greater than or equal to ``start`` and less than
 |      ``stop``.  Negative start and stop values are treated like negative
 |      slice bounds -- i.e., they count from the end of the list.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractLazySequence:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LazyZip
Python Library Documentation: class LazyZip in module nltk.collections

class LazyZip(LazyMap)
 |  LazyZip(*lists)
 |
 |  A lazy sequence whose elements are tuples, each containing the i-th
 |  element from each of the argument sequences.  The returned list is
 |  truncated in length to the length of the shortest argument sequence. The
 |  tuples are constructed lazily -- i.e., when you read a value from the
 |  list, ``LazyZip`` will calculate that value by forming a tuple from
 |  the i-th element of each of the argument sequences.
 |
 |  ``LazyZip`` is essentially a lazy version of the Python primitive function
 |  ``zip``.  In particular, an evaluated LazyZip is equivalent to a zip:
 |
 |      >>> from nltk.collections import LazyZip
 |      >>> sequence1, sequence2 = [1, 2, 3], ['a', 'b', 'c']
 |      >>> zip(sequence1, sequence2) # doctest: +SKIP
 |      [(1, 'a'), (2, 'b'), (3, 'c')]
 |      >>> list(LazyZip(sequence1, sequence2))
 |      [(1, 'a'), (2, 'b'), (3, 'c')]
 |      >>> sequences = [sequence1, sequence2, [6,7,8,9]]
 |      >>> list(zip(*sequences)) == list(LazyZip(*sequences))
 |      True
 |
 |  Lazy zips can be useful for conserving memory in cases where the argument
 |  sequences are particularly long.
 |
 |  A typical example of a use case for this class is combining long sequences
 |  of gold standard and predicted values in a classification or tagging task
 |  in order to calculate accuracy.  By constructing tuples lazily and
 |  avoiding the creation of an additional long sequence, memory usage can be
 |  significantly reduced.
 |
 |  Method resolution order:
 |      LazyZip
 |      LazyMap
 |      AbstractLazySequence
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, *lists)
 |      :param lists: the underlying lists
 |      :type lists: list(list)
 |
 |  __len__(self)
 |      Return the number of tokens in the corpus file underlying this
 |      corpus view.
 |
 |  iterate_from(self, index)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view, starting at the token number
 |      ``start``.  If ``start>=len(self)``, then this iterator will
 |      generate no tokens.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from LazyMap:
 |
 |  __getitem__(self, index)
 |      Return the *i* th token in the corpus file underlying this
 |      corpus view.  Negative indices and spans are both supported.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractLazySequence:
 |
 |  __add__(self, other)
 |      Return a list concatenating self with other.
 |
 |  __contains__(self, value)
 |      Return true if this list contains ``value``.
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      :raise ValueError: Corpus view objects are unhashable.
 |
 |  __iter__(self)
 |      Return an iterator that generates the tokens in the corpus
 |      file underlying this corpus view.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __radd__(self, other)
 |      Return a list concatenating other with self.
 |
 |  __repr__(self)
 |      Return a string representation for this corpus view that is
 |      similar to a list's representation; but if it would be more
 |      than 60 characters long, it is truncated.
 |
 |  __rmul__(self, count)
 |      Return a list concatenating self with itself ``count`` times.
 |
 |  count(self, value)
 |      Return the number of times this list contains ``value``.
 |
 |  index(self, value, start=None, stop=None)
 |      Return the index of the first occurrence of ``value`` in this
 |      list that is greater than or equal to ``start`` and less than
 |      ``stop``.  Negative start and stop values are treated like negative
 |      slice bounds -- i.e., they count from the end of the list.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractLazySequence:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LeftCornerChartParser
Python Library Documentation: class LeftCornerChartParser in module nltk.parse.chart

class LeftCornerChartParser(ChartParser)
 |  LeftCornerChartParser(grammar, **parser_args)
 |
 |  Method resolution order:
 |      LeftCornerChartParser
 |      ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LegalitySyllableTokenizer
Python Library Documentation: class LegalitySyllableTokenizer in module nltk.tokenize.legality_principle

class LegalitySyllableTokenizer(nltk.tokenize.api.TokenizerI)
 |  LegalitySyllableTokenizer(tokenized_source_text, vowels='aeiouy', legal_frequency_threshold=0.001)
 |
 |  Syllabifies words based on the Legality Principle and Onset Maximization.
 |
 |      >>> from nltk.tokenize import LegalitySyllableTokenizer
 |      >>> from nltk import word_tokenize
 |      >>> from nltk.corpus import words
 |      >>> text = "This is a wonderful sentence."
 |      >>> text_words = word_tokenize(text)
 |      >>> LP = LegalitySyllableTokenizer(words.words())
 |      >>> [LP.tokenize(word) for word in text_words]
 |      [['This'], ['is'], ['a'], ['won', 'der', 'ful'], ['sen', 'ten', 'ce'], ['.']]
 |
 |  Method resolution order:
 |      LegalitySyllableTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, tokenized_source_text, vowels='aeiouy', legal_frequency_threshold=0.001)
 |      :param tokenized_source_text: List of valid tokens in the language
 |      :type tokenized_source_text: list(str)
 |      :param vowels: Valid vowels in language or IPA representation
 |      :type vowels: str
 |      :param legal_frequency_threshold: Lowest frequency of all onsets to be considered a legal onset
 |      :type legal_frequency_threshold: float
 |
 |  find_legal_onsets(self, words)
 |      Gathers all onsets and then return only those above the frequency threshold
 |
 |      :param words: List of words in a language
 |      :type words: list(str)
 |      :return: Set of legal onsets
 |      :rtype: set(str)
 |
 |  onset(self, word)
 |      Returns consonant cluster of word, i.e. all characters until the first vowel.
 |
 |      :param word: Single word or token
 |      :type word: str
 |      :return: String of characters of onset
 |      :rtype: str
 |
 |  tokenize(self, token)
 |      Apply the Legality Principle in combination with
 |      Onset Maximization to return a list of syllables.
 |
 |      :param token: Single word or token
 |      :type token: str
 |      :return syllable_list: Single word or token broken up into syllables.
 |      :rtype: list(str)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LidstoneProbDist
Python Library Documentation: class LidstoneProbDist in module nltk.probability

class LidstoneProbDist(ProbDistI)
 |  LidstoneProbDist(freqdist, gamma, bins=None)
 |
 |  The Lidstone estimate for the probability distribution of the
 |  experiment used to generate a frequency distribution.  The
 |  "Lidstone estimate" is parameterized by a real number *gamma*,
 |  which typically ranges from 0 to 1.  The Lidstone estimate
 |  approximates the probability of a sample with count *c* from an
 |  experiment with *N* outcomes and *B* bins as
 |  ``c+gamma)/(N+B*gamma)``.  This is equivalent to adding
 |  *gamma* to the count for each bin, and taking the maximum
 |  likelihood estimate of the resulting frequency distribution.
 |
 |  Method resolution order:
 |      LidstoneProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, freqdist, gamma, bins=None)
 |      Use the Lidstone estimate to create a probability distribution
 |      for the experiment used to generate ``freqdist``.
 |
 |      :type freqdist: FreqDist
 |      :param freqdist: The frequency distribution that the
 |          probability estimates should be based on.
 |      :type gamma: float
 |      :param gamma: A real number used to parameterize the
 |          estimate.  The Lidstone estimate is equivalent to adding
 |          *gamma* to the count for each bin, and taking the
 |          maximum likelihood estimate of the resulting frequency
 |          distribution.
 |      :type bins: int
 |      :param bins: The number of sample values that can be generated
 |          by the experiment that is described by the probability
 |          distribution.  This value must be correctly set for the
 |          probabilities of the sample values to sum to one.  If
 |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
 |
 |  __repr__(self)
 |      Return a string representation of this ``ProbDist``.
 |
 |      :rtype: str
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  freqdist(self)
 |      Return the frequency distribution that this probability
 |      distribution is based on.
 |
 |      :rtype: FreqDist
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  SUM_TO_ONE = False
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LineTokenizer
Python Library Documentation: class LineTokenizer in module nltk.tokenize.simple

class LineTokenizer(nltk.tokenize.api.TokenizerI)
 |  LineTokenizer(blanklines='discard')
 |
 |  Tokenize a string into its lines, optionally discarding blank lines.
 |  This is similar to ``s.split('\n')``.
 |
 |      >>> from nltk.tokenize import LineTokenizer
 |      >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
 |      >>> LineTokenizer(blanklines='keep').tokenize(s) # doctest: +NORMALIZE_WHITESPACE
 |      ['Good muffins cost $3.88', 'in New York.  Please buy me',
 |      'two of them.', '', 'Thanks.']
 |      >>> # same as [l for l in s.split('\n') if l.strip()]:
 |      >>> LineTokenizer(blanklines='discard').tokenize(s) # doctest: +NORMALIZE_WHITESPACE
 |      ['Good muffins cost $3.88', 'in New York.  Please buy me',
 |      'two of them.', 'Thanks.']
 |
 |  :param blanklines: Indicates how blank lines should be handled.  Valid values are:
 |
 |      - ``discard``: strip blank lines out of the token list before returning it.
 |         A line is considered blank if it contains only whitespace characters.
 |      - ``keep``: leave all blank lines in the token list.
 |      - ``discard-eof``: if the string ends with a newline, then do not generate
 |         a corresponding token ``''`` after that newline.
 |
 |  Method resolution order:
 |      LineTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, blanklines='discard')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  span_tokenize(self, s)
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  tokenize(self, s)
 |      Return a tokenized copy of *s*.
 |
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.LogicalExpressionException
Python Library Documentation: class LogicalExpressionException in module nltk.sem.logic

class LogicalExpressionException(builtins.Exception)
 |  LogicalExpressionException(index, message)
 |
 |  Method resolution order:
 |      LogicalExpressionException
 |      builtins.Exception
 |      builtins.BaseException
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, index, message)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.Exception:
 |
 |  __new__(*args, **kwargs) class method of builtins.Exception
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.BaseException:
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __reduce__(...)
 |      Helper for pickle.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __setstate__(...)
 |
 |  __str__(self, /)
 |      Return str(self).
 |
 |  add_note(...)
 |      Exception.add_note(note) --
 |      add a note to the exception
 |
 |  with_traceback(...)
 |      Exception.with_traceback(tb) --
 |      set self.__traceback__ to tb and return self.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from builtins.BaseException:
 |
 |  __cause__
 |      exception cause
 |
 |  __context__
 |      exception context
 |
 |  __dict__
 |
 |  __suppress_context__
 |
 |  __traceback__
 |
 |  args
nltk.LongestChartParser
Python Library Documentation: class LongestChartParser in module nltk.parse.pchart

class LongestChartParser(BottomUpProbabilisticChartParser)
 |  LongestChartParser(grammar, beam_size=0, trace=0)
 |
 |  A bottom-up parser for ``PCFG`` grammars that tries longer edges before
 |  shorter ones.  This sorting order results in a type of best-first
 |  search strategy.
 |
 |  Method resolution order:
 |      LongestChartParser
 |      BottomUpProbabilisticChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  sort_queue(self, queue, chart)
 |      Sort the given queue of ``Edge`` objects, placing the edge that should
 |      be tried first at the beginning of the queue.  This method
 |      will be called after each ``Edge`` is added to the queue.
 |
 |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
 |          this queue is an edge that could be added to the chart by
 |          the fundamental rule; but that has not yet been added.
 |      :type queue: list(Edge)
 |      :param chart: The chart being used to parse the text.  This
 |          chart can be used to provide extra information for sorting
 |          the queue.
 |      :type chart: Chart
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BottomUpProbabilisticChartParser:
 |
 |  __init__(self, grammar, beam_size=0, trace=0)
 |      Create a new ``BottomUpProbabilisticChartParser``, that uses
 |      ``grammar`` to parse texts.
 |
 |      :type grammar: PCFG
 |      :param grammar: The grammar used to parse texts.
 |      :type beam_size: int
 |      :param beam_size: The maximum length for the parser's edge queue.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.MAX_EVERYGRAMS_DEFAULT_LEN
Python Library Documentation: int object

class int(object)
 |  int([x]) -> integer
 |  int(x, base=10) -> integer
 |
 |  Convert a number or string to an integer, or return 0 if no arguments
 |  are given.  If x is a number, return x.__int__().  For floating-point
 |  numbers, this truncates towards zero.
 |
 |  If x is not a number or if base is given, then x must be a string,
 |  bytes, or bytearray instance representing an integer literal in the
 |  given base.  The literal can be preceded by '+' or '-' and be surrounded
 |  by whitespace.  The base defaults to 10.  Valid bases are 0 and 2-36.
 |  Base 0 means to interpret the base from the string as an integer literal.
 |  >>> int('0b100', base=0)
 |  4
 |
 |  Built-in subclasses:
 |      bool
 |
 |  Methods defined here:
 |
 |  __abs__(self, /)
 |      abs(self)
 |
 |  __add__(self, value, /)
 |      Return self+value.
 |
 |  __and__(self, value, /)
 |      Return self&value.
 |
 |  __bool__(self, /)
 |      True if self else False
 |
 |  __ceil__(...)
 |      Ceiling of an Integral returns itself.
 |
 |  __divmod__(self, value, /)
 |      Return divmod(self, value).
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __float__(self, /)
 |      float(self)
 |
 |  __floor__(...)
 |      Flooring an Integral returns itself.
 |
 |  __floordiv__(self, value, /)
 |      Return self//value.
 |
 |  __format__(self, format_spec, /)
 |      Convert to a string according to format_spec.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __getnewargs__(self, /)
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __hash__(self, /)
 |      Return hash(self).
 |
 |  __index__(self, /)
 |      Return self converted to an integer, if self is suitable for use as an index into a list.
 |
 |  __int__(self, /)
 |      int(self)
 |
 |  __invert__(self, /)
 |      ~self
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __lshift__(self, value, /)
 |      Return self<<value.
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __mod__(self, value, /)
 |      Return self%value.
 |
 |  __mul__(self, value, /)
 |      Return self*value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __neg__(self, /)
 |      -self
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __pos__(self, /)
 |      +self
 |
 |  __pow__(self, value, mod=None, /)
 |      Return pow(self, value, mod).
 |
 |  __radd__(self, value, /)
 |      Return value+self.
 |
 |  __rand__(self, value, /)
 |      Return value&self.
 |
 |  __rdivmod__(self, value, /)
 |      Return divmod(value, self).
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __rfloordiv__(self, value, /)
 |      Return value//self.
 |
 |  __rlshift__(self, value, /)
 |      Return value<<self.
 |
 |  __rmod__(self, value, /)
 |      Return value%self.
 |
 |  __rmul__(self, value, /)
 |      Return value*self.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __round__(...)
 |      Rounding an Integral returns itself.
 |
 |      Rounding with an ndigits argument also returns an integer.
 |
 |  __rpow__(self, value, mod=None, /)
 |      Return pow(value, self, mod).
 |
 |  __rrshift__(self, value, /)
 |      Return value>>self.
 |
 |  __rshift__(self, value, /)
 |      Return self>>value.
 |
 |  __rsub__(self, value, /)
 |      Return value-self.
 |
 |  __rtruediv__(self, value, /)
 |      Return value/self.
 |
 |  __rxor__(self, value, /)
 |      Return value^self.
 |
 |  __sizeof__(self, /)
 |      Returns size in memory, in bytes.
 |
 |  __sub__(self, value, /)
 |      Return self-value.
 |
 |  __truediv__(self, value, /)
 |      Return self/value.
 |
 |  __trunc__(...)
 |      Truncating an Integral returns itself.
 |
 |  __xor__(self, value, /)
 |      Return self^value.
 |
 |  as_integer_ratio(self, /)
 |      Return a pair of integers, whose ratio is equal to the original int.
 |
 |      The ratio is in lowest terms and has a positive denominator.
 |
 |      >>> (10).as_integer_ratio()
 |      (10, 1)
 |      >>> (-10).as_integer_ratio()
 |      (-10, 1)
 |      >>> (0).as_integer_ratio()
 |      (0, 1)
 |
 |  bit_count(self, /)
 |      Number of ones in the binary representation of the absolute value of self.
 |
 |      Also known as the population count.
 |
 |      >>> bin(13)
 |      '0b1101'
 |      >>> (13).bit_count()
 |      3
 |
 |  bit_length(self, /)
 |      Number of bits necessary to represent self in binary.
 |
 |      >>> bin(37)
 |      '0b100101'
 |      >>> (37).bit_length()
 |      6
 |
 |  conjugate(...)
 |      Returns self, the complex conjugate of any int.
 |
 |  is_integer(self, /)
 |      Returns True. Exists for duck type compatibility with float.is_integer.
 |
 |  to_bytes(self, /, length=1, byteorder='big', *, signed=False)
 |      Return an array of bytes representing an integer.
 |
 |      length
 |        Length of bytes object to use.  An OverflowError is raised if the
 |        integer is not representable with the given number of bytes.  Default
 |        is length 1.
 |      byteorder
 |        The byte order used to represent the integer.  If byteorder is 'big',
 |        the most significant byte is at the beginning of the byte array.  If
 |        byteorder is 'little', the most significant byte is at the end of the
 |        byte array.  To request the native byte order of the host system, use
 |        `sys.byteorder' as the byte order value.  Default is to use 'big'.
 |      signed
 |        Determines whether two's complement is used to represent the integer.
 |        If signed is False and a negative integer is given, an OverflowError
 |        is raised.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  from_bytes(bytes, byteorder='big', *, signed=False)
 |      Return the integer represented by the given array of bytes.
 |
 |      bytes
 |        Holds the array of bytes to convert.  The argument must either
 |        support the buffer protocol or be an iterable object producing bytes.
 |        Bytes and bytearray are examples of built-in objects that support the
 |        buffer protocol.
 |      byteorder
 |        The byte order used to represent the integer.  If byteorder is 'big',
 |        the most significant byte is at the beginning of the byte array.  If
 |        byteorder is 'little', the most significant byte is at the end of the
 |        byte array.  To request the native byte order of the host system, use
 |        `sys.byteorder' as the byte order value.  Default is to use 'big'.
 |      signed
 |        Indicates whether two's complement is used to represent the integer.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  denominator
 |      the denominator of a rational number in lowest terms
 |
 |  imag
 |      the imaginary part of a complex number
 |
 |  numerator
 |      the numerator of a rational number in lowest terms
 |
 |  real
 |      the real part of a complex number
nltk.MLEProbDist
Python Library Documentation: class MLEProbDist in module nltk.probability

class MLEProbDist(ProbDistI)
 |  MLEProbDist(freqdist, bins=None)
 |
 |  The maximum likelihood estimate for the probability distribution
 |  of the experiment used to generate a frequency distribution.  The
 |  "maximum likelihood estimate" approximates the probability of
 |  each sample as the frequency of that sample in the frequency
 |  distribution.
 |
 |  Method resolution order:
 |      MLEProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, freqdist, bins=None)
 |      Use the maximum likelihood estimate to create a probability
 |      distribution for the experiment used to generate ``freqdist``.
 |
 |      :type freqdist: FreqDist
 |      :param freqdist: The frequency distribution that the
 |          probability estimates should be based on.
 |
 |  __repr__(self)
 |      :rtype: str
 |      :return: A string representation of this ``ProbDist``.
 |
 |  freqdist(self)
 |      Return the frequency distribution that this probability
 |      distribution is based on.
 |
 |      :rtype: FreqDist
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from ProbDistI:
 |
 |  SUM_TO_ONE = True
nltk.MWETokenizer
Python Library Documentation: class MWETokenizer in module nltk.tokenize.mwe

class MWETokenizer(nltk.tokenize.api.TokenizerI)
 |  MWETokenizer(mwes=None, separator='_')
 |
 |  A tokenizer that processes tokenized text and merges multi-word expressions
 |  into single tokens.
 |
 |  Method resolution order:
 |      MWETokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, mwes=None, separator='_')
 |      Initialize the multi-word tokenizer with a list of expressions and a
 |      separator
 |
 |      :type mwes: list(list(str))
 |      :param mwes: A sequence of multi-word expressions to be merged, where
 |          each MWE is a sequence of strings.
 |      :type separator: str
 |      :param separator: String that should be inserted between words in a multi-word
 |          expression token. (Default is '_')
 |
 |  add_mwe(self, mwe)
 |      Add a multi-word expression to the lexicon (stored as a word trie)
 |
 |      We use ``util.Trie`` to represent the trie. Its form is a dict of dicts.
 |      The key True marks the end of a valid MWE.
 |
 |      :param mwe: The multi-word expression we're adding into the word trie
 |      :type mwe: tuple(str) or list(str)
 |
 |      :Example:
 |
 |      >>> tokenizer = MWETokenizer()
 |      >>> tokenizer.add_mwe(('a', 'b'))
 |      >>> tokenizer.add_mwe(('a', 'b', 'c'))
 |      >>> tokenizer.add_mwe(('a', 'x'))
 |      >>> expected = {'a': {'x': {True: None}, 'b': {True: None, 'c': {True: None}}}}
 |      >>> tokenizer._mwes == expected
 |      True
 |
 |  tokenize(self, text)
 |      :param text: A list containing tokenized text
 |      :type text: list(str)
 |      :return: A list of the tokenized text with multi-words merged together
 |      :rtype: list(str)
 |
 |      :Example:
 |
 |      >>> tokenizer = MWETokenizer([('hors', "d'oeuvre")], separator='+')
 |      >>> tokenizer.tokenize("An hors d'oeuvre tonight, sir?".split())
 |      ['An', "hors+d'oeuvre", 'tonight,', 'sir?']
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Mace
Python Library Documentation: class Mace in module nltk.inference.mace

class Mace(nltk.inference.prover9.Prover9Parent, nltk.inference.api.ModelBuilder)
 |  Mace(end_size=500)
 |
 |  Method resolution order:
 |      Mace
 |      nltk.inference.prover9.Prover9Parent
 |      nltk.inference.api.ModelBuilder
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, end_size=500)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.prover9.Prover9Parent:
 |
 |  binary_locations(self)
 |      A list of directories that should be searched for the prover9
 |      executables.  This list is used by ``config_prover9`` when searching
 |      for the prover9 executables.
 |
 |  config_prover9(self, binary_location, verbose=False)
 |
 |  prover9_input(self, goal, assumptions)
 |      :return: The input string that should be provided to the
 |          prover9 binary.  This string is formed based on the goal,
 |          assumptions, and timeout value of this object.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.inference.prover9.Prover9Parent:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.ModelBuilder:
 |
 |  build_model(self, goal=None, assumptions=None, verbose=False)
 |      Perform the actual model building.
 |      :return: Whether a model was generated
 |      :rtype: bool
nltk.MaceCommand
Python Library Documentation: class MaceCommand in module nltk.inference.mace

class MaceCommand(nltk.inference.prover9.Prover9CommandParent, nltk.inference.api.BaseModelBuilderCommand)
 |  MaceCommand(goal=None, assumptions=None, max_models=500, model_builder=None)
 |
 |  A ``MaceCommand`` specific to the ``Mace`` model builder.  It contains
 |  a print_assumptions() method that is used to print the list
 |  of assumptions in multiple formats.
 |
 |  Method resolution order:
 |      MaceCommand
 |      nltk.inference.prover9.Prover9CommandParent
 |      nltk.inference.api.BaseModelBuilderCommand
 |      nltk.inference.api.BaseTheoremToolCommand
 |      nltk.inference.api.ModelBuilderCommand
 |      nltk.inference.api.TheoremToolCommand
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, goal=None, assumptions=None, max_models=500, model_builder=None)
 |      :param goal: Input expression to prove
 |      :type goal: sem.Expression
 |      :param assumptions: Input expressions to use as assumptions in
 |          the proof.
 |      :type assumptions: list(sem.Expression)
 |      :param max_models: The maximum number of models that Mace will try before
 |          simply returning false. (Use 0 for no maximum.)
 |      :type max_models: int
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  valuation
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.prover9.Prover9CommandParent:
 |
 |  print_assumptions(self, output_format='nltk')
 |      Print the list of the current assumptions.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.inference.prover9.Prover9CommandParent:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.BaseModelBuilderCommand:
 |
 |  build_model(self, verbose=False)
 |      Attempt to build a model.  Store the result to prevent unnecessary
 |      re-building.
 |
 |  get_model_builder(self)
 |      Return the model builder object
 |      :return: ``ModelBuilder``
 |
 |  model(self, format=None)
 |      Return a string representation of the model
 |
 |      :param simplify: bool simplify the proof?
 |      :return: str
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.BaseTheoremToolCommand:
 |
 |  add_assumptions(self, new_assumptions)
 |      Add new assumptions to the assumption list.
 |
 |      :param new_assumptions: new assumptions
 |      :type new_assumptions: list(sem.Expression)
 |
 |  assumptions(self)
 |      List the current assumptions.
 |
 |      :return: list of ``Expression``
 |
 |  goal(self)
 |      Return the goal
 |
 |      :return: ``Expression``
 |
 |  retract_assumptions(self, retracted, debug=False)
 |      Retract assumptions from the assumption list.
 |
 |      :param debug: If True, give warning when ``retracted`` is not present on
 |          assumptions list.
 |      :type debug: bool
 |      :param retracted: assumptions to be retracted
 |      :type retracted: list(sem.Expression)
nltk.MaltParser
Python Library Documentation: class MaltParser in module nltk.parse.malt

class MaltParser(nltk.parse.api.ParserI)
 |  MaltParser(parser_dirname='', model_filename=None, tagger=None, additional_java_args=None)
 |
 |  A class for dependency parsing with MaltParser. The input is the paths to:
 |  - (optionally) a maltparser directory
 |  - (optionally) the path to a pre-trained MaltParser .mco model file
 |  - (optionally) the tagger to use for POS tagging before parsing
 |  - (optionally) additional Java arguments
 |
 |  Example:
 |      >>> from nltk.parse import malt
 |      >>> # With MALT_PARSER and MALT_MODEL environment set.
 |      >>> mp = malt.MaltParser(model_filename='engmalt.linear-1.7.mco') # doctest: +SKIP
 |      >>> mp.parse_one('I shot an elephant in my pajamas .'.split()).tree() # doctest: +SKIP
 |      (shot I (elephant an) (in (pajamas my)) .)
 |      >>> # Without MALT_PARSER and MALT_MODEL environment.
 |      >>> mp = malt.MaltParser('/home/user/maltparser-1.9.2/', '/home/user/engmalt.linear-1.7.mco') # doctest: +SKIP
 |      >>> mp.parse_one('I shot an elephant in my pajamas .'.split()).tree() # doctest: +SKIP
 |      (shot I (elephant an) (in (pajamas my)) .)
 |
 |  Method resolution order:
 |      MaltParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, parser_dirname='', model_filename=None, tagger=None, additional_java_args=None)
 |      An interface for parsing with the Malt Parser.
 |
 |      :param parser_dirname: The path to the maltparser directory that
 |          contains the maltparser-1.x.jar
 |      :type parser_dirname: str
 |      :param model_filename: The name of the pre-trained model with .mco file
 |          extension. If provided, training will not be required.
 |          (see http://www.maltparser.org/mco/mco.html and
 |          see http://www.patful.com/chalk/node/185)
 |      :type model_filename: str
 |      :param tagger: The tagger used to POS tag the raw string before
 |          formatting to CONLL format. It should behave like `nltk.pos_tag`
 |      :type tagger: function
 |      :param additional_java_args: This is the additional Java arguments that
 |          one can use when calling Maltparser, usually this is the heapsize
 |          limits, e.g. `additional_java_args=['-Xmx1024m']`
 |          (see https://javarevisited.blogspot.com/2011/05/java-heap-space-memory-size-jvm.html)
 |      :type additional_java_args: list
 |
 |  generate_malt_command(self, inputfilename, outputfilename=None, mode=None)
 |      This function generates the maltparser command use at the terminal.
 |
 |      :param inputfilename: path to the input file
 |      :type inputfilename: str
 |      :param outputfilename: path to the output file
 |      :type outputfilename: str
 |
 |  parse_sents(self, sentences, verbose=False, top_relation_label='null')
 |      Use MaltParser to parse multiple sentences.
 |      Takes a list of sentences, where each sentence is a list of words.
 |      Each sentence will be automatically tagged with this
 |      MaltParser instance's tagger.
 |
 |      :param sentences: Input sentences to parse
 |      :type sentence: list(list(str))
 |      :return: iter(DependencyGraph)
 |
 |  parse_tagged_sents(self, sentences, verbose=False, top_relation_label='null')
 |      Use MaltParser to parse multiple POS tagged sentences. Takes multiple
 |      sentences where each sentence is a list of (word, tag) tuples.
 |      The sentences must have already been tokenized and tagged.
 |
 |      :param sentences: Input sentences to parse
 |      :type sentence: list(list(tuple(str, str)))
 |      :return: iter(iter(``DependencyGraph``)) the dependency graph
 |          representation of each sentence
 |
 |  train(self, depgraphs, verbose=False)
 |      Train MaltParser from a list of ``DependencyGraph`` objects
 |
 |      :param depgraphs: list of ``DependencyGraph`` objects for training input data
 |      :type depgraphs: DependencyGraph
 |
 |  train_from_file(self, conll_file, verbose=False)
 |      Train MaltParser from a file
 |      :param conll_file: str for the filename of the training input data
 |      :type conll_file: str
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, sent, *args, **kwargs)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.MaxentClassifier
Python Library Documentation: class MaxentClassifier in module nltk.classify.maxent

class MaxentClassifier(nltk.classify.api.ClassifierI)
 |  MaxentClassifier(encoding, weights, logarithmic=True)
 |
 |  A maximum entropy classifier (also known as a "conditional
 |  exponential classifier").  This classifier is parameterized by a
 |  set of "weights", which are used to combine the joint-features
 |  that are generated from a featureset by an "encoding".  In
 |  particular, the encoding maps each ``(featureset, label)`` pair to
 |  a vector.  The probability of each label is then computed using
 |  the following equation::
 |
 |                              dotprod(weights, encode(fs,label))
 |    prob(fs|label) = ---------------------------------------------------
 |                     sum(dotprod(weights, encode(fs,l)) for l in labels)
 |
 |  Where ``dotprod`` is the dot product::
 |
 |    dotprod(a,b) = sum(x*y for (x,y) in zip(a,b))
 |
 |  Method resolution order:
 |      MaxentClassifier
 |      nltk.classify.api.ClassifierI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, encoding, weights, logarithmic=True)
 |      Construct a new maxent classifier model.  Typically, new
 |      classifier models are created using the ``train()`` method.
 |
 |      :type encoding: MaxentFeatureEncodingI
 |      :param encoding: An encoding that is used to convert the
 |          featuresets that are given to the ``classify`` method into
 |          joint-feature vectors, which are used by the maxent
 |          classifier model.
 |
 |      :type weights: list of float
 |      :param weights:  The feature weight vector for this classifier.
 |
 |      :type logarithmic: bool
 |      :param logarithmic: If false, then use non-logarithmic weights.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  classify(self, featureset)
 |      :return: the most appropriate label for the given featureset.
 |      :rtype: label
 |
 |  explain(self, featureset, columns=4)
 |      Print a table showing the effect of each of the features in
 |      the given feature set, and how they combine to determine the
 |      probabilities of each label for that featureset.
 |
 |  labels(self)
 |      :return: the list of category labels used by this classifier.
 |      :rtype: list of (immutable)
 |
 |  most_informative_features(self, n=10)
 |      Generates the ranked list of informative features from most to least.
 |
 |  prob_classify(self, featureset)
 |      :return: a probability distribution over labels for the given
 |          featureset.
 |      :rtype: ProbDistI
 |
 |  set_weights(self, new_weights)
 |      Set the feature weight vector for this classifier.
 |      :param new_weights: The new feature weight vector.
 |      :type new_weights: list of float
 |
 |  show_most_informative_features(self, n=10, show='all')
 |      :param show: all, neg, or pos (for negative-only or positive-only)
 |      :type show: str
 |      :param n: The no. of top features
 |      :type n: int
 |
 |  weights(self)
 |      :return: The feature weight vector for this classifier.
 |      :rtype: list of float
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  train(train_toks, algorithm=None, trace=3, encoding=None, labels=None, gaussian_prior_sigma=0, **cutoffs)
 |      Train a new maxent classifier based on the given corpus of
 |      training samples.  This classifier will have its weights
 |      chosen to maximize entropy while remaining empirically
 |      consistent with the training corpus.
 |
 |      :rtype: MaxentClassifier
 |      :return: The new maxent classifier
 |
 |      :type train_toks: list
 |      :param train_toks: Training data, represented as a list of
 |          pairs, the first member of which is a featureset,
 |          and the second of which is a classification label.
 |
 |      :type algorithm: str
 |      :param algorithm: A case-insensitive string, specifying which
 |          algorithm should be used to train the classifier.  The
 |          following algorithms are currently available.
 |
 |          - Iterative Scaling Methods: Generalized Iterative Scaling (``'GIS'``),
 |            Improved Iterative Scaling (``'IIS'``)
 |          - External Libraries (requiring megam):
 |            LM-BFGS algorithm, with training performed by Megam (``'megam'``)
 |
 |          The default algorithm is ``'IIS'``.
 |
 |      :type trace: int
 |      :param trace: The level of diagnostic tracing output to produce.
 |          Higher values produce more verbose output.
 |      :type encoding: MaxentFeatureEncodingI
 |      :param encoding: A feature encoding, used to convert featuresets
 |          into feature vectors.  If none is specified, then a
 |          ``BinaryMaxentFeatureEncoding`` will be built based on the
 |          features that are attested in the training corpus.
 |      :type labels: list(str)
 |      :param labels: The set of possible labels.  If none is given, then
 |          the set of all labels attested in the training data will be
 |          used instead.
 |      :param gaussian_prior_sigma: The sigma value for a gaussian
 |          prior on model weights.  Currently, this is supported by
 |          ``megam``. For other algorithms, its value is ignored.
 |      :param cutoffs: Arguments specifying various conditions under
 |          which the training should be halted.  (Some of the cutoff
 |          conditions are not supported by some algorithms.)
 |
 |          - ``max_iter=v``: Terminate after ``v`` iterations.
 |          - ``min_ll=v``: Terminate after the negative average
 |            log-likelihood drops under ``v``.
 |          - ``min_lldelta=v``: Terminate if a single iteration improves
 |            log likelihood by less than ``v``.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  ALGORITHMS = ['GIS', 'IIS', 'MEGAM', 'TADM']
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.api.ClassifierI:
 |
 |  classify_many(self, featuresets)
 |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.classify(fs) for fs in featuresets]
 |
 |      :rtype: list(label)
 |
 |  prob_classify_many(self, featuresets)
 |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.prob_classify(fs) for fs in featuresets]
 |
 |      :rtype: list(ProbDistI)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.classify.api.ClassifierI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Maxent_NE_Chunker
Python Library Documentation: class Maxent_NE_Chunker in module nltk.chunk.named_entity

class Maxent_NE_Chunker(NEChunkParser)
 |  Maxent_NE_Chunker(fmt='multiclass')
 |
 |  Expected input: list of pos-tagged words
 |
 |  Method resolution order:
 |      Maxent_NE_Chunker
 |      NEChunkParser
 |      nltk.chunk.api.ChunkParserI
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, fmt='multiclass')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  load_params(self)
 |
 |  save_params(self)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from NEChunkParser:
 |
 |  parse(self, tokens)
 |      Each token should be a pos-tagged word
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.chunk.api.ChunkParserI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the chunker against the gold standard.
 |      Remove the chunking the gold standard text, rechunk it using
 |      the chunker, and return a ``ChunkScore`` object
 |      reflecting the performance of this chunk parser.
 |
 |      :type gold: list(Tree)
 |      :param gold: The list of chunked sentences to score the chunker on.
 |      :rtype: ChunkScore
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Model
Python Library Documentation: class Model in module nltk.sem.evaluate

class Model(builtins.object)
 |  Model(domain, valuation)
 |
 |  A first order model is a domain *D* of discourse and a valuation *V*.
 |
 |  A domain *D* is a set, and a valuation *V* is a map that associates
 |  expressions with values in the model.
 |  The domain of *V* should be a subset of *D*.
 |
 |  Construct a new ``Model``.
 |
 |  :type domain: set
 |  :param domain: A set of entities representing the domain of discourse of the model.
 |  :type valuation: Valuation
 |  :param valuation: the valuation of the model.
 |  :param prop: If this is set, then we are building a propositional    model and don't require the domain of *V* to be subset of *D*.
 |
 |  Methods defined here:
 |
 |  __init__(self, domain, valuation)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  evaluate(self, expr, g, trace=None)
 |      Read input expressions, and provide a handler for ``satisfy``
 |      that blocks further propagation of the ``Undefined`` error.
 |      :param expr: An ``Expression`` of ``logic``.
 |      :type g: Assignment
 |      :param g: an assignment to individual variables.
 |      :rtype: bool or 'Undefined'
 |
 |  i(self, parsed, g, trace=False)
 |      An interpretation function.
 |
 |      Assuming that ``parsed`` is atomic:
 |
 |      - if ``parsed`` is a non-logical constant, calls the valuation *V*
 |      - else if ``parsed`` is an individual variable, calls assignment *g*
 |      - else returns ``Undefined``.
 |
 |      :param parsed: an ``Expression`` of ``logic``.
 |      :type g: Assignment
 |      :param g: an assignment to individual variables.
 |      :return: a semantic value
 |
 |  satisfiers(self, parsed, varex, g, trace=None, nesting=0)
 |      Generate the entities from the model's domain that satisfy an open formula.
 |
 |      :param parsed: an open formula
 |      :type parsed: Expression
 |      :param varex: the relevant free individual variable in ``parsed``.
 |      :type varex: VariableExpression or str
 |      :param g: a variable assignment
 |      :type g:  Assignment
 |      :return: a set of the entities that satisfy ``parsed``.
 |
 |  satisfy(self, parsed, g, trace=None)
 |      Recursive interpretation function for a formula of first-order logic.
 |
 |      Raises an ``Undefined`` error when ``parsed`` is an atomic string
 |      but is not a symbol or an individual variable.
 |
 |      :return: Returns a truth value or ``Undefined`` if ``parsed`` is        complex, and calls the interpretation function ``i`` if ``parsed``        is atomic.
 |
 |      :param parsed: An expression of ``logic``.
 |      :type g: Assignment
 |      :param g: an assignment to individual variables.
 |      :raise Error: if ``parsed`` has a nested quantifier/lambda path whose        domain-value combinations (|domain| ** nesting depth) would exceed        ``MAX_SATISFY_OPERATIONS`` (CWE-770).
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MAX_SATISFY_OPERATIONS = 1000000
nltk.MultiClassifierI
Python Library Documentation: class MultiClassifierI in module nltk.classify.api

class MultiClassifierI(builtins.object)
 |  A processing interface for labeling tokens with zero or more
 |  category labels (or "labels").  Labels are typically strs
 |  or ints, but can be any immutable type.  The set of labels
 |  that the multi-classifier chooses from must be fixed and finite.
 |
 |  Subclasses must define:
 |    - ``labels()``
 |    - either ``classify()`` or ``classify_many()`` (or both)
 |
 |  Subclasses may define:
 |    - either ``prob_classify()`` or ``prob_classify_many()`` (or both)
 |
 |  Methods defined here:
 |
 |  classify(self, featureset)
 |      :return: the most appropriate set of labels for the given featureset.
 |      :rtype: set(label)
 |
 |  classify_many(self, featuresets)
 |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.classify(fs) for fs in featuresets]
 |
 |      :rtype: list(set(label))
 |
 |  labels(self)
 |      :return: the list of category labels used by this classifier.
 |      :rtype: list of (immutable)
 |
 |  prob_classify(self, featureset)
 |      :return: a probability distribution over sets of labels for the
 |          given featureset.
 |      :rtype: ProbDistI
 |
 |  prob_classify_many(self, featuresets)
 |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.prob_classify(fs) for fs in featuresets]
 |
 |      :rtype: list(ProbDistI)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.MultiParentedTree
Python Library Documentation: class MultiParentedTree in module nltk.tree.parented

class MultiParentedTree(AbstractParentedTree)
 |  MultiParentedTree(node, children=None)
 |
 |  A ``Tree`` that automatically maintains parent pointers for
 |  multi-parented trees.  The following are methods for querying the
 |  structure of a multi-parented tree: ``parents()``, ``parent_indices()``,
 |  ``left_siblings()``, ``right_siblings()``, ``roots``, ``treepositions``.
 |
 |  Each ``MultiParentedTree`` may have zero or more parents.  In
 |  particular, subtrees may be shared.  If a single
 |  ``MultiParentedTree`` is used as multiple children of the same
 |  parent, then that parent will appear multiple times in its
 |  ``parents()`` method.
 |
 |  ``MultiParentedTrees`` should never be used in the same tree as
 |  ``Trees`` or ``ParentedTrees``.  Mixing tree implementations may
 |  result in incorrect parent pointers and in ``TypeError`` exceptions.
 |
 |  Method resolution order:
 |      MultiParentedTree
 |      AbstractParentedTree
 |      nltk.tree.tree.Tree
 |      builtins.list
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, node, children=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  left_siblings(self)
 |      A list of all left siblings of this tree, in any of its parent
 |      trees.  A tree may be its own left sibling if it is used as
 |      multiple contiguous children of the same parent.  A tree may
 |      appear multiple times in this list if it is the left sibling
 |      of this tree with respect to multiple parents.
 |
 |      :type: list(MultiParentedTree)
 |
 |  parent_indices(self, parent)
 |      Return a list of the indices where this tree occurs as a child
 |      of ``parent``.  If this child does not occur as a child of
 |      ``parent``, then the empty list is returned.  The following is
 |      always true::
 |
 |        for parent_index in ptree.parent_indices(parent):
 |            parent[parent_index] is ptree
 |
 |  parents(self)
 |      The set of parents of this tree.  If this tree has no parents,
 |      then ``parents`` is the empty set.  To check if a tree is used
 |      as multiple children of the same parent, use the
 |      ``parent_indices()`` method.
 |
 |      :type: list(MultiParentedTree)
 |
 |  right_siblings(self)
 |      A list of all right siblings of this tree, in any of its parent
 |      trees.  A tree may be its own right sibling if it is used as
 |      multiple contiguous children of the same parent.  A tree may
 |      appear multiple times in this list if it is the right sibling
 |      of this tree with respect to multiple parents.
 |
 |      :type: list(MultiParentedTree)
 |
 |  roots(self)
 |      The set of all roots of this tree.  This set is formed by
 |      tracing all possible parent paths until trees with no parents
 |      are found.
 |
 |      :type: list(MultiParentedTree)
 |
 |  treepositions(self, root)
 |      Return a list of all tree positions that can be used to reach
 |      this multi-parented tree starting from ``root``.  I.e., the
 |      following is always true::
 |
 |        for treepos in ptree.treepositions(root):
 |            root[treepos] is ptree
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractParentedTree:
 |
 |  __delitem__(self, index)
 |      Delete self[key].
 |
 |  __getnewargs__(self)
 |      Method used by the pickle module when un-pickling.
 |      This method provides the arguments passed to ``__new__``
 |      upon un-pickling. Without this method, ParentedTree instances
 |      cannot be pickled and unpickled in Python 3.7+ onwards.
 |
 |      :return: Tuple of arguments for ``__new__``, i.e. the label
 |          and the children of this node.
 |      :rtype: Tuple[Any, List[AbstractParentedTree]]
 |
 |  __setitem__(self, index, value)
 |      Set self[key] to value.
 |
 |  append(self, child)
 |      Append object to the end of the list.
 |
 |  extend(self, children)
 |      Extend list by appending elements from the iterable.
 |
 |  insert(self, index, child)
 |      Insert object before index.
 |
 |  pop(self, index=-1)
 |      Remove and return item at index (default last).
 |
 |      Raises IndexError if list is empty or index is out of range.
 |
 |  remove(self, child)
 |      Remove first occurrence of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.tree.Tree:
 |
 |  __add__(self, v)
 |      Return self+value.
 |
 |  __copy__(self)
 |
 |  __deepcopy__(self, memo)
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__ lambda self, other
 |
 |  __getitem__(self, index)
 |      Return self[index].
 |
 |  __gt__ lambda self, other
 |
 |  __le__ lambda self, other
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, v)
 |      Return self*value.
 |
 |  __ne__ lambda self, other
 |      # @total_ordering doesn't work here, since the class inherits from a builtin class
 |
 |  __radd__(self, v)
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __rmul__(self, v)
 |      Return value*self.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
 |      This method can modify a tree in three ways:
 |
 |        1. Convert a tree into its Chomsky Normal Form (CNF)
 |           equivalent -- Every subtree has either two non-terminals
 |           or one terminal as its children.  This process requires
 |           the creation of more"artificial" non-terminal nodes.
 |        2. Markov (vertical) smoothing of children in new artificial
 |           nodes
 |        3. Horizontal (parent) annotation of nodes
 |
 |      :param factor: Right or left factoring method (default = "right")
 |      :type  factor: str = [left|right]
 |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
 |      :type  horzMarkov: int | None
 |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
 |      :type  vertMarkov: int | None
 |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
 |                        original subtree from the child nodes that have yet to be expanded (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string used to separate the node representation from its vertical annotation
 |      :type  parentChar: str
 |
 |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
 |      Collapse subtrees with a single child (ie. unary productions)
 |      into a new non-terminal (Tree node) joined by 'joinChar'.
 |      This is useful when working with algorithms that do not allow
 |      unary productions, and completely removing the unary productions
 |      would require loss of useful information.  The Tree is modified
 |      directly (since it is passed by reference) and no value is returned.
 |
 |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
 |                          Part-of-Speech tags) since they are always unary productions
 |      :type  collapsePOS: bool
 |      :param collapseRoot: 'False' (default) will not modify the root production
 |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
 |                           to the TOP -> productions.
 |      :type collapseRoot: bool
 |      :param joinChar: A string used to connect collapsed node values (default = "+")
 |      :type  joinChar: str
 |
 |  copy(self, deep=False)
 |      Return a shallow copy of the list.
 |
 |  draw(self)
 |      Open a new window containing a graphical diagram of this tree.
 |
 |  flatten(self)
 |      Return a flat version of the tree, with all non-root non-terminals removed.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> print(t.flatten())
 |          (S the dog chased the cat)
 |
 |      :return: a tree consisting of this tree's root connected directly to
 |          its leaves, omitting all intervening non-terminal nodes.
 |      :rtype: Tree
 |
 |  freeze(self, leaf_freezer=None)
 |
 |  height(self)
 |      Return the height of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.height()
 |          5
 |          >>> print(t[0,0])
 |          (D the)
 |          >>> t[0,0].height()
 |          2
 |
 |      :return: The height of this tree.  The height of a tree
 |          containing no children is 1; the height of a tree
 |          containing only leaves is 2; and the height of any other
 |          tree is one plus the maximum of its children's
 |          heights.
 |      :rtype: int
 |
 |  label(self)
 |      Return the node label of the tree.
 |
 |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
 |          >>> t.label()
 |          'S'
 |
 |      :return: the node label (typically a string)
 |      :rtype: any
 |
 |  leaf_treeposition(self, index)
 |      :return: The tree position of the ``index``-th leaf in this
 |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
 |          ``self[tp]==self.leaves()[i]``.
 |
 |      :raise IndexError: If this tree contains fewer than ``index+1``
 |          leaves, or if ``index<0``.
 |
 |  leaves(self)
 |      Return the leaves of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.leaves()
 |          ['the', 'dog', 'chased', 'the', 'cat']
 |
 |      :return: a list containing this tree's leaves.
 |          The order reflects the order of the
 |          leaves in the tree's hierarchical structure.
 |      :rtype: list
 |
 |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
 |      :return: A pretty-printed string representation of this tree.
 |      :rtype: str
 |      :param margin: The right margin at which to do line-wrapping.
 |      :type margin: int
 |      :param indent: The indentation level at which printing
 |          begins.  This number is used to decide how far to indent
 |          subsequent lines.
 |      :type indent: int
 |      :param nodesep: A string that is used to separate the node
 |          from the children.  E.g., the default value ``':'`` gives
 |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
 |
 |  pformat_latex_qtree(self)
 |      Returns a representation of the tree compatible with the
 |      LaTeX qtree package. This consists of the string ``\Tree``
 |      followed by the tree represented in bracketed notation.
 |
 |      For example, the following result was generated from a parse tree of
 |      the sentence ``The announcement astounded us``::
 |
 |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
 |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
 |
 |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
 |      style file for the qtree package.
 |
 |      :return: A latex qtree representation of this tree.
 |      :rtype: str
 |
 |  pos(self)
 |      Return a sequence of pos-tagged words extracted from the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.pos()
 |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
 |
 |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
 |          The order reflects the order of the leaves in the tree's hierarchical structure.
 |      :rtype: list(tuple)
 |
 |  pprint(self, **kwargs)
 |      Print a string representation of this Tree to 'stream'
 |
 |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
 |      Pretty-print this tree as ASCII or Unicode art.
 |      For explanation of the arguments, see the documentation for
 |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
 |
 |  productions(self)
 |      Generate the productions that correspond to the non-terminal nodes of the tree.
 |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
 |      form P -> C1 C2 ... Cn.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
 |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
 |          NP -> D N, D -> 'the', N -> 'cat']
 |
 |      :rtype: list(Production)
 |
 |  set_label(self, label)
 |      Set the node label of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.set_label("T")
 |          >>> print(t)
 |          (T (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))
 |
 |      :param label: the node label (typically a string)
 |      :type label: any
 |
 |  subtrees(self, filter=None)
 |      Generate all the subtrees of this tree, optionally restricted
 |      to trees matching the filter function.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> for s in t.subtrees(lambda t: t.height() == 2):
 |          ...     print(s)
 |          (D the)
 |          (N dog)
 |          (V chased)
 |          (D the)
 |          (N cat)
 |
 |      :type filter: function
 |      :param filter: the function to filter all local trees
 |
 |  treeposition_spanning_leaves(self, start, end)
 |      :return: The tree position of the lowest descendant of this
 |          tree that dominates ``self.leaves()[start:end]``.
 |      :raise ValueError: if ``end <= start``
 |
 |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
 |      This method modifies the tree in three ways:
 |
 |        1. Transforms a tree in Chomsky Normal Form back to its
 |           original structure (branching greater than two)
 |        2. Removes any parent annotation (if it exists)
 |        3. (optional) expands unary subtrees (if previously
 |           collapsed with collapseUnary(...) )
 |
 |      :param expandUnary: Flag to expand unary or not (default = True)
 |      :type  expandUnary: bool
 |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
 |      :type  parentChar: str
 |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
 |      :type  unaryChar: str
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from nltk.tree.tree.Tree:
 |
 |  convert(tree)
 |      Convert a tree between different subtypes of Tree.  ``cls`` determines
 |      which class will be used to encode the new tree.
 |
 |      :type tree: Tree
 |      :param tree: The tree that should be converted.
 |      :return: The new Tree.
 |
 |  fromlist(l)
 |      :type l: list
 |      :param l: a tree represented as nested lists
 |
 |      :return: A tree corresponding to the list representation ``l``.
 |      :rtype: Tree
 |
 |      Convert nested lists to a NLTK Tree
 |
 |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
 |      Read a bracketed tree string and return the resulting tree.
 |      Trees are represented as nested brackettings, such as::
 |
 |        (S (NP (NNP John)) (VP (V runs)))
 |
 |      :type s: str
 |      :param s: The string to read
 |
 |      :type brackets: str (length=2)
 |      :param brackets: The bracket characters used to mark the
 |          beginning and end of trees and subtrees.
 |
 |      :type read_node: function
 |      :type read_leaf: function
 |      :param read_node, read_leaf: If specified, these functions
 |          are applied to the substrings of ``s`` corresponding to
 |          nodes and leaves (respectively) to obtain the values for
 |          those nodes and leaves.  They should have the following
 |          signature:
 |
 |             read_node(str) -> value
 |
 |          For example, these functions could be used to process nodes
 |          and leaves whose values should be some type other than
 |          string (such as ``FeatStruct``).
 |          Note that by default, node strings and leaf strings are
 |          delimited by whitespace and brackets; to override this
 |          default, use the ``node_pattern`` and ``leaf_pattern``
 |          arguments.
 |
 |      :type node_pattern: str
 |      :type leaf_pattern: str
 |      :param node_pattern, leaf_pattern: Regular expression patterns
 |          used to find node and leaf substrings in ``s``.  By
 |          default, both nodes patterns are defined to match any
 |          sequence of non-whitespace non-bracket characters.
 |
 |      :type remove_empty_top_bracketing: bool
 |      :param remove_empty_top_bracketing: If the resulting tree has
 |          an empty node label, and is length one, then return its
 |          single child instead.  This is useful for treebank trees,
 |          which sometimes contain an extra level of bracketing.
 |
 |      :return: A tree corresponding to the string representation ``s``.
 |          If this class method is called using a subclass of Tree,
 |          then it will return a tree of that type.
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tree.tree.Tree:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  node
 |      Outdated method to access the node value; use the label() method instead.
 |
 |      @deprecated: Use label() instead
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.tree.tree.Tree:
 |
 |  __hash__ = None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.list:
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iadd__(self, value, /)
 |      Implement self+=value.
 |
 |  __imul__(self, value, /)
 |      Implement self*=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the list.
 |
 |  __sizeof__(self, /)
 |      Return the size of the list in memory, in bytes.
 |
 |  clear(self, /)
 |      Remove all items from list.
 |
 |  count(self, value, /)
 |      Return number of occurrences of value.
 |
 |  index(self, value, start=0, stop=9223372036854775807, /)
 |      Return first index of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  reverse(self, /)
 |      Reverse *IN PLACE*.
 |
 |  sort(self, /, *, key=None, reverse=False)
 |      Sort the list in ascending order and return None.
 |
 |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
 |      order of two equal elements is maintained).
 |
 |      If a key function is given, apply it once to each list item and sort them,
 |      ascending or descending, according to their function values.
 |
 |      The reverse flag can be set to sort in descending order.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.list:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.list:
 |
 |  __new__(*args, **kwargs) class method of builtins.list
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.MutableProbDist
Python Library Documentation: class MutableProbDist in module nltk.probability

class MutableProbDist(ProbDistI)
 |  MutableProbDist(prob_dist, samples, store_logs=True)
 |
 |  An mutable probdist where the probabilities may be easily modified. This
 |  simply copies an existing probdist, storing the probability values in a
 |  mutable dictionary and providing an update method.
 |
 |  Method resolution order:
 |      MutableProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, prob_dist, samples, store_logs=True)
 |      Creates the mutable probdist based on the given prob_dist and using
 |      the list of samples given. These values are stored as log
 |      probabilities if the store_logs flag is set.
 |
 |      :param prob_dist: the distribution from which to garner the
 |          probabilities
 |      :type prob_dist: ProbDist
 |      :param samples: the complete set of samples
 |      :type samples: sequence of any
 |      :param store_logs: whether to store the probabilities as logarithms
 |      :type store_logs: bool
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  update(self, sample, prob, log=True)
 |      Update the probability for the given sample. This may cause the object
 |      to stop being the valid probability distribution - the user must
 |      ensure that they update the sample probabilities such that all samples
 |      have probabilities between 0 and 1 and that all probabilities sum to
 |      one.
 |
 |      :param sample: the sample for which to update the probability
 |      :type sample: any
 |      :param prob: the new probability
 |      :type prob: float
 |      :param log: is the probability already logged
 |      :type log: bool
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from ProbDistI:
 |
 |  SUM_TO_ONE = True
nltk.NLTKWordTokenizer
Python Library Documentation: class NLTKWordTokenizer in module nltk.tokenize.destructive

class NLTKWordTokenizer(nltk.tokenize.api.TokenizerI)
 |  The NLTK tokenizer that has improved upon the TreebankWordTokenizer.
 |
 |  This is the method that is invoked by ``word_tokenize()``.  It assumes that the
 |  text has already been segmented into sentences, e.g. using ``sent_tokenize()``.
 |
 |  The tokenizer is "destructive" such that the regexes applied will munge the
 |  input string to a state beyond re-construction. It is possible to apply
 |  `TreebankWordDetokenizer.detokenize` to the tokenized outputs of
 |  `NLTKDestructiveWordTokenizer.tokenize` but there's no guarantees to
 |  revert to the original string.
 |
 |  Method resolution order:
 |      NLTKWordTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  span_tokenize(self, text: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Returns the spans of the tokens in ``text``.
 |      Uses the post-hoc nltk.tokens.align_tokens to return the offset spans.
 |
 |          >>> from nltk.tokenize import NLTKWordTokenizer
 |          >>> s = '''Good muffins cost $3.88\nin New (York).  Please (buy) me\ntwo of them.\n(Thanks).'''
 |          >>> expected = [(0, 4), (5, 12), (13, 17), (18, 19), (19, 23),
 |          ... (24, 26), (27, 30), (31, 32), (32, 36), (36, 37), (37, 38),
 |          ... (40, 46), (47, 48), (48, 51), (51, 52), (53, 55), (56, 59),
 |          ... (60, 62), (63, 68), (69, 70), (70, 76), (76, 77), (77, 78)]
 |          >>> list(NLTKWordTokenizer().span_tokenize(s)) == expected
 |          True
 |          >>> expected = ['Good', 'muffins', 'cost', '$', '3.88', 'in',
 |          ... 'New', '(', 'York', ')', '.', 'Please', '(', 'buy', ')',
 |          ... 'me', 'two', 'of', 'them.', '(', 'Thanks', ')', '.']
 |          >>> [s[start:end] for start, end in NLTKWordTokenizer().span_tokenize(s)] == expected
 |          True
 |
 |      :param text: A string with a sentence or sentences.
 |      :type text: str
 |      :yield: Tuple[int, int]
 |
 |  tokenize(self, text: str, convert_parentheses: bool = False, return_str: bool = False) -> list[str]
 |      Return a tokenized copy of `text`.
 |
 |      >>> from nltk.tokenize import NLTKWordTokenizer
 |      >>> s = '''Good muffins cost $3.88 (roughly 3,36 euros)\nin New York.  Please buy me\ntwo of them.\nThanks.'''
 |      >>> NLTKWordTokenizer().tokenize(s) # doctest: +NORMALIZE_WHITESPACE
 |      ['Good', 'muffins', 'cost', '$', '3.88', '(', 'roughly', '3,36',
 |      'euros', ')', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two',
 |      'of', 'them.', 'Thanks', '.']
 |      >>> NLTKWordTokenizer().tokenize(s, convert_parentheses=True) # doctest: +NORMALIZE_WHITESPACE
 |      ['Good', 'muffins', 'cost', '$', '3.88', '-LRB-', 'roughly', '3,36',
 |      'euros', '-RRB-', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two',
 |      'of', 'them.', 'Thanks', '.']
 |
 |
 |      :param text: A string with a sentence or sentences.
 |      :type text: str
 |      :param convert_parentheses: if True, replace parentheses to PTB symbols,
 |          e.g. `(` to `-LRB-`. Defaults to False.
 |      :type convert_parentheses: bool, optional
 |      :param return_str: If True, return tokens as space-separated string,
 |          defaults to False.
 |      :type return_str: bool, optional
 |      :return: List of tokens from `text`.
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  CONTRACTIONS2 = [re.compile('(?i)\\b(can)(?#X)(not)\\b', re.IGNORECASE...
 |
 |  CONTRACTIONS3 = [re.compile("(?i) ('t)(?#X)(is)\\b", re.IGNORECASE), r...
 |
 |  CONVERT_PARENTHESES = [(re.compile('\\('), '-LRB-'), (re.compile('\\)'...
 |
 |  DOUBLE_DASHES = (re.compile('--'), ' -- ')
 |
 |  ENDING_QUOTES = [(re.compile('([»”’])'), r' \1 '), (re.compile("''"), ...
 |
 |  PARENS_BRACKETS = (re.compile('[\\]\\[\\(\\)\\{\\}\\<\\>]'), r' \g<0> ...
 |
 |  PUNCTUATION = [(re.compile('([^\\.])(\\.)([\\]\\)}>"\\\'»”’ ]*)\\s*$')...
 |
 |  STARTING_QUOTES = [(re.compile('([«“‘„]|[`]+)'), r' \1 '), (re.compile...
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.NaiveBayesClassifier
Python Library Documentation: class NaiveBayesClassifier in module nltk.classify.naivebayes

class NaiveBayesClassifier(nltk.classify.api.ClassifierI)
 |  NaiveBayesClassifier(label_probdist, feature_probdist)
 |
 |  A Naive Bayes classifier.  Naive Bayes classifiers are
 |  paramaterized by two probability distributions:
 |
 |    - P(label) gives the probability that an input will receive each
 |      label, given no information about the input's features.
 |
 |    - P(fname=fval|label) gives the probability that a given feature
 |      (fname) will receive a given value (fval), given that the
 |      label (label).
 |
 |  If the classifier encounters an input with a feature that has
 |  never been seen with any label, then rather than assigning a
 |  probability of 0 to all labels, it will ignore that feature.
 |
 |  The feature value 'None' is reserved for unseen feature values;
 |  you generally should not use 'None' as a feature value for one of
 |  your own features.
 |
 |  Method resolution order:
 |      NaiveBayesClassifier
 |      nltk.classify.api.ClassifierI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, label_probdist, feature_probdist)
 |      :param label_probdist: P(label), the probability distribution
 |          over labels.  It is expressed as a ``ProbDistI`` whose
 |          samples are labels.  I.e., P(label) =
 |          ``label_probdist.prob(label)``.
 |
 |      :param feature_probdist: P(fname=fval|label), the probability
 |          distribution for feature values, given labels.  It is
 |          expressed as a dictionary whose keys are ``(label, fname)``
 |          pairs and whose values are ``ProbDistI`` objects over feature
 |          values.  I.e., P(fname=fval|label) =
 |          ``feature_probdist[label,fname].prob(fval)``.  If a given
 |          ``(label,fname)`` is not a key in ``feature_probdist``, then
 |          it is assumed that the corresponding P(fname=fval|label)
 |          is 0 for all values of ``fval``.
 |
 |  classify(self, featureset)
 |      :return: the most appropriate label for the given featureset.
 |      :rtype: label
 |
 |  labels(self)
 |      :return: the list of category labels used by this classifier.
 |      :rtype: list of (immutable)
 |
 |  most_informative_features(self, n=100)
 |      Return a list of the 'most informative' features used by this
 |      classifier.  For the purpose of this function, the
 |      informativeness of a feature ``(fname,fval)`` is equal to the
 |      highest value of P(fname=fval|label), for any label, divided by
 |      the lowest value of P(fname=fval|label), for any label:
 |
 |      |  max[ P(fname=fval|label1) / P(fname=fval|label2) ]
 |
 |  prob_classify(self, featureset)
 |      :return: a probability distribution over labels for the given
 |          featureset.
 |      :rtype: ProbDistI
 |
 |  show_most_informative_features(self, n=10)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  train(labeled_featuresets, estimator=<class 'nltk.probability.ELEProbDist'>)
 |      :param labeled_featuresets: A list of classified featuresets,
 |          i.e., a list of tuples ``(featureset, label)``.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.api.ClassifierI:
 |
 |  classify_many(self, featuresets)
 |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.classify(fs) for fs in featuresets]
 |
 |      :rtype: list(label)
 |
 |  prob_classify_many(self, featuresets)
 |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.prob_classify(fs) for fs in featuresets]
 |
 |      :rtype: list(ProbDistI)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.classify.api.ClassifierI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.NaiveBayesDependencyScorer
Python Library Documentation: class NaiveBayesDependencyScorer in module nltk.parse.nonprojectivedependencyparser

class NaiveBayesDependencyScorer(DependencyScorerI)
 |  A dependency scorer built around a MaxEnt classifier.  In this
 |  particular class that classifier is a ``NaiveBayesClassifier``.
 |  It uses head-word, head-tag, child-word, and child-tag features
 |  for classification.
 |
 |  >>> from nltk.parse.dependencygraph import DependencyGraph, conll_data2
 |
 |  >>> graphs = [DependencyGraph(entry) for entry in conll_data2.split('\n\n') if entry]
 |  >>> npp = ProbabilisticNonprojectiveParser()
 |  >>> npp.train(graphs, NaiveBayesDependencyScorer())
 |  >>> parses = npp.parse(['Cathy', 'zag', 'hen', 'zwaaien', '.'], ['N', 'V', 'Pron', 'Adj', 'N', 'Punc'])
 |  >>> len(list(parses))
 |  1
 |
 |  Method resolution order:
 |      NaiveBayesDependencyScorer
 |      DependencyScorerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  score(self, graph)
 |      Converts the graph into a feature-based representation of
 |      each edge, and then assigns a score to each based on the
 |      confidence of the classifier in assigning it to the
 |      positive label.  Scores are returned in a multidimensional list.
 |
 |      :type graph: DependencyGraph
 |      :param graph: A dependency graph to score.
 |      :rtype: 3 dimensional list
 |      :return: Edge scores for the graph parameter.
 |
 |  train(self, graphs)
 |      Trains a ``NaiveBayesClassifier`` using the edges present in
 |      graphs list as positive examples, the edges not present as
 |      negative examples.  Uses a feature vector of head-word,
 |      head-tag, child-word, and child-tag.
 |
 |      :type graphs: list(DependencyGraph)
 |      :param graphs: A list of dependency graphs to train the scorer.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from DependencyScorerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.NgramAssocMeasures
Python Library Documentation: class NgramAssocMeasures in module nltk.metrics.association

class NgramAssocMeasures(builtins.object)
 |  An abstract class defining a collection of generic association measures.
 |  Each public method returns a score, taking the following arguments::
 |
 |      score_fn(count_of_ngram,
 |               (count_of_n-1gram_1, ..., count_of_n-1gram_j),
 |               (count_of_n-2gram_1, ..., count_of_n-2gram_k),
 |               ...,
 |               (count_of_1gram_1, ..., count_of_1gram_n),
 |               count_of_total_words)
 |
 |  See ``BigramAssocMeasures`` and ``TrigramAssocMeasures``
 |
 |  Inheriting classes should define a property _n, and a method _contingency
 |  which calculates contingency values from marginals in order for all
 |  association measures defined here to be usable.
 |
 |  Class methods defined here:
 |
 |  chi_sq(*marginals)
 |      Scores ngrams using Pearson's chi-square as in Manning and Schutze
 |      5.3.3.
 |
 |  jaccard(*marginals)
 |      Scores ngrams using the Jaccard index.
 |
 |  likelihood_ratio(*marginals)
 |      Scores ngrams using likelihood ratios as in Manning and Schutze 5.3.4.
 |
 |  pmi(*marginals)
 |      Scores ngrams by pointwise mutual information, as in Manning and
 |      Schutze 5.4.
 |
 |  poisson_stirling(*marginals)
 |      Scores ngrams using the Poisson-Stirling measure.
 |
 |  student_t(*marginals)
 |      Scores ngrams using Student's t test with independence hypothesis
 |      for unigrams, as in Manning and Schutze 5.3.1.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  mi_like(*marginals, **kwargs)
 |      Scores ngrams using a variant of mutual information. The keyword
 |      argument power sets an exponent (default 3) for the numerator. No
 |      logarithm of the result is calculated.
 |
 |  raw_freq(*marginals)
 |      Scores ngrams by their frequency
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset({'_contingency', '_marginals'})
nltk.NgramTagger
Python Library Documentation: class NgramTagger in module nltk.tag.sequential

class NgramTagger(ContextTagger)
 |  NgramTagger(n, train=None, model=None, backoff=None, cutoff=0, verbose=False)
 |
 |  A tagger that chooses a token's tag based on its word string and
 |  on the preceding n word's tags.  In particular, a tuple
 |  (tags[i-n:i-1], words[i]) is looked up in a table, and the
 |  corresponding tag is returned.  N-gram taggers are typically
 |  trained on a tagged corpus.
 |
 |  Train a new NgramTagger using the given training data or
 |  the supplied model.  In particular, construct a new tagger
 |  whose table maps from each context (tag[i-n:i-1], word[i])
 |  to the most frequent tag for that context.  But exclude any
 |  contexts that are already tagged perfectly by the backoff
 |  tagger.
 |
 |  :param train: A tagged corpus consisting of a list of tagged
 |      sentences, where each sentence is a list of (word, tag) tuples.
 |  :param backoff: A backoff tagger, to be used by the new
 |      tagger if it encounters an unknown context.
 |  :param cutoff: If the most likely tag for a context occurs
 |      fewer than *cutoff* times, then exclude it from the
 |      context-to-tag table for the new tagger.
 |
 |  Method resolution order:
 |      NgramTagger
 |      ContextTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, n, train=None, model=None, backoff=None, cutoff=0, verbose=False)
 |      :param context_to_tag: A dictionary mapping contexts to tags.
 |      :param backoff: The backoff tagger that should be used for this tagger.
 |
 |  context(self, tokens, index, history)
 |      :return: the context that should be used to look up the tag
 |          for the specified token; or None if the specified token
 |          should not be handled by this tagger.
 |      :rtype: (hashable)
 |
 |  encode_json_obj(self)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  decode_json_obj(obj)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  json_tag = 'nltk.tag.sequential.NgramTagger'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ContextTagger:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  size(self)
 |      :return: The number of entries in the table used by this
 |          tagger to map from contexts to tags.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.NonprojectiveDependencyParser
Python Library Documentation: class NonprojectiveDependencyParser in module nltk.parse.nonprojectivedependencyparser

class NonprojectiveDependencyParser(builtins.object)
 |  NonprojectiveDependencyParser(dependency_grammar)
 |
 |  A non-projective, rule-based, dependency parser.  This parser
 |  will return the set of all possible non-projective parses based on
 |  the word-to-word relations defined in the parser's dependency
 |  grammar, and will allow the branches of the parse tree to cross
 |  in order to capture a variety of linguistic phenomena that a
 |  projective parser will not.
 |
 |  Methods defined here:
 |
 |  __init__(self, dependency_grammar)
 |      Creates a new ``NonprojectiveDependencyParser``.
 |
 |      :param dependency_grammar: a grammar of word-to-word relations.
 |      :type dependency_grammar: DependencyGrammar
 |
 |  parse(self, tokens)
 |      Parses the input tokens with respect to the parser's grammar.  Parsing
 |      is accomplished by representing the search-space of possible parses as
 |      a fully-connected directed graph.  Arcs that would lead to ungrammatical
 |      parses are removed and a lattice is constructed of length n, where n is
 |      the number of input tokens, to represent all possible grammatical
 |      traversals.  All possible paths through the lattice are then enumerated
 |      to produce the set of non-projective parses.
 |
 |      param tokens: A list of tokens to parse.
 |      type tokens: list(str)
 |      return: An iterator of non-projective parses.
 |      rtype: iter(DependencyGraph)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Nonterminal
Python Library Documentation: class Nonterminal in module nltk.grammar

class Nonterminal(builtins.object)
 |  Nonterminal(symbol)
 |
 |  A non-terminal symbol for a context free grammar.  ``Nonterminal``
 |  is a wrapper class for node values; it is used by ``Production``
 |  objects to distinguish node values from leaf values.
 |  The node value that is wrapped by a ``Nonterminal`` is known as its
 |  "symbol".  Symbols are typically strings representing phrasal
 |  categories (such as ``"NP"`` or ``"VP"``).  However, more complex
 |  symbol types are sometimes used (e.g., for lexicalized grammars).
 |  Since symbols are node values, they must be immutable and
 |  hashable.  Two ``Nonterminals`` are considered equal if their
 |  symbols are equal.
 |
 |  :see: ``CFG``, ``Production``
 |  :type _symbol: any
 |  :ivar _symbol: The node value corresponding to this
 |      ``Nonterminal``.  This value must be immutable and hashable.
 |
 |  Methods defined here:
 |
 |  __div__(self, rhs)
 |      Return a new nonterminal whose symbol is ``A/B``, where ``A`` is
 |      the symbol for this nonterminal, and ``B`` is the symbol for rhs.
 |
 |      :param rhs: The nonterminal used to form the right hand side
 |          of the new nonterminal.
 |      :type rhs: Nonterminal
 |      :rtype: Nonterminal
 |
 |  __eq__(self, other)
 |      Return True if this non-terminal is equal to ``other``.  In
 |      particular, return True if ``other`` is a ``Nonterminal``
 |      and this non-terminal's symbol is equal to ``other`` 's symbol.
 |
 |      :rtype: bool
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __init__(self, symbol)
 |      Construct a new non-terminal from the given symbol.
 |
 |      :type symbol: any
 |      :param symbol: The node value corresponding to this
 |          ``Nonterminal``.  This value must be immutable and
 |          hashable.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Return a string representation for this ``Nonterminal``.
 |
 |      :rtype: str
 |
 |  __str__(self)
 |      Return a string representation for this ``Nonterminal``.
 |
 |      :rtype: str
 |
 |  __truediv__(self, rhs)
 |      Return a new nonterminal whose symbol is ``A/B``, where ``A`` is
 |      the symbol for this nonterminal, and ``B`` is the symbol for rhs.
 |      This function allows use of the slash ``/`` operator with
 |      the future import of division.
 |
 |      :param rhs: The nonterminal used to form the right hand side
 |          of the new nonterminal.
 |      :type rhs: Nonterminal
 |      :rtype: Nonterminal
 |
 |  symbol(self)
 |      Return the node value corresponding to this ``Nonterminal``.
 |
 |      :rtype: (any)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.OrderedDict
Python Library Documentation: class OrderedDict in module nltk.collections

class OrderedDict(builtins.dict)
 |  OrderedDict(data=None, **kwargs)
 |
 |  Method resolution order:
 |      OrderedDict
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __delitem__(self, key)
 |      Delete self[key].
 |
 |  __getitem__(self, key)
 |      Return self[key].
 |
 |  __init__(self, data=None, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __iter__(self)
 |      Implement iter(self).
 |
 |  __missing__(self, key)
 |
 |  __setitem__(self, key, item)
 |      Set self[key] to value.
 |
 |  clear(self)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  copy(self)
 |      D.copy() -> a shallow copy of D
 |
 |  items(self)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(self, data=None, keys=None)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  popitem(self)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, failobj=None)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(self, data)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(self)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.PCFG
Python Library Documentation: class PCFG in module nltk.grammar

class PCFG(CFG)
 |  PCFG(start, productions, calculate_leftcorners=True)
 |
 |  A probabilistic context-free grammar.  A PCFG consists of a
 |  start state and a set of productions with probabilities.  The set of
 |  terminals and nonterminals is implicitly specified by the productions.
 |
 |  PCFG productions use the ``ProbabilisticProduction`` class.
 |  ``PCFGs`` impose the constraint that the set of productions with
 |  any given left-hand-side must have probabilities that sum to 1
 |  (allowing for a small margin of error).
 |
 |  If you need efficient key-based access to productions, you can use
 |  a subclass to implement it.
 |
 |  :type EPSILON: float
 |  :cvar EPSILON: The acceptable margin of error for checking that
 |      productions with a given left-hand side have probabilities
 |      that sum to 1.
 |
 |  Method resolution order:
 |      PCFG
 |      CFG
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, start, productions, calculate_leftcorners=True)
 |      Create a new context-free grammar, from the given start state
 |      and set of ``ProbabilisticProductions``.
 |
 |      :param start: The start symbol
 |      :type start: Nonterminal
 |      :param productions: The list of productions that defines the grammar
 |      :type productions: list(Production)
 |      :raise ValueError: if the set of productions with any left-hand-side
 |          do not have probabilities that sum to a value within
 |          EPSILON of 1.
 |      :param calculate_leftcorners: False if we don't want to calculate the
 |          leftcorner relation. In that case, some optimized chart parsers won't work.
 |      :type calculate_leftcorners: bool
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  fromstring(input, encoding=None)
 |      Return a probabilistic context-free grammar corresponding to the
 |      input string(s).
 |
 |      :param input: a grammar, either in the form of a string or else
 |           as a list of strings.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  EPSILON = 0.01
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from CFG:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  check_coverage(self, tokens)
 |      Check whether the grammar rules cover the given list of tokens.
 |      If not, then raise an exception.
 |
 |      :type tokens: list(str)
 |
 |  chomsky_normal_form(self, new_token_padding='@$@', flexible=False)
 |      Returns a new Grammar that is in chomsky normal
 |
 |      :param: new_token_padding
 |          Customise new rule formation during binarisation
 |
 |  is_binarised(self)
 |      Return True if all productions are at most binary.
 |      Note that there can still be empty and unary productions.
 |
 |  is_chomsky_normal_form(self)
 |      Return True if the grammar is of Chomsky Normal Form, i.e. all productions
 |      are of the form A -> B C, or A -> "s".
 |
 |  is_flexible_chomsky_normal_form(self)
 |      Return True if all productions are of the forms
 |      A -> B C, A -> B, or A -> "s".
 |
 |  is_leftcorner(self, cat, left)
 |      True if left is a leftcorner of cat, where left can be a
 |      terminal or a nonterminal.
 |
 |      :param cat: the parent of the leftcorner
 |      :type cat: Nonterminal
 |      :param left: the suggested leftcorner
 |      :type left: Terminal or Nonterminal
 |      :rtype: bool
 |
 |  is_lexical(self)
 |      Return True if all productions are lexicalised.
 |
 |  is_nonempty(self)
 |      Return True if there are no empty productions.
 |
 |  is_nonlexical(self)
 |      Return True if all lexical rules are "preterminals", that is,
 |      unary rules which can be separated in a preprocessing step.
 |
 |      This means that all productions are of the forms
 |      A -> B1 ... Bn (n>=0), or A -> "s".
 |
 |      Note: is_lexical() and is_nonlexical() are not opposites.
 |      There are grammars which are neither, and grammars which are both.
 |
 |  leftcorner_parents(self, cat)
 |      Return the set of all nonterminals for which the given category
 |      is a left corner. This is the inverse of the leftcorner relation.
 |
 |      :param cat: the suggested leftcorner
 |      :type cat: Nonterminal
 |      :return: the set of all parents to the leftcorner
 |      :rtype: set(Nonterminal)
 |
 |  leftcorners(self, cat)
 |      Return the set of all nonterminals that the given nonterminal
 |      can start with, including itself.
 |
 |      This is the reflexive, transitive closure of the immediate
 |      leftcorner relation:  (A > B)  iff  (A -> B beta)
 |
 |      :param cat: the parent of the leftcorners
 |      :type cat: Nonterminal
 |      :return: the set of all leftcorners
 |      :rtype: set(Nonterminal)
 |
 |  max_len(self)
 |      Return the right-hand side length of the longest grammar production.
 |
 |  min_len(self)
 |      Return the right-hand side length of the shortest grammar production.
 |
 |  productions(self, lhs=None, rhs=None, empty=False)
 |      Return the grammar productions, filtered by the left-hand side
 |      or the first item in the right-hand side.
 |
 |      :param lhs: Only return productions with the given left-hand side.
 |      :param rhs: Only return productions with the given first item
 |          in the right-hand side.
 |      :param empty: Only return productions with an empty right-hand side.
 |      :return: A list of productions matching the given constraints.
 |      :rtype: list(Production)
 |
 |  start(self)
 |      Return the start symbol of the grammar
 |
 |      :rtype: Nonterminal
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from CFG:
 |
 |  binarize(grammar, padding='@$@')
 |      Convert all non-binary rules into binary by introducing
 |      new tokens.
 |      Example::
 |
 |          Original:
 |              A => B C D
 |          After Conversion:
 |              A => B A@$@B
 |              A@$@B => C D
 |
 |  eliminate_start(grammar)
 |      Eliminate start rule in case it appears on RHS
 |      Example: S -> S0 S1 and S0 -> S1 S
 |      Then another rule S0_Sigma -> S is added
 |
 |  remove_mixed_rules(grammar, padding='@$@')
 |      Convert all mixed rules containing terminals and non-terminals
 |      into dummy non-terminals.
 |      Example::
 |
 |          Original:
 |              A => term B
 |          After Conversion:
 |              A => TERM@$@TERM B
 |              TERM@$@TERM => term
 |
 |  remove_unitary_rules(grammar)
 |      Remove nonlexical unitary rules and convert them to
 |      lexical
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from CFG:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.PRETRAINED_TAGGERS
Python Library Documentation: dict object

class dict(object)
 |  dict() -> new empty dictionary
 |  dict(mapping) -> new dictionary initialized from a mapping object's
 |      (key, value) pairs
 |  dict(iterable) -> new dictionary initialized as if via:
 |      d = {}
 |      for k, v in iterable:
 |          d[k] = v
 |  dict(**kwargs) -> new dictionary initialized with the name=value pairs
 |      in the keyword argument list.  For example:  dict(one=1, two=2)
 |
 |  Built-in subclasses:
 |      StgDict
 |
 |  Methods defined here:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __init__(self, /, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __hash__ = None
nltk.Paice
Python Library Documentation: class Paice in module nltk.metrics.paice

class Paice(builtins.object)
 |  Paice(lemmas, stems)
 |
 |  Class for storing lemmas, stems and evaluation metrics.
 |
 |  Methods defined here:
 |
 |  __init__(self, lemmas, stems)
 |      :param lemmas: A dictionary where keys are lemmas and values are sets
 |          or lists of words corresponding to that lemma.
 |      :param stems: A dictionary where keys are stems and values are sets
 |          or lists of words corresponding to that stem.
 |      :type lemmas: dict(str): list(str)
 |      :type stems: dict(str): set(str)
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  update(self)
 |      Update statistics after lemmas and stems have been set.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ParallelProverBuilder
Python Library Documentation: class ParallelProverBuilder in module nltk.inference.api

class ParallelProverBuilder(Prover, ModelBuilder)
 |  ParallelProverBuilder(prover, modelbuilder)
 |
 |  This class stores both a prover and a model builder and when either
 |  prove() or build_model() is called, then both theorem tools are run in
 |  parallel.  Whichever finishes first, the prover or the model builder, is the
 |  result that will be used.
 |
 |  Method resolution order:
 |      ParallelProverBuilder
 |      Prover
 |      ModelBuilder
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, prover, modelbuilder)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Prover:
 |
 |  prove(self, goal=None, assumptions=None, verbose=False)
 |      :return: Whether the proof was successful or not.
 |      :rtype: bool
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Prover:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ModelBuilder:
 |
 |  build_model(self, goal=None, assumptions=None, verbose=False)
 |      Perform the actual model building.
 |      :return: Whether a model was generated
 |      :rtype: bool
nltk.ParallelProverBuilderCommand
Python Library Documentation: class ParallelProverBuilderCommand in module nltk.inference.api

class ParallelProverBuilderCommand(BaseProverCommand, BaseModelBuilderCommand)
 |  ParallelProverBuilderCommand(prover, modelbuilder, goal=None, assumptions=None)
 |
 |  This command stores both a prover and a model builder and when either
 |  prove() or build_model() is called, then both theorem tools are run in
 |  parallel.  Whichever finishes first, the prover or the model builder, is the
 |  result that will be used.
 |
 |  Because the theorem prover result is the opposite of the model builder
 |  result, we will treat self._result as meaning "proof found/no model found".
 |
 |  Method resolution order:
 |      ParallelProverBuilderCommand
 |      BaseProverCommand
 |      BaseModelBuilderCommand
 |      BaseTheoremToolCommand
 |      ProverCommand
 |      ModelBuilderCommand
 |      TheoremToolCommand
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, prover, modelbuilder, goal=None, assumptions=None)
 |      :param prover: The theorem tool to execute with the assumptions
 |      :type prover: Prover
 |      :see: ``BaseTheoremToolCommand``
 |
 |  build_model(self, verbose=False)
 |      Attempt to build a model.  Store the result to prevent unnecessary
 |      re-building.
 |
 |  prove(self, verbose=False)
 |      Perform the actual proof.  Store the result to prevent unnecessary
 |      re-proving.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BaseProverCommand:
 |
 |  decorate_proof(self, proof_string, simplify=True)
 |      Modify and return the proof string
 |      :param proof_string: str the proof to decorate
 |      :param simplify: bool simplify the proof?
 |      :return: str
 |
 |  get_prover(self)
 |      Return the prover object
 |      :return: ``Prover``
 |
 |  proof(self, simplify=True)
 |      Return the proof string
 |      :param simplify: bool simplify the proof?
 |      :return: str
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BaseModelBuilderCommand:
 |
 |  get_model_builder(self)
 |      Return the model builder object
 |      :return: ``ModelBuilder``
 |
 |  model(self, format=None)
 |      Return a string representation of the model
 |
 |      :param simplify: bool simplify the proof?
 |      :return: str
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BaseTheoremToolCommand:
 |
 |  add_assumptions(self, new_assumptions)
 |      Add new assumptions to the assumption list.
 |
 |      :param new_assumptions: new assumptions
 |      :type new_assumptions: list(sem.Expression)
 |
 |  assumptions(self)
 |      List the current assumptions.
 |
 |      :return: list of ``Expression``
 |
 |  goal(self)
 |      Return the goal
 |
 |      :return: ``Expression``
 |
 |  print_assumptions(self)
 |      Print the list of the current assumptions.
 |
 |  retract_assumptions(self, retracted, debug=False)
 |      Retract assumptions from the assumption list.
 |
 |      :param debug: If True, give warning when ``retracted`` is not present on
 |          assumptions list.
 |      :type debug: bool
 |      :param retracted: assumptions to be retracted
 |      :type retracted: list(sem.Expression)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from TheoremToolCommand:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ParentedTree
Python Library Documentation: class ParentedTree in module nltk.tree.parented

class ParentedTree(AbstractParentedTree)
 |  ParentedTree(node, children=None)
 |
 |  A ``Tree`` that automatically maintains parent pointers for
 |  single-parented trees.  The following are methods for querying
 |  the structure of a parented tree: ``parent``, ``parent_index``,
 |  ``left_sibling``, ``right_sibling``, ``root``, ``treeposition``.
 |
 |  Each ``ParentedTree`` may have at most one parent.  In
 |  particular, subtrees may not be shared.  Any attempt to reuse a
 |  single ``ParentedTree`` as a child of more than one parent (or
 |  as multiple children of the same parent) will cause a
 |  ``ValueError`` exception to be raised.
 |
 |  ``ParentedTrees`` should never be used in the same tree as ``Trees``
 |  or ``MultiParentedTrees``.  Mixing tree implementations may result
 |  in incorrect parent pointers and in ``TypeError`` exceptions.
 |
 |  Method resolution order:
 |      ParentedTree
 |      AbstractParentedTree
 |      nltk.tree.tree.Tree
 |      builtins.list
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, node, children=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  copy(self, deep=False)
 |      Return a shallow copy of the list.
 |
 |  left_sibling(self)
 |      The left sibling of this tree, or None if it has none.
 |
 |  parent(self)
 |      The parent of this tree, or None if it has no parent.
 |
 |  parent_index(self)
 |      The index of this tree in its parent.  I.e.,
 |      ``ptree.parent()[ptree.parent_index()] is ptree``.  Note that
 |      ``ptree.parent_index()`` is not necessarily equal to
 |      ``ptree.parent.index(ptree)``, since the ``index()`` method
 |      returns the first child that is equal to its argument.
 |
 |  right_sibling(self)
 |      The right sibling of this tree, or None if it has none.
 |
 |  root(self)
 |      The root of this tree.  I.e., the unique ancestor of this tree
 |      whose parent is None.  If ``ptree.parent()`` is None, then
 |      ``ptree`` is its own root.
 |
 |  treeposition(self)
 |      The tree position of this tree, relative to the root of the
 |      tree.  I.e., ``ptree.root[ptree.treeposition] is ptree``.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractParentedTree:
 |
 |  __delitem__(self, index)
 |      Delete self[key].
 |
 |  __getnewargs__(self)
 |      Method used by the pickle module when un-pickling.
 |      This method provides the arguments passed to ``__new__``
 |      upon un-pickling. Without this method, ParentedTree instances
 |      cannot be pickled and unpickled in Python 3.7+ onwards.
 |
 |      :return: Tuple of arguments for ``__new__``, i.e. the label
 |          and the children of this node.
 |      :rtype: Tuple[Any, List[AbstractParentedTree]]
 |
 |  __setitem__(self, index, value)
 |      Set self[key] to value.
 |
 |  append(self, child)
 |      Append object to the end of the list.
 |
 |  extend(self, children)
 |      Extend list by appending elements from the iterable.
 |
 |  insert(self, index, child)
 |      Insert object before index.
 |
 |  pop(self, index=-1)
 |      Remove and return item at index (default last).
 |
 |      Raises IndexError if list is empty or index is out of range.
 |
 |  remove(self, child)
 |      Remove first occurrence of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.tree.Tree:
 |
 |  __add__(self, v)
 |      Return self+value.
 |
 |  __copy__(self)
 |
 |  __deepcopy__(self, memo)
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__ lambda self, other
 |
 |  __getitem__(self, index)
 |      Return self[index].
 |
 |  __gt__ lambda self, other
 |
 |  __le__ lambda self, other
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, v)
 |      Return self*value.
 |
 |  __ne__ lambda self, other
 |      # @total_ordering doesn't work here, since the class inherits from a builtin class
 |
 |  __radd__(self, v)
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __rmul__(self, v)
 |      Return value*self.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
 |      This method can modify a tree in three ways:
 |
 |        1. Convert a tree into its Chomsky Normal Form (CNF)
 |           equivalent -- Every subtree has either two non-terminals
 |           or one terminal as its children.  This process requires
 |           the creation of more"artificial" non-terminal nodes.
 |        2. Markov (vertical) smoothing of children in new artificial
 |           nodes
 |        3. Horizontal (parent) annotation of nodes
 |
 |      :param factor: Right or left factoring method (default = "right")
 |      :type  factor: str = [left|right]
 |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
 |      :type  horzMarkov: int | None
 |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
 |      :type  vertMarkov: int | None
 |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
 |                        original subtree from the child nodes that have yet to be expanded (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string used to separate the node representation from its vertical annotation
 |      :type  parentChar: str
 |
 |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
 |      Collapse subtrees with a single child (ie. unary productions)
 |      into a new non-terminal (Tree node) joined by 'joinChar'.
 |      This is useful when working with algorithms that do not allow
 |      unary productions, and completely removing the unary productions
 |      would require loss of useful information.  The Tree is modified
 |      directly (since it is passed by reference) and no value is returned.
 |
 |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
 |                          Part-of-Speech tags) since they are always unary productions
 |      :type  collapsePOS: bool
 |      :param collapseRoot: 'False' (default) will not modify the root production
 |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
 |                           to the TOP -> productions.
 |      :type collapseRoot: bool
 |      :param joinChar: A string used to connect collapsed node values (default = "+")
 |      :type  joinChar: str
 |
 |  draw(self)
 |      Open a new window containing a graphical diagram of this tree.
 |
 |  flatten(self)
 |      Return a flat version of the tree, with all non-root non-terminals removed.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> print(t.flatten())
 |          (S the dog chased the cat)
 |
 |      :return: a tree consisting of this tree's root connected directly to
 |          its leaves, omitting all intervening non-terminal nodes.
 |      :rtype: Tree
 |
 |  freeze(self, leaf_freezer=None)
 |
 |  height(self)
 |      Return the height of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.height()
 |          5
 |          >>> print(t[0,0])
 |          (D the)
 |          >>> t[0,0].height()
 |          2
 |
 |      :return: The height of this tree.  The height of a tree
 |          containing no children is 1; the height of a tree
 |          containing only leaves is 2; and the height of any other
 |          tree is one plus the maximum of its children's
 |          heights.
 |      :rtype: int
 |
 |  label(self)
 |      Return the node label of the tree.
 |
 |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
 |          >>> t.label()
 |          'S'
 |
 |      :return: the node label (typically a string)
 |      :rtype: any
 |
 |  leaf_treeposition(self, index)
 |      :return: The tree position of the ``index``-th leaf in this
 |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
 |          ``self[tp]==self.leaves()[i]``.
 |
 |      :raise IndexError: If this tree contains fewer than ``index+1``
 |          leaves, or if ``index<0``.
 |
 |  leaves(self)
 |      Return the leaves of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.leaves()
 |          ['the', 'dog', 'chased', 'the', 'cat']
 |
 |      :return: a list containing this tree's leaves.
 |          The order reflects the order of the
 |          leaves in the tree's hierarchical structure.
 |      :rtype: list
 |
 |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
 |      :return: A pretty-printed string representation of this tree.
 |      :rtype: str
 |      :param margin: The right margin at which to do line-wrapping.
 |      :type margin: int
 |      :param indent: The indentation level at which printing
 |          begins.  This number is used to decide how far to indent
 |          subsequent lines.
 |      :type indent: int
 |      :param nodesep: A string that is used to separate the node
 |          from the children.  E.g., the default value ``':'`` gives
 |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
 |
 |  pformat_latex_qtree(self)
 |      Returns a representation of the tree compatible with the
 |      LaTeX qtree package. This consists of the string ``\Tree``
 |      followed by the tree represented in bracketed notation.
 |
 |      For example, the following result was generated from a parse tree of
 |      the sentence ``The announcement astounded us``::
 |
 |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
 |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
 |
 |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
 |      style file for the qtree package.
 |
 |      :return: A latex qtree representation of this tree.
 |      :rtype: str
 |
 |  pos(self)
 |      Return a sequence of pos-tagged words extracted from the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.pos()
 |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
 |
 |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
 |          The order reflects the order of the leaves in the tree's hierarchical structure.
 |      :rtype: list(tuple)
 |
 |  pprint(self, **kwargs)
 |      Print a string representation of this Tree to 'stream'
 |
 |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
 |      Pretty-print this tree as ASCII or Unicode art.
 |      For explanation of the arguments, see the documentation for
 |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
 |
 |  productions(self)
 |      Generate the productions that correspond to the non-terminal nodes of the tree.
 |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
 |      form P -> C1 C2 ... Cn.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
 |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
 |          NP -> D N, D -> 'the', N -> 'cat']
 |
 |      :rtype: list(Production)
 |
 |  set_label(self, label)
 |      Set the node label of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.set_label("T")
 |          >>> print(t)
 |          (T (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))
 |
 |      :param label: the node label (typically a string)
 |      :type label: any
 |
 |  subtrees(self, filter=None)
 |      Generate all the subtrees of this tree, optionally restricted
 |      to trees matching the filter function.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> for s in t.subtrees(lambda t: t.height() == 2):
 |          ...     print(s)
 |          (D the)
 |          (N dog)
 |          (V chased)
 |          (D the)
 |          (N cat)
 |
 |      :type filter: function
 |      :param filter: the function to filter all local trees
 |
 |  treeposition_spanning_leaves(self, start, end)
 |      :return: The tree position of the lowest descendant of this
 |          tree that dominates ``self.leaves()[start:end]``.
 |      :raise ValueError: if ``end <= start``
 |
 |  treepositions(self, order='preorder')
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.treepositions() # doctest: +ELLIPSIS
 |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
 |          >>> for pos in t.treepositions('leaves'):
 |          ...     t[pos] = t[pos][::-1].upper()
 |          >>> print(t)
 |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
 |
 |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
 |          ``leaves``.
 |
 |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
 |      This method modifies the tree in three ways:
 |
 |        1. Transforms a tree in Chomsky Normal Form back to its
 |           original structure (branching greater than two)
 |        2. Removes any parent annotation (if it exists)
 |        3. (optional) expands unary subtrees (if previously
 |           collapsed with collapseUnary(...) )
 |
 |      :param expandUnary: Flag to expand unary or not (default = True)
 |      :type  expandUnary: bool
 |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
 |      :type  parentChar: str
 |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
 |      :type  unaryChar: str
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from nltk.tree.tree.Tree:
 |
 |  convert(tree)
 |      Convert a tree between different subtypes of Tree.  ``cls`` determines
 |      which class will be used to encode the new tree.
 |
 |      :type tree: Tree
 |      :param tree: The tree that should be converted.
 |      :return: The new Tree.
 |
 |  fromlist(l)
 |      :type l: list
 |      :param l: a tree represented as nested lists
 |
 |      :return: A tree corresponding to the list representation ``l``.
 |      :rtype: Tree
 |
 |      Convert nested lists to a NLTK Tree
 |
 |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
 |      Read a bracketed tree string and return the resulting tree.
 |      Trees are represented as nested brackettings, such as::
 |
 |        (S (NP (NNP John)) (VP (V runs)))
 |
 |      :type s: str
 |      :param s: The string to read
 |
 |      :type brackets: str (length=2)
 |      :param brackets: The bracket characters used to mark the
 |          beginning and end of trees and subtrees.
 |
 |      :type read_node: function
 |      :type read_leaf: function
 |      :param read_node, read_leaf: If specified, these functions
 |          are applied to the substrings of ``s`` corresponding to
 |          nodes and leaves (respectively) to obtain the values for
 |          those nodes and leaves.  They should have the following
 |          signature:
 |
 |             read_node(str) -> value
 |
 |          For example, these functions could be used to process nodes
 |          and leaves whose values should be some type other than
 |          string (such as ``FeatStruct``).
 |          Note that by default, node strings and leaf strings are
 |          delimited by whitespace and brackets; to override this
 |          default, use the ``node_pattern`` and ``leaf_pattern``
 |          arguments.
 |
 |      :type node_pattern: str
 |      :type leaf_pattern: str
 |      :param node_pattern, leaf_pattern: Regular expression patterns
 |          used to find node and leaf substrings in ``s``.  By
 |          default, both nodes patterns are defined to match any
 |          sequence of non-whitespace non-bracket characters.
 |
 |      :type remove_empty_top_bracketing: bool
 |      :param remove_empty_top_bracketing: If the resulting tree has
 |          an empty node label, and is length one, then return its
 |          single child instead.  This is useful for treebank trees,
 |          which sometimes contain an extra level of bracketing.
 |
 |      :return: A tree corresponding to the string representation ``s``.
 |          If this class method is called using a subclass of Tree,
 |          then it will return a tree of that type.
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tree.tree.Tree:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  node
 |      Outdated method to access the node value; use the label() method instead.
 |
 |      @deprecated: Use label() instead
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.tree.tree.Tree:
 |
 |  __hash__ = None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.list:
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iadd__(self, value, /)
 |      Implement self+=value.
 |
 |  __imul__(self, value, /)
 |      Implement self*=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the list.
 |
 |  __sizeof__(self, /)
 |      Return the size of the list in memory, in bytes.
 |
 |  clear(self, /)
 |      Remove all items from list.
 |
 |  count(self, value, /)
 |      Return number of occurrences of value.
 |
 |  index(self, value, start=0, stop=9223372036854775807, /)
 |      Return first index of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  reverse(self, /)
 |      Reverse *IN PLACE*.
 |
 |  sort(self, /, *, key=None, reverse=False)
 |      Sort the list in ascending order and return None.
 |
 |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
 |      order of two equal elements is maintained).
 |
 |      If a key function is given, apply it once to each list item and sort them,
 |      ascending or descending, according to their function values.
 |
 |      The reverse flag can be set to sort in descending order.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.list:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.list:
 |
 |  __new__(*args, **kwargs) class method of builtins.list
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.ParserI
Python Library Documentation: class ParserI in module nltk.parse.api

class ParserI(builtins.object)
 |  A processing class for deriving trees that represent possible
 |  structures for a sequence of tokens.  These tree structures are
 |  known as "parses".  Typically, parsers are used to derive syntax
 |  trees for sentences.  But parsers can also be used to derive other
 |  kinds of tree structure, such as morphological trees and discourse
 |  structures.
 |
 |  Subclasses must define:
 |    - at least one of: ``parse()``, ``parse_sents()``.
 |
 |  Subclasses may define:
 |    - ``grammar()``
 |
 |  Methods defined here:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, sent, *args, **kwargs)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Path
Python Library Documentation: class Path in module pathlib

class Path(PurePath)
 |  Path(*args, **kwargs)
 |
 |  PurePath subclass that can make system calls.
 |
 |  Path represents a filesystem path but unlike PurePath, also offers
 |  methods to do system calls on path objects. Depending on your system,
 |  instantiating a Path will return either a PosixPath or a WindowsPath
 |  object. You can also instantiate a PosixPath or WindowsPath directly,
 |  but cannot instantiate a WindowsPath on a POSIX system or vice versa.
 |
 |  Method resolution order:
 |      Path
 |      PurePath
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __enter__(self)
 |
 |  __exit__(self, t, v, tb)
 |
 |  __init__(self, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  absolute(self)
 |      Return an absolute version of this path by prepending the current
 |      working directory. No normalization or symlink resolution is performed.
 |
 |      Use resolve() to get the canonical path to a file.
 |
 |  chmod(self, mode, *, follow_symlinks=True)
 |      Change the permissions of the path, like os.chmod().
 |
 |  exists(self, *, follow_symlinks=True)
 |      Whether this path exists.
 |
 |      This method normally follows symlinks; to check whether a symlink exists,
 |      add the argument follow_symlinks=False.
 |
 |  expanduser(self)
 |      Return a new path with expanded ~ and ~user constructs
 |      (as returned by os.path.expanduser)
 |
 |  glob(self, pattern, *, case_sensitive=None)
 |      Iterate over this subtree and yield all existing files (of any
 |      kind, including directories) matching the given relative pattern.
 |
 |  group(self)
 |      Return the group name of the file gid.
 |
 |  hardlink_to(self, target)
 |      Make this path a hard link pointing to the same file as *target*.
 |
 |      Note the order of arguments (self, target) is the reverse of os.link's.
 |
 |  is_block_device(self)
 |      Whether this path is a block device.
 |
 |  is_char_device(self)
 |      Whether this path is a character device.
 |
 |  is_dir(self)
 |      Whether this path is a directory.
 |
 |  is_fifo(self)
 |      Whether this path is a FIFO.
 |
 |  is_file(self)
 |      Whether this path is a regular file (also True for symlinks pointing
 |      to regular files).
 |
 |  is_junction(self)
 |      Whether this path is a junction.
 |
 |  is_mount(self)
 |      Check if this path is a mount point
 |
 |  is_socket(self)
 |      Whether this path is a socket.
 |
 |  is_symlink(self)
 |      Whether this path is a symbolic link.
 |
 |  iterdir(self)
 |      Yield path objects of the directory contents.
 |
 |      The children are yielded in arbitrary order, and the
 |      special entries '.' and '..' are not included.
 |
 |  lchmod(self, mode)
 |      Like chmod(), except if the path points to a symlink, the symlink's
 |      permissions are changed, rather than its target's.
 |
 |  lstat(self)
 |      Like stat(), except if the path points to a symlink, the symlink's
 |      status information is returned, rather than its target's.
 |
 |  mkdir(self, mode=511, parents=False, exist_ok=False)
 |      Create a new directory at this given path.
 |
 |  open(self, mode='r', buffering=-1, encoding=None, errors=None, newline=None)
 |      Open the file pointed to by this path and return a file object, as
 |      the built-in open() function does.
 |
 |  owner(self)
 |      Return the login name of the file owner.
 |
 |  read_bytes(self)
 |      Open the file in bytes mode, read it, and close the file.
 |
 |  read_text(self, encoding=None, errors=None)
 |      Open the file in text mode, read it, and close the file.
 |
 |  readlink(self)
 |      Return the path to which the symbolic link points.
 |
 |  rename(self, target)
 |      Rename this path to the target path.
 |
 |      The target path may be absolute or relative. Relative paths are
 |      interpreted relative to the current working directory, *not* the
 |      directory of the Path object.
 |
 |      Returns the new Path instance pointing to the target path.
 |
 |  replace(self, target)
 |      Rename this path to the target path, overwriting if that path exists.
 |
 |      The target path may be absolute or relative. Relative paths are
 |      interpreted relative to the current working directory, *not* the
 |      directory of the Path object.
 |
 |      Returns the new Path instance pointing to the target path.
 |
 |  resolve(self, strict=False)
 |      Make the path absolute, resolving all symlinks on the way and also
 |      normalizing it.
 |
 |  rglob(self, pattern, *, case_sensitive=None)
 |      Recursively yield all existing files (of any kind, including
 |      directories) matching the given relative pattern, anywhere in
 |      this subtree.
 |
 |  rmdir(self)
 |      Remove this directory.  The directory must be empty.
 |
 |  samefile(self, other_path)
 |      Return whether other_path is the same or not as this file
 |      (as returned by os.path.samefile()).
 |
 |  stat(self, *, follow_symlinks=True)
 |      Return the result of the stat() system call on this path, like
 |      os.stat() does.
 |
 |  symlink_to(self, target, target_is_directory=False)
 |      Make this path a symlink pointing to the target path.
 |      Note the order of arguments (link, target) is the reverse of os.symlink.
 |
 |  touch(self, mode=438, exist_ok=True)
 |      Create this file with the given access mode, if it doesn't exist.
 |
 |  unlink(self, missing_ok=False)
 |      Remove this file or link.
 |      If the path is a directory, use rmdir() instead.
 |
 |  walk(self, top_down=True, on_error=None, follow_symlinks=False)
 |      Walk the directory tree from this directory, similar to os.walk().
 |
 |  write_bytes(self, data)
 |      Open the file in bytes mode, write to it, and close the file.
 |
 |  write_text(self, data, encoding=None, errors=None, newline=None)
 |      Open the file in text mode, write to it, and close the file.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  cwd()
 |      Return a new path pointing to the current working directory.
 |
 |  home()
 |      Return a new path pointing to the user's home directory (as
 |      returned by os.path.expanduser('~')).
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(cls, *args, **kwargs)
 |      Construct a PurePath from one or several strings and or existing
 |      PurePath objects.  The strings and path objects are combined so as
 |      to yield a canonicalized path, which is incorporated into the
 |      new PurePath object.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from PurePath:
 |
 |  __bytes__(self)
 |      Return the bytes representation of the path.  This is only
 |      recommended to use under Unix.
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __fspath__(self)
 |
 |  __ge__(self, other)
 |      Return self>=value.
 |
 |  __gt__(self, other)
 |      Return self>value.
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __le__(self, other)
 |      Return self<=value.
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __reduce__(self)
 |      Helper for pickle.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __rtruediv__(self, key)
 |
 |  __str__(self)
 |      Return the string representation of the path, suitable for
 |      passing to system calls.
 |
 |  __truediv__(self, key)
 |
 |  as_posix(self)
 |      Return the string representation of the path with forward (/)
 |      slashes.
 |
 |  as_uri(self)
 |      Return the path as a 'file' URI.
 |
 |  is_absolute(self)
 |      True if the path is absolute (has both a root and, if applicable,
 |      a drive).
 |
 |  is_relative_to(self, other, /, *_deprecated)
 |      Return True if the path is relative to another path or False.
 |
 |  is_reserved(self)
 |      Return True if the path contains one of the special names reserved
 |      by the system, if any.
 |
 |  joinpath(self, *pathsegments)
 |      Combine this path with one or several arguments, and return a
 |      new path representing either a subpath (if all arguments are relative
 |      paths) or a totally different path (if one of the arguments is
 |      anchored).
 |
 |  match(self, path_pattern, *, case_sensitive=None)
 |      Return True if this path matches the given pattern.
 |
 |  relative_to(self, other, /, *_deprecated, walk_up=False)
 |      Return the relative path to another path identified by the passed
 |      arguments.  If the operation is not possible (because this is not
 |      related to the other path), raise ValueError.
 |
 |      The *walk_up* parameter controls whether `..` may be used to resolve
 |      the path.
 |
 |  with_name(self, name)
 |      Return a new path with the file name changed.
 |
 |  with_segments(self, *pathsegments)
 |      Construct a new path object from any number of path-like objects.
 |      Subclasses may override this method to customize how new path objects
 |      are created from methods like `iterdir()`.
 |
 |  with_stem(self, stem)
 |      Return a new path with the stem changed.
 |
 |  with_suffix(self, suffix)
 |      Return a new path with the file suffix changed.  If the path
 |      has no suffix, add given suffix.  If the given suffix is an empty
 |      string, remove the suffix from the path.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from PurePath:
 |
 |  anchor
 |      The concatenation of the drive and root, or ''.
 |
 |  drive
 |      The drive prefix (letter or UNC path), if any.
 |
 |  name
 |      The final path component, if any.
 |
 |  parent
 |      The logical parent of the path.
 |
 |  parents
 |      A sequence of this path's logical parents.
 |
 |  parts
 |      An object providing sequence-like access to the
 |      components in the filesystem path.
 |
 |  root
 |      The root of the path, if any.
 |
 |  stem
 |      The final path component, minus its last suffix.
 |
 |  suffix
 |      The final component's last suffix, if any.
 |
 |      This includes the leading period. For example: '.txt'
 |
 |  suffixes
 |      A list of the final component's suffixes, if any.
 |
 |      These include the leading periods. For example: ['.tar', '.gz']
nltk.PerceptronTagger
Python Library Documentation: class PerceptronTagger in module nltk.tag.perceptron

class PerceptronTagger(nltk.tag.api.TaggerI)
 |  PerceptronTagger(load=True, lang='eng', loc=None)
 |
 |  Greedy Averaged Perceptron tagger, as implemented by Matthew Honnibal.
 |  See more implementation details here:
 |  https://explosion.ai/blog/part-of-speech-pos-tagger-in-python
 |
 |  >>> from nltk.tag.perceptron import PerceptronTagger
 |  >>> tagger = PerceptronTagger(load=False)
 |
 |  Train and save the model:
 |
 |  >>> tagger.train([[('today','NN'),('is','VBZ'),('good','JJ'),('day','NN')],
 |  ... [('yes','NNS'),('it','PRP'),('beautiful','JJ')]], save_loc=tagger.save_dir)
 |
 |  Load the saved model:
 |
 |  >>> from nltk.data import FileSystemPathPointer
 |  >>> tagger2 = PerceptronTagger(loc=FileSystemPathPointer(tagger.save_dir))
 |  >>> print(sorted(list(tagger2.classes)))
 |  ['JJ', 'NN', 'NNS', 'PRP', 'VBZ']
 |
 |  >>> print(tagger2.classes == tagger.classes)
 |  True
 |
 |  >>> tagger2.tag(['today','is','a','beautiful','day'])
 |  [('today', 'NN'), ('is', 'PRP'), ('a', 'PRP'), ('beautiful', 'JJ'), ('day', 'NN')]
 |
 |  Use the pretrain model (the default constructor)
 |
 |  >>> pretrain = PerceptronTagger()
 |
 |  >>> pretrain.tag('The quick brown fox jumps over the lazy dog'.split())
 |  [('The', 'DT'), ('quick', 'JJ'), ('brown', 'NN'), ('fox', 'NN'), ('jumps', 'VBZ'), ('over', 'IN'), ('the', 'DT'), ('lazy', 'JJ'), ('dog', 'NN')]
 |
 |  >>> pretrain.tag("The red cat".split())
 |  [('The', 'DT'), ('red', 'JJ'), ('cat', 'NN')]
 |
 |  Method resolution order:
 |      PerceptronTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, load=True, lang='eng', loc=None)
 |      :param load: Load the json model upon instantiation.
 |
 |  decode_json_params(self, params)
 |
 |  encode_json_obj(self)
 |
 |  load_from_json(self, lang='eng', loc=None)
 |
 |  normalize(self, word)
 |      Normalization used in pre-processing.
 |      - All words are lower cased
 |      - Groups of digits of length 4 are represented as !YEAR;
 |      - Other digits are represented as !DIGITS
 |
 |      :rtype: str
 |
 |  param_files(self, lang='eng')
 |
 |  save_to_json(self, lang='xxx', loc=None)
 |
 |  tag(self, tokens, return_conf=False, use_tagdict=True)
 |      Tag tokenized sentences.
 |      :params tokens: list of word
 |      :type tokens: list(str)
 |
 |  train(self, sentences, save_loc=None, nr_iter=5)
 |      Train a model from sentences, and save it at ``save_loc``. ``nr_iter``
 |      controls the number of Perceptron training iterations.
 |
 |      :param sentences: A list or iterator of sentences, where each sentence
 |          is a list of (words, tags) tuples.
 |      :param save_loc: If not ``None``, saves a json model in this location.
 |      :param nr_iter: Number of training iterations.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  decode_json_obj(obj)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  END = ['-END-', '-END2-']
 |
 |  START = ['-START-', '-START2-']
 |
 |  __abstractmethods__ = frozenset()
 |
 |  json_tag = 'nltk.tag.perceptron.PerceptronTagger'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.PhraseTable
Python Library Documentation: class PhraseTable in module nltk.translate.api

class PhraseTable(builtins.object)
 |  In-memory store of translations for a given phrase, and the log
 |  probability of the those translations
 |
 |  Methods defined here:
 |
 |  __contains__(self, src_phrase)
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  add(self, src_phrase, trg_phrase, log_prob)
 |      :type src_phrase: tuple(str)
 |      :type trg_phrase: tuple(str)
 |
 |      :param log_prob: Log probability that given ``src_phrase``,
 |          ``trg_phrase`` is its translation
 |      :type log_prob: float
 |
 |  translations_for(self, src_phrase)
 |      Get the translations for a source language phrase
 |
 |      :param src_phrase: Source language phrase of interest
 |      :type src_phrase: tuple(str)
 |
 |      :return: A list of target language phrases that are translations
 |          of ``src_phrase``, ordered in decreasing order of
 |          likelihood. Each list element is a tuple of the target
 |          phrase and its log probability.
 |      :rtype: list(PhraseTableEntry)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.PorterStemmer
Python Library Documentation: class PorterStemmer in module nltk.stem.porter

class PorterStemmer(nltk.stem.api.StemmerI)
 |  PorterStemmer(mode='NLTK_EXTENSIONS')
 |
 |  A word stemmer based on the Porter stemming algorithm.
 |
 |      Porter, M. "An algorithm for suffix stripping."
 |      Program 14.3 (1980): 130-137.
 |
 |  See https://www.tartarus.org/~martin/PorterStemmer/ for the homepage
 |  of the algorithm.
 |
 |  Martin Porter has endorsed several modifications to the Porter
 |  algorithm since writing his original paper, and those extensions are
 |  included in the implementations on his website. Additionally, others
 |  have proposed further improvements to the algorithm, including NLTK
 |  contributors. There are thus three modes that can be selected by
 |  passing the appropriate constant to the class constructor's `mode`
 |  attribute:
 |
 |  - PorterStemmer.ORIGINAL_ALGORITHM
 |
 |      An implementation that is faithful to the original paper.
 |
 |      Note that Martin Porter has deprecated this version of the
 |      algorithm. Martin distributes implementations of the Porter
 |      Stemmer in many languages, hosted at:
 |
 |      https://www.tartarus.org/~martin/PorterStemmer/
 |
 |      and all of these implementations include his extensions. He
 |      strongly recommends against using the original, published
 |      version of the algorithm; only use this mode if you clearly
 |      understand why you are choosing to do so.
 |
 |  - PorterStemmer.MARTIN_EXTENSIONS
 |
 |      An implementation that only uses the modifications to the
 |      algorithm that are included in the implementations on Martin
 |      Porter's website. He has declared Porter frozen, so the
 |      behaviour of those implementations should never change.
 |
 |  - PorterStemmer.NLTK_EXTENSIONS (default)
 |
 |      An implementation that includes further improvements devised by
 |      NLTK contributors or taken from other modified implementations
 |      found on the web.
 |
 |  For the best stemming, you should use the default NLTK_EXTENSIONS
 |  version. However, if you need to get the same results as either the
 |  original algorithm or one of Martin Porter's hosted versions for
 |  compatibility with an existing implementation or dataset, you can use
 |  one of the other modes instead.
 |
 |  Method resolution order:
 |      PorterStemmer
 |      nltk.stem.api.StemmerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, mode='NLTK_EXTENSIONS')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  stem(self, word, to_lowercase=True)
 |      :param to_lowercase: if `to_lowercase=True` the word always lowercase
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MARTIN_EXTENSIONS = 'MARTIN_EXTENSIONS'
 |
 |  NLTK_EXTENSIONS = 'NLTK_EXTENSIONS'
 |
 |  ORIGINAL_ALGORITHM = 'ORIGINAL_ALGORITHM'
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.stem.api.StemmerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.PositiveNaiveBayesClassifier
Python Library Documentation: class PositiveNaiveBayesClassifier in module nltk.classify.positivenaivebayes

class PositiveNaiveBayesClassifier(nltk.classify.naivebayes.NaiveBayesClassifier)
 |  PositiveNaiveBayesClassifier(label_probdist, feature_probdist)
 |
 |  Method resolution order:
 |      PositiveNaiveBayesClassifier
 |      nltk.classify.naivebayes.NaiveBayesClassifier
 |      nltk.classify.api.ClassifierI
 |      builtins.object
 |
 |  Static methods defined here:
 |
 |  train(positive_featuresets, unlabeled_featuresets, positive_prob_prior=0.5, estimator=<class 'nltk.probability.ELEProbDist'>)
 |      :param positive_featuresets: An iterable of featuresets that are known as positive
 |          examples (i.e., their label is ``True``).
 |
 |      :param unlabeled_featuresets: An iterable of featuresets whose label is unknown.
 |
 |      :param positive_prob_prior: A prior estimate of the probability of the label
 |          ``True`` (default 0.5).
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.naivebayes.NaiveBayesClassifier:
 |
 |  __init__(self, label_probdist, feature_probdist)
 |      :param label_probdist: P(label), the probability distribution
 |          over labels.  It is expressed as a ``ProbDistI`` whose
 |          samples are labels.  I.e., P(label) =
 |          ``label_probdist.prob(label)``.
 |
 |      :param feature_probdist: P(fname=fval|label), the probability
 |          distribution for feature values, given labels.  It is
 |          expressed as a dictionary whose keys are ``(label, fname)``
 |          pairs and whose values are ``ProbDistI`` objects over feature
 |          values.  I.e., P(fname=fval|label) =
 |          ``feature_probdist[label,fname].prob(fval)``.  If a given
 |          ``(label,fname)`` is not a key in ``feature_probdist``, then
 |          it is assumed that the corresponding P(fname=fval|label)
 |          is 0 for all values of ``fval``.
 |
 |  classify(self, featureset)
 |      :return: the most appropriate label for the given featureset.
 |      :rtype: label
 |
 |  labels(self)
 |      :return: the list of category labels used by this classifier.
 |      :rtype: list of (immutable)
 |
 |  most_informative_features(self, n=100)
 |      Return a list of the 'most informative' features used by this
 |      classifier.  For the purpose of this function, the
 |      informativeness of a feature ``(fname,fval)`` is equal to the
 |      highest value of P(fname=fval|label), for any label, divided by
 |      the lowest value of P(fname=fval|label), for any label:
 |
 |      |  max[ P(fname=fval|label1) / P(fname=fval|label2) ]
 |
 |  prob_classify(self, featureset)
 |      :return: a probability distribution over labels for the given
 |          featureset.
 |      :rtype: ProbDistI
 |
 |  show_most_informative_features(self, n=10)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.api.ClassifierI:
 |
 |  classify_many(self, featuresets)
 |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.classify(fs) for fs in featuresets]
 |
 |      :rtype: list(label)
 |
 |  prob_classify_many(self, featuresets)
 |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.prob_classify(fs) for fs in featuresets]
 |
 |      :rtype: list(ProbDistI)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.classify.api.ClassifierI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ProbDistI
Python Library Documentation: class ProbDistI in module nltk.probability

class ProbDistI(builtins.object)
 |  A probability distribution for the outcomes of an experiment.  A
 |  probability distribution specifies how likely it is that an
 |  experiment will have any given outcome.  For example, a
 |  probability distribution could be used to predict the probability
 |  that a token in a document will have a given type.  Formally, a
 |  probability distribution can be defined as a function mapping from
 |  samples to nonnegative real numbers, such that the sum of every
 |  number in the function's range is 1.0.  A ``ProbDist`` is often
 |  used to model the probability distribution of the experiment used
 |  to generate a frequency distribution.
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Classes inheriting from ProbDistI should implement __init__.
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  SUM_TO_ONE = True
 |
 |  __abstractmethods__ = frozenset({'__init__', 'max', 'prob', 'samples'}...
nltk.ProbabilisticDependencyGrammar
Python Library Documentation: class ProbabilisticDependencyGrammar in module nltk.grammar

class ProbabilisticDependencyGrammar(builtins.object)
 |  ProbabilisticDependencyGrammar(productions, events, tags)
 |
 |  Methods defined here:
 |
 |  __init__(self, productions, events, tags)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return a concise string representation of the ``ProbabilisticDependencyGrammar``
 |
 |  __str__(self)
 |      Return a verbose string representation of the ``ProbabilisticDependencyGrammar``
 |
 |      :rtype: str
 |
 |  contains(self, head, mod)
 |      Return True if this ``DependencyGrammar`` contains a
 |      ``DependencyProduction`` mapping 'head' to 'mod'.
 |
 |      :param head: A head word.
 |      :type head: str
 |      :param mod: A mod word, to test as a modifier of 'head'.
 |      :type mod: str
 |      :rtype: bool
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ProbabilisticMixIn
Python Library Documentation: class ProbabilisticMixIn in module nltk.probability

class ProbabilisticMixIn(builtins.object)
 |  ProbabilisticMixIn(**kwargs)
 |
 |  A mix-in class to associate probabilities with other classes
 |  (trees, rules, etc.).  To use the ``ProbabilisticMixIn`` class,
 |  define a new class that derives from an existing class and from
 |  ProbabilisticMixIn.  You will need to define a new constructor for
 |  the new class, which explicitly calls the constructors of both its
 |  parent classes.  For example:
 |
 |      >>> from nltk.probability import ProbabilisticMixIn
 |      >>> class A:
 |      ...     def __init__(self, x, y): self.data = (x,y)
 |      ...
 |      >>> class ProbabilisticA(A, ProbabilisticMixIn):
 |      ...     def __init__(self, x, y, **prob_kwarg):
 |      ...         A.__init__(self, x, y)
 |      ...         ProbabilisticMixIn.__init__(self, **prob_kwarg)
 |
 |  See the documentation for the ProbabilisticMixIn
 |  ``constructor<__init__>`` for information about the arguments it
 |  expects.
 |
 |  You should generally also redefine the string representation
 |  methods, the comparison methods, and the hashing method.
 |
 |  Methods defined here:
 |
 |  __init__(self, **kwargs)
 |      Initialize this object's probability.  This initializer should
 |      be called by subclass constructors.  ``prob`` should generally be
 |      the first argument for those constructors.
 |
 |      :param prob: The probability associated with the object.
 |      :type prob: float
 |      :param logprob: The log of the probability associated with
 |          the object.
 |      :type logprob: float
 |
 |  logprob(self)
 |      Return ``log(p)``, where ``p`` is the probability associated
 |      with this object.
 |
 |      :rtype: float
 |
 |  prob(self)
 |      Return the probability associated with this object.
 |
 |      :rtype: float
 |
 |  set_logprob(self, logprob)
 |      Set the log probability associated with this object to
 |      ``logprob``.  I.e., set the probability associated with this
 |      object to ``2**(logprob)``.
 |
 |      :param logprob: The new log probability
 |      :type logprob: float
 |
 |  set_prob(self, prob)
 |      Set the probability associated with this object to ``prob``.
 |
 |      :param prob: The new probability
 |      :type prob: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ProbabilisticNonprojectiveParser
Python Library Documentation: class ProbabilisticNonprojectiveParser in module nltk.parse.nonprojectivedependencyparser

class ProbabilisticNonprojectiveParser(builtins.object)
 |  A probabilistic non-projective dependency parser.
 |
 |  Nonprojective dependencies allows for "crossing branches" in the parse tree
 |  which is necessary for representing particular linguistic phenomena, or even
 |  typical parses in some languages.  This parser follows the MST parsing
 |  algorithm, outlined in McDonald(2005), which likens the search for the best
 |  non-projective parse to finding the maximum spanning tree in a weighted
 |  directed graph.
 |
 |  >>> class Scorer(DependencyScorerI):
 |  ...     def train(self, graphs):
 |  ...         pass
 |  ...
 |  ...     def score(self, graph):
 |  ...         return [
 |  ...             [[], [5],  [1],  [1]],
 |  ...             [[], [],   [11], [4]],
 |  ...             [[], [10], [],   [5]],
 |  ...             [[], [8],  [8],  []],
 |  ...         ]
 |
 |
 |  >>> npp = ProbabilisticNonprojectiveParser()
 |  >>> npp.train([], Scorer())
 |
 |  >>> parses = npp.parse(['v1', 'v2', 'v3'], [None, None, None])
 |  >>> len(list(parses))
 |  1
 |
 |  Rule based example
 |
 |  >>> from nltk.grammar import DependencyGrammar
 |
 |  >>> grammar = DependencyGrammar.fromstring('''
 |  ... 'taught' -> 'play' | 'man'
 |  ... 'man' -> 'the' | 'in'
 |  ... 'in' -> 'corner'
 |  ... 'corner' -> 'the'
 |  ... 'play' -> 'golf' | 'dachshund' | 'to'
 |  ... 'dachshund' -> 'his'
 |  ... ''')
 |
 |  >>> ndp = NonprojectiveDependencyParser(grammar)
 |  >>> parses = ndp.parse(['the', 'man', 'in', 'the', 'corner', 'taught', 'his', 'dachshund', 'to', 'play', 'golf'])
 |  >>> len(list(parses))
 |  4
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Creates a new non-projective parser.
 |
 |  best_incoming_arc(self, node_index)
 |      Returns the source of the best incoming arc to the
 |      node with address: node_index
 |
 |      :type node_index: integer.
 |      :param node_index: The address of the 'destination' node,
 |          the node that is arced to.
 |
 |  collapse_nodes(self, new_node, cycle_path, g_graph, b_graph, c_graph)
 |      Takes a list of nodes that have been identified to belong to a cycle,
 |      and collapses them into on larger node.  The arcs of all nodes in
 |      the graph must be updated to account for this.
 |
 |      :type new_node: Node.
 |      :param new_node: A Node (Dictionary) to collapse the cycle nodes into.
 |      :type cycle_path: A list of integers.
 |      :param cycle_path: A list of node addresses, each of which is in the cycle.
 |      :type g_graph, b_graph, c_graph: DependencyGraph
 |      :param g_graph, b_graph, c_graph: Graphs which need to be updated.
 |
 |  compute_max_subtract_score(self, column_index, cycle_indexes)
 |      When updating scores the score of the highest-weighted incoming
 |      arc is subtracted upon collapse.  This returns the correct
 |      amount to subtract from that edge.
 |
 |      :type column_index: integer.
 |      :param column_index: A index representing the column of incoming arcs
 |          to a particular node being updated
 |      :type cycle_indexes: A list of integers.
 |      :param cycle_indexes: Only arcs from cycle nodes are considered.  This
 |          is a list of such nodes addresses.
 |
 |  compute_original_indexes(self, new_indexes)
 |      As nodes are collapsed into others, they are replaced
 |      by the new node in the graph, but it's still necessary
 |      to keep track of what these original nodes were.  This
 |      takes a list of node addresses and replaces any collapsed
 |      node addresses with their original addresses.
 |
 |      :type new_indexes: A list of integers.
 |      :param new_indexes: A list of node addresses to check for
 |          subsumed nodes.
 |
 |  initialize_edge_scores(self, graph)
 |      Assigns a score to every edge in the ``DependencyGraph`` graph.
 |      These scores are generated via the parser's scorer which
 |      was assigned during the training process.
 |
 |      :type graph: DependencyGraph
 |      :param graph: A dependency graph to assign scores to.
 |
 |  original_best_arc(self, node_index)
 |
 |  parse(self, tokens, tags)
 |      Parses a list of tokens in accordance to the MST parsing algorithm
 |      for non-projective dependency parses.  Assumes that the tokens to
 |      be parsed have already been tagged and those tags are provided.  Various
 |      scoring methods can be used by implementing the ``DependencyScorerI``
 |      interface and passing it to the training algorithm.
 |
 |      :type tokens: list(str)
 |      :param tokens: A list of words or punctuation to be parsed.
 |      :type tags: list(str)
 |      :param tags: A list of tags corresponding by index to the words in the tokens list.
 |      :return: An iterator of non-projective parses.
 |      :rtype: iter(DependencyGraph)
 |
 |  train(self, graphs, dependency_scorer)
 |      Trains a ``DependencyScorerI`` from a set of ``DependencyGraph`` objects,
 |      and establishes this as the parser's scorer.  This is used to
 |      initialize the scores on a ``DependencyGraph`` during the parsing
 |      procedure.
 |
 |      :type graphs: list(DependencyGraph)
 |      :param graphs: A list of dependency graphs to train the scorer.
 |      :type dependency_scorer: DependencyScorerI
 |      :param dependency_scorer: A scorer which implements the
 |          ``DependencyScorerI`` interface.
 |
 |  update_edge_scores(self, new_node, cycle_path)
 |      Updates the edge scores to reflect a collapse operation into
 |      new_node.
 |
 |      :type new_node: A Node.
 |      :param new_node: The node which cycle nodes are collapsed into.
 |      :type cycle_path: A list of integers.
 |      :param cycle_path: A list of node addresses that belong to the cycle.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ProbabilisticProduction
Python Library Documentation: class ProbabilisticProduction in module nltk.grammar

class ProbabilisticProduction(Production, nltk.probability.ImmutableProbabilisticMixIn)
 |  ProbabilisticProduction(lhs, rhs, **prob)
 |
 |  A probabilistic context free grammar production.
 |  A PCFG ``ProbabilisticProduction`` is essentially just a ``Production`` that
 |  has an associated probability, which represents how likely it is that
 |  this production will be used.  In particular, the probability of a
 |  ``ProbabilisticProduction`` records the likelihood that its right-hand side is
 |  the correct instantiation for any given occurrence of its left-hand side.
 |
 |  :see: ``Production``
 |
 |  Method resolution order:
 |      ProbabilisticProduction
 |      Production
 |      nltk.probability.ImmutableProbabilisticMixIn
 |      nltk.probability.ProbabilisticMixIn
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |      Return True if this ``Production`` is equal to ``other``.
 |
 |      :rtype: bool
 |
 |  __hash__(self)
 |      Return a hash value for the ``Production``.
 |
 |      :rtype: int
 |
 |  __init__(self, lhs, rhs, **prob)
 |      Construct a new ``ProbabilisticProduction``.
 |
 |      :param lhs: The left-hand side of the new ``ProbabilisticProduction``.
 |      :type lhs: Nonterminal
 |      :param rhs: The right-hand side of the new ``ProbabilisticProduction``.
 |      :type rhs: sequence(Nonterminal and terminal)
 |      :param prob: Probability parameters of the new ``ProbabilisticProduction``.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __str__(self)
 |      Return a verbose string representation of the ``Production``.
 |
 |      :rtype: str
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Production:
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __len__(self)
 |      Return the length of the right-hand side.
 |
 |      :rtype: int
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __repr__(self)
 |      Return a concise string representation of the ``Production``.
 |
 |      :rtype: str
 |
 |  is_lexical(self)
 |      Return True if the right-hand contain at least one terminal token.
 |
 |      :rtype: bool
 |
 |  is_nonlexical(self)
 |      Return True if the right-hand side only contains ``Nonterminals``
 |
 |      :rtype: bool
 |
 |  lhs(self)
 |      Return the left-hand side of this ``Production``.
 |
 |      :rtype: Nonterminal
 |
 |  rhs(self)
 |      Return the right-hand side of this ``Production``.
 |
 |      :rtype: sequence(Nonterminal and terminal)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Production:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.probability.ImmutableProbabilisticMixIn:
 |
 |  set_logprob(self, prob)
 |      Set the log probability associated with this object to
 |      ``logprob``.  I.e., set the probability associated with this
 |      object to ``2**(logprob)``.
 |
 |      :param logprob: The new log probability
 |      :type logprob: float
 |
 |  set_prob(self, prob)
 |      Set the probability associated with this object to ``prob``.
 |
 |      :param prob: The new probability
 |      :type prob: float
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.probability.ProbabilisticMixIn:
 |
 |  logprob(self)
 |      Return ``log(p)``, where ``p`` is the probability associated
 |      with this object.
 |
 |      :rtype: float
 |
 |  prob(self)
 |      Return the probability associated with this object.
 |
 |      :rtype: float
nltk.ProbabilisticProjectiveDependencyParser
Python Library Documentation: class ProbabilisticProjectiveDependencyParser in module nltk.parse.projectivedependencyparser

class ProbabilisticProjectiveDependencyParser(builtins.object)
 |  A probabilistic, projective dependency parser.
 |
 |  This parser returns the most probable projective parse derived from the
 |  probabilistic dependency grammar derived from the train() method.  The
 |  probabilistic model is an implementation of Eisner's (1996) Model C, which
 |  conditions on head-word, head-tag, child-word, and child-tag.  The decoding
 |  uses a bottom-up chart-based span concatenation algorithm that's identical
 |  to the one utilized by the rule-based projective parser.
 |
 |  Usage example
 |
 |  >>> from nltk.parse.dependencygraph import conll_data2
 |
 |  >>> graphs = [
 |  ... DependencyGraph(entry) for entry in conll_data2.split('\n\n') if entry
 |  ... ]
 |
 |  >>> ppdp = ProbabilisticProjectiveDependencyParser()
 |  >>> ppdp.train(graphs)
 |
 |  >>> sent = ['Cathy', 'zag', 'hen', 'wild', 'zwaaien', '.']
 |  >>> list(ppdp.parse(sent))
 |  [Tree('zag', ['Cathy', 'hen', Tree('zwaaien', ['wild', '.'])])]
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Create a new probabilistic dependency parser.  No additional
 |      operations are necessary.
 |
 |  compute_prob(self, dg)
 |      Computes the probability of a dependency graph based
 |      on the parser's probability model (defined by the parser's
 |      statistical dependency grammar).
 |
 |      :param dg: A dependency graph to score.
 |      :type dg: DependencyGraph
 |      :return: The probability of the dependency graph.
 |      :rtype: int
 |
 |  concatenate(self, span1, span2)
 |      Concatenates the two spans in whichever way possible.  This
 |      includes rightward concatenation (from the leftmost word of the
 |      leftmost span to the rightmost word of the rightmost span) and
 |      leftward concatenation (vice-versa) between adjacent spans.  Unlike
 |      Eisner's presentation of span concatenation, these spans do not
 |      share or pivot on a particular word/word-index.
 |
 |      :return: A list of new spans formed through concatenation.
 |      :rtype: list(DependencySpan)
 |
 |  parse(self, tokens)
 |      Parses the list of tokens subject to the projectivity constraint
 |      and the productions in the parser's grammar.  This uses a method
 |      similar to the span-concatenation algorithm defined in Eisner (1996).
 |      It returns the most probable parse derived from the parser's
 |      probabilistic dependency grammar.
 |
 |  train(self, graphs)
 |      Trains a ProbabilisticDependencyGrammar based on the list of input
 |      DependencyGraphs.  This model is an implementation of Eisner's (1996)
 |      Model C, which derives its statistics from head-word, head-tag,
 |      child-word, and child-tag relationships.
 |
 |      :param graphs: A list of dependency graphs to train from.
 |      :type: list(DependencyGraph)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MAX_TOKENS = 500
nltk.ProbabilisticTree
Python Library Documentation: class ProbabilisticTree in module nltk.tree.probabilistic

class ProbabilisticTree(nltk.tree.tree.Tree, nltk.probability.ProbabilisticMixIn)
 |  ProbabilisticTree(node, children=None, **prob_kwargs)
 |
 |  Method resolution order:
 |      ProbabilisticTree
 |      nltk.tree.tree.Tree
 |      builtins.list
 |      nltk.probability.ProbabilisticMixIn
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __init__(self, node, children=None, **prob_kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  copy(self, deep=False)
 |      Return a shallow copy of the list.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  convert(val)
 |      Convert a tree between different subtypes of Tree.  ``cls`` determines
 |      which class will be used to encode the new tree.
 |
 |      :type tree: Tree
 |      :param tree: The tree that should be converted.
 |      :return: The new Tree.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __hash__ = None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tree.tree.Tree:
 |
 |  __add__(self, v)
 |      Return self+value.
 |
 |  __copy__(self)
 |
 |  __deepcopy__(self, memo)
 |
 |  __delitem__(self, index)
 |      Delete self[key].
 |
 |  __ge__ lambda self, other
 |
 |  __getitem__(self, index)
 |      Return self[index].
 |
 |  __gt__ lambda self, other
 |
 |  __le__ lambda self, other
 |
 |  __mul__(self, v)
 |      Return self*value.
 |
 |  __ne__ lambda self, other
 |      # @total_ordering doesn't work here, since the class inherits from a builtin class
 |
 |  __radd__(self, v)
 |
 |  __rmul__(self, v)
 |      Return value*self.
 |
 |  __setitem__(self, index, value)
 |      Set self[key] to value.
 |
 |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
 |      This method can modify a tree in three ways:
 |
 |        1. Convert a tree into its Chomsky Normal Form (CNF)
 |           equivalent -- Every subtree has either two non-terminals
 |           or one terminal as its children.  This process requires
 |           the creation of more"artificial" non-terminal nodes.
 |        2. Markov (vertical) smoothing of children in new artificial
 |           nodes
 |        3. Horizontal (parent) annotation of nodes
 |
 |      :param factor: Right or left factoring method (default = "right")
 |      :type  factor: str = [left|right]
 |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
 |      :type  horzMarkov: int | None
 |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
 |      :type  vertMarkov: int | None
 |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
 |                        original subtree from the child nodes that have yet to be expanded (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string used to separate the node representation from its vertical annotation
 |      :type  parentChar: str
 |
 |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
 |      Collapse subtrees with a single child (ie. unary productions)
 |      into a new non-terminal (Tree node) joined by 'joinChar'.
 |      This is useful when working with algorithms that do not allow
 |      unary productions, and completely removing the unary productions
 |      would require loss of useful information.  The Tree is modified
 |      directly (since it is passed by reference) and no value is returned.
 |
 |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
 |                          Part-of-Speech tags) since they are always unary productions
 |      :type  collapsePOS: bool
 |      :param collapseRoot: 'False' (default) will not modify the root production
 |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
 |                           to the TOP -> productions.
 |      :type collapseRoot: bool
 |      :param joinChar: A string used to connect collapsed node values (default = "+")
 |      :type  joinChar: str
 |
 |  draw(self)
 |      Open a new window containing a graphical diagram of this tree.
 |
 |  flatten(self)
 |      Return a flat version of the tree, with all non-root non-terminals removed.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> print(t.flatten())
 |          (S the dog chased the cat)
 |
 |      :return: a tree consisting of this tree's root connected directly to
 |          its leaves, omitting all intervening non-terminal nodes.
 |      :rtype: Tree
 |
 |  freeze(self, leaf_freezer=None)
 |
 |  height(self)
 |      Return the height of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.height()
 |          5
 |          >>> print(t[0,0])
 |          (D the)
 |          >>> t[0,0].height()
 |          2
 |
 |      :return: The height of this tree.  The height of a tree
 |          containing no children is 1; the height of a tree
 |          containing only leaves is 2; and the height of any other
 |          tree is one plus the maximum of its children's
 |          heights.
 |      :rtype: int
 |
 |  label(self)
 |      Return the node label of the tree.
 |
 |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
 |          >>> t.label()
 |          'S'
 |
 |      :return: the node label (typically a string)
 |      :rtype: any
 |
 |  leaf_treeposition(self, index)
 |      :return: The tree position of the ``index``-th leaf in this
 |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
 |          ``self[tp]==self.leaves()[i]``.
 |
 |      :raise IndexError: If this tree contains fewer than ``index+1``
 |          leaves, or if ``index<0``.
 |
 |  leaves(self)
 |      Return the leaves of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.leaves()
 |          ['the', 'dog', 'chased', 'the', 'cat']
 |
 |      :return: a list containing this tree's leaves.
 |          The order reflects the order of the
 |          leaves in the tree's hierarchical structure.
 |      :rtype: list
 |
 |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
 |      :return: A pretty-printed string representation of this tree.
 |      :rtype: str
 |      :param margin: The right margin at which to do line-wrapping.
 |      :type margin: int
 |      :param indent: The indentation level at which printing
 |          begins.  This number is used to decide how far to indent
 |          subsequent lines.
 |      :type indent: int
 |      :param nodesep: A string that is used to separate the node
 |          from the children.  E.g., the default value ``':'`` gives
 |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
 |
 |  pformat_latex_qtree(self)
 |      Returns a representation of the tree compatible with the
 |      LaTeX qtree package. This consists of the string ``\Tree``
 |      followed by the tree represented in bracketed notation.
 |
 |      For example, the following result was generated from a parse tree of
 |      the sentence ``The announcement astounded us``::
 |
 |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
 |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
 |
 |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
 |      style file for the qtree package.
 |
 |      :return: A latex qtree representation of this tree.
 |      :rtype: str
 |
 |  pos(self)
 |      Return a sequence of pos-tagged words extracted from the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.pos()
 |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
 |
 |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
 |          The order reflects the order of the leaves in the tree's hierarchical structure.
 |      :rtype: list(tuple)
 |
 |  pprint(self, **kwargs)
 |      Print a string representation of this Tree to 'stream'
 |
 |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
 |      Pretty-print this tree as ASCII or Unicode art.
 |      For explanation of the arguments, see the documentation for
 |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
 |
 |  productions(self)
 |      Generate the productions that correspond to the non-terminal nodes of the tree.
 |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
 |      form P -> C1 C2 ... Cn.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
 |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
 |          NP -> D N, D -> 'the', N -> 'cat']
 |
 |      :rtype: list(Production)
 |
 |  set_label(self, label)
 |      Set the node label of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.set_label("T")
 |          >>> print(t)
 |          (T (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))
 |
 |      :param label: the node label (typically a string)
 |      :type label: any
 |
 |  subtrees(self, filter=None)
 |      Generate all the subtrees of this tree, optionally restricted
 |      to trees matching the filter function.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> for s in t.subtrees(lambda t: t.height() == 2):
 |          ...     print(s)
 |          (D the)
 |          (N dog)
 |          (V chased)
 |          (D the)
 |          (N cat)
 |
 |      :type filter: function
 |      :param filter: the function to filter all local trees
 |
 |  treeposition_spanning_leaves(self, start, end)
 |      :return: The tree position of the lowest descendant of this
 |          tree that dominates ``self.leaves()[start:end]``.
 |      :raise ValueError: if ``end <= start``
 |
 |  treepositions(self, order='preorder')
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.treepositions() # doctest: +ELLIPSIS
 |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
 |          >>> for pos in t.treepositions('leaves'):
 |          ...     t[pos] = t[pos][::-1].upper()
 |          >>> print(t)
 |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
 |
 |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
 |          ``leaves``.
 |
 |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
 |      This method modifies the tree in three ways:
 |
 |        1. Transforms a tree in Chomsky Normal Form back to its
 |           original structure (branching greater than two)
 |        2. Removes any parent annotation (if it exists)
 |        3. (optional) expands unary subtrees (if previously
 |           collapsed with collapseUnary(...) )
 |
 |      :param expandUnary: Flag to expand unary or not (default = True)
 |      :type  expandUnary: bool
 |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
 |      :type  parentChar: str
 |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
 |      :type  unaryChar: str
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from nltk.tree.tree.Tree:
 |
 |  fromlist(l)
 |      :type l: list
 |      :param l: a tree represented as nested lists
 |
 |      :return: A tree corresponding to the list representation ``l``.
 |      :rtype: Tree
 |
 |      Convert nested lists to a NLTK Tree
 |
 |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
 |      Read a bracketed tree string and return the resulting tree.
 |      Trees are represented as nested brackettings, such as::
 |
 |        (S (NP (NNP John)) (VP (V runs)))
 |
 |      :type s: str
 |      :param s: The string to read
 |
 |      :type brackets: str (length=2)
 |      :param brackets: The bracket characters used to mark the
 |          beginning and end of trees and subtrees.
 |
 |      :type read_node: function
 |      :type read_leaf: function
 |      :param read_node, read_leaf: If specified, these functions
 |          are applied to the substrings of ``s`` corresponding to
 |          nodes and leaves (respectively) to obtain the values for
 |          those nodes and leaves.  They should have the following
 |          signature:
 |
 |             read_node(str) -> value
 |
 |          For example, these functions could be used to process nodes
 |          and leaves whose values should be some type other than
 |          string (such as ``FeatStruct``).
 |          Note that by default, node strings and leaf strings are
 |          delimited by whitespace and brackets; to override this
 |          default, use the ``node_pattern`` and ``leaf_pattern``
 |          arguments.
 |
 |      :type node_pattern: str
 |      :type leaf_pattern: str
 |      :param node_pattern, leaf_pattern: Regular expression patterns
 |          used to find node and leaf substrings in ``s``.  By
 |          default, both nodes patterns are defined to match any
 |          sequence of non-whitespace non-bracket characters.
 |
 |      :type remove_empty_top_bracketing: bool
 |      :param remove_empty_top_bracketing: If the resulting tree has
 |          an empty node label, and is length one, then return its
 |          single child instead.  This is useful for treebank trees,
 |          which sometimes contain an extra level of bracketing.
 |
 |      :return: A tree corresponding to the string representation ``s``.
 |          If this class method is called using a subclass of Tree,
 |          then it will return a tree of that type.
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tree.tree.Tree:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  node
 |      Outdated method to access the node value; use the label() method instead.
 |
 |      @deprecated: Use label() instead
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.list:
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iadd__(self, value, /)
 |      Implement self+=value.
 |
 |  __imul__(self, value, /)
 |      Implement self*=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the list.
 |
 |  __sizeof__(self, /)
 |      Return the size of the list in memory, in bytes.
 |
 |  append(self, object, /)
 |      Append object to the end of the list.
 |
 |  clear(self, /)
 |      Remove all items from list.
 |
 |  count(self, value, /)
 |      Return number of occurrences of value.
 |
 |  extend(self, iterable, /)
 |      Extend list by appending elements from the iterable.
 |
 |  index(self, value, start=0, stop=9223372036854775807, /)
 |      Return first index of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  insert(self, index, object, /)
 |      Insert object before index.
 |
 |  pop(self, index=-1, /)
 |      Remove and return item at index (default last).
 |
 |      Raises IndexError if list is empty or index is out of range.
 |
 |  remove(self, value, /)
 |      Remove first occurrence of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  reverse(self, /)
 |      Reverse *IN PLACE*.
 |
 |  sort(self, /, *, key=None, reverse=False)
 |      Sort the list in ascending order and return None.
 |
 |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
 |      order of two equal elements is maintained).
 |
 |      If a key function is given, apply it once to each list item and sort them,
 |      ascending or descending, according to their function values.
 |
 |      The reverse flag can be set to sort in descending order.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.list:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.list:
 |
 |  __new__(*args, **kwargs) class method of builtins.list
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.probability.ProbabilisticMixIn:
 |
 |  logprob(self)
 |      Return ``log(p)``, where ``p`` is the probability associated
 |      with this object.
 |
 |      :rtype: float
 |
 |  prob(self)
 |      Return the probability associated with this object.
 |
 |      :rtype: float
 |
 |  set_logprob(self, logprob)
 |      Set the log probability associated with this object to
 |      ``logprob``.  I.e., set the probability associated with this
 |      object to ``2**(logprob)``.
 |
 |      :param logprob: The new log probability
 |      :type logprob: float
 |
 |  set_prob(self, prob)
 |      Set the probability associated with this object to ``prob``.
 |
 |      :param prob: The new probability
 |      :type prob: float
nltk.Production
Python Library Documentation: class Production in module nltk.grammar

class Production(builtins.object)
 |  Production(lhs, rhs)
 |
 |  A grammar production.  Each production maps a single symbol
 |  on the "left-hand side" to a sequence of symbols on the
 |  "right-hand side".  (In the case of context-free productions,
 |  the left-hand side must be a ``Nonterminal``, and the right-hand
 |  side is a sequence of terminals and ``Nonterminals``.)
 |  "terminals" can be any immutable hashable object that is
 |  not a ``Nonterminal``.  Typically, terminals are strings
 |  representing words, such as ``"dog"`` or ``"under"``.
 |
 |  :see: ``CFG``
 |  :see: ``DependencyGrammar``
 |  :see: ``Nonterminal``
 |  :type _lhs: Nonterminal
 |  :ivar _lhs: The left-hand side of the production.
 |  :type _rhs: tuple(Nonterminal, terminal)
 |  :ivar _rhs: The right-hand side of the production.
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |      Return True if this ``Production`` is equal to ``other``.
 |
 |      :rtype: bool
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      Return a hash value for the ``Production``.
 |
 |      :rtype: int
 |
 |  __init__(self, lhs, rhs)
 |      Construct a new ``Production``.
 |
 |      :param lhs: The left-hand side of the new ``Production``.
 |      :type lhs: Nonterminal
 |      :param rhs: The right-hand side of the new ``Production``.
 |      :type rhs: sequence(Nonterminal and terminal)
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __len__(self)
 |      Return the length of the right-hand side.
 |
 |      :rtype: int
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Return a concise string representation of the ``Production``.
 |
 |      :rtype: str
 |
 |  __str__(self)
 |      Return a verbose string representation of the ``Production``.
 |
 |      :rtype: str
 |
 |  is_lexical(self)
 |      Return True if the right-hand contain at least one terminal token.
 |
 |      :rtype: bool
 |
 |  is_nonlexical(self)
 |      Return True if the right-hand side only contains ``Nonterminals``
 |
 |      :rtype: bool
 |
 |  lhs(self)
 |      Return the left-hand side of this ``Production``.
 |
 |      :rtype: Nonterminal
 |
 |  rhs(self)
 |      Return the right-hand side of this ``Production``.
 |
 |      :rtype: sequence(Nonterminal and terminal)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ProjectiveDependencyParser
Python Library Documentation: class ProjectiveDependencyParser in module nltk.parse.projectivedependencyparser

class ProjectiveDependencyParser(builtins.object)
 |  ProjectiveDependencyParser(dependency_grammar)
 |
 |  A projective, rule-based, dependency parser.  A ProjectiveDependencyParser
 |  is created with a DependencyGrammar, a set of productions specifying
 |  word-to-word dependency relations.  The parse() method will then
 |  return the set of all parses, in tree representation, for a given input
 |  sequence of tokens.  Each parse must meet the requirements of the both
 |  the grammar and the projectivity constraint which specifies that the
 |  branches of the dependency tree are not allowed to cross.  Alternatively,
 |  this can be understood as stating that each parent node and its children
 |  in the parse tree form a continuous substring of the input sequence.
 |
 |  Methods defined here:
 |
 |  __init__(self, dependency_grammar)
 |      Create a new ProjectiveDependencyParser, from a word-to-word
 |      dependency grammar ``DependencyGrammar``.
 |
 |      :param dependency_grammar: A word-to-word relation dependencygrammar.
 |      :type dependency_grammar: DependencyGrammar
 |
 |  concatenate(self, span1, span2)
 |      Concatenates the two spans in whichever way possible.  This
 |      includes rightward concatenation (from the leftmost word of the
 |      leftmost span to the rightmost word of the rightmost span) and
 |      leftward concatenation (vice-versa) between adjacent spans.  Unlike
 |      Eisner's presentation of span concatenation, these spans do not
 |      share or pivot on a particular word/word-index.
 |
 |      :return: A list of new spans formed through concatenation.
 |      :rtype: list(DependencySpan)
 |
 |  parse(self, tokens)
 |      Performs a projective dependency parse on the list of tokens using
 |      a chart-based, span-concatenation algorithm similar to Eisner (1996).
 |
 |      :param tokens: The list of input tokens.
 |      :type tokens: list(str)
 |      :return: An iterator over parse trees.
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MAX_TOKENS = 500
nltk.Prover9
Python Library Documentation: class Prover9 in module nltk.inference.prover9

class Prover9(Prover9Parent, nltk.inference.api.Prover)
 |  Prover9(timeout=60)
 |
 |  Method resolution order:
 |      Prover9
 |      Prover9Parent
 |      nltk.inference.api.Prover
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, timeout=60)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  prover9_input(self, goal, assumptions)
 |      :see: Prover9Parent.prover9_input
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Prover9Parent:
 |
 |  binary_locations(self)
 |      A list of directories that should be searched for the prover9
 |      executables.  This list is used by ``config_prover9`` when searching
 |      for the prover9 executables.
 |
 |  config_prover9(self, binary_location, verbose=False)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Prover9Parent:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.Prover:
 |
 |  prove(self, goal=None, assumptions=None, verbose=False)
 |      :return: Whether the proof was successful or not.
 |      :rtype: bool
nltk.Prover9Command
Python Library Documentation: class Prover9Command in module nltk.inference.prover9

class Prover9Command(Prover9CommandParent, nltk.inference.api.BaseProverCommand)
 |  Prover9Command(goal=None, assumptions=None, timeout=60, prover=None)
 |
 |  A ``ProverCommand`` specific to the ``Prover9`` prover.  It contains
 |  the a print_assumptions() method that is used to print the list
 |  of assumptions in multiple formats.
 |
 |  Method resolution order:
 |      Prover9Command
 |      Prover9CommandParent
 |      nltk.inference.api.BaseProverCommand
 |      nltk.inference.api.BaseTheoremToolCommand
 |      nltk.inference.api.ProverCommand
 |      nltk.inference.api.TheoremToolCommand
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, goal=None, assumptions=None, timeout=60, prover=None)
 |      :param goal: Input expression to prove
 |      :type goal: sem.Expression
 |      :param assumptions: Input expressions to use as assumptions in
 |          the proof.
 |      :type assumptions: list(sem.Expression)
 |      :param timeout: number of seconds before timeout; set to 0 for
 |          no timeout.
 |      :type timeout: int
 |      :param prover: a prover.  If not set, one will be created.
 |      :type prover: Prover9
 |
 |  decorate_proof(self, proof_string, simplify=True)
 |      :see BaseProverCommand.decorate_proof()
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Prover9CommandParent:
 |
 |  print_assumptions(self, output_format='nltk')
 |      Print the list of the current assumptions.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Prover9CommandParent:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.BaseProverCommand:
 |
 |  get_prover(self)
 |      Return the prover object
 |      :return: ``Prover``
 |
 |  proof(self, simplify=True)
 |      Return the proof string
 |      :param simplify: bool simplify the proof?
 |      :return: str
 |
 |  prove(self, verbose=False)
 |      Perform the actual proof.  Store the result to prevent unnecessary
 |      re-proving.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.BaseTheoremToolCommand:
 |
 |  add_assumptions(self, new_assumptions)
 |      Add new assumptions to the assumption list.
 |
 |      :param new_assumptions: new assumptions
 |      :type new_assumptions: list(sem.Expression)
 |
 |  assumptions(self)
 |      List the current assumptions.
 |
 |      :return: list of ``Expression``
 |
 |  goal(self)
 |      Return the goal
 |
 |      :return: ``Expression``
 |
 |  retract_assumptions(self, retracted, debug=False)
 |      Retract assumptions from the assumption list.
 |
 |      :param debug: If True, give warning when ``retracted`` is not present on
 |          assumptions list.
 |      :type debug: bool
 |      :param retracted: assumptions to be retracted
 |      :type retracted: list(sem.Expression)
nltk.ProxyBasicAuthHandler
Python Library Documentation: class ProxyBasicAuthHandler in module urllib.request

class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler)
 |  ProxyBasicAuthHandler(password_mgr=None)
 |
 |  Method resolution order:
 |      ProxyBasicAuthHandler
 |      AbstractBasicAuthHandler
 |      BaseHandler
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  http_error_407(self, req, fp, code, msg, headers)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  auth_header = 'Proxy-authorization'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractBasicAuthHandler:
 |
 |  __init__(self, password_mgr=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  http_error_auth_reqed(self, authreq, host, req, headers)
 |
 |  http_request(self, req)
 |
 |  http_response(self, req, response)
 |
 |  https_request = http_request(self, req)
 |
 |  https_response = http_response(self, req, response)
 |
 |  retry_http_basic_auth(self, host, req, realm)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractBasicAuthHandler:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from AbstractBasicAuthHandler:
 |
 |  rx = re.compile('(?:^|,)[ \t]*([^ \t,]+)[ \t]+realm=(["\']?)([^"\']*)\...
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BaseHandler:
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  add_parent(self, parent)
 |
 |  close(self)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from BaseHandler:
 |
 |  handler_order = 500
nltk.ProxyDigestAuthHandler
Python Library Documentation: class ProxyDigestAuthHandler in module urllib.request

class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler)
 |  ProxyDigestAuthHandler(passwd=None)
 |
 |  Method resolution order:
 |      ProxyDigestAuthHandler
 |      BaseHandler
 |      AbstractDigestAuthHandler
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  http_error_407(self, req, fp, code, msg, headers)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  auth_header = 'Proxy-Authorization'
 |
 |  handler_order = 490
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BaseHandler:
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  add_parent(self, parent)
 |
 |  close(self)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from BaseHandler:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractDigestAuthHandler:
 |
 |  __init__(self, passwd=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  get_algorithm_impls(self, algorithm)
 |
 |  get_authorization(self, req, chal)
 |
 |  get_cnonce(self, nonce)
 |
 |  get_entity_digest(self, data, chal)
 |
 |  http_error_auth_reqed(self, auth_header, host, req, headers)
 |
 |  reset_retry_count(self)
 |
 |  retry_http_digest_auth(self, req, auth)
nltk.ProxyHandler
Python Library Documentation: class ProxyHandler in module urllib.request

class ProxyHandler(BaseHandler)
 |  ProxyHandler(proxies=None)
 |
 |  Method resolution order:
 |      ProxyHandler
 |      BaseHandler
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, proxies=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  proxy_open(self, req, proxy, type)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  handler_order = 100
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BaseHandler:
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  add_parent(self, parent)
 |
 |  close(self)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from BaseHandler:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.PunktSentenceTokenizer
Python Library Documentation: class PunktSentenceTokenizer in module nltk.tokenize.punkt

class PunktSentenceTokenizer(PunktBaseClass, nltk.tokenize.api.TokenizerI)
 |  PunktSentenceTokenizer(train_text=None, verbose=False, lang_vars=None, token_cls=<class 'nltk.tokenize.punkt.PunktToken'>)
 |
 |  A sentence tokenizer which uses an unsupervised algorithm to build
 |  a model for abbreviation words, collocations, and words that start
 |  sentences; and then uses that model to find sentence boundaries.
 |  This approach has been shown to work well for many European
 |  languages.
 |
 |  Method resolution order:
 |      PunktSentenceTokenizer
 |      PunktBaseClass
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, train_text=None, verbose=False, lang_vars=None, token_cls=<class 'nltk.tokenize.punkt.PunktToken'>)
 |      train_text can either be the sole training text for this sentence
 |      boundary detector, or can be a PunktParameters object.
 |
 |  debug_decisions(self, text: str) -> collections.abc.Iterator[dict[str, typing.Any]]
 |      Classifies candidate periods as sentence breaks, yielding a dict for
 |      each that may be used to understand why the decision was made.
 |
 |      See format_debug_decision() to help make this output readable.
 |
 |  dump(self, tokens: collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]) -> None
 |      # [XX] TESTING
 |
 |  sentences_from_text(self, text: str, realign_boundaries: bool = True) -> list[str]
 |      Given a text, generates the sentences in that text by only
 |      testing candidate sentence breaks. If realign_boundaries is
 |      True, includes in the sentence closing punctuation that
 |      follows the period.
 |
 |  sentences_from_text_legacy(self, text: str) -> collections.abc.Iterator[str]
 |      Given a text, generates the sentences in that text. Annotates all
 |      tokens, rather than just those with possible sentence breaks. Should
 |      produce the same results as ``sentences_from_text``.
 |
 |  sentences_from_tokens(self, tokens: collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]) -> collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]
 |      Given a sequence of tokens, generates lists of tokens, each list
 |      corresponding to a sentence.
 |
 |  span_tokenize(self, text: str, realign_boundaries: bool = True) -> collections.abc.Iterator[tuple[int, int]]
 |      Given a text, generates (start, end) spans of sentences
 |      in the text.
 |
 |  text_contains_sentbreak(self, text: str) -> bool
 |      Returns True if the given text includes a sentence break.
 |
 |  tokenize(self, text: str, realign_boundaries: bool = True) -> list[str]
 |      Given a text, returns a list of the sentences in that text.
 |
 |  train(self, train_text, verbose=False)
 |      Derives parameters from a given training text, or uses the parameters
 |      given. Repeated calls to this method destroy previous parameters. For
 |      incremental training, instantiate a separate PunktTrainer instance.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  PUNCTUATION = (';', ':', ',', '.', '!', '?')
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from PunktBaseClass:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
nltk.PunktTokenizer
Python Library Documentation: class PunktTokenizer in module nltk.tokenize.punkt

class PunktTokenizer(PunktSentenceTokenizer)
 |  PunktTokenizer(lang='english')
 |
 |  Punkt Sentence Tokenizer that loads/saves its parameters from/to data files
 |
 |  Method resolution order:
 |      PunktTokenizer
 |      PunktSentenceTokenizer
 |      PunktBaseClass
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, lang='english')
 |      train_text can either be the sole training text for this sentence
 |      boundary detector, or can be a PunktParameters object.
 |
 |  load_lang(self, lang='english')
 |
 |  save_params(self)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from PunktSentenceTokenizer:
 |
 |  debug_decisions(self, text: str) -> collections.abc.Iterator[dict[str, typing.Any]]
 |      Classifies candidate periods as sentence breaks, yielding a dict for
 |      each that may be used to understand why the decision was made.
 |
 |      See format_debug_decision() to help make this output readable.
 |
 |  dump(self, tokens: collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]) -> None
 |      # [XX] TESTING
 |
 |  sentences_from_text(self, text: str, realign_boundaries: bool = True) -> list[str]
 |      Given a text, generates the sentences in that text by only
 |      testing candidate sentence breaks. If realign_boundaries is
 |      True, includes in the sentence closing punctuation that
 |      follows the period.
 |
 |  sentences_from_text_legacy(self, text: str) -> collections.abc.Iterator[str]
 |      Given a text, generates the sentences in that text. Annotates all
 |      tokens, rather than just those with possible sentence breaks. Should
 |      produce the same results as ``sentences_from_text``.
 |
 |  sentences_from_tokens(self, tokens: collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]) -> collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]
 |      Given a sequence of tokens, generates lists of tokens, each list
 |      corresponding to a sentence.
 |
 |  span_tokenize(self, text: str, realign_boundaries: bool = True) -> collections.abc.Iterator[tuple[int, int]]
 |      Given a text, generates (start, end) spans of sentences
 |      in the text.
 |
 |  text_contains_sentbreak(self, text: str) -> bool
 |      Returns True if the given text includes a sentence break.
 |
 |  tokenize(self, text: str, realign_boundaries: bool = True) -> list[str]
 |      Given a text, returns a list of the sentences in that text.
 |
 |  train(self, train_text, verbose=False)
 |      Derives parameters from a given training text, or uses the parameters
 |      given. Repeated calls to this method destroy previous parameters. For
 |      incremental training, instantiate a separate PunktTrainer instance.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from PunktSentenceTokenizer:
 |
 |  PUNCTUATION = (';', ':', ',', '.', '!', '?')
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from PunktBaseClass:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
nltk.QuadgramAssocMeasures
Python Library Documentation: class QuadgramAssocMeasures in module nltk.metrics.association

class QuadgramAssocMeasures(NgramAssocMeasures)
 |  A collection of quadgram association measures. Each association measure
 |  is provided as a function with five arguments::
 |
 |      trigram_score_fn(n_iiii,
 |                      (n_iiix, n_iixi, n_ixii, n_xiii),
 |                      (n_iixx, n_ixix, n_ixxi, n_xixi, n_xxii, n_xiix),
 |                      (n_ixxx, n_xixx, n_xxix, n_xxxi),
 |                      n_all)
 |
 |  The arguments constitute the marginals of a contingency table, counting
 |  the occurrences of particular events in a corpus. The letter i in the
 |  suffix refers to the appearance of the word in question, while x indicates
 |  the appearance of any word. Thus, for example:
 |
 |  - n_iiii counts ``(w1, w2, w3, w4)``, i.e. the quadgram being scored
 |  - n_ixxi counts ``(w1, *, *, w4)``
 |  - n_xxxx counts ``(*, *, *, *)``, i.e. any quadgram
 |
 |  Method resolution order:
 |      QuadgramAssocMeasures
 |      NgramAssocMeasures
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from NgramAssocMeasures:
 |
 |  chi_sq(*marginals)
 |      Scores ngrams using Pearson's chi-square as in Manning and Schutze
 |      5.3.3.
 |
 |  jaccard(*marginals)
 |      Scores ngrams using the Jaccard index.
 |
 |  likelihood_ratio(*marginals)
 |      Scores ngrams using likelihood ratios as in Manning and Schutze 5.3.4.
 |
 |  pmi(*marginals)
 |      Scores ngrams by pointwise mutual information, as in Manning and
 |      Schutze 5.4.
 |
 |  poisson_stirling(*marginals)
 |      Scores ngrams using the Poisson-Stirling measure.
 |
 |  student_t(*marginals)
 |      Scores ngrams using Student's t test with independence hypothesis
 |      for unigrams, as in Manning and Schutze 5.3.1.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from NgramAssocMeasures:
 |
 |  mi_like(*marginals, **kwargs)
 |      Scores ngrams using a variant of mutual information. The keyword
 |      argument power sets an exponent (default 3) for the numerator. No
 |      logarithm of the result is calculated.
 |
 |  raw_freq(*marginals)
 |      Scores ngrams by their frequency
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from NgramAssocMeasures:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.QuadgramCollocationFinder
Python Library Documentation: class QuadgramCollocationFinder in module nltk.collocations

class QuadgramCollocationFinder(AbstractCollocationFinder)
 |  QuadgramCollocationFinder(word_fd, quadgram_fd, ii, iii, ixi, ixxi, iixi, ixii)
 |
 |  A tool for the finding and ranking of quadgram collocations or other association measures.
 |  It is often useful to use from_words() rather than constructing an instance directly.
 |
 |  Method resolution order:
 |      QuadgramCollocationFinder
 |      AbstractCollocationFinder
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, word_fd, quadgram_fd, ii, iii, ixi, ixxi, iixi, ixii)
 |      Construct a QuadgramCollocationFinder, given FreqDists for appearances of words,
 |      bigrams, trigrams, two words with one word and two words between them, three words
 |      with a word between them in both variations.
 |
 |  score_ngram(self, score_fn, w1, w2, w3, w4)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  from_words(words, window_size=4)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  default_ws = 4
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractCollocationFinder:
 |
 |  above_score(self, score_fn, min_score)
 |      Returns a sequence of ngrams, ordered by decreasing score, whose
 |      scores each exceed the given minimum score.
 |
 |  apply_freq_filter(self, min_freq)
 |      Removes candidate ngrams which have frequency less than min_freq.
 |
 |  apply_ngram_filter(self, fn)
 |      Removes candidate ngrams (w1, w2, ...) where fn(w1, w2, ...)
 |      evaluates to True.
 |
 |  apply_word_filter(self, fn)
 |      Removes candidate ngrams (w1, w2, ...) where any of (fn(w1), fn(w2),
 |      ...) evaluates to True.
 |
 |  nbest(self, score_fn, n)
 |      Returns the top n ngrams when scored by the given function.
 |
 |  score_ngrams(self, score_fn)
 |      Returns a sequence of (ngram, score) pairs ordered from highest to
 |      lowest score, as determined by the scoring function provided.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from AbstractCollocationFinder:
 |
 |  from_documents(documents)
 |      Constructs a collocation finder given a collection of documents,
 |      each of which is a list (or iterable) of tokens.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractCollocationFinder:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.RSLPStemmer
Python Library Documentation: class RSLPStemmer in module nltk.stem.rslp

class RSLPStemmer(nltk.stem.api.StemmerI)
 |  A stemmer for Portuguese.
 |
 |      >>> from nltk.stem import RSLPStemmer
 |      >>> st = RSLPStemmer()
 |      >>> # opening lines of Erico Verissimo's "Música ao Longe"
 |      >>> text = '''
 |      ... Clarissa risca com giz no quadro-negro a paisagem que os alunos
 |      ... devem copiar . Uma casinha de porta e janela , em cima duma
 |      ... coxilha .'''
 |      >>> for token in text.split(): # doctest: +NORMALIZE_WHITESPACE
 |      ...     print(st.stem(token))
 |      clariss risc com giz no quadro-negr a pais que os alun dev copi .
 |      uma cas de port e janel , em cim dum coxilh .
 |
 |  Method resolution order:
 |      RSLPStemmer
 |      nltk.stem.api.StemmerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  apply_rule(self, word, rule_index)
 |
 |  read_rule(self, filename)
 |
 |  stem(self, word)
 |      Strip affixes from the token and return the stem.
 |
 |      :param token: The token that should be stemmed.
 |      :type token: str
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.stem.api.StemmerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.RTEFeatureExtractor
Python Library Documentation: class RTEFeatureExtractor in module nltk.classify.rte_classify

class RTEFeatureExtractor(builtins.object)
 |  RTEFeatureExtractor(rtepair, stop=True, use_lemmatize=False)
 |
 |  This builds a bag of words for both the text and the hypothesis after
 |  throwing away some stopwords, then calculates overlap and difference.
 |
 |  Methods defined here:
 |
 |  __init__(self, rtepair, stop=True, use_lemmatize=False)
 |      :param rtepair: a ``RTEPair`` from which features should be extracted
 |      :param stop: if ``True``, stopwords are thrown away.
 |      :type stop: bool
 |
 |  hyp_extra(self, toktype, debug=True)
 |      Compute the extraneous material in the hypothesis.
 |
 |      :param toktype: distinguish Named Entities from ordinary words
 |      :type toktype: 'ne' or 'word'
 |
 |  overlap(self, toktype, debug=False)
 |      Compute the overlap between text and hypothesis.
 |
 |      :param toktype: distinguish Named Entities from ordinary words
 |      :type toktype: 'ne' or 'word'
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.RandomChartParser
Python Library Documentation: class RandomChartParser in module nltk.parse.pchart

class RandomChartParser(BottomUpProbabilisticChartParser)
 |  RandomChartParser(grammar, beam_size=0, trace=0)
 |
 |  A bottom-up parser for ``PCFG`` grammars that tries edges in random order.
 |  This sorting order results in a random search strategy.
 |
 |  Method resolution order:
 |      RandomChartParser
 |      BottomUpProbabilisticChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  sort_queue(self, queue, chart)
 |      Sort the given queue of ``Edge`` objects, placing the edge that should
 |      be tried first at the beginning of the queue.  This method
 |      will be called after each ``Edge`` is added to the queue.
 |
 |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
 |          this queue is an edge that could be added to the chart by
 |          the fundamental rule; but that has not yet been added.
 |      :type queue: list(Edge)
 |      :param chart: The chart being used to parse the text.  This
 |          chart can be used to provide extra information for sorting
 |          the queue.
 |      :type chart: Chart
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BottomUpProbabilisticChartParser:
 |
 |  __init__(self, grammar, beam_size=0, trace=0)
 |      Create a new ``BottomUpProbabilisticChartParser``, that uses
 |      ``grammar`` to parse texts.
 |
 |      :type grammar: PCFG
 |      :param grammar: The grammar used to parse texts.
 |      :type beam_size: int
 |      :param beam_size: The maximum length for the parser's edge queue.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.RangeFeature
Python Library Documentation: class RangeFeature in module nltk.featstruct

class RangeFeature(Feature)
 |  RangeFeature(name, default=None, display=None)
 |
 |  Method resolution order:
 |      RangeFeature
 |      Feature
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  read_value(self, s, position, reentrances, parser)
 |
 |  unify_base_values(self, fval1, fval2, bindings)
 |      If possible, return a single value..  If not, return
 |      the value ``UnificationFailure``.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  RANGE_RE = re.compile('(-?\\d+):(-?\\d+)')
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Feature:
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __init__(self, name, default=None, display=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from Feature:
 |
 |  default
 |      Default value for this feature.
 |
 |  display
 |      Custom display location: can be prefix, or slash.
 |
 |  name
 |      The name of this feature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Feature:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ReadingCommand
Python Library Documentation: class ReadingCommand in module nltk.inference.discourse

class ReadingCommand(builtins.object)
 |  Methods defined here:
 |
 |  combine_readings(self, readings)
 |      :param readings: readings to combine
 |      :type readings: list(Expression)
 |      :return: one combined reading
 |      :rtype: Expression
 |
 |  parse_to_readings(self, sentence)
 |      :param sentence: the sentence to read
 |      :type sentence: str
 |
 |  process_thread(self, sentence_readings)
 |      This method should be used to handle dependencies between readings such
 |      as resolving anaphora.
 |
 |      :param sentence_readings: readings to process
 |      :type sentence_readings: list(Expression)
 |      :return: the list of readings after processing
 |      :rtype: list(Expression)
 |
 |  to_fol(self, expression)
 |      Convert this expression into a First-Order Logic expression.
 |
 |      :param expression: an expression
 |      :type expression: Expression
 |      :return: a FOL version of the input expression
 |      :rtype: Expression
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset({'combine_readings', 'parse_to_reading...
nltk.RecursiveDescentParser
Python Library Documentation: class RecursiveDescentParser in module nltk.parse.recursivedescent

class RecursiveDescentParser(nltk.parse.api.ParserI)
 |  RecursiveDescentParser(grammar, trace=0)
 |
 |  A simple top-down CFG parser that parses texts by recursively
 |  expanding the fringe of a Tree, and matching it against a
 |  text.
 |
 |  ``RecursiveDescentParser`` uses a list of tree locations called a
 |  "frontier" to remember which subtrees have not yet been expanded
 |  and which leaves have not yet been matched against the text.  Each
 |  tree location consists of a list of child indices specifying the
 |  path from the root of the tree to a subtree or a leaf; see the
 |  reference documentation for Tree for more information
 |  about tree locations.
 |
 |  When the parser begins parsing a text, it constructs a tree
 |  containing only the start symbol, and a frontier containing the
 |  location of the tree's root node.  It then extends the tree to
 |  cover the text, using the following recursive procedure:
 |
 |    - If the frontier is empty, and the text is covered by the tree,
 |      then return the tree as a possible parse.
 |    - If the frontier is empty, and the text is not covered by the
 |      tree, then return no parses.
 |    - If the first element of the frontier is a subtree, then
 |      use CFG productions to "expand" it.  For each applicable
 |      production, add the expanded subtree's children to the
 |      frontier, and recursively find all parses that can be
 |      generated by the new tree and frontier.
 |    - If the first element of the frontier is a token, then "match"
 |      it against the next token from the text.  Remove the token
 |      from the frontier, and recursively find all parses that can be
 |      generated by the new tree and frontier.
 |
 |  :see: ``nltk.grammar``
 |
 |  Method resolution order:
 |      RecursiveDescentParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, trace=0)
 |      Create a new ``RecursiveDescentParser``, that uses ``grammar``
 |      to parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.RegexpChunkParser
Python Library Documentation: class RegexpChunkParser in module nltk.chunk.regexp

class RegexpChunkParser(nltk.chunk.api.ChunkParserI)
 |  RegexpChunkParser(rules, chunk_label='NP', root_label='S', trace=0)
 |
 |  A regular expression based chunk parser.  ``RegexpChunkParser`` uses a
 |  sequence of "rules" to find chunks of a single type within a
 |  text.  The chunking of the text is encoded using a ``ChunkString``,
 |  and each rule acts by modifying the chunking in the
 |  ``ChunkString``.  The rules are all implemented using regular
 |  expression matching and substitution.
 |
 |  The ``RegexpChunkRule`` class and its subclasses (``ChunkRule``,
 |  ``StripRule``, ``UnChunkRule``, ``MergeRule``, and ``SplitRule``)
 |  define the rules that are used by ``RegexpChunkParser``.  Each rule
 |  defines an ``apply()`` method, which modifies the chunking encoded
 |  by a given ``ChunkString``.
 |
 |  :type _rules: list(RegexpChunkRule)
 |  :ivar _rules: The list of rules that should be applied to a text.
 |  :type _trace: int
 |  :ivar _trace: The default level of tracing.
 |
 |  Method resolution order:
 |      RegexpChunkParser
 |      nltk.chunk.api.ChunkParserI
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, rules, chunk_label='NP', root_label='S', trace=0)
 |      Construct a new ``RegexpChunkParser``.
 |
 |      :type rules: list(RegexpChunkRule)
 |      :param rules: The sequence of rules that should be used to
 |          generate the chunking for a tagged text.
 |      :type chunk_label: str
 |      :param chunk_label: The node value that should be used for
 |          chunk subtrees.  This is typically a short string
 |          describing the type of information contained by the chunk,
 |          such as ``"NP"`` for base noun phrases.
 |      :type root_label: str
 |      :param root_label: The node value that should be used for the
 |          top node of the chunk structure.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          ``1`` will generate normal tracing output; and ``2`` or
 |          higher will generate verbose tracing output.
 |
 |  __repr__(self)
 |      :return: a concise string representation of this
 |          ``RegexpChunkParser``.
 |      :rtype: str
 |
 |  __str__(self)
 |      :return: a verbose string representation of this ``RegexpChunkParser``.
 |      :rtype: str
 |
 |  parse(self, chunk_struct, trace=None)
 |      :type chunk_struct: Tree
 |      :param chunk_struct: the chunk structure to be (further) chunked
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          ``1`` will generate normal tracing output; and ``2`` or
 |          higher will generate verbose tracing output.  This value
 |          overrides the trace level value that was given to the
 |          constructor.
 |      :rtype: Tree
 |      :return: a chunk structure that encodes the chunks in a given
 |          tagged sentence.  A chunk is a non-overlapping linguistic
 |          group, such as a noun phrase.  The set of chunks
 |          identified in the chunk structure depends on the rules
 |          used to define this ``RegexpChunkParser``.
 |
 |  rules(self)
 |      :return: the sequence of rules used by ``RegexpChunkParser``.
 |      :rtype: list(RegexpChunkRule)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.chunk.api.ChunkParserI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the chunker against the gold standard.
 |      Remove the chunking the gold standard text, rechunk it using
 |      the chunker, and return a ``ChunkScore`` object
 |      reflecting the performance of this chunk parser.
 |
 |      :type gold: list(Tree)
 |      :param gold: The list of chunked sentences to score the chunker on.
 |      :rtype: ChunkScore
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.RegexpParser
Python Library Documentation: class RegexpParser in module nltk.chunk.regexp

class RegexpParser(nltk.chunk.api.ChunkParserI)
 |  RegexpParser(grammar, root_label='S', loop=1, trace=0)
 |
 |  A grammar based chunk parser.  ``chunk.RegexpParser`` uses a set of
 |  regular expression patterns to specify the behavior of the parser.
 |  The chunking of the text is encoded using a ``ChunkString``, and
 |  each rule acts by modifying the chunking in the ``ChunkString``.
 |  The rules are all implemented using regular expression matching
 |  and substitution.
 |
 |  A grammar contains one or more clauses in the following form::
 |
 |   NP:
 |     {<DT|JJ>}          # chunk determiners and adjectives
 |     }<[\.VI].*>+{      # strip any tag beginning with V, I, or .
 |     <.*>}{<DT>         # split a chunk at a determiner
 |     <DT|JJ>{}<NN.*>    # merge chunk ending with det/adj
 |                        # with one starting with a noun
 |
 |  The patterns of a clause are executed in order.  An earlier
 |  pattern may introduce a chunk boundary that prevents a later
 |  pattern from executing.  Sometimes an individual pattern will
 |  match on multiple, overlapping extents of the input.  As with
 |  regular expression substitution more generally, the chunker will
 |  identify the first match possible, then continue looking for matches
 |  after this one has ended.
 |
 |  The clauses of a grammar are also executed in order.  A cascaded
 |  chunk parser is one having more than one clause.  The maximum depth
 |  of a parse tree created by this chunk parser is the same as the
 |  number of clauses in the grammar.
 |
 |  When tracing is turned on, the comment portion of a line is displayed
 |  each time the corresponding pattern is applied.
 |
 |  :type _start: str
 |  :ivar _start: The start symbol of the grammar (the root node of
 |      resulting trees)
 |  :type _stages: int
 |  :ivar _stages: The list of parsing stages corresponding to the grammar
 |
 |  Method resolution order:
 |      RegexpParser
 |      nltk.chunk.api.ChunkParserI
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, root_label='S', loop=1, trace=0)
 |      Create a new chunk parser, from the given start state
 |      and set of chunk patterns.
 |
 |      :param grammar: The grammar, or a list of RegexpChunkParser objects
 |      :type grammar: str or list(RegexpChunkParser)
 |      :param root_label: The top node of the tree being created
 |      :type root_label: str or Nonterminal
 |      :param loop: The number of times to run through the patterns
 |      :type loop: int
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          ``1`` will generate normal tracing output; and ``2`` or
 |          higher will generate verbose tracing output.
 |
 |  __repr__(self)
 |      :return: a concise string representation of this ``chunk.RegexpParser``.
 |      :rtype: str
 |
 |  __str__(self)
 |      :return: a verbose string representation of this
 |          ``RegexpParser``.
 |      :rtype: str
 |
 |  parse(self, chunk_struct, trace=None)
 |      Apply the chunk parser to this input.
 |
 |      :type chunk_struct: Tree
 |      :param chunk_struct: the chunk structure to be (further) chunked
 |          (this tree is modified, and is also returned)
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          ``1`` will generate normal tracing output; and ``2`` or
 |          higher will generate verbose tracing output.  This value
 |          overrides the trace level value that was given to the
 |          constructor.
 |      :return: the chunked output.
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.chunk.api.ChunkParserI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the chunker against the gold standard.
 |      Remove the chunking the gold standard text, rechunk it using
 |      the chunker, and return a ``ChunkScore`` object
 |      reflecting the performance of this chunk parser.
 |
 |      :type gold: list(Tree)
 |      :param gold: The list of chunked sentences to score the chunker on.
 |      :rtype: ChunkScore
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.RegexpStemmer
Python Library Documentation: class RegexpStemmer in module nltk.stem.regexp

class RegexpStemmer(nltk.stem.api.StemmerI)
 |  RegexpStemmer(regexp, min=0)
 |
 |  A stemmer that uses regular expressions to identify morphological
 |  affixes.  Any substrings that match the regular expressions will
 |  be removed.
 |
 |      >>> from nltk.stem import RegexpStemmer
 |      >>> st = RegexpStemmer('ing$|s$|e$|able$', min=4)
 |      >>> st.stem('cars')
 |      'car'
 |      >>> st.stem('mass')
 |      'mas'
 |      >>> st.stem('was')
 |      'was'
 |      >>> st.stem('bee')
 |      'bee'
 |      >>> st.stem('compute')
 |      'comput'
 |      >>> st.stem('advisable')
 |      'advis'
 |
 |  :type regexp: str or regexp
 |  :param regexp: The regular expression that should be used to
 |      identify morphological affixes.
 |  :type min: int
 |  :param min: The minimum length of string to stem
 |
 |  Method resolution order:
 |      RegexpStemmer
 |      nltk.stem.api.StemmerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, regexp, min=0)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  stem(self, word)
 |      Strip affixes from the token and return the stem.
 |
 |      :param token: The token that should be stemmed.
 |      :type token: str
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.stem.api.StemmerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.RegexpTagger
Python Library Documentation: class RegexpTagger in module nltk.tag.sequential

class RegexpTagger(SequentialBackoffTagger)
 |  RegexpTagger(regexps: list[tuple[str, str]], backoff: nltk.tag.api.TaggerI | None = None)
 |
 |  Regular Expression Tagger
 |
 |  The RegexpTagger assigns tags to tokens by comparing their
 |  word strings to a series of regular expressions.  The following tagger
 |  uses word suffixes to make guesses about the correct Brown Corpus part
 |  of speech tag:
 |
 |      >>> from nltk.corpus import brown
 |      >>> from nltk.tag import RegexpTagger
 |      >>> test_sent = brown.sents(categories='news')[0]
 |      >>> regexp_tagger = RegexpTagger(
 |      ...     [(r'^-?[0-9]+(\.[0-9]+)?$', 'CD'),  # cardinal numbers
 |      ...      (r'(The|the|A|a|An|an)$', 'AT'),   # articles
 |      ...      (r'.*able$', 'JJ'),                # adjectives
 |      ...      (r'.*ness$', 'NN'),                # nouns formed from adjectives
 |      ...      (r'.*ly$', 'RB'),                  # adverbs
 |      ...      (r'.*s$', 'NNS'),                  # plural nouns
 |      ...      (r'.*ing$', 'VBG'),                # gerunds
 |      ...      (r'.*ed$', 'VBD'),                 # past tense verbs
 |      ...      (r'.*', 'NN')                      # nouns (default)
 |      ... ])
 |      >>> regexp_tagger
 |      <Regexp Tagger: size=9>
 |      >>> regexp_tagger.tag(test_sent) # doctest: +NORMALIZE_WHITESPACE
 |      [('The', 'AT'), ('Fulton', 'NN'), ('County', 'NN'), ('Grand', 'NN'), ('Jury', 'NN'),
 |      ('said', 'NN'), ('Friday', 'NN'), ('an', 'AT'), ('investigation', 'NN'), ('of', 'NN'),
 |      ("Atlanta's", 'NNS'), ('recent', 'NN'), ('primary', 'NN'), ('election', 'NN'),
 |      ('produced', 'VBD'), ('``', 'NN'), ('no', 'NN'), ('evidence', 'NN'), ("''", 'NN'),
 |      ('that', 'NN'), ('any', 'NN'), ('irregularities', 'NNS'), ('took', 'NN'),
 |      ('place', 'NN'), ('.', 'NN')]
 |
 |  :type regexps: list(tuple(str, str))
 |  :param regexps: A list of ``(regexp, tag)`` pairs, each of
 |      which indicates that a word matching ``regexp`` should
 |      be tagged with ``tag``.  The pairs will be evaluated in
 |      order.  If none of the regexps match a word, then the
 |      optional backoff tagger is invoked, else it is
 |      assigned the tag None.
 |
 |  Method resolution order:
 |      RegexpTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, regexps: list[tuple[str, str]], backoff: nltk.tag.api.TaggerI | None = None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  encode_json_obj(self)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  decode_json_obj(obj)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  json_tag = 'nltk.tag.sequential.RegexpTagger'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.RegexpTokenizer
Python Library Documentation: class RegexpTokenizer in module nltk.tokenize.regexp

class RegexpTokenizer(nltk.tokenize.api.TokenizerI)
 |  RegexpTokenizer(pattern, gaps=False, discard_empty=True, flags=re.UNICODE|re.MULTILINE|re.DOTALL)
 |
 |  A tokenizer that splits a string using a regular expression, which
 |  matches either the tokens or the separators between tokens.
 |
 |      >>> tokenizer = RegexpTokenizer(r'\w+|\$[\d\.]+|\S+')
 |
 |  :type pattern: str
 |  :param pattern: The pattern used to build this tokenizer.
 |      (This pattern must not contain capturing parentheses;
 |      Use non-capturing parentheses, e.g. (?:...), instead)
 |  :type gaps: bool
 |  :param gaps: True if this tokenizer's pattern should be used
 |      to find separators between tokens; False if this
 |      tokenizer's pattern should be used to find the tokens
 |      themselves.
 |  :type discard_empty: bool
 |  :param discard_empty: True if any empty tokens `''`
 |      generated by the tokenizer should be discarded.  Empty
 |      tokens can only be generated if `_gaps == True`.
 |  :type flags: int
 |  :param flags: The regexp flags used to compile this
 |      tokenizer's pattern.  By default, the following flags are
 |      used: `re.UNICODE | re.MULTILINE | re.DOTALL`.
 |
 |  Method resolution order:
 |      RegexpTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, pattern, gaps=False, discard_empty=True, flags=re.UNICODE|re.MULTILINE|re.DOTALL)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  span_tokenize(self, text)
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  tokenize(self, text)
 |      Return a tokenized copy of *s*.
 |
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ReppTokenizer
Python Library Documentation: class ReppTokenizer in module nltk.tokenize.repp

class ReppTokenizer(nltk.tokenize.api.TokenizerI)
 |  ReppTokenizer(repp_dir, encoding='utf8')
 |
 |  A class for word tokenization using the REPP parser described in
 |  Rebecca Dridan and Stephan Oepen (2012) Tokenization: Returning to a
 |  Long Solved Problem - A Survey, Contrastive  Experiment, Recommendations,
 |  and Toolkit. In ACL. http://anthology.aclweb.org/P/P12/P12-2.pdf#page=406
 |
 |  >>> sents = ['Tokenization is widely regarded as a solved problem due to the high accuracy that rulebased tokenizers achieve.' ,
 |  ... 'But rule-based tokenizers are hard to maintain and their rules language specific.' ,
 |  ... 'We evaluated our method on three languages and obtained error rates of 0.27% (English), 0.35% (Dutch) and 0.76% (Italian) for our best models.'
 |  ... ]
 |  >>> tokenizer = ReppTokenizer('/home/alvas/repp/') # doctest: +SKIP
 |  >>> for sent in sents:                             # doctest: +SKIP
 |  ...     tokenizer.tokenize(sent)                   # doctest: +SKIP
 |  ...
 |  (u'Tokenization', u'is', u'widely', u'regarded', u'as', u'a', u'solved', u'problem', u'due', u'to', u'the', u'high', u'accuracy', u'that', u'rulebased', u'tokenizers', u'achieve', u'.')
 |  (u'But', u'rule-based', u'tokenizers', u'are', u'hard', u'to', u'maintain', u'and', u'their', u'rules', u'language', u'specific', u'.')
 |  (u'We', u'evaluated', u'our', u'method', u'on', u'three', u'languages', u'and', u'obtained', u'error', u'rates', u'of', u'0.27', u'%', u'(', u'English', u')', u',', u'0.35', u'%', u'(', u'Dutch', u')', u'and', u'0.76', u'%', u'(', u'Italian', u')', u'for', u'our', u'best', u'models', u'.')
 |
 |  >>> for sent in tokenizer.tokenize_sents(sents): # doctest: +SKIP
 |  ...     print(sent)                              # doctest: +SKIP
 |  ...
 |  (u'Tokenization', u'is', u'widely', u'regarded', u'as', u'a', u'solved', u'problem', u'due', u'to', u'the', u'high', u'accuracy', u'that', u'rulebased', u'tokenizers', u'achieve', u'.')
 |  (u'But', u'rule-based', u'tokenizers', u'are', u'hard', u'to', u'maintain', u'and', u'their', u'rules', u'language', u'specific', u'.')
 |  (u'We', u'evaluated', u'our', u'method', u'on', u'three', u'languages', u'and', u'obtained', u'error', u'rates', u'of', u'0.27', u'%', u'(', u'English', u')', u',', u'0.35', u'%', u'(', u'Dutch', u')', u'and', u'0.76', u'%', u'(', u'Italian', u')', u'for', u'our', u'best', u'models', u'.')
 |  >>> for sent in tokenizer.tokenize_sents(sents, keep_token_positions=True): # doctest: +SKIP
 |  ...     print(sent)                                                         # doctest: +SKIP
 |  ...
 |  [(u'Tokenization', 0, 12), (u'is', 13, 15), (u'widely', 16, 22), (u'regarded', 23, 31), (u'as', 32, 34), (u'a', 35, 36), (u'solved', 37, 43), (u'problem', 44, 51), (u'due', 52, 55), (u'to', 56, 58), (u'the', 59, 62), (u'high', 63, 67), (u'accuracy', 68, 76), (u'that', 77, 81), (u'rulebased', 82, 91), (u'tokenizers', 92, 102), (u'achieve', 103, 110), (u'.', 110, 111)]
 |  [(u'But', 0, 3), (u'rule-based', 4, 14), (u'tokenizers', 15, 25), (u'are', 26, 29), (u'hard', 30, 34), (u'to', 35, 37), (u'maintain', 38, 46), (u'and', 47, 50), (u'their', 51, 56), (u'rules', 57, 62), (u'language', 63, 71), (u'specific', 72, 80), (u'.', 80, 81)]
 |  [(u'We', 0, 2), (u'evaluated', 3, 12), (u'our', 13, 16), (u'method', 17, 23), (u'on', 24, 26), (u'three', 27, 32), (u'languages', 33, 42), (u'and', 43, 46), (u'obtained', 47, 55), (u'error', 56, 61), (u'rates', 62, 67), (u'of', 68, 70), (u'0.27', 71, 75), (u'%', 75, 76), (u'(', 77, 78), (u'English', 78, 85), (u')', 85, 86), (u',', 86, 87), (u'0.35', 88, 92), (u'%', 92, 93), (u'(', 94, 95), (u'Dutch', 95, 100), (u')', 100, 101), (u'and', 102, 105), (u'0.76', 106, 110), (u'%', 110, 111), (u'(', 112, 113), (u'Italian', 113, 120), (u')', 120, 121), (u'for', 122, 125), (u'our', 126, 129), (u'best', 130, 134), (u'models', 135, 141), (u'.', 141, 142)]
 |
 |  Method resolution order:
 |      ReppTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, repp_dir, encoding='utf8')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  find_repptokenizer(self, repp_dirname)
 |      A module to find REPP tokenizer binary and its *repp.set* config file.
 |
 |  generate_repp_command(self, inputfilename)
 |      This module generates the REPP command to be used at the terminal.
 |
 |      :param inputfilename: path to the input file
 |      :type inputfilename: str
 |
 |  tokenize(self, sentence)
 |      Use Repp to tokenize a single sentence.
 |
 |      :param sentence: A single sentence string.
 |      :type sentence: str
 |      :return: A tuple of tokens.
 |      :rtype: tuple(str)
 |
 |  tokenize_sents(self, sentences, keep_token_positions=False)
 |      Tokenize multiple sentences using Repp.
 |
 |      :param sentences: A list of sentence strings.
 |      :type sentences: list(str)
 |      :return: A list of tuples of tokens
 |      :rtype: iter(tuple(str))
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  parse_repp_outputs(repp_output)
 |      This module parses the tri-tuple format that REPP outputs using the
 |      "--format triple" option and returns an generator with tuple of string
 |      tokens.
 |
 |      :param repp_output:
 |      :type repp_output: type
 |      :return: an iterable of the tokenized sentences as tuples of strings
 |      :rtype: iter(tuple)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ResolutionProver
Python Library Documentation: class ResolutionProver in module nltk.inference.resolution

class ResolutionProver(nltk.inference.api.Prover)
 |  Method resolution order:
 |      ResolutionProver
 |      nltk.inference.api.Prover
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  ANSWER_KEY = 'ANSWER'
 |
 |  TIMEOUT = 60
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.Prover:
 |
 |  prove(self, goal=None, assumptions=None, verbose=False)
 |      :return: Whether the proof was successful or not.
 |      :rtype: bool
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.inference.api.Prover:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ResolutionProverCommand
Python Library Documentation: class ResolutionProverCommand in module nltk.inference.resolution

class ResolutionProverCommand(nltk.inference.api.BaseProverCommand)
 |  ResolutionProverCommand(goal=None, assumptions=None, prover=None)
 |
 |  Method resolution order:
 |      ResolutionProverCommand
 |      nltk.inference.api.BaseProverCommand
 |      nltk.inference.api.BaseTheoremToolCommand
 |      nltk.inference.api.ProverCommand
 |      nltk.inference.api.TheoremToolCommand
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, goal=None, assumptions=None, prover=None)
 |      :param goal: Input expression to prove
 |      :type goal: sem.Expression
 |      :param assumptions: Input expressions to use as assumptions in
 |          the proof.
 |      :type assumptions: list(sem.Expression)
 |
 |  find_answers(self, verbose=False)
 |
 |  prove(self, verbose=False)
 |      Perform the actual proof.  Store the result to prevent unnecessary
 |      re-proving.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.BaseProverCommand:
 |
 |  decorate_proof(self, proof_string, simplify=True)
 |      Modify and return the proof string
 |      :param proof_string: str the proof to decorate
 |      :param simplify: bool simplify the proof?
 |      :return: str
 |
 |  get_prover(self)
 |      Return the prover object
 |      :return: ``Prover``
 |
 |  proof(self, simplify=True)
 |      Return the proof string
 |      :param simplify: bool simplify the proof?
 |      :return: str
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.BaseTheoremToolCommand:
 |
 |  add_assumptions(self, new_assumptions)
 |      Add new assumptions to the assumption list.
 |
 |      :param new_assumptions: new assumptions
 |      :type new_assumptions: list(sem.Expression)
 |
 |  assumptions(self)
 |      List the current assumptions.
 |
 |      :return: list of ``Expression``
 |
 |  goal(self)
 |      Return the goal
 |
 |      :return: ``Expression``
 |
 |  print_assumptions(self)
 |      Print the list of the current assumptions.
 |
 |  retract_assumptions(self, retracted, debug=False)
 |      Retract assumptions from the assumption list.
 |
 |      :param debug: If True, give warning when ``retracted`` is not present on
 |          assumptions list.
 |      :type debug: bool
 |      :param retracted: assumptions to be retracted
 |      :type retracted: list(sem.Expression)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.inference.api.TheoremToolCommand:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SExprTokenizer
Python Library Documentation: class SExprTokenizer in module nltk.tokenize.sexpr

class SExprTokenizer(nltk.tokenize.api.TokenizerI)
 |  SExprTokenizer(parens='()', strict=True)
 |
 |  A tokenizer that divides strings into s-expressions.
 |  An s-expresion can be either:
 |
 |    - a parenthesized expression, including any nested parenthesized
 |      expressions, or
 |    - a sequence of non-whitespace non-parenthesis characters.
 |
 |  For example, the string ``(a (b c)) d e (f)`` consists of four
 |  s-expressions: ``(a (b c))``, ``d``, ``e``, and ``(f)``.
 |
 |  By default, the characters ``(`` and ``)`` are treated as open and
 |  close parentheses, but alternative strings may be specified.
 |
 |  :param parens: A two-element sequence specifying the open and close parentheses
 |      that should be used to find sexprs.  This will typically be either a
 |      two-character string, or a list of two strings.
 |  :type parens: str or list
 |  :param strict: If true, then raise an exception when tokenizing an ill-formed sexpr.
 |
 |  Method resolution order:
 |      SExprTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, parens='()', strict=True)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  tokenize(self, text)
 |      Return a list of s-expressions extracted from *text*.
 |      For example:
 |
 |          >>> SExprTokenizer().tokenize('(a b (c d)) e f (g)')
 |          ['(a b (c d))', 'e', 'f', '(g)']
 |
 |      All parentheses are assumed to mark s-expressions.
 |      (No special processing is done to exclude parentheses that occur
 |      inside strings, or following backslash characters.)
 |
 |      If the given expression contains non-matching parentheses,
 |      then the behavior of the tokenizer depends on the ``strict``
 |      parameter to the constructor.  If ``strict`` is ``True``, then
 |      raise a ``ValueError``.  If ``strict`` is ``False``, then any
 |      unmatched close parentheses will be listed as their own
 |      s-expression; and the last partial s-expression with unmatched open
 |      parentheses will be listed as its own s-expression:
 |
 |          >>> SExprTokenizer(strict=False).tokenize('c) d) e (f (g')
 |          ['c', ')', 'd', ')', 'e', '(f (g']
 |
 |      :param text: the string to be tokenized
 |      :type text: str or iter(str)
 |      :rtype: iter(str)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SLASH
Python Library Documentation: SlashFeature in module nltk.featstruct object

class SlashFeature(Feature)
 |  SlashFeature(name, default=None, display=None)
 |
 |  Method resolution order:
 |      SlashFeature
 |      Feature
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  read_value(self, s, position, reentrances, parser)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Feature:
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __init__(self, name, default=None, display=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  unify_base_values(self, fval1, fval2, bindings)
 |      If possible, return a single value..  If not, return
 |      the value ``UnificationFailure``.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from Feature:
 |
 |  default
 |      Default value for this feature.
 |
 |  display
 |      Custom display location: can be prefix, or slash.
 |
 |  name
 |      The name of this feature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Feature:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Senna
Python Library Documentation: class Senna in module nltk.classify.senna

class Senna(nltk.tag.api.TaggerI)
 |  Senna(senna_path, operations, encoding='utf-8')
 |
 |  Method resolution order:
 |      Senna
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, senna_path, operations, encoding='utf-8')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  executable(self, base_path)
 |      The function that determines the system specific binary that should be
 |      used in the pipeline. In case, the system is not known the default senna binary will
 |      be used.
 |
 |  tag(self, tokens)
 |      Applies the specified operation(s) on a list of tokens.
 |
 |  tag_sents(self, sentences)
 |      Applies the tag method over a list of sentences. This method will return a
 |      list of dictionaries. Every dictionary will contain a word with its
 |      calculated annotations/tags.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  SUPPORTED_OPERATIONS = ['pos', 'chk', 'ner']
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SennaChunkTagger
Python Library Documentation: class SennaChunkTagger in module nltk.tag.senna

class SennaChunkTagger(nltk.classify.senna.Senna)
 |  SennaChunkTagger(path, encoding='utf-8')
 |
 |  Method resolution order:
 |      SennaChunkTagger
 |      nltk.classify.senna.Senna
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, path, encoding='utf-8')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  bio_to_chunks(self, tagged_sent, chunk_type)
 |      Extracts the chunks in a BIO chunk-tagged sentence.
 |
 |      >>> from nltk.tag import SennaChunkTagger
 |      >>> chktagger = SennaChunkTagger('/usr/share/senna-v3.0')  # doctest: +SKIP
 |      >>> sent = 'What is the airspeed of an unladen swallow ?'.split()
 |      >>> tagged_sent = chktagger.tag(sent)  # doctest: +SKIP
 |      >>> tagged_sent  # doctest: +SKIP
 |      [('What', 'B-NP'), ('is', 'B-VP'), ('the', 'B-NP'), ('airspeed', 'I-NP'),
 |      ('of', 'B-PP'), ('an', 'B-NP'), ('unladen', 'I-NP'), ('swallow', 'I-NP'),
 |      ('?', 'O')]
 |      >>> list(chktagger.bio_to_chunks(tagged_sent, chunk_type='NP'))  # doctest: +SKIP
 |      [('What', '0'), ('the airspeed', '2-3'), ('an unladen swallow', '5-6-7')]
 |
 |      :param tagged_sent: A list of tuples of word and BIO chunk tag.
 |      :type tagged_sent: list(tuple)
 |      :param tagged_sent: The chunk tag that users want to extract, e.g. 'NP' or 'VP'
 |      :type tagged_sent: str
 |
 |      :return: An iterable of tuples of chunks that users want to extract
 |        and their corresponding indices.
 |      :rtype: iter(tuple(str))
 |
 |  tag_sents(self, sentences)
 |      Applies the tag method over a list of sentences. This method will return
 |      for each sentence a list of tuples of (word, tag).
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.senna.Senna:
 |
 |  executable(self, base_path)
 |      The function that determines the system specific binary that should be
 |      used in the pipeline. In case, the system is not known the default senna binary will
 |      be used.
 |
 |  tag(self, tokens)
 |      Applies the specified operation(s) on a list of tokens.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.classify.senna.Senna:
 |
 |  SUPPORTED_OPERATIONS = ['pos', 'chk', 'ner']
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SennaNERTagger
Python Library Documentation: class SennaNERTagger in module nltk.tag.senna

class SennaNERTagger(nltk.classify.senna.Senna)
 |  SennaNERTagger(path, encoding='utf-8')
 |
 |  Method resolution order:
 |      SennaNERTagger
 |      nltk.classify.senna.Senna
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, path, encoding='utf-8')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  tag_sents(self, sentences)
 |      Applies the tag method over a list of sentences. This method will return
 |      for each sentence a list of tuples of (word, tag).
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.senna.Senna:
 |
 |  executable(self, base_path)
 |      The function that determines the system specific binary that should be
 |      used in the pipeline. In case, the system is not known the default senna binary will
 |      be used.
 |
 |  tag(self, tokens)
 |      Applies the specified operation(s) on a list of tokens.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.classify.senna.Senna:
 |
 |  SUPPORTED_OPERATIONS = ['pos', 'chk', 'ner']
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SennaTagger
Python Library Documentation: class SennaTagger in module nltk.tag.senna

class SennaTagger(nltk.classify.senna.Senna)
 |  SennaTagger(path, encoding='utf-8')
 |
 |  Method resolution order:
 |      SennaTagger
 |      nltk.classify.senna.Senna
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, path, encoding='utf-8')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  tag_sents(self, sentences)
 |      Applies the tag method over a list of sentences. This method will return
 |      for each sentence a list of tuples of (word, tag).
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.senna.Senna:
 |
 |  executable(self, base_path)
 |      The function that determines the system specific binary that should be
 |      used in the pipeline. In case, the system is not known the default senna binary will
 |      be used.
 |
 |  tag(self, tokens)
 |      Applies the specified operation(s) on a list of tokens.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from nltk.classify.senna.Senna:
 |
 |  SUPPORTED_OPERATIONS = ['pos', 'chk', 'ner']
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SequentialBackoffTagger
Python Library Documentation: class SequentialBackoffTagger in module nltk.tag.sequential

class SequentialBackoffTagger(nltk.tag.api.TaggerI)
 |  SequentialBackoffTagger(backoff=None)
 |
 |  An abstract base class for taggers that tags words sequentially,
 |  left to right.  Tagging of individual words is performed by the
 |  ``choose_tag()`` method, which should be defined by subclasses.  If
 |  a tagger is unable to determine a tag for the specified token,
 |  then its backoff tagger is consulted.
 |
 |  :ivar _taggers: A list of all the taggers that should be tried to
 |      tag a token (i.e., self and its backoff taggers).
 |
 |  Method resolution order:
 |      SequentialBackoffTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, backoff=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset({'choose_tag'})
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ShiftReduceParser
Python Library Documentation: class ShiftReduceParser in module nltk.parse.shiftreduce

class ShiftReduceParser(nltk.parse.api.ParserI)
 |  ShiftReduceParser(grammar, trace=0)
 |
 |  A simple bottom-up CFG parser that uses two operations, "shift"
 |  and "reduce", to find a single parse for a text.
 |
 |  ``ShiftReduceParser`` maintains a stack, which records the
 |  structure of a portion of the text.  This stack is a list of
 |  strings and Trees that collectively cover a portion of
 |  the text.  For example, while parsing the sentence "the dog saw
 |  the man" with a typical grammar, ``ShiftReduceParser`` will produce
 |  the following stack, which covers "the dog saw"::
 |
 |     [(NP: (Det: 'the') (N: 'dog')), (V: 'saw')]
 |
 |  ``ShiftReduceParser`` attempts to extend the stack to cover the
 |  entire text, and to combine the stack elements into a single tree,
 |  producing a complete parse for the sentence.
 |
 |  Initially, the stack is empty.  It is extended to cover the text,
 |  from left to right, by repeatedly applying two operations:
 |
 |    - "shift" moves a token from the beginning of the text to the
 |      end of the stack.
 |    - "reduce" uses a CFG production to combine the rightmost stack
 |      elements into a single Tree.
 |
 |  Often, more than one operation can be performed on a given stack.
 |  In this case, ``ShiftReduceParser`` uses the following heuristics
 |  to decide which operation to perform:
 |
 |    - Only shift if no reductions are available.
 |    - If multiple reductions are available, then apply the reduction
 |      whose CFG production is listed earliest in the grammar.
 |
 |  Note that these heuristics are not guaranteed to choose an
 |  operation that leads to a parse of the text.  Also, if multiple
 |  parses exists, ``ShiftReduceParser`` will return at most one of
 |  them.
 |
 |  :see: ``nltk.grammar``
 |
 |  Method resolution order:
 |      ShiftReduceParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, trace=0)
 |      Create a new ``ShiftReduceParser``, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: Grammar
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SimpleGoodTuringProbDist
Python Library Documentation: class SimpleGoodTuringProbDist in module nltk.probability

class SimpleGoodTuringProbDist(ProbDistI)
 |  SimpleGoodTuringProbDist(freqdist, bins=None)
 |
 |  SimpleGoodTuring ProbDist approximates from frequency to frequency of
 |  frequency into a linear line under log space by linear regression.
 |  Details of Simple Good-Turing algorithm can be found in:
 |
 |  - Good Turing smoothing without tears" (Gale & Sampson 1995),
 |    Journal of Quantitative Linguistics, vol. 2 pp. 217-237.
 |  - "Speech and Language Processing (Jurafsky & Martin),
 |    2nd Edition, Chapter 4.5 p103 (log(Nc) =  a + b*log(c))
 |  - https://www.grsampson.net/RGoodTur.html
 |
 |  Given a set of pair (xi, yi),  where the xi denotes the frequency and
 |  yi denotes the frequency of frequency, we want to minimize their
 |  square variation. E(x) and E(y) represent the mean of xi and yi.
 |
 |  - slope: b = sigma ((xi-E(x)(yi-E(y))) / sigma ((xi-E(x))(xi-E(x)))
 |  - intercept: a = E(y) - b.E(x)
 |
 |  Method resolution order:
 |      SimpleGoodTuringProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, freqdist, bins=None)
 |      :param freqdist: The frequency counts upon which to base the
 |          estimation.
 |      :type freqdist: FreqDist
 |      :param bins: The number of possible event types. This must be
 |          larger than the number of bins in the ``freqdist``. If None,
 |          then it's assumed to be equal to ``freqdist``.B() + 1
 |      :type bins: int
 |
 |  __repr__(self)
 |      Return a string representation of this ``ProbDist``.
 |
 |      :rtype: str
 |
 |  check(self)
 |
 |  discount(self)
 |      This function returns the total mass of probability transfers from the
 |      seen samples to the unseen samples.
 |
 |  find_best_fit(self, r, nr)
 |      Use simple linear regression to tune parameters self._slope and
 |      self._intercept in the log-log space based on count and Nr(count)
 |      (Work in log space to avoid floating point underflow.)
 |
 |  freqdist(self)
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the sample's probability.
 |
 |      :param sample: sample of the event
 |      :type sample: str
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  smoothedNr(self, r)
 |      Return the number of samples with count r.
 |
 |      :param r: The amount of frequency.
 |      :type r: int
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  SUM_TO_ONE = False
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SklearnClassifier
Python Library Documentation: class SklearnClassifier in module nltk.classify.scikitlearn

class SklearnClassifier(nltk.classify.api.ClassifierI)
 |  SklearnClassifier(estimator, dtype=<class 'float'>, sparse=True)
 |
 |  Wrapper for scikit-learn classifiers.
 |
 |  Method resolution order:
 |      SklearnClassifier
 |      nltk.classify.api.ClassifierI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, estimator, dtype=<class 'float'>, sparse=True)
 |      :param estimator: scikit-learn classifier object.
 |
 |      :param dtype: data type used when building feature array.
 |          scikit-learn estimators work exclusively on numeric data. The
 |          default value should be fine for almost all situations.
 |
 |      :param sparse: Whether to use sparse matrices internally.
 |          The estimator must support these; not all scikit-learn classifiers
 |          do (see their respective documentation and look for "sparse
 |          matrix"). The default value is True, since most NLP problems
 |          involve sparse feature sets. Setting this to False may take a
 |          great amount of memory.
 |      :type sparse: boolean.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  classify_many(self, featuresets)
 |      Classify a batch of samples.
 |
 |      :param featuresets: An iterable over featuresets, each a dict mapping
 |          strings to either numbers, booleans or strings.
 |      :return: The predicted class label for each input sample.
 |      :rtype: list
 |
 |  labels(self)
 |      The class labels used by this classifier.
 |
 |      :rtype: list
 |
 |  prob_classify_many(self, featuresets)
 |      Compute per-class probabilities for a batch of samples.
 |
 |      :param featuresets: An iterable over featuresets, each a dict mapping
 |          strings to either numbers, booleans or strings.
 |      :rtype: list of ``ProbDistI``
 |
 |  train(self, labeled_featuresets)
 |      Train (fit) the scikit-learn estimator.
 |
 |      :param labeled_featuresets: A list of ``(featureset, label)``
 |          where each ``featureset`` is a dict mapping strings to either
 |          numbers, booleans or strings.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.api.ClassifierI:
 |
 |  classify(self, featureset)
 |      :return: the most appropriate label for the given featureset.
 |      :rtype: label
 |
 |  prob_classify(self, featureset)
 |      :return: a probability distribution over labels for the given
 |          featureset.
 |      :rtype: ProbDistI
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.classify.api.ClassifierI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SlashFeature
Python Library Documentation: class SlashFeature in module nltk.featstruct

class SlashFeature(Feature)
 |  SlashFeature(name, default=None, display=None)
 |
 |  Method resolution order:
 |      SlashFeature
 |      Feature
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  read_value(self, s, position, reentrances, parser)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Feature:
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __init__(self, name, default=None, display=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  unify_base_values(self, fval1, fval2, bindings)
 |      If possible, return a single value..  If not, return
 |      the value ``UnificationFailure``.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from Feature:
 |
 |  default
 |      Default value for this feature.
 |
 |  display
 |      Custom display location: can be prefix, or slash.
 |
 |  name
 |      The name of this feature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Feature:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SnowballStemmer
Python Library Documentation: class SnowballStemmer in module nltk.stem.snowball

class SnowballStemmer(nltk.stem.api.StemmerI)
 |  SnowballStemmer(language, ignore_stopwords=False)
 |
 |  Snowball Stemmer
 |
 |  The following languages are supported:
 |  Arabic, Danish, Dutch, English, Finnish, French, German,
 |  Hungarian, Italian, Norwegian, Portuguese, Romanian, Russian,
 |  Spanish and Swedish.
 |
 |  The algorithm for English is documented here:
 |
 |      Porter, M. "An algorithm for suffix stripping."
 |      Program 14.3 (1980): 130-137.
 |
 |  The algorithms have been developed by Martin Porter.
 |  These stemmers are called Snowball, because Porter created
 |  a programming language with this name for creating
 |  new stemming algorithms. There is more information available
 |  at http://snowball.tartarus.org/
 |
 |  The stemmer is invoked as shown below:
 |
 |  >>> from nltk.stem import SnowballStemmer # See which languages are supported
 |  >>> print(" ".join(SnowballStemmer.languages)) # doctest: +NORMALIZE_WHITESPACE
 |  arabic danish dutch english finnish french german hungarian
 |  italian norwegian porter portuguese romanian russian
 |  spanish swedish
 |  >>> stemmer = SnowballStemmer("german") # Choose a language
 |  >>> stemmer.stem("Autobahnen") # Stem a word
 |  'autobahn'
 |
 |  Invoking the stemmers that way is useful if you do not know the
 |  language to be stemmed at runtime. Alternatively, if you already know
 |  the language, then you can invoke the language specific stemmer directly:
 |
 |  >>> from nltk.stem.snowball import GermanStemmer
 |  >>> stemmer = GermanStemmer()
 |  >>> stemmer.stem("Autobahnen")
 |  'autobahn'
 |
 |  :param language: The language whose subclass is instantiated.
 |  :type language: str or unicode
 |  :param ignore_stopwords: If set to True, stopwords are
 |                           not stemmed and returned unchanged.
 |                           Set to False by default.
 |  :type ignore_stopwords: bool
 |  :raise ValueError: If there is no stemmer for the specified
 |                         language, a ValueError is raised.
 |
 |  Method resolution order:
 |      SnowballStemmer
 |      nltk.stem.api.StemmerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, language, ignore_stopwords=False)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  stem(self, token)
 |      Strip affixes from the token and return the stem.
 |
 |      :param token: The token that should be stemmed.
 |      :type token: str
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  languages = ('arabic', 'danish', 'dutch', 'english', 'finnish', 'frenc...
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.stem.api.StemmerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SpaceTokenizer
Python Library Documentation: class SpaceTokenizer in module nltk.tokenize.simple

class SpaceTokenizer(nltk.tokenize.api.StringTokenizer)
 |  Tokenize a string using the space character as a delimiter,
 |  which is the same as ``s.split(' ')``.
 |
 |      >>> from nltk.tokenize import SpaceTokenizer
 |      >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
 |      >>> SpaceTokenizer().tokenize(s) # doctest: +NORMALIZE_WHITESPACE
 |      ['Good', 'muffins', 'cost', '$3.88\nin', 'New', 'York.', '',
 |      'Please', 'buy', 'me\ntwo', 'of', 'them.\n\nThanks.']
 |
 |  Method resolution order:
 |      SpaceTokenizer
 |      nltk.tokenize.api.StringTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.StringTokenizer:
 |
 |  span_tokenize(self, s)
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  tokenize(self, s)
 |      Return a tokenized copy of *s*.
 |
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.StackDecoder
Python Library Documentation: class StackDecoder in module nltk.translate.stack_decoder

class StackDecoder(builtins.object)
 |  StackDecoder(phrase_table, language_model)
 |
 |  Phrase-based stack decoder for machine translation
 |
 |  >>> from nltk.translate import PhraseTable
 |  >>> phrase_table = PhraseTable()
 |  >>> phrase_table.add(('niemand',), ('nobody',), log(0.8))
 |  >>> phrase_table.add(('niemand',), ('no', 'one'), log(0.2))
 |  >>> phrase_table.add(('erwartet',), ('expects',), log(0.8))
 |  >>> phrase_table.add(('erwartet',), ('expecting',), log(0.2))
 |  >>> phrase_table.add(('niemand', 'erwartet'), ('one', 'does', 'not', 'expect'), log(0.1))
 |  >>> phrase_table.add(('die', 'spanische', 'inquisition'), ('the', 'spanish', 'inquisition'), log(0.8))
 |  >>> phrase_table.add(('!',), ('!',), log(0.8))
 |
 |  >>> #  nltk.model should be used here once it is implemented
 |  >>> from collections import defaultdict
 |  >>> language_prob = defaultdict(lambda: -999.0)
 |  >>> language_prob[('nobody',)] = log(0.5)
 |  >>> language_prob[('expects',)] = log(0.4)
 |  >>> language_prob[('the', 'spanish', 'inquisition')] = log(0.2)
 |  >>> language_prob[('!',)] = log(0.1)
 |  >>> language_model = type('',(object,),{'probability_change': lambda self, context, phrase: language_prob[phrase], 'probability': lambda self, phrase: language_prob[phrase]})()
 |
 |  >>> stack_decoder = StackDecoder(phrase_table, language_model)
 |
 |  >>> stack_decoder.translate(['niemand', 'erwartet', 'die', 'spanische', 'inquisition', '!'])
 |  ['nobody', 'expects', 'the', 'spanish', 'inquisition', '!']
 |
 |  Methods defined here:
 |
 |  __init__(self, phrase_table, language_model)
 |      :param phrase_table: Table of translations for source language
 |          phrases and the log probabilities for those translations.
 |      :type phrase_table: PhraseTable
 |
 |      :param language_model: Target language model. Must define a
 |          ``probability_change`` method that calculates the change in
 |          log probability of a sentence, if a given string is appended
 |          to it.
 |          This interface is experimental and will likely be replaced
 |          with nltk.model once it is implemented.
 |      :type language_model: object
 |
 |  compute_future_scores(self, src_sentence)
 |      Determines the approximate scores for translating every
 |      subsequence in ``src_sentence``
 |
 |      Future scores can be used a look-ahead to determine the
 |      difficulty of translating the remaining parts of a src_sentence.
 |
 |      :type src_sentence: tuple(str)
 |
 |      :return: Scores of subsequences referenced by their start and
 |          end positions. For example, result[2][5] is the score of the
 |          subsequence covering positions 2, 3, and 4.
 |      :rtype: dict(int: (dict(int): float))
 |
 |  distortion_score(self, hypothesis, next_src_phrase_span)
 |
 |  expansion_score(self, hypothesis, translation_option, src_phrase_span)
 |      Calculate the score of expanding ``hypothesis`` with
 |      ``translation_option``
 |
 |      :param hypothesis: Hypothesis being expanded
 |      :type hypothesis: _Hypothesis
 |
 |      :param translation_option: Information about the proposed expansion
 |      :type translation_option: PhraseTableEntry
 |
 |      :param src_phrase_span: Word position span of the source phrase
 |      :type src_phrase_span: tuple(int, int)
 |
 |  find_all_src_phrases(self, src_sentence)
 |      Finds all subsequences in src_sentence that have a phrase
 |      translation in the translation table
 |
 |      :type src_sentence: tuple(str)
 |
 |      :return: Subsequences that have a phrase translation,
 |          represented as a table of lists of end positions.
 |          For example, if result[2] is [5, 6, 9], then there are
 |          three phrases starting from position 2 in ``src_sentence``,
 |          ending at positions 5, 6, and 9 exclusive. The list of
 |          ending positions are in ascending order.
 |      :rtype: list(list(int))
 |
 |  future_score(self, hypothesis, future_score_table, sentence_length)
 |      Determines the approximate score for translating the
 |      untranslated words in ``hypothesis``
 |
 |  translate(self, src_sentence)
 |      :param src_sentence: Sentence to be translated
 |      :type src_sentence: list(str)
 |
 |      :return: Translated sentence
 |      :rtype: list(str)
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  valid_phrases(all_phrases_from, hypothesis)
 |      Extract phrases from ``all_phrases_from`` that contains words
 |      that have not been translated by ``hypothesis``
 |
 |      :param all_phrases_from: Phrases represented by their spans, in
 |          the same format as the return value of
 |          ``find_all_src_phrases``
 |      :type all_phrases_from: list(list(int))
 |
 |      :type hypothesis: _Hypothesis
 |
 |      :return: A list of phrases, represented by their spans, that
 |          cover untranslated positions.
 |      :rtype: list(tuple(int, int))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  distortion_factor
 |      float: Amount of reordering of source phrases.
 |          Lower values favour monotone translation, suitable when
 |          word order is similar for both source and target languages.
 |          Value between 0.0 and 1.0. Default 0.5.
nltk.StanfordNERTagger
Python Library Documentation: class StanfordNERTagger in module nltk.tag.stanford

class StanfordNERTagger(StanfordTagger)
 |  StanfordNERTagger(*args, **kwargs)
 |
 |  A class for Named-Entity Tagging with Stanford Tagger. The input is the paths to:
 |
 |  - a model trained on training data
 |  - (optionally) the path to the stanford tagger jar file. If not specified here,
 |    then this jar file must be specified in the CLASSPATH environment variable.
 |  - (optionally) the encoding of the training data (default: UTF-8)
 |
 |  Example:
 |
 |      >>> from nltk.tag import StanfordNERTagger
 |      >>> st = StanfordNERTagger('english.all.3class.distsim.crf.ser.gz') # doctest: +SKIP
 |      >>> st.tag('Rami Eid is studying at Stony Brook University in NY'.split()) # doctest: +SKIP
 |      [('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'),
 |       ('at', 'O'), ('Stony', 'ORGANIZATION'), ('Brook', 'ORGANIZATION'),
 |       ('University', 'ORGANIZATION'), ('in', 'O'), ('NY', 'LOCATION')]
 |
 |  Method resolution order:
 |      StanfordNERTagger
 |      StanfordTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  parse_output(self, text, sentences)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from StanfordTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.StanfordPOSTagger
Python Library Documentation: class StanfordPOSTagger in module nltk.tag.stanford

class StanfordPOSTagger(StanfordTagger)
 |  StanfordPOSTagger(*args, **kwargs)
 |
 |  A class for pos tagging with Stanford Tagger. The input is the paths to:
 |   - a model trained on training data
 |   - (optionally) the path to the stanford tagger jar file. If not specified here,
 |     then this jar file must be specified in the CLASSPATH environment variable.
 |   - (optionally) the encoding of the training data (default: UTF-8)
 |
 |  Example:
 |
 |      >>> from nltk.tag import StanfordPOSTagger
 |      >>> st = StanfordPOSTagger('english-bidirectional-distsim.tagger') # doctest: +SKIP
 |      >>> st.tag('What is the airspeed of an unladen swallow ?'.split()) # doctest: +SKIP
 |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'), ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'), ('unladen', 'JJ'), ('swallow', 'VB'), ('?', '.')]
 |
 |  Method resolution order:
 |      StanfordPOSTagger
 |      StanfordTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from StanfordTagger:
 |
 |  parse_output(self, text, sentences=None)
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.StanfordSegmenter
Python Library Documentation: class StanfordSegmenter in module nltk.tokenize.stanford_segmenter

class StanfordSegmenter(nltk.tokenize.api.TokenizerI)
 |  StanfordSegmenter(path_to_jar=None, path_to_slf4j=None, java_class=None, path_to_model=None, path_to_dict=None, path_to_sihan_corpora_dict=None, sihan_post_processing='false', keep_whitespaces='false', encoding='UTF-8', options=None, verbose=False, java_options='-mx2g')
 |
 |  Interface to the Stanford Segmenter
 |
 |  If stanford-segmenter version is older than 2016-10-31, then path_to_slf4j
 |  should be provieded, for example::
 |
 |      seg = StanfordSegmenter(path_to_slf4j='/YOUR_PATH/slf4j-api.jar')
 |
 |  >>> from nltk.tokenize.stanford_segmenter import StanfordSegmenter
 |  >>> seg = StanfordSegmenter() # doctest: +SKIP
 |  >>> seg.default_config('zh') # doctest: +SKIP
 |  >>> sent = u'这是斯坦福中文分词器测试'
 |  >>> print(seg.segment(sent)) # doctest: +SKIP
 |  这 是 斯坦福 中文 分词器 测试
 |  <BLANKLINE>
 |  >>> seg.default_config('ar') # doctest: +SKIP
 |  >>> sent = u'هذا هو تصنيف ستانفورد العربي للكلمات'
 |  >>> print(seg.segment(sent.split())) # doctest: +SKIP
 |  هذا هو تصنيف ستانفورد العربي ل الكلمات
 |  <BLANKLINE>
 |
 |  Method resolution order:
 |      StanfordSegmenter
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, path_to_jar=None, path_to_slf4j=None, java_class=None, path_to_model=None, path_to_dict=None, path_to_sihan_corpora_dict=None, sihan_post_processing='false', keep_whitespaces='false', encoding='UTF-8', options=None, verbose=False, java_options='-mx2g')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  default_config(self, lang)
 |      Attempt to initialize Stanford Word Segmenter for the specified language
 |      using the STANFORD_SEGMENTER and STANFORD_MODELS environment variables
 |
 |  segment(self, tokens)
 |
 |  segment_file(self, input_file_path)
 |
 |  segment_sents(self, sentences)
 |
 |  tokenize(self, s)
 |      Return a tokenized copy of *s*.
 |
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.StanfordTagger
Python Library Documentation: class StanfordTagger in module nltk.tag.stanford

class StanfordTagger(nltk.tag.api.TaggerI)
 |  StanfordTagger(model_filename, path_to_jar=None, encoding='utf8', verbose=False, java_options='-mx1000m')
 |
 |  An interface to Stanford taggers. Subclasses must define:
 |
 |  - ``_cmd`` property: A property that returns the command that will be
 |    executed.
 |  - ``_SEPARATOR``: Class constant that represents that character that
 |    is used to separate the tokens from their tags.
 |  - ``_JAR`` file: Class constant that represents the jar file name.
 |
 |  Method resolution order:
 |      StanfordTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, model_filename, path_to_jar=None, encoding='utf8', verbose=False, java_options='-mx1000m')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  parse_output(self, text, sentences=None)
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset({'_cmd'})
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.StemmerI
Python Library Documentation: class StemmerI in module nltk.stem.api

class StemmerI(builtins.object)
 |  A processing interface for removing morphological affixes from
 |  words.  This process is known as stemming.
 |
 |  Methods defined here:
 |
 |  stem(self, token)
 |      Strip affixes from the token and return the stem.
 |
 |      :param token: The token that should be stemmed.
 |      :type token: str
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset({'stem'})
nltk.SteppingChartParser
Python Library Documentation: class SteppingChartParser in module nltk.parse.chart

class SteppingChartParser(ChartParser)
 |  SteppingChartParser(grammar, strategy=[], trace=0)
 |
 |  A ``ChartParser`` that allows you to step through the parsing
 |  process, adding a single edge at a time.  It also allows you to
 |  change the parser's strategy or grammar midway through parsing a
 |  text.
 |
 |  The ``initialize`` method is used to start parsing a text.  ``step``
 |  adds a single edge to the chart.  ``set_strategy`` changes the
 |  strategy used by the chart parser.  ``parses`` returns the set of
 |  parses that has been found by the chart parser.
 |
 |  :ivar _restart: Records whether the parser's strategy, grammar,
 |      or chart has been changed.  If so, then ``step`` must restart
 |      the parsing algorithm.
 |
 |  Method resolution order:
 |      SteppingChartParser
 |      ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, strategy=[], trace=0)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  chart(self)
 |      Return the chart that is used by this parser.
 |
 |  current_chartrule(self)
 |      Return the chart rule used to generate the most recent edge.
 |
 |  grammar(self)
 |      Return the grammar used by this parser.
 |
 |  initialize(self, tokens)
 |      Begin parsing the given tokens.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  parses(self, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      Return the parse trees currently contained in the chart.
 |
 |  set_chart(self, chart)
 |      Load a given chart into the chart parser.
 |
 |  set_grammar(self, grammar)
 |      Change the grammar used by the parser.
 |
 |  set_strategy(self, strategy)
 |      Change the strategy that the parser uses to decide which edges
 |      to add to the chart.
 |
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart.
 |
 |  step(self)
 |      Return a generator that adds edges to the chart, one at a
 |      time.  Each time the generator is resumed, it adds a single
 |      edge and yields that edge.  If no more edges can be added,
 |      then it yields None.
 |
 |      If the parser's strategy, grammar, or chart is changed, then
 |      the generator will continue adding edges using the new
 |      strategy, grammar, or chart.
 |
 |      Note that this generator never terminates, since the grammar
 |      or strategy might be changed to values that would add new
 |      edges.  Instead, it yields None when no more edges can be
 |      added with the current strategy and grammar.
 |
 |  strategy(self)
 |      Return the strategy used by this parser.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SteppingRecursiveDescentParser
Python Library Documentation: class SteppingRecursiveDescentParser in module nltk.parse.recursivedescent

class SteppingRecursiveDescentParser(RecursiveDescentParser)
 |  SteppingRecursiveDescentParser(grammar, trace=0)
 |
 |  A ``RecursiveDescentParser`` that allows you to step through the
 |  parsing process, performing a single operation at a time.
 |
 |  The ``initialize`` method is used to start parsing a text.
 |  ``expand`` expands the first element on the frontier using a single
 |  CFG production, and ``match`` matches the first element on the
 |  frontier against the next text token. ``backtrack`` undoes the most
 |  recent expand or match operation.  ``step`` performs a single
 |  expand, match, or backtrack operation.  ``parses`` returns the set
 |  of parses that have been found by the parser.
 |
 |  :ivar _history: A list of ``(rtext, tree, frontier)`` tripples,
 |      containing the previous states of the parser.  This history is
 |      used to implement the ``backtrack`` operation.
 |  :ivar _tried_e: A record of all productions that have been tried
 |      for a given tree.  This record is used by ``expand`` to perform
 |      the next untried production.
 |  :ivar _tried_m: A record of what tokens have been matched for a
 |      given tree.  This record is used by ``step`` to decide whether
 |      or not to match a token.
 |  :see: ``nltk.grammar``
 |
 |  Method resolution order:
 |      SteppingRecursiveDescentParser
 |      RecursiveDescentParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, trace=0)
 |      Create a new ``RecursiveDescentParser``, that uses ``grammar``
 |      to parse texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  backtrack(self)
 |      Return the parser to its state before the most recent
 |      match or expand operation.  Calling ``undo`` repeatedly return
 |      the parser to successively earlier states.  If no match or
 |      expand operations have been performed, ``undo`` will make no
 |      changes.
 |
 |      :return: true if an operation was successfully undone.
 |      :rtype: bool
 |
 |  currently_complete(self)
 |      :return: Whether the parser's current state represents a
 |          complete parse.
 |      :rtype: bool
 |
 |  expand(self, production=None)
 |      Expand the first element of the frontier.  In particular, if
 |      the first element of the frontier is a subtree whose node type
 |      is equal to ``production``'s left hand side, then add a child
 |      to that subtree for each element of ``production``'s right hand
 |      side.  If ``production`` is not specified, then use the first
 |      untried expandable production.  If all expandable productions
 |      have been tried, do nothing.
 |
 |      :return: The production used to expand the frontier, if an
 |         expansion was performed.  If no expansion was performed,
 |         return None.
 |      :rtype: Production or None
 |
 |  expandable_productions(self)
 |      :return: A list of all the productions for which expansions
 |          are available for the current parser state.
 |      :rtype: list(Production)
 |
 |  frontier(self)
 |      :return: A list of the tree locations of all subtrees that
 |          have not yet been expanded, and all leaves that have not
 |          yet been matched.
 |      :rtype: list(tuple(int))
 |
 |  initialize(self, tokens)
 |      Start parsing a given text.  This sets the parser's tree to
 |      the start symbol, its frontier to the root node, and its
 |      remaining text to ``token['SUBTOKENS']``.
 |
 |  match(self)
 |      Match the first element of the frontier.  In particular, if
 |      the first element of the frontier has the same type as the
 |      next text token, then substitute the text token into the tree.
 |
 |      :return: The token matched, if a match operation was
 |          performed.  If no match was performed, return None
 |      :rtype: str or None
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  parses(self)
 |      :return: An iterator of the parses that have been found by this
 |          parser so far.
 |      :rtype: list of Tree
 |
 |  remaining_text(self)
 |      :return: The portion of the text that is not yet covered by the
 |          tree.
 |      :rtype: list(str)
 |
 |  set_grammar(self, grammar)
 |      Change the grammar used to parse texts.
 |
 |      :param grammar: The new grammar.
 |      :type grammar: CFG
 |
 |  step(self)
 |      Perform a single parsing operation.  If an untried match is
 |      possible, then perform the match, and return the matched
 |      token.  If an untried expansion is possible, then perform the
 |      expansion, and return the production that it is based on.  If
 |      backtracking is possible, then backtrack, and return True.
 |      Otherwise, return None.
 |
 |      :return: None if no operation was performed; a token if a match
 |          was performed; a production if an expansion was performed;
 |          and True if a backtrack operation was performed.
 |      :rtype: Production or String or bool
 |
 |  tree(self)
 |      :return: A partial structure for the text that is
 |          currently being parsed.  The elements specified by the
 |          frontier have not yet been expanded or matched.
 |      :rtype: Tree
 |
 |  untried_expandable_productions(self)
 |      :return: A list of all the untried productions for which
 |          expansions are available for the current parser state.
 |      :rtype: list(Production)
 |
 |  untried_match(self)
 |      :return: Whether the first element of the frontier is a token
 |          that has not yet been matched.
 |      :rtype: bool
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from RecursiveDescentParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SteppingShiftReduceParser
Python Library Documentation: class SteppingShiftReduceParser in module nltk.parse.shiftreduce

class SteppingShiftReduceParser(ShiftReduceParser)
 |  SteppingShiftReduceParser(grammar, trace=0)
 |
 |  A ``ShiftReduceParser`` that allows you to setp through the parsing
 |  process, performing a single operation at a time.  It also allows
 |  you to change the parser's grammar midway through parsing a text.
 |
 |  The ``initialize`` method is used to start parsing a text.
 |  ``shift`` performs a single shift operation, and ``reduce`` performs
 |  a single reduce operation.  ``step`` will perform a single reduce
 |  operation if possible; otherwise, it will perform a single shift
 |  operation.  ``parses`` returns the set of parses that have been
 |  found by the parser.
 |
 |  :ivar _history: A list of ``(stack, remaining_text)`` pairs,
 |      containing all of the previous states of the parser.  This
 |      history is used to implement the ``undo`` operation.
 |  :see: ``nltk.grammar``
 |
 |  Method resolution order:
 |      SteppingShiftReduceParser
 |      ShiftReduceParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, trace=0)
 |      Create a new ``ShiftReduceParser``, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: Grammar
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  initialize(self, tokens)
 |      Start parsing a given text.  This sets the parser's stack to
 |      ``[]`` and sets its remaining text to ``tokens``.
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  parses(self)
 |      :return: An iterator of the parses that have been found by this
 |          parser so far.
 |      :rtype: iter(Tree)
 |
 |  reduce(self, production=None)
 |      Use ``production`` to combine the rightmost stack elements into
 |      a single Tree.  If ``production`` does not match the
 |      rightmost stack elements, then do nothing.
 |
 |      :return: The production used to reduce the stack, if a
 |          reduction was performed.  If no reduction was performed,
 |          return None.
 |
 |      :rtype: Production or None
 |
 |  reducible_productions(self)
 |      :return: A list of the productions for which reductions are
 |          available for the current parser state.
 |      :rtype: list(Production)
 |
 |  remaining_text(self)
 |      :return: The portion of the text that is not yet covered by the
 |          stack.
 |      :rtype: list(str)
 |
 |  set_grammar(self, grammar)
 |      Change the grammar used to parse texts.
 |
 |      :param grammar: The new grammar.
 |      :type grammar: CFG
 |
 |  shift(self)
 |      Move a token from the beginning of the remaining text to the
 |      end of the stack.  If there are no more tokens in the
 |      remaining text, then do nothing.
 |
 |      :return: True if the shift operation was successful.
 |      :rtype: bool
 |
 |  stack(self)
 |      :return: The parser's stack.
 |      :rtype: list(str and Tree)
 |
 |  step(self)
 |      Perform a single parsing operation.  If a reduction is
 |      possible, then perform that reduction, and return the
 |      production that it is based on.  Otherwise, if a shift is
 |      possible, then perform it, and return True.  Otherwise,
 |      return False.
 |
 |      :return: False if no operation was performed; True if a shift was
 |          performed; and the CFG production used to reduce if a
 |          reduction was performed.
 |      :rtype: Production or bool
 |
 |  undo(self)
 |      Return the parser to its state before the most recent
 |      shift or reduce operation.  Calling ``undo`` repeatedly return
 |      the parser to successively earlier states.  If no shift or
 |      reduce operations have been performed, ``undo`` will make no
 |      changes.
 |
 |      :return: true if an operation was successfully undone.
 |      :rtype: bool
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ShiftReduceParser:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.SyllableTokenizer
Python Library Documentation: class SyllableTokenizer in module nltk.tokenize.sonority_sequencing

class SyllableTokenizer(nltk.tokenize.api.TokenizerI)
 |  SyllableTokenizer(lang='en', sonority_hierarchy=False)
 |
 |  Syllabifies words based on the Sonority Sequencing Principle (SSP).
 |
 |      >>> from nltk.tokenize import SyllableTokenizer
 |      >>> from nltk import word_tokenize
 |      >>> SSP = SyllableTokenizer()
 |      >>> SSP.tokenize('justification')
 |      ['jus', 'ti', 'fi', 'ca', 'tion']
 |      >>> text = "This is a foobar-like sentence."
 |      >>> [SSP.tokenize(token) for token in word_tokenize(text)]
 |      [['This'], ['is'], ['a'], ['foo', 'bar', '-', 'li', 'ke'], ['sen', 'ten', 'ce'], ['.']]
 |
 |  Method resolution order:
 |      SyllableTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, lang='en', sonority_hierarchy=False)
 |      :param lang: Language parameter, default is English, 'en'
 |      :type lang: str
 |      :param sonority_hierarchy: Sonority hierarchy according to the
 |                                 Sonority Sequencing Principle.
 |      :type sonority_hierarchy: list(str)
 |
 |  assign_values(self, token)
 |      Assigns each phoneme its value from the sonority hierarchy.
 |      Note: Sentence/text has to be tokenized first.
 |
 |      :param token: Single word or token
 |      :type token: str
 |      :return: List of tuples, first element is character/phoneme and
 |               second is the soronity value.
 |      :rtype: list(tuple(str, int))
 |
 |  tokenize(self, token)
 |      Apply the SSP to return a list of syllables.
 |      Note: Sentence/text has to be tokenized first.
 |
 |      :param token: Single word or token
 |      :type token: str
 |      :return syllable_list: Single word or token broken up into syllables.
 |      :rtype: list(str)
 |
 |  validate_syllables(self, syllable_list)
 |      Ensures each syllable has at least one vowel.
 |      If the following syllable doesn't have vowel, add it to the current one.
 |
 |      :param syllable_list: Single word or token broken up into syllables.
 |      :type syllable_list: list(str)
 |      :return: Single word or token broken up into syllables
 |               (with added syllables if necessary)
 |      :rtype: list(str)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TYPE
Python Library Documentation: Feature in module nltk.featstruct object

class Feature(builtins.object)
 |  Feature(name, default=None, display=None)
 |
 |  A feature identifier that's specialized to put additional
 |  constraints, default values, etc.
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __init__(self, name, default=None, display=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __ne__(self, other)
 |      Return self!=value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  read_value(self, s, position, reentrances, parser)
 |
 |  unify_base_values(self, fval1, fval2, bindings)
 |      If possible, return a single value..  If not, return
 |      the value ``UnificationFailure``.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  default
 |      Default value for this feature.
 |
 |  display
 |      Custom display location: can be prefix, or slash.
 |
 |  name
 |      The name of this feature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TabTokenizer
Python Library Documentation: class TabTokenizer in module nltk.tokenize.simple

class TabTokenizer(nltk.tokenize.api.StringTokenizer)
 |  Tokenize a string use the tab character as a delimiter,
 |  the same as ``s.split('\t')``.
 |
 |      >>> from nltk.tokenize import TabTokenizer
 |      >>> TabTokenizer().tokenize('a\tb c\n\t d')
 |      ['a', 'b c\n', ' d']
 |
 |  Method resolution order:
 |      TabTokenizer
 |      nltk.tokenize.api.StringTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.StringTokenizer:
 |
 |  span_tokenize(self, s)
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  tokenize(self, s)
 |      Return a tokenized copy of *s*.
 |
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TableauProver
Python Library Documentation: class TableauProver in module nltk.inference.tableau

class TableauProver(nltk.inference.api.Prover)
 |  Method resolution order:
 |      TableauProver
 |      nltk.inference.api.Prover
 |      builtins.object
 |
 |  Static methods defined here:
 |
 |  is_atom(e)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  MAX_TABLEAU_DEPTH = 200
 |
 |  TIMEOUT = 60
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.Prover:
 |
 |  prove(self, goal=None, assumptions=None, verbose=False)
 |      :return: Whether the proof was successful or not.
 |      :rtype: bool
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.inference.api.Prover:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TableauProverCommand
Python Library Documentation: class TableauProverCommand in module nltk.inference.tableau

class TableauProverCommand(nltk.inference.api.BaseProverCommand)
 |  TableauProverCommand(goal=None, assumptions=None, prover=None)
 |
 |  Method resolution order:
 |      TableauProverCommand
 |      nltk.inference.api.BaseProverCommand
 |      nltk.inference.api.BaseTheoremToolCommand
 |      nltk.inference.api.ProverCommand
 |      nltk.inference.api.TheoremToolCommand
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, goal=None, assumptions=None, prover=None)
 |      :param goal: Input expression to prove
 |      :type goal: sem.Expression
 |      :param assumptions: Input expressions to use as assumptions in
 |          the proof.
 |      :type assumptions: list(sem.Expression)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.BaseProverCommand:
 |
 |  decorate_proof(self, proof_string, simplify=True)
 |      Modify and return the proof string
 |      :param proof_string: str the proof to decorate
 |      :param simplify: bool simplify the proof?
 |      :return: str
 |
 |  get_prover(self)
 |      Return the prover object
 |      :return: ``Prover``
 |
 |  proof(self, simplify=True)
 |      Return the proof string
 |      :param simplify: bool simplify the proof?
 |      :return: str
 |
 |  prove(self, verbose=False)
 |      Perform the actual proof.  Store the result to prevent unnecessary
 |      re-proving.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.inference.api.BaseTheoremToolCommand:
 |
 |  add_assumptions(self, new_assumptions)
 |      Add new assumptions to the assumption list.
 |
 |      :param new_assumptions: new assumptions
 |      :type new_assumptions: list(sem.Expression)
 |
 |  assumptions(self)
 |      List the current assumptions.
 |
 |      :return: list of ``Expression``
 |
 |  goal(self)
 |      Return the goal
 |
 |      :return: ``Expression``
 |
 |  print_assumptions(self)
 |      Print the list of the current assumptions.
 |
 |  retract_assumptions(self, retracted, debug=False)
 |      Retract assumptions from the assumption list.
 |
 |      :param debug: If True, give warning when ``retracted`` is not present on
 |          assumptions list.
 |      :type debug: bool
 |      :param retracted: assumptions to be retracted
 |      :type retracted: list(sem.Expression)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.inference.api.TheoremToolCommand:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TaggerI
Python Library Documentation: class TaggerI in module nltk.tag.api

class TaggerI(builtins.object)
 |  A processing interface for assigning a tag to each token in a list.
 |  Tags are case sensitive strings that identify some property of each
 |  token, such as its part of speech or its sense.
 |
 |  Some taggers require specific types for their tokens.  This is
 |  generally indicated by the use of a sub-interface to ``TaggerI``.
 |  For example, featureset taggers, which are subclassed from
 |  ``FeaturesetTagger``, require that each token be a ``featureset``.
 |
 |  Subclasses must define:
 |    - either ``tag()`` or ``tag_sents()`` (or both)
 |
 |  Methods defined here:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset({'tag'})
nltk.TestGrammar
Python Library Documentation: class TestGrammar in module nltk.parse.util

class TestGrammar(builtins.object)
 |  TestGrammar(grammar, suite, accept=None, reject=None)
 |
 |  Unit tests for  CFG.
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, suite, accept=None, reject=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  run(self, show_trees=False)
 |      Sentences in the test suite are divided into two classes:
 |
 |      - grammatical (``accept``) and
 |      - ungrammatical (``reject``).
 |
 |      If a sentence should parse according to the grammar, the value of
 |      ``trees`` will be a non-empty list. If a sentence should be rejected
 |      according to the grammar, then the value of ``trees`` will be None.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Text
Python Library Documentation: class Text in module nltk.text

class Text(builtins.object)
 |  Text(tokens, name=None)
 |
 |  A wrapper around a sequence of simple (string) tokens, which is
 |  intended to support initial exploration of texts (via the
 |  interactive console).  Its methods perform a variety of analyses
 |  on the text's contexts (e.g., counting, concordancing, collocation
 |  discovery), and display the results.  If you wish to write a
 |  program which makes use of these analyses, then you should bypass
 |  the ``Text`` class, and use the appropriate analysis function or
 |  class directly instead.
 |
 |  A ``Text`` is typically initialized from a given document or
 |  corpus.  E.g.:
 |
 |  >>> import nltk.corpus
 |  >>> from nltk.text import Text
 |  >>> moby = Text(nltk.corpus.gutenberg.words('melville-moby_dick.txt'))
 |
 |  Methods defined here:
 |
 |  __getitem__(self, i)
 |
 |  __init__(self, tokens, name=None)
 |      Create a Text object.
 |
 |      :param tokens: The source text.
 |      :type tokens: sequence of str
 |
 |  __len__(self)
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  collocation_list(self, num=20, window_size=2)
 |      Return collocations derived from the text, ignoring stopwords.
 |
 |          >>> from nltk.book import text4
 |          >>> text4.collocation_list()[:2]
 |          [('United', 'States'), ('fellow', 'citizens')]
 |
 |      :param num: The maximum number of collocations to return.
 |      :type num: int
 |      :param window_size: The number of tokens spanned by a collocation (default=2)
 |      :type window_size: int
 |      :rtype: list(tuple(str, str))
 |
 |  collocations(self, num=20, window_size=2)
 |      Print collocations derived from the text, ignoring stopwords.
 |
 |          >>> from nltk.book import text4
 |          >>> text4.collocations() # doctest: +NORMALIZE_WHITESPACE
 |          United States; fellow citizens; years ago; four years; Federal
 |          Government; General Government; Vice President; American people; God
 |          bless; Chief Justice; one another; fellow Americans; Old World;
 |          Almighty God; Fellow citizens; Chief Magistrate; every citizen; Indian
 |          tribes; public debt; foreign nations
 |
 |
 |      :param num: The maximum number of collocations to print.
 |      :type num: int
 |      :param window_size: The number of tokens spanned by a collocation (default=2)
 |      :type window_size: int
 |
 |  common_contexts(self, words, num=20)
 |      Find contexts where the specified words appear; list
 |      most frequent common contexts first.
 |
 |      :param words: The words used to seed the similarity search
 |      :type words: str
 |      :param num: The number of words to generate (default=20)
 |      :type num: int
 |      :seealso: ContextIndex.common_contexts()
 |
 |  concordance(self, word, width=79, lines=25)
 |      Prints a concordance for ``word`` with the specified context window.
 |      Word matching is not case-sensitive.
 |
 |      :param word: The target word or phrase (a list of strings)
 |      :type word: str or list
 |      :param width: The width of each line, in characters (default=80)
 |      :type width: int
 |      :param lines: The number of lines to display (default=25)
 |      :type lines: int
 |
 |      :seealso: ``ConcordanceIndex``
 |
 |  concordance_list(self, word, width=79, lines=25)
 |      Generate a concordance for ``word`` with the specified context window.
 |      Word matching is not case-sensitive.
 |
 |      :param word: The target word or phrase (a list of strings)
 |      :type word: str or list
 |      :param width: The width of each line, in characters (default=80)
 |      :type width: int
 |      :param lines: The number of lines to display (default=25)
 |      :type lines: int
 |
 |      :seealso: ``ConcordanceIndex``
 |
 |  count(self, word)
 |      Count the number of times this word appears in the text.
 |
 |  dispersion_plot(self, words)
 |      Produce a plot showing the distribution of the words through the text.
 |      Requires pylab to be installed.
 |
 |      :param words: The words to be plotted
 |      :type words: list(str)
 |      :seealso: nltk.draw.dispersion_plot()
 |
 |  findall(self, regexp, timeout=<object object at 0x0000028F95A7E840>)
 |      Find instances of the regular expression in the text.
 |      The text is a list of tokens, and a regexp pattern to match
 |      a single token must be surrounded by angle brackets.  E.g.
 |
 |      >>> from nltk.book import text1, text5, text9
 |      >>> text5.findall("<.*><.*><bro>")
 |      you rule bro; telling you bro; u twizted bro
 |      >>> text1.findall("<a>(<.*>)<man>")
 |      monied; nervous; dangerous; white; white; white; pious; queer; good;
 |      mature; white; Cape; great; wise; wise; butterless; white; fiendish;
 |      pale; furious; better; certain; complete; dismasted; younger; brave;
 |      brave; brave; brave
 |      >>> text9.findall("<th.*>{3,}")
 |      thread through those; the thought that; that the thing; the thing
 |      that; that that thing; through these than through; them that the;
 |      through the thick; them that they; thought that the
 |
 |      :param regexp: A regular expression
 |      :type regexp: str
 |      :param timeout: wall-clock limit, in seconds, for the search; ``None``
 |          disables it. Defaults to ``TOKENSEARCH_TIMEOUT``.
 |      :type timeout: float or None
 |
 |  generate(self, length=100, text_seed=None, random_seed=42)
 |      Print random text, generated using a trigram language model.
 |      See also `help(nltk.lm)`.
 |
 |      :param length: The length of text to generate (default=100)
 |      :type length: int
 |
 |      :param text_seed: Generation can be conditioned on preceding context.
 |      :type text_seed: list(str)
 |
 |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
 |          makes the random sampling part of generation reproducible. (default=42)
 |      :type random_seed: int
 |
 |  index(self, word)
 |      Find the index of the first occurrence of the word in the text.
 |
 |  plot(self, *args)
 |      See documentation for FreqDist.plot()
 |      :seealso: nltk.prob.FreqDist.plot()
 |
 |  readability(self, method)
 |
 |  similar(self, word, num=20)
 |      Distributional similarity: find other words which appear in the
 |      same contexts as the specified word; list most similar words first.
 |
 |      :param word: The word used to seed the similarity search
 |      :type word: str
 |      :param num: The number of words to generate (default=20)
 |      :type num: int
 |      :seealso: ContextIndex.similar_words()
 |
 |  vocab(self)
 |      :seealso: nltk.prob.FreqDist
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TextCat
Python Library Documentation: class TextCat in module nltk.classify.textcat

class TextCat(builtins.object)
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  calc_dist(self, lang, trigram, text_profile)
 |      Calculate the "out-of-place" measure between the
 |      text and language profile for a single trigram
 |
 |  guess_language(self, text, return_all=False)
 |      Determines the most likely language(s) for the given text.
 |
 |      Parameters
 |      ----------
 |      text : str
 |          The text whose language is to be identified.
 |      return_all : bool, optional
 |          If False (default), returns a single ISO 639-3 language code as a str,
 |          or None if the language is ambiguous or cannot be determined.
 |          If True, returns a list of all language codes sharing the minimal distance.
 |          The list will have one element if there is a unique best match,
 |          multiple elements for ties, or be empty if no language is found.
 |
 |      Returns
 |      -------
 |      str or None, or list of str
 |          If return_all is False:
 |              - str: language code if unique minimum found
 |              - None: if ambiguous or not classifiable
 |          If return_all is True:
 |              - list: possible language code(s), or empty list if not classifiable
 |
 |      Examples
 |      --------
 |      >>> from nltk.classify.textcat import TextCat
 |      >>> cat = TextCat()
 |      >>> print(cat.guess_language('The quick brown fox jumps over the lazy dog.'))
 |      eng
 |
 |      A case with no information, returns None or an empty list:
 |
 |      >>> print(cat.guess_language('', return_all=True))
 |      []
 |      >>> print(cat.guess_language(''))
 |      None
 |
 |      A case where a single short input ties between Catalan and French:
 |
 |      >>> print(sorted(cat.guess_language('ent', return_all=True)))
 |      ['cat', 'fra']
 |
 |      By default (`return_all=False`), in a tie, guess_language returns None:
 |
 |      >>> print(cat.guess_language('ent'))
 |      None
 |
 |      Note: For short or generic inputs, or for closely related languages,
 |      the classifier may return an unexpected language. For example,
 |      the following is a perfectly grammatical English sentence, but may
 |      be classified as Scots ('sco') due to profile similarity:
 |
 |      >>> print(cat.guess_language('This is a short English sentence.'))
 |      sco
 |
 |      This behavior is not a bug, but an artifact of the underlying n-gram profiles.
 |      The classifier should be used with sufficiently distinctive and longer text fragments
 |      for best accuracy.
 |
 |  lang_dists(self, text)
 |      Calculate the "out-of-place" measure between
 |      the text and all languages
 |
 |  profile(self, text)
 |      Create FreqDist of trigrams within text
 |
 |  remove_punctuation(self, text)
 |      Get rid of punctuation except apostrophes
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  fingerprints = {}
 |
 |  last_distances = {}
nltk.TextCollection
Python Library Documentation: class TextCollection in module nltk.text

class TextCollection(Text)
 |  TextCollection(source)
 |
 |  A collection of texts, which can be loaded with list of texts, or
 |  with a corpus consisting of one or more texts, and which supports
 |  counting, concordancing, collocation discovery, etc.  Initialize a
 |  TextCollection as follows:
 |
 |  >>> import nltk.corpus
 |  >>> from nltk.text import TextCollection
 |  >>> from nltk.book import text1, text2, text3
 |  >>> gutenberg = TextCollection(nltk.corpus.gutenberg)
 |  >>> mytexts = TextCollection([text1, text2, text3])
 |
 |  Iterating over a TextCollection produces all the tokens of all the
 |  texts in order.
 |
 |  Method resolution order:
 |      TextCollection
 |      Text
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, source)
 |      Create a Text object.
 |
 |      :param tokens: The source text.
 |      :type tokens: sequence of str
 |
 |  idf(self, term)
 |      The number of texts in the corpus divided by the
 |      number of texts that the term appears in.
 |      If a term does not appear in the corpus, 0.0 is returned.
 |
 |  tf(self, term, text)
 |      The frequency of the term in text.
 |
 |  tf_idf(self, term, text)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from Text:
 |
 |  __getitem__(self, i)
 |
 |  __len__(self)
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  collocation_list(self, num=20, window_size=2)
 |      Return collocations derived from the text, ignoring stopwords.
 |
 |          >>> from nltk.book import text4
 |          >>> text4.collocation_list()[:2]
 |          [('United', 'States'), ('fellow', 'citizens')]
 |
 |      :param num: The maximum number of collocations to return.
 |      :type num: int
 |      :param window_size: The number of tokens spanned by a collocation (default=2)
 |      :type window_size: int
 |      :rtype: list(tuple(str, str))
 |
 |  collocations(self, num=20, window_size=2)
 |      Print collocations derived from the text, ignoring stopwords.
 |
 |          >>> from nltk.book import text4
 |          >>> text4.collocations() # doctest: +NORMALIZE_WHITESPACE
 |          United States; fellow citizens; years ago; four years; Federal
 |          Government; General Government; Vice President; American people; God
 |          bless; Chief Justice; one another; fellow Americans; Old World;
 |          Almighty God; Fellow citizens; Chief Magistrate; every citizen; Indian
 |          tribes; public debt; foreign nations
 |
 |
 |      :param num: The maximum number of collocations to print.
 |      :type num: int
 |      :param window_size: The number of tokens spanned by a collocation (default=2)
 |      :type window_size: int
 |
 |  common_contexts(self, words, num=20)
 |      Find contexts where the specified words appear; list
 |      most frequent common contexts first.
 |
 |      :param words: The words used to seed the similarity search
 |      :type words: str
 |      :param num: The number of words to generate (default=20)
 |      :type num: int
 |      :seealso: ContextIndex.common_contexts()
 |
 |  concordance(self, word, width=79, lines=25)
 |      Prints a concordance for ``word`` with the specified context window.
 |      Word matching is not case-sensitive.
 |
 |      :param word: The target word or phrase (a list of strings)
 |      :type word: str or list
 |      :param width: The width of each line, in characters (default=80)
 |      :type width: int
 |      :param lines: The number of lines to display (default=25)
 |      :type lines: int
 |
 |      :seealso: ``ConcordanceIndex``
 |
 |  concordance_list(self, word, width=79, lines=25)
 |      Generate a concordance for ``word`` with the specified context window.
 |      Word matching is not case-sensitive.
 |
 |      :param word: The target word or phrase (a list of strings)
 |      :type word: str or list
 |      :param width: The width of each line, in characters (default=80)
 |      :type width: int
 |      :param lines: The number of lines to display (default=25)
 |      :type lines: int
 |
 |      :seealso: ``ConcordanceIndex``
 |
 |  count(self, word)
 |      Count the number of times this word appears in the text.
 |
 |  dispersion_plot(self, words)
 |      Produce a plot showing the distribution of the words through the text.
 |      Requires pylab to be installed.
 |
 |      :param words: The words to be plotted
 |      :type words: list(str)
 |      :seealso: nltk.draw.dispersion_plot()
 |
 |  findall(self, regexp, timeout=<object object at 0x0000028F95A7E840>)
 |      Find instances of the regular expression in the text.
 |      The text is a list of tokens, and a regexp pattern to match
 |      a single token must be surrounded by angle brackets.  E.g.
 |
 |      >>> from nltk.book import text1, text5, text9
 |      >>> text5.findall("<.*><.*><bro>")
 |      you rule bro; telling you bro; u twizted bro
 |      >>> text1.findall("<a>(<.*>)<man>")
 |      monied; nervous; dangerous; white; white; white; pious; queer; good;
 |      mature; white; Cape; great; wise; wise; butterless; white; fiendish;
 |      pale; furious; better; certain; complete; dismasted; younger; brave;
 |      brave; brave; brave
 |      >>> text9.findall("<th.*>{3,}")
 |      thread through those; the thought that; that the thing; the thing
 |      that; that that thing; through these than through; them that the;
 |      through the thick; them that they; thought that the
 |
 |      :param regexp: A regular expression
 |      :type regexp: str
 |      :param timeout: wall-clock limit, in seconds, for the search; ``None``
 |          disables it. Defaults to ``TOKENSEARCH_TIMEOUT``.
 |      :type timeout: float or None
 |
 |  generate(self, length=100, text_seed=None, random_seed=42)
 |      Print random text, generated using a trigram language model.
 |      See also `help(nltk.lm)`.
 |
 |      :param length: The length of text to generate (default=100)
 |      :type length: int
 |
 |      :param text_seed: Generation can be conditioned on preceding context.
 |      :type text_seed: list(str)
 |
 |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
 |          makes the random sampling part of generation reproducible. (default=42)
 |      :type random_seed: int
 |
 |  index(self, word)
 |      Find the index of the first occurrence of the word in the text.
 |
 |  plot(self, *args)
 |      See documentation for FreqDist.plot()
 |      :seealso: nltk.prob.FreqDist.plot()
 |
 |  readability(self, method)
 |
 |  similar(self, word, num=20)
 |      Distributional similarity: find other words which appear in the
 |      same contexts as the specified word; list most similar words first.
 |
 |      :param word: The word used to seed the similarity search
 |      :type word: str
 |      :param num: The number of words to generate (default=20)
 |      :type num: int
 |      :seealso: ContextIndex.similar_words()
 |
 |  vocab(self)
 |      :seealso: nltk.prob.FreqDist
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from Text:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TextTilingTokenizer
Python Library Documentation: class TextTilingTokenizer in module nltk.tokenize.texttiling

class TextTilingTokenizer(nltk.tokenize.api.TokenizerI)
 |  TextTilingTokenizer(w=20, k=10, similarity_method='block_comparison', stopwords=None, smoothing_method=[0], smoothing_width=2, smoothing_rounds=1, cutoff_policy=1, demo_mode=False)
 |
 |  Tokenize a document into topical sections using the TextTiling algorithm.
 |  This algorithm detects subtopic shifts based on the analysis of lexical
 |  co-occurrence patterns.
 |
 |  The process starts by tokenizing the text into pseudosentences of
 |  a fixed size w. Then, depending on the method used, similarity
 |  scores are assigned at sentence gaps. The algorithm proceeds by
 |  detecting the peak differences between these scores and marking
 |  them as boundaries. The boundaries are normalized to the closest
 |  paragraph break and the segmented text is returned.
 |
 |  :param w: Pseudosentence size
 |  :type w: int
 |  :param k: Size (in sentences) of the block used in the block comparison method
 |  :type k: int
 |  :param similarity_method: The method used for determining similarity scores:
 |     `BLOCK_COMPARISON` (default) or `VOCABULARY_INTRODUCTION`.
 |  :type similarity_method: constant
 |  :param stopwords: A list of stopwords that are filtered out (defaults to NLTK's stopwords corpus)
 |  :type stopwords: list(str)
 |  :param smoothing_method: The method used for smoothing the score plot:
 |    `DEFAULT_SMOOTHING` (default)
 |  :type smoothing_method: constant
 |  :param smoothing_width: The width of the window used by the smoothing method
 |  :type smoothing_width: int
 |  :param smoothing_rounds: The number of smoothing passes
 |  :type smoothing_rounds: int
 |  :param cutoff_policy: The policy used to determine the number of boundaries:
 |    `HC` (default) or `LC`
 |  :type cutoff_policy: constant
 |
 |  >>> from nltk.corpus import brown
 |  >>> tt = TextTilingTokenizer(demo_mode=True)
 |  >>> text = brown.raw()[:4000]
 |  >>> s, ss, d, b = tt.tokenize(text)
 |  >>> b
 |  [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0]
 |
 |  Method resolution order:
 |      TextTilingTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, w=20, k=10, similarity_method='block_comparison', stopwords=None, smoothing_method=[0], smoothing_width=2, smoothing_rounds=1, cutoff_policy=1, demo_mode=False)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  tokenize(self, text)
 |      Return a tokenized copy of *text*, where each "token" represents
 |      a separate topic.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TnT
Python Library Documentation: class TnT in module nltk.tag.tnt

class TnT(nltk.tag.api.TaggerI)
 |  TnT(unk=None, Trained=False, N=1000, C=False)
 |
 |  TnT statistical part of speech tagger.
 |
 |  This class implements the Trigrams'n'Tags tagger described by
 |  Brants (2000). TnT is a second order hidden Markov model. Its
 |  hidden states are part of speech tags, its observations are word
 |  tokens, and each transition is conditioned on the two previous tag
 |  states.
 |
 |  Input
 |
 |  TnT estimates and scores sentence boundary transitions, so training
 |  and tagging data should normally be sentence delimited.
 |
 |  Training data should be a list of tagged sentences. Each sentence
 |  should be a list of ``(word, tag)`` tuples.
 |
 |  ``tag()`` expects one tokenized sentence.
 |  ``tagdata()`` expects a list of tokenized sentences.
 |
 |  For simple punctuation based segmentation of token streams, use
 |  ``basic_sent_chop()`` or pass ``segment=True`` to ``tag()``. The
 |  punctuation tokens are ``.``, ``!``, ``?``, and ``;``, following
 |  Brants's sentence boundary heuristic.
 |
 |  Model
 |
 |  For a sentence of length ``T``, the decoder chooses the tag sequence
 |  that maximizes
 |
 |      prod_i P(t_i | t_{i-1}, t_{i-2}) * P(w_i | t_i)
 |
 |  and then scores an explicit end of sentence transition. EOS is
 |  recorded as an ordinary next state in the trained n-gram stream,
 |  so its factor uses the same deleted interpolation as the body
 |  transitions (unigram, bigram, and trigram tiers). This generalizes
 |  Brants's printed factor ``P(t_{T+1} | t_T)``, which is bigram only.
 |
 |  Decoding runs in log space over a Viterbi trellis whose state is
 |  the pair ``(t_{i-1}, t_i)``.
 |
 |  Transition smoothing
 |
 |  Transition probabilities use context independent deleted
 |  interpolation of unigram, bigram, and trigram tag models.
 |
 |      P(t_i | t_{i-1}, t_{i-2})
 |          = l1 * P(t_i)
 |          + l2 * P(t_i | t_{i-1})
 |          + l3 * P(t_i | t_{i-1}, t_{i-2})
 |
 |  The interpolation weights ``l1``, ``l2``, and ``l3`` are estimated
 |  from the training counts by the deleted interpolation procedure in
 |  Brants (2000), section 2.2.
 |
 |  Emissions
 |
 |  Known words use a tag dictionary. For a known word, candidate tags
 |  are restricted to the tags assigned to that word in the training
 |  data. The emission probability is the relative frequency of the
 |  word and tag pair in the training lexicon.
 |
 |  Unknown words use Brants's suffix model by default. The model builds
 |  capitalization specific suffix tries from infrequent training words,
 |  using the threshold of at most 10 occurrences from Brants (2000),
 |  section 2.3. At decode time it uses the longest suffix observed in
 |  training, capped at 10 characters, smooths the suffix tag
 |  distribution by successive abstraction, and applies Bayesian
 |  inversion to obtain emission like scores.
 |
 |  A user supplied tagger may be passed with ``unk``. When supplied,
 |  it overrides the built in suffix model for unknown words.
 |
 |  Beam search
 |
 |  The decoder uses beam pruning to limit memory and runtime. After
 |  each Viterbi step, states whose log probability is worse than the
 |  current best state by more than ``log2(N)`` are discarded. The
 |  default threshold ``N=1000`` follows Brants (2000), section 2.5.
 |
 |  Capitalization
 |
 |  When ``C=True``, capitalization is included in the tag state. This
 |  is equivalent to splitting each tag into capitalized and
 |  uncapitalized variants, as described by Brants (2000), section 2.4.
 |
 |  Reproducibility
 |
 |  Training-time iteration is sorted in ``_compute_lambda``,
 |  ``_build_suffix_model``, and ``_tagword``'s candidate construction,
 |  so the trained model and decoded output are bit-identical across
 |  reorderings of equivalent training data.
 |
 |  Method resolution order:
 |      TnT
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, unk=None, Trained=False, N=1000, C=False)
 |      Construct a TnT statistical tagger. The tagger must be trained
 |      before it can be used to tag input.
 |
 |      :param unk: instance of a POS tagger, conforms to TaggerI.
 |                  When supplied, overrides the built-in suffix model
 |                  on the unknown-word path.
 |      :type unk: TaggerI
 |      :param Trained: Indication that the POS tagger is trained or not.
 |                      Set True to skip training the optional ``unk``
 |                      tagger on the next train() call.
 |      :type Trained: bool
 |      :param N: Beam search pruning threshold. After each Viterbi
 |              step any state whose log-probability is worse than
 |              the best by more than a factor of N is discarded.
 |              Must be a positive integer; 1000 is a good default.
 |      :type N: int
 |      :param C: Capitalization flag. When True, tags are differentiated
 |              by whether the source word is capitalized. This rarely
 |              improves accuracy in practice.
 |      :type C: bool
 |
 |  tag(self, tokens, segment=False)
 |      Tag a single sentence. Delegates the actual decode to
 |      `_tagword`, then pairs each chosen tag with its input token.
 |
 |      When `segment` is True, the input may contain mid-sequence
 |      sentence punctuation [.!?;]. The decoder splits on those
 |      tokens and re-seeds the BOS state for each segment.
 |      The default is False because most NLTK callers pre-segment,
 |      and auto-splitting on `.` would mis-handle abbreviations
 |      like "Mr." in unsegmented input.
 |
 |      :param tokens: words to tag
 |      :type tokens: list[str]
 |      :param segment: split on [.!?;] and decode each segment with a
 |                      fresh BOS state
 |      :type segment: bool
 |      :return: list of `(word, tag)` tuples
 |
 |  tagdata(self, data, segment=False)
 |      Tags a list of sentences. Each input sentence is a list of words;
 |      each output sentence is a list of (word, tag) tuples.
 |
 |      :param data: list of list of words
 |      :type data: list[list[str]]
 |      :param segment: forwarded to ``tag``. Pass True to auto-split
 |                      each input on internal [.!?;] punctuation.
 |      :type segment: bool
 |      :return: list of list of (word, tag) tuples
 |
 |  train(self, data)
 |      Trains the tagger on a list of tagged sentences. Each call
 |      rebuilds the model from scratch on the supplied data. The
 |      n-gram counts, word-tag lexicon, suffix model, and
 |      deleted-interpolation weights are all replaced, and the decode
 |      cache is cleared.
 |
 |      The optional external unknown-word tagger (``unk``) is trained
 |      on the supplied data only the first time ``train()`` is called.
 |      Subsequent calls leave it alone, since retraining it on each
 |      new training set is rarely what callers want.
 |
 |      :param data: list of lists of (word, tag) tuples
 |      :type data: list[list[tuple[str, str]]]
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TokenSearcher
Python Library Documentation: class TokenSearcher in module nltk.text

class TokenSearcher(builtins.object)
 |  TokenSearcher(tokens)
 |
 |  A class that makes it easier to use regular expressions to search
 |  over tokenized strings.  The tokenized string is converted to a
 |  string where tokens are marked with angle brackets -- e.g.,
 |  ``'<the><window><is><still><open>'``.  The regular expression
 |  passed to the ``findall()`` method is modified to treat angle
 |  brackets as non-capturing parentheses, in addition to matching the
 |  token boundaries; and to have ``'.'`` not match the angle brackets.
 |
 |  Methods defined here:
 |
 |  __init__(self, tokens)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  findall(self, regexp, timeout=<object object at 0x0000028F95A7E840>)
 |      Find instances of the regular expression in the text.
 |      The text is a list of tokens, and a regexp pattern to match
 |      a single token must be surrounded by angle brackets.  E.g.
 |
 |      >>> from nltk.text import TokenSearcher
 |      >>> from nltk.book import text1, text5, text9
 |      >>> text5.findall("<.*><.*><bro>")
 |      you rule bro; telling you bro; u twizted bro
 |      >>> text1.findall("<a>(<.*>)<man>")
 |      monied; nervous; dangerous; white; white; white; pious; queer; good;
 |      mature; white; Cape; great; wise; wise; butterless; white; fiendish;
 |      pale; furious; better; certain; complete; dismasted; younger; brave;
 |      brave; brave; brave
 |      >>> text9.findall("<th.*>{3,}")
 |      thread through those; the thought that; that the thing; the thing
 |      that; that that thing; through these than through; them that the;
 |      through the thick; them that they; thought that the
 |
 |      :param regexp: A regular expression
 |      :type regexp: str
 |      :param timeout: wall-clock limit, in seconds, for the search; ``None``
 |          disables it. Defaults to ``TOKENSEARCH_TIMEOUT``.
 |      :type timeout: float or None
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ToktokTokenizer
Python Library Documentation: class ToktokTokenizer in module nltk.tokenize.toktok

class ToktokTokenizer(nltk.tokenize.api.TokenizerI)
 |  This is a Python port of the tok-tok.pl from
 |  https://github.com/jonsafari/tok-tok/blob/master/tok-tok.pl
 |
 |  >>> toktok = ToktokTokenizer()
 |  >>> text = u'Is 9.5 or 525,600 my favorite number?'
 |  >>> print(toktok.tokenize(text, return_str=True))
 |  Is 9.5 or 525,600 my favorite number ?
 |  >>> text = u'The https://github.com/jonsafari/tok-tok/blob/master/tok-tok.pl is a website with/and/or slashes and sort of weird : things'
 |  >>> print(toktok.tokenize(text, return_str=True))
 |  The https://github.com/jonsafari/tok-tok/blob/master/tok-tok.pl is a website with/and/or slashes and sort of weird : things
 |  >>> text = u'¡This, is a sentence with weird» symbols… appearing everywhere¿'
 |  >>> expected = u'¡ This , is a sentence with weird » symbols … appearing everywhere ¿'
 |  >>> assert toktok.tokenize(text, return_str=True) == expected
 |  >>> toktok.tokenize(text) == [u'¡', u'This', u',', u'is', u'a', u'sentence', u'with', u'weird', u'»', u'symbols', u'…', u'appearing', u'everywhere', u'¿']
 |  True
 |
 |  Method resolution order:
 |      ToktokTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  tokenize(self, text, return_str=False)
 |      Return a tokenized copy of *s*.
 |
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  AMPERCENT = (re.compile('& '), '&amp; ')
 |
 |  CLOSE_PUNCT = ')]}༻༽᚜⁆⁾₎〉❩❫❭❯❱❳❵⟆⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘⧙⧛⧽⸣⸥⸧⸩〉》」』】〕〗〙〛〞〟﴿︘︶...
 |
 |  CLOSE_PUNCT_RE = (re.compile('([)]}༻༽᚜⁆⁾₎〉❩❫❭❯❱❳❵⟆⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘⧙⧛⧽⸣...
 |
 |  COMMA_IN_NUM = (re.compile('(?<!,)([,،])(?![,\\d])'), r' \1 ')
 |
 |  CURRENCY_SYM = '$¢£¤¥֏؋৲৳৻૱௹฿៛₠₡₢₣₤₥₦₧₨₩₪₫€₭₮₯₰₱₲₳₴₵₶₷₸₹₺꠸﷼﹩$¢£¥₩'
 |
 |  CURRENCY_SYM_RE = (re.compile('([$¢£¤¥֏؋৲৳৻૱௹฿៛₠₡₢₣₤₥₦₧₨₩₪₫€₭₮₯₰₱₲₳₴₵₶...
 |
 |  EN_EM_DASHES = (re.compile('([–—])'), r' \1 ')
 |
 |  FINAL_PERIOD_1 = (re.compile('(?<!\\.)\\.$'), ' .')
 |
 |  FINAL_PERIOD_2 = (re.compile('(?<!\\.)\\.\\s*(["\'’»›”]) *$'), r' . \1...
 |
 |  FUNKY_PUNCT_1 = (re.compile('([،;؛¿!"\\])}»›”؟¡%٪°±©®।॥…])'), r' \1 ')
 |
 |  FUNKY_PUNCT_2 = (re.compile('([({\\[“‘„‚«‹「『])'), r' \1 ')
 |
 |  LSTRIP = (re.compile('^ +'), '')
 |
 |  MULTI_COMMAS = (re.compile('(,{2,})'), r' \1 ')
 |
 |  MULTI_DASHES = (re.compile('(-{2,})'), r' \1 ')
 |
 |  MULTI_DOTS = (re.compile('(\\.{2,})'), r' \1 ')
 |
 |  NON_BREAKING = (re.compile('\xa0'), ' ')
 |
 |  ONE_SPACE = (re.compile(' {2,}'), ' ')
 |
 |  OPEN_PUNCT = '([{༺༼᚛‚„⁅⁽₍〈❨❪❬❮❰❲❴⟅⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗⧘⧚⧼⸢⸤⸦⸨〈《「『【〔〖〘〚〝﴾︗︵...
 |
 |  OPEN_PUNCT_RE = (re.compile('([([{༺༼᚛‚„⁅⁽₍〈❨❪❬❮❰❲❴⟅⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗⧘⧚⧼...
 |
 |  PIPE = (re.compile('\\|'), ' &#124; ')
 |
 |  PROB_SINGLE_QUOTES = (re.compile("(['’`])"), r' \1 ')
 |
 |  RSTRIP = (re.compile('\\s+$'), '\n')
 |
 |  STUPID_QUOTES_1 = (re.compile(' ` ` '), ' `` ')
 |
 |  STUPID_QUOTES_2 = (re.compile(" ' ' "), " '' ")
 |
 |  TAB = (re.compile('\t'), ' &#9; ')
 |
 |  TOKTOK_REGEXES = [(re.compile('\xa0'), ' '), (re.compile('([،;؛¿!"\\])...
 |
 |  URL_FOE_1 = (re.compile(':(?!//)'), ' : ')
 |
 |  URL_FOE_2 = (re.compile('\\?(?!\\S)'), ' ? ')
 |
 |  URL_FOE_3 = (re.compile('(:\\/\\/)[\\S+\\.\\S+\\/\\S+][\\/]'), ' / ')
 |
 |  URL_FOE_4 = (re.compile(' /'), ' / ')
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TopDownChartParser
Python Library Documentation: class TopDownChartParser in module nltk.parse.chart

class TopDownChartParser(ChartParser)
 |  TopDownChartParser(grammar, **parser_args)
 |
 |  A ``ChartParser`` using a top-down parsing strategy.
 |  See ``ChartParser`` for more information.
 |
 |  Method resolution order:
 |      TopDownChartParser
 |      ChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, **parser_args)
 |      Create a new chart parser, that uses ``grammar`` to parse
 |      texts.
 |
 |      :type grammar: CFG
 |      :param grammar: The grammar used to parse texts.
 |      :type strategy: list(ChartRuleI)
 |      :param strategy: A list of rules that should be used to decide
 |          what edges to add to the chart (top-down strategy by default).
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |      :type trace_chart_width: int
 |      :param trace_chart_width: The default total width reserved for
 |          the chart in trace output.  The remainder of each line will
 |          be used to display edges.
 |      :type use_agenda: bool
 |      :param use_agenda: Use an optimized agenda-based algorithm,
 |          if possible.
 |      :param chart_class: The class that should be used to create
 |          the parse charts.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ChartParser:
 |
 |  chart_parse(self, tokens, trace=None)
 |      Return the final parse ``Chart`` from which all possible
 |      parse trees can be extracted.
 |
 |      :param tokens: The sentence to be parsed
 |      :type tokens: list(str)
 |      :rtype: Chart
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TransitionParser
Python Library Documentation: class TransitionParser in module nltk.parse.transitionparser

class TransitionParser(nltk.parse.api.ParserI)
 |  TransitionParser(algorithm)
 |
 |  Class for transition based parser. Implement 2 algorithms which are "arc-standard" and "arc-eager"
 |
 |  Method resolution order:
 |      TransitionParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, algorithm)
 |      :param algorithm: the algorithm option of this parser. Currently support `arc-standard` and `arc-eager` algorithm
 |      :type algorithm: str
 |
 |  parse(self, depgraphs, modelFile)
 |      :param depgraphs: the list of test sentence, each sentence is represented as a dependency graph where the 'head' information is dummy
 |      :type depgraphs: list(DependencyGraph)
 |      :param modelfile: the model file
 |      :type modelfile: str
 |      :return: list (DependencyGraph) with the 'head' and 'rel' information
 |
 |  train(self, depgraphs, modelfile, verbose=True)
 |      :param depgraphs : list of DependencyGraph as the training data
 |      :type depgraphs : DependencyGraph
 |      :param modelfile : file name to save the trained model
 |      :type modelfile : str
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  ARC_EAGER = 'arc-eager'
 |
 |  ARC_STANDARD = 'arc-standard'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Tree
Python Library Documentation: class Tree in module nltk.tree.tree

class Tree(builtins.list)
 |  Tree(node, children=None)
 |
 |  A Tree represents a hierarchical grouping of leaves and subtrees.
 |  For example, each constituent in a syntax tree is represented by a single Tree.
 |
 |  A tree's children are encoded as a list of leaves and subtrees,
 |  where a leaf is a basic (non-tree) value; and a subtree is a
 |  nested Tree.
 |
 |      >>> from nltk.tree import Tree
 |      >>> print(Tree(1, [2, Tree(3, [4]), 5]))
 |      (1 2 (3 4) 5)
 |      >>> vp = Tree('VP', [Tree('V', ['saw']),
 |      ...                  Tree('NP', ['him'])])
 |      >>> s = Tree('S', [Tree('NP', ['I']), vp])
 |      >>> print(s)
 |      (S (NP I) (VP (V saw) (NP him)))
 |      >>> print(s[1])
 |      (VP (V saw) (NP him))
 |      >>> print(s[1,1])
 |      (NP him)
 |      >>> t = Tree.fromstring("(S (NP I) (VP (V saw) (NP him)))")
 |      >>> s == t
 |      True
 |      >>> t[1][1].set_label('X')
 |      >>> t[1][1].label()
 |      'X'
 |      >>> print(t)
 |      (S (NP I) (VP (V saw) (X him)))
 |      >>> t[0], t[1,1] = t[1,1], t[0]
 |      >>> print(t)
 |      (S (X him) (VP (V saw) (NP I)))
 |
 |  The length of a tree is the number of children it has.
 |
 |      >>> len(t)
 |      2
 |
 |  The set_label() and label() methods allow individual constituents
 |  to be labeled.  For example, syntax trees use this label to specify
 |  phrase tags, such as "NP" and "VP".
 |
 |  Several Tree methods use "tree positions" to specify
 |  children or descendants of a tree.  Tree positions are defined as
 |  follows:
 |
 |    - The tree position *i* specifies a Tree's *i*\ th child.
 |    - The tree position ``()`` specifies the Tree itself.
 |    - If *p* is the tree position of descendant *d*, then
 |      *p+i* specifies the *i*\ th child of *d*.
 |
 |  I.e., every tree position is either a single index *i*,
 |  specifying ``tree[i]``; or a sequence *i1, i2, ..., iN*,
 |  specifying ``tree[i1][i2]...[iN]``.
 |
 |  Construct a new tree.  This constructor can be called in one
 |  of two ways:
 |
 |  - ``Tree(label, children)`` constructs a new tree with the
 |      specified label and list of children.
 |
 |  - ``Tree.fromstring(s)`` constructs a new tree by parsing the string ``s``.
 |
 |  Method resolution order:
 |      Tree
 |      builtins.list
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __add__(self, v)
 |      Return self+value.
 |
 |  __copy__(self)
 |
 |  __deepcopy__(self, memo)
 |
 |  __delitem__(self, index)
 |      Delete self[key].
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__ lambda self, other
 |
 |  __getitem__(self, index)
 |      Return self[index].
 |
 |  __gt__ lambda self, other
 |
 |  __init__(self, node, children=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __le__ lambda self, other
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __mul__(self, v)
 |      Return self*value.
 |
 |  __ne__ lambda self, other
 |      # @total_ordering doesn't work here, since the class inherits from a builtin class
 |
 |  __radd__(self, v)
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __rmul__(self, v)
 |      Return value*self.
 |
 |  __setitem__(self, index, value)
 |      Set self[key] to value.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
 |      This method can modify a tree in three ways:
 |
 |        1. Convert a tree into its Chomsky Normal Form (CNF)
 |           equivalent -- Every subtree has either two non-terminals
 |           or one terminal as its children.  This process requires
 |           the creation of more"artificial" non-terminal nodes.
 |        2. Markov (vertical) smoothing of children in new artificial
 |           nodes
 |        3. Horizontal (parent) annotation of nodes
 |
 |      :param factor: Right or left factoring method (default = "right")
 |      :type  factor: str = [left|right]
 |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
 |      :type  horzMarkov: int | None
 |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
 |      :type  vertMarkov: int | None
 |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
 |                        original subtree from the child nodes that have yet to be expanded (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string used to separate the node representation from its vertical annotation
 |      :type  parentChar: str
 |
 |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
 |      Collapse subtrees with a single child (ie. unary productions)
 |      into a new non-terminal (Tree node) joined by 'joinChar'.
 |      This is useful when working with algorithms that do not allow
 |      unary productions, and completely removing the unary productions
 |      would require loss of useful information.  The Tree is modified
 |      directly (since it is passed by reference) and no value is returned.
 |
 |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
 |                          Part-of-Speech tags) since they are always unary productions
 |      :type  collapsePOS: bool
 |      :param collapseRoot: 'False' (default) will not modify the root production
 |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
 |                           to the TOP -> productions.
 |      :type collapseRoot: bool
 |      :param joinChar: A string used to connect collapsed node values (default = "+")
 |      :type  joinChar: str
 |
 |  copy(self, deep=False)
 |      Return a shallow copy of the list.
 |
 |  draw(self)
 |      Open a new window containing a graphical diagram of this tree.
 |
 |  flatten(self)
 |      Return a flat version of the tree, with all non-root non-terminals removed.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> print(t.flatten())
 |          (S the dog chased the cat)
 |
 |      :return: a tree consisting of this tree's root connected directly to
 |          its leaves, omitting all intervening non-terminal nodes.
 |      :rtype: Tree
 |
 |  freeze(self, leaf_freezer=None)
 |
 |  height(self)
 |      Return the height of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.height()
 |          5
 |          >>> print(t[0,0])
 |          (D the)
 |          >>> t[0,0].height()
 |          2
 |
 |      :return: The height of this tree.  The height of a tree
 |          containing no children is 1; the height of a tree
 |          containing only leaves is 2; and the height of any other
 |          tree is one plus the maximum of its children's
 |          heights.
 |      :rtype: int
 |
 |  label(self)
 |      Return the node label of the tree.
 |
 |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
 |          >>> t.label()
 |          'S'
 |
 |      :return: the node label (typically a string)
 |      :rtype: any
 |
 |  leaf_treeposition(self, index)
 |      :return: The tree position of the ``index``-th leaf in this
 |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
 |          ``self[tp]==self.leaves()[i]``.
 |
 |      :raise IndexError: If this tree contains fewer than ``index+1``
 |          leaves, or if ``index<0``.
 |
 |  leaves(self)
 |      Return the leaves of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.leaves()
 |          ['the', 'dog', 'chased', 'the', 'cat']
 |
 |      :return: a list containing this tree's leaves.
 |          The order reflects the order of the
 |          leaves in the tree's hierarchical structure.
 |      :rtype: list
 |
 |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
 |      :return: A pretty-printed string representation of this tree.
 |      :rtype: str
 |      :param margin: The right margin at which to do line-wrapping.
 |      :type margin: int
 |      :param indent: The indentation level at which printing
 |          begins.  This number is used to decide how far to indent
 |          subsequent lines.
 |      :type indent: int
 |      :param nodesep: A string that is used to separate the node
 |          from the children.  E.g., the default value ``':'`` gives
 |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
 |
 |  pformat_latex_qtree(self)
 |      Returns a representation of the tree compatible with the
 |      LaTeX qtree package. This consists of the string ``\Tree``
 |      followed by the tree represented in bracketed notation.
 |
 |      For example, the following result was generated from a parse tree of
 |      the sentence ``The announcement astounded us``::
 |
 |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
 |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
 |
 |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
 |      style file for the qtree package.
 |
 |      :return: A latex qtree representation of this tree.
 |      :rtype: str
 |
 |  pos(self)
 |      Return a sequence of pos-tagged words extracted from the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.pos()
 |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
 |
 |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
 |          The order reflects the order of the leaves in the tree's hierarchical structure.
 |      :rtype: list(tuple)
 |
 |  pprint(self, **kwargs)
 |      Print a string representation of this Tree to 'stream'
 |
 |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
 |      Pretty-print this tree as ASCII or Unicode art.
 |      For explanation of the arguments, see the documentation for
 |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
 |
 |  productions(self)
 |      Generate the productions that correspond to the non-terminal nodes of the tree.
 |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
 |      form P -> C1 C2 ... Cn.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
 |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
 |          NP -> D N, D -> 'the', N -> 'cat']
 |
 |      :rtype: list(Production)
 |
 |  set_label(self, label)
 |      Set the node label of the tree.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.set_label("T")
 |          >>> print(t)
 |          (T (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))
 |
 |      :param label: the node label (typically a string)
 |      :type label: any
 |
 |  subtrees(self, filter=None)
 |      Generate all the subtrees of this tree, optionally restricted
 |      to trees matching the filter function.
 |
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> for s in t.subtrees(lambda t: t.height() == 2):
 |          ...     print(s)
 |          (D the)
 |          (N dog)
 |          (V chased)
 |          (D the)
 |          (N cat)
 |
 |      :type filter: function
 |      :param filter: the function to filter all local trees
 |
 |  treeposition_spanning_leaves(self, start, end)
 |      :return: The tree position of the lowest descendant of this
 |          tree that dominates ``self.leaves()[start:end]``.
 |      :raise ValueError: if ``end <= start``
 |
 |  treepositions(self, order='preorder')
 |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
 |          >>> t.treepositions() # doctest: +ELLIPSIS
 |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
 |          >>> for pos in t.treepositions('leaves'):
 |          ...     t[pos] = t[pos][::-1].upper()
 |          >>> print(t)
 |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
 |
 |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
 |          ``leaves``.
 |
 |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
 |      This method modifies the tree in three ways:
 |
 |        1. Transforms a tree in Chomsky Normal Form back to its
 |           original structure (branching greater than two)
 |        2. Removes any parent annotation (if it exists)
 |        3. (optional) expands unary subtrees (if previously
 |           collapsed with collapseUnary(...) )
 |
 |      :param expandUnary: Flag to expand unary or not (default = True)
 |      :type  expandUnary: bool
 |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
 |      :type  childChar: str
 |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
 |      :type  parentChar: str
 |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
 |      :type  unaryChar: str
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  convert(tree)
 |      Convert a tree between different subtypes of Tree.  ``cls`` determines
 |      which class will be used to encode the new tree.
 |
 |      :type tree: Tree
 |      :param tree: The tree that should be converted.
 |      :return: The new Tree.
 |
 |  fromlist(l)
 |      :type l: list
 |      :param l: a tree represented as nested lists
 |
 |      :return: A tree corresponding to the list representation ``l``.
 |      :rtype: Tree
 |
 |      Convert nested lists to a NLTK Tree
 |
 |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
 |      Read a bracketed tree string and return the resulting tree.
 |      Trees are represented as nested brackettings, such as::
 |
 |        (S (NP (NNP John)) (VP (V runs)))
 |
 |      :type s: str
 |      :param s: The string to read
 |
 |      :type brackets: str (length=2)
 |      :param brackets: The bracket characters used to mark the
 |          beginning and end of trees and subtrees.
 |
 |      :type read_node: function
 |      :type read_leaf: function
 |      :param read_node, read_leaf: If specified, these functions
 |          are applied to the substrings of ``s`` corresponding to
 |          nodes and leaves (respectively) to obtain the values for
 |          those nodes and leaves.  They should have the following
 |          signature:
 |
 |             read_node(str) -> value
 |
 |          For example, these functions could be used to process nodes
 |          and leaves whose values should be some type other than
 |          string (such as ``FeatStruct``).
 |          Note that by default, node strings and leaf strings are
 |          delimited by whitespace and brackets; to override this
 |          default, use the ``node_pattern`` and ``leaf_pattern``
 |          arguments.
 |
 |      :type node_pattern: str
 |      :type leaf_pattern: str
 |      :param node_pattern, leaf_pattern: Regular expression patterns
 |          used to find node and leaf substrings in ``s``.  By
 |          default, both nodes patterns are defined to match any
 |          sequence of non-whitespace non-bracket characters.
 |
 |      :type remove_empty_top_bracketing: bool
 |      :param remove_empty_top_bracketing: If the resulting tree has
 |          an empty node label, and is length one, then return its
 |          single child instead.  This is useful for treebank trees,
 |          which sometimes contain an extra level of bracketing.
 |
 |      :return: A tree corresponding to the string representation ``s``.
 |          If this class method is called using a subclass of Tree,
 |          then it will return a tree of that type.
 |      :rtype: Tree
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  node
 |      Outdated method to access the node value; use the label() method instead.
 |
 |      @deprecated: Use label() instead
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __hash__ = None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.list:
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iadd__(self, value, /)
 |      Implement self+=value.
 |
 |  __imul__(self, value, /)
 |      Implement self*=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the list.
 |
 |  __sizeof__(self, /)
 |      Return the size of the list in memory, in bytes.
 |
 |  append(self, object, /)
 |      Append object to the end of the list.
 |
 |  clear(self, /)
 |      Remove all items from list.
 |
 |  count(self, value, /)
 |      Return number of occurrences of value.
 |
 |  extend(self, iterable, /)
 |      Extend list by appending elements from the iterable.
 |
 |  index(self, value, start=0, stop=9223372036854775807, /)
 |      Return first index of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  insert(self, index, object, /)
 |      Insert object before index.
 |
 |  pop(self, index=-1, /)
 |      Remove and return item at index (default last).
 |
 |      Raises IndexError if list is empty or index is out of range.
 |
 |  remove(self, value, /)
 |      Remove first occurrence of value.
 |
 |      Raises ValueError if the value is not present.
 |
 |  reverse(self, /)
 |      Reverse *IN PLACE*.
 |
 |  sort(self, /, *, key=None, reverse=False)
 |      Sort the list in ascending order and return None.
 |
 |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
 |      order of two equal elements is maintained).
 |
 |      If a key function is given, apply it once to each list item and sort them,
 |      ascending or descending, according to their function values.
 |
 |      The reverse flag can be set to sort in descending order.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.list:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.list:
 |
 |  __new__(*args, **kwargs) class method of builtins.list
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.TreePrettyPrinter
Python Library Documentation: class TreePrettyPrinter in module nltk.tree.prettyprinter

class TreePrettyPrinter(builtins.object)
 |  TreePrettyPrinter(tree, sentence=None, highlight=())
 |
 |  Pretty-print a tree in text format, either as ASCII or Unicode.
 |  The tree can be a normal tree, or discontinuous.
 |
 |  ``TreePrettyPrinter(tree, sentence=None, highlight=())``
 |  creates an object from which different visualizations can be created.
 |
 |  :param tree: a Tree object.
 |  :param sentence: a list of words (strings). If `sentence` is given,
 |      `tree` must contain integers as leaves, which are taken as indices
 |      in `sentence`. Using this you can display a discontinuous tree.
 |  :param highlight: Optionally, a sequence of Tree objects in `tree` which
 |      should be highlighted. Has the effect of only applying colors to nodes
 |      in this sequence (nodes should be given as Tree objects, terminals as
 |      indices).
 |
 |  >>> from nltk.tree import Tree
 |  >>> tree = Tree.fromstring('(S (NP Mary) (VP walks))')
 |  >>> print(TreePrettyPrinter(tree).text())
 |  ... # doctest: +NORMALIZE_WHITESPACE
 |        S
 |    ____|____
 |   NP        VP
 |   |         |
 |  Mary     walks
 |
 |  Methods defined here:
 |
 |  __init__(self, tree, sentence=None, highlight=())
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  svg(self, nodecolor='blue', leafcolor='red', funccolor='green')
 |      :return: SVG representation of a tree.
 |
 |  text(self, nodedist=1, unicodelines=False, html=False, ansi=False, nodecolor='blue', leafcolor='red', funccolor='green', abbreviate=None, maxwidth=16)
 |      :return: ASCII art for a discontinuous tree.
 |
 |      :param unicodelines: whether to use Unicode line drawing characters
 |          instead of plain (7-bit) ASCII.
 |      :param html: whether to wrap output in html code (default plain text).
 |      :param ansi: whether to produce colors with ANSI escape sequences
 |          (only effective when html==False).
 |      :param leafcolor, nodecolor: specify colors of leaves and phrasal
 |          nodes; effective when either html or ansi is True.
 |      :param abbreviate: if True, abbreviate labels longer than 5 characters.
 |          If integer, abbreviate labels longer than `abbr` characters.
 |      :param maxwidth: maximum number of characters before a label starts to
 |          wrap; pass None to disable.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  nodecoords(tree, sentence, highlight)
 |      Produce coordinates of nodes on a grid.
 |
 |      Objective:
 |
 |      - Produce coordinates for a non-overlapping placement of nodes and
 |          horizontal lines.
 |      - Order edges so that crossing edges cross a minimal number of previous
 |          horizontal lines (never vertical lines).
 |
 |      Approach:
 |
 |      - bottom up level order traversal (start at terminals)
 |      - at each level, identify nodes which cannot be on the same row
 |      - identify nodes which cannot be in the same column
 |      - place nodes into a grid at (row, column)
 |      - order child-parent edges with crossing edges last
 |
 |      Coordinates are (row, column); the origin (0, 0) is at the top left;
 |      the root node is on row 0. Coordinates do not consider the size of a
 |      node (which depends on font, &c), so the width of a column of the grid
 |      should be automatically determined by the element with the greatest
 |      width in that column. Alternatively, the integer coordinates could be
 |      converted to coordinates in which the distances between adjacent nodes
 |      are non-uniform.
 |
 |      Produces tuple (nodes, coords, edges, highlighted) where:
 |
 |      - nodes[id]: Tree object for the node with this integer id
 |      - coords[id]: (n, m) coordinate where to draw node with id in the grid
 |      - edges[id]: parent id of node with this id (ordered dictionary)
 |      - highlighted: set of ids that should be highlighted
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TreebankWordDetokenizer
Python Library Documentation: class TreebankWordDetokenizer in module nltk.tokenize.treebank

class TreebankWordDetokenizer(nltk.tokenize.api.TokenizerI)
 |  The Treebank detokenizer uses the reverse regex operations corresponding to
 |  the Treebank tokenizer's regexes.
 |
 |  Note:
 |
 |  - There're additional assumption mades when undoing the padding of ``[;@#$%&]``
 |    punctuation symbols that isn't presupposed in the TreebankTokenizer.
 |  - There're additional regexes added in reversing the parentheses tokenization,
 |     such as the ``r'([\]\)\}\>])\s([:;,.])'``, which removes the additional right
 |     padding added to the closing parentheses precedding ``[:;,.]``.
 |  - It's not possible to return the original whitespaces as they were because
 |    there wasn't explicit records of where `'\n'`, `'\t'` or `'\s'` were removed at
 |    the text.split() operation.
 |
 |  >>> from nltk.tokenize.treebank import TreebankWordTokenizer, TreebankWordDetokenizer
 |  >>> s = '''Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\nThanks.'''
 |  >>> d = TreebankWordDetokenizer()
 |  >>> t = TreebankWordTokenizer()
 |  >>> toks = t.tokenize(s)
 |  >>> d.detokenize(toks)
 |  'Good muffins cost $3.88 in New York. Please buy me two of them. Thanks.'
 |
 |  The MXPOST parentheses substitution can be undone using the ``convert_parentheses``
 |  parameter:
 |
 |  >>> s = '''Good muffins cost $3.88\nin New (York).  Please (buy) me\ntwo of them.\n(Thanks).'''
 |  >>> expected_tokens = ['Good', 'muffins', 'cost', '$', '3.88', 'in',
 |  ... 'New', '-LRB-', 'York', '-RRB-', '.', 'Please', '-LRB-', 'buy',
 |  ... '-RRB-', 'me', 'two', 'of', 'them.', '-LRB-', 'Thanks', '-RRB-', '.']
 |  >>> expected_tokens == t.tokenize(s, convert_parentheses=True)
 |  True
 |  >>> expected_detoken = 'Good muffins cost $3.88 in New (York). Please (buy) me two of them. (Thanks).'
 |  >>> expected_detoken == d.detokenize(t.tokenize(s, convert_parentheses=True), convert_parentheses=True)
 |  True
 |
 |  During tokenization it's safe to add more spaces but during detokenization,
 |  simply undoing the padding doesn't really help.
 |
 |  - During tokenization, left and right pad is added to ``[!?]``, when
 |    detokenizing, only left shift the ``[!?]`` is needed.
 |    Thus ``(re.compile(r'\s([?!])'), r'\g<1>')``.
 |
 |  - During tokenization ``[:,]`` are left and right padded but when detokenizing,
 |    only left shift is necessary and we keep right pad after comma/colon
 |    if the string after is a non-digit.
 |    Thus ``(re.compile(r'\s([:,])\s([^\d])'), r'\1 \2')``.
 |
 |  >>> from nltk.tokenize.treebank import TreebankWordDetokenizer
 |  >>> toks = ['hello', ',', 'i', 'ca', "n't", 'feel', 'my', 'feet', '!', 'Help', '!', '!']
 |  >>> twd = TreebankWordDetokenizer()
 |  >>> twd.detokenize(toks)
 |  "hello, i can't feel my feet! Help!!"
 |
 |  >>> toks = ['hello', ',', 'i', "can't", 'feel', ';', 'my', 'feet', '!',
 |  ... 'Help', '!', '!', 'He', 'said', ':', 'Help', ',', 'help', '?', '!']
 |  >>> twd.detokenize(toks)
 |  "hello, i can't feel; my feet! Help!! He said: Help, help?!"
 |
 |  Method resolution order:
 |      TreebankWordDetokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  detokenize(self, tokens: list[str], convert_parentheses: bool = False) -> str
 |      Duck-typing the abstract *tokenize()*.
 |
 |  tokenize(self, tokens: list[str], convert_parentheses: bool = False) -> str
 |      Treebank detokenizer, created by undoing the regexes from
 |      the TreebankWordTokenizer.tokenize.
 |
 |      :param tokens: A list of strings, i.e. tokenized text.
 |      :type tokens: List[str]
 |      :param convert_parentheses: if True, replace PTB symbols with parentheses,
 |          e.g. `-LRB-` to `(`. Defaults to False.
 |      :type convert_parentheses: bool, optional
 |      :return: str
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  CONTRACTIONS2 = [re.compile('(?i)\\b(can)\\s(not)\\b', re.IGNORECASE),...
 |
 |  CONTRACTIONS3 = [re.compile("(?i) ('t)\\s(is)\\b", re.IGNORECASE), re....
 |
 |  CONVERT_PARENTHESES = [(re.compile('-LRB-'), '('), (re.compile('-RRB-'...
 |
 |  DOUBLE_DASHES = (re.compile(' -- '), '--')
 |
 |  ENDING_QUOTES = [(re.compile("([^' ])\\s('ll|'LL|'re|'RE|'ve|'VE|n't|N...
 |
 |  PARENS_BRACKETS = [(re.compile('([\\[\\(\\{\\<])\\s'), r'\g<1>'), (re....
 |
 |  PUNCTUATION = [(re.compile("([^'])\\s'\\s"), r"\1' "), (re.compile('\\...
 |
 |  STARTING_QUOTES = [(re.compile('([ (\\[{<])\\s``'), r'\1``'), (re.comp...
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TreebankWordTokenizer
Python Library Documentation: class TreebankWordTokenizer in module nltk.tokenize.treebank

class TreebankWordTokenizer(nltk.tokenize.api.TokenizerI)
 |  The Treebank tokenizer uses regular expressions to tokenize text as in Penn Treebank.
 |
 |  This tokenizer performs the following steps:
 |
 |  - split standard contractions, e.g. ``don't`` -> ``do n't`` and ``they'll`` -> ``they 'll``
 |  - treat most punctuation characters as separate tokens
 |  - split off commas and single quotes, when followed by whitespace
 |  - separate periods that appear at the end of line
 |
 |  >>> from nltk.tokenize import TreebankWordTokenizer
 |  >>> s = '''Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\nThanks.'''
 |  >>> TreebankWordTokenizer().tokenize(s)
 |  ['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two', 'of', 'them.', 'Thanks', '.']
 |  >>> s = "They'll save and invest more."
 |  >>> TreebankWordTokenizer().tokenize(s)
 |  ['They', "'ll", 'save', 'and', 'invest', 'more', '.']
 |  >>> s = "hi, my name can't hello,"
 |  >>> TreebankWordTokenizer().tokenize(s)
 |  ['hi', ',', 'my', 'name', 'ca', "n't", 'hello', ',']
 |
 |  Method resolution order:
 |      TreebankWordTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  span_tokenize(self, text: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Returns the spans of the tokens in ``text``.
 |      Uses the post-hoc nltk.tokens.align_tokens to return the offset spans.
 |
 |          >>> from nltk.tokenize import TreebankWordTokenizer
 |          >>> s = '''Good muffins cost $3.88\nin New (York).  Please (buy) me\ntwo of them.\n(Thanks).'''
 |          >>> expected = [(0, 4), (5, 12), (13, 17), (18, 19), (19, 23),
 |          ... (24, 26), (27, 30), (31, 32), (32, 36), (36, 37), (37, 38),
 |          ... (40, 46), (47, 48), (48, 51), (51, 52), (53, 55), (56, 59),
 |          ... (60, 62), (63, 68), (69, 70), (70, 76), (76, 77), (77, 78)]
 |          >>> list(TreebankWordTokenizer().span_tokenize(s)) == expected
 |          True
 |          >>> expected = ['Good', 'muffins', 'cost', '$', '3.88', 'in',
 |          ... 'New', '(', 'York', ')', '.', 'Please', '(', 'buy', ')',
 |          ... 'me', 'two', 'of', 'them.', '(', 'Thanks', ')', '.']
 |          >>> [s[start:end] for start, end in TreebankWordTokenizer().span_tokenize(s)] == expected
 |          True
 |
 |      :param text: A string with a sentence or sentences.
 |      :type text: str
 |      :yield: Tuple[int, int]
 |
 |  tokenize(self, text: str, convert_parentheses: bool = False, return_str: bool = False) -> list[str]
 |      Return a tokenized copy of `text`.
 |
 |      >>> from nltk.tokenize import TreebankWordTokenizer
 |      >>> s = '''Good muffins cost $3.88 (roughly 3,36 euros)\nin New York.  Please buy me\ntwo of them.\nThanks.'''
 |      >>> TreebankWordTokenizer().tokenize(s) # doctest: +NORMALIZE_WHITESPACE
 |      ['Good', 'muffins', 'cost', '$', '3.88', '(', 'roughly', '3,36',
 |      'euros', ')', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two',
 |      'of', 'them.', 'Thanks', '.']
 |      >>> TreebankWordTokenizer().tokenize(s, convert_parentheses=True) # doctest: +NORMALIZE_WHITESPACE
 |      ['Good', 'muffins', 'cost', '$', '3.88', '-LRB-', 'roughly', '3,36',
 |      'euros', '-RRB-', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two',
 |      'of', 'them.', 'Thanks', '.']
 |
 |      :param text: A string with a sentence or sentences.
 |      :type text: str
 |      :param convert_parentheses: if True, replace parentheses to PTB symbols,
 |          e.g. `(` to `-LRB-`. Defaults to False.
 |      :type convert_parentheses: bool, optional
 |      :param return_str: If True, return tokens as space-separated string,
 |          defaults to False.
 |      :type return_str: bool, optional
 |      :return: List of tokens from `text`.
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  CONTRACTIONS2 = [re.compile('(?i)\\b(can)(?#X)(not)\\b', re.IGNORECASE...
 |
 |  CONTRACTIONS3 = [re.compile("(?i) ('t)(?#X)(is)\\b", re.IGNORECASE), r...
 |
 |  CONVERT_PARENTHESES = [(re.compile('\\('), '-LRB-'), (re.compile('\\)'...
 |
 |  DOUBLE_DASHES = (re.compile('--'), ' -- ')
 |
 |  ENDING_QUOTES = [(re.compile("''"), " '' "), (re.compile('"'), " '' ")...
 |
 |  PARENS_BRACKETS = (re.compile('[\\]\\[\\(\\)\\{\\}\\<\\>]'), r' \g<0> ...
 |
 |  PUNCTUATION = [(re.compile('([:,])([^\\d])'), r' \1 \2'), (re.compile(...
 |
 |  STARTING_QUOTES = [(re.compile('^\\"'), '``'), (re.compile('(``)'), r'...
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Trie
Python Library Documentation: class Trie in module nltk.collections

class Trie(builtins.dict)
 |  Trie(strings=None)
 |
 |  A Trie implementation for strings
 |
 |  Method resolution order:
 |      Trie
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, strings=None)
 |      Builds a Trie object, which is built around a ``dict``
 |
 |      If ``strings`` is provided, it will add the ``strings``, which
 |      consist of a ``list`` of ``strings``, to the Trie.
 |      Otherwise, it'll construct an empty Trie.
 |
 |      :param strings: List of strings to insert into the trie
 |          (Default is ``None``)
 |      :type strings: list(str)
 |
 |  __missing__(self, key)
 |
 |  insert(self, string)
 |      Inserts ``string`` into the Trie
 |
 |      :param string: String to insert into the trie
 |      :type string: str
 |
 |      :Example:
 |
 |      >>> from nltk.collections import Trie
 |      >>> trie = Trie(["abc", "def"])
 |      >>> expected = {'a': {'b': {'c': {True: None}}},                         'd': {'e': {'f': {True: None}}}}
 |      >>> trie == expected
 |      True
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  LEAF = True
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.TrigramAssocMeasures
Python Library Documentation: class TrigramAssocMeasures in module nltk.metrics.association

class TrigramAssocMeasures(NgramAssocMeasures)
 |  A collection of trigram association measures. Each association measure
 |  is provided as a function with four arguments::
 |
 |      trigram_score_fn(n_iii,
 |                       (n_iix, n_ixi, n_xii),
 |                       (n_ixx, n_xix, n_xxi),
 |                       n_xxx)
 |
 |  The arguments constitute the marginals of a contingency table, counting
 |  the occurrences of particular events in a corpus. The letter i in the
 |  suffix refers to the appearance of the word in question, while x indicates
 |  the appearance of any word. Thus, for example:
 |
 |  - n_iii counts ``(w1, w2, w3)``, i.e. the trigram being scored
 |  - n_ixx counts ``(w1, *, *)``
 |  - n_xxx counts ``(*, *, *)``, i.e. any trigram
 |
 |  Method resolution order:
 |      TrigramAssocMeasures
 |      NgramAssocMeasures
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from NgramAssocMeasures:
 |
 |  chi_sq(*marginals)
 |      Scores ngrams using Pearson's chi-square as in Manning and Schutze
 |      5.3.3.
 |
 |  jaccard(*marginals)
 |      Scores ngrams using the Jaccard index.
 |
 |  likelihood_ratio(*marginals)
 |      Scores ngrams using likelihood ratios as in Manning and Schutze 5.3.4.
 |
 |  pmi(*marginals)
 |      Scores ngrams by pointwise mutual information, as in Manning and
 |      Schutze 5.4.
 |
 |  poisson_stirling(*marginals)
 |      Scores ngrams using the Poisson-Stirling measure.
 |
 |  student_t(*marginals)
 |      Scores ngrams using Student's t test with independence hypothesis
 |      for unigrams, as in Manning and Schutze 5.3.1.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from NgramAssocMeasures:
 |
 |  mi_like(*marginals, **kwargs)
 |      Scores ngrams using a variant of mutual information. The keyword
 |      argument power sets an exponent (default 3) for the numerator. No
 |      logarithm of the result is calculated.
 |
 |  raw_freq(*marginals)
 |      Scores ngrams by their frequency
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from NgramAssocMeasures:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TrigramCollocationFinder
Python Library Documentation: class TrigramCollocationFinder in module nltk.collocations

class TrigramCollocationFinder(AbstractCollocationFinder)
 |  TrigramCollocationFinder(word_fd, bigram_fd, wildcard_fd, trigram_fd)
 |
 |  A tool for the finding and ranking of trigram collocations or other
 |  association measures. It is often useful to use from_words() rather than
 |  constructing an instance directly.
 |
 |  Method resolution order:
 |      TrigramCollocationFinder
 |      AbstractCollocationFinder
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, word_fd, bigram_fd, wildcard_fd, trigram_fd)
 |      Construct a TrigramCollocationFinder, given FreqDists for
 |      appearances of words, bigrams, two words with any word between them,
 |      and trigrams.
 |
 |  bigram_finder(self)
 |      Constructs a bigram collocation finder with the bigram and unigram
 |      data from this finder. Note that this does not include any filtering
 |      applied to this finder.
 |
 |  score_ngram(self, score_fn, w1, w2, w3)
 |      Returns the score for a given trigram using the given scoring
 |      function.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  from_words(words, window_size=3)
 |      Construct a TrigramCollocationFinder for all trigrams in the given
 |      sequence.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  default_ws = 3
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from AbstractCollocationFinder:
 |
 |  above_score(self, score_fn, min_score)
 |      Returns a sequence of ngrams, ordered by decreasing score, whose
 |      scores each exceed the given minimum score.
 |
 |  apply_freq_filter(self, min_freq)
 |      Removes candidate ngrams which have frequency less than min_freq.
 |
 |  apply_ngram_filter(self, fn)
 |      Removes candidate ngrams (w1, w2, ...) where fn(w1, w2, ...)
 |      evaluates to True.
 |
 |  apply_word_filter(self, fn)
 |      Removes candidate ngrams (w1, w2, ...) where any of (fn(w1), fn(w2),
 |      ...) evaluates to True.
 |
 |  nbest(self, score_fn, n)
 |      Returns the top n ngrams when scored by the given function.
 |
 |  score_ngrams(self, score_fn)
 |      Returns a sequence of (ngram, score) pairs ordered from highest to
 |      lowest score, as determined by the scoring function provided.
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from AbstractCollocationFinder:
 |
 |  from_documents(documents)
 |      Constructs a collocation finder given a collection of documents,
 |      each of which is a list (or iterable) of tokens.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from AbstractCollocationFinder:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TrigramTagger
Python Library Documentation: class TrigramTagger in module nltk.tag.sequential

class TrigramTagger(NgramTagger)
 |  TrigramTagger(train=None, model=None, backoff=None, cutoff=0, verbose=False)
 |
 |  A tagger that chooses a token's tag based its word string and on
 |  the preceding two words' tags.  In particular, a tuple consisting
 |  of the previous two tags and the word is looked up in a table, and
 |  the corresponding tag is returned.
 |
 |  :param train: The corpus of training data, a list of tagged sentences
 |  :type train: list(list(tuple(str, str)))
 |  :param model: The tagger model
 |  :type model: dict
 |  :param backoff: Another tagger which this tagger will consult when it is
 |      unable to tag a word
 |  :type backoff: TaggerI
 |  :param cutoff: The number of instances of training data the tagger must see
 |      in order not to use the backoff tagger
 |  :type cutoff: int
 |
 |  Method resolution order:
 |      TrigramTagger
 |      NgramTagger
 |      ContextTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, train=None, model=None, backoff=None, cutoff=0, verbose=False)
 |      :param context_to_tag: A dictionary mapping contexts to tags.
 |      :param backoff: The backoff tagger that should be used for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  json_tag = 'nltk.tag.sequential.TrigramTagger'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from NgramTagger:
 |
 |  context(self, tokens, index, history)
 |      :return: the context that should be used to look up the tag
 |          for the specified token; or None if the specified token
 |          should not be handled by this tagger.
 |      :rtype: (hashable)
 |
 |  encode_json_obj(self)
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from NgramTagger:
 |
 |  decode_json_obj(obj)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ContextTagger:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  size(self)
 |      :return: The number of entries in the table used by this
 |          tagger to map from contexts to tags.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TweetTokenizer
Python Library Documentation: class TweetTokenizer in module nltk.tokenize.casual

class TweetTokenizer(nltk.tokenize.api.TokenizerI)
 |  TweetTokenizer(preserve_case=True, reduce_len=False, strip_handles=False, match_phone_numbers=True)
 |
 |  Tokenizer for tweets.
 |
 |      >>> from nltk.tokenize import TweetTokenizer
 |      >>> tknzr = TweetTokenizer()
 |      >>> s0 = "This is a cooool #dummysmiley: :-) :-P <3 and some arrows < > -> <--"
 |      >>> tknzr.tokenize(s0) # doctest: +NORMALIZE_WHITESPACE
 |      ['This', 'is', 'a', 'cooool', '#dummysmiley', ':', ':-)', ':-P', '<3', 'and', 'some', 'arrows', '<', '>', '->',
 |       '<--']
 |
 |  Examples using `strip_handles` and `reduce_len parameters`:
 |
 |      >>> tknzr = TweetTokenizer(strip_handles=True, reduce_len=True)
 |      >>> s1 = '@remy: This is waaaaayyyy too much for you!!!!!!'
 |      >>> tknzr.tokenize(s1)
 |      [':', 'This', 'is', 'waaayyy', 'too', 'much', 'for', 'you', '!', '!', '!']
 |
 |  Method resolution order:
 |      TweetTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, preserve_case=True, reduce_len=False, strip_handles=False, match_phone_numbers=True)
 |      Create a `TweetTokenizer` instance with settings for use in the `tokenize` method.
 |
 |      :param preserve_case: Flag indicating whether to preserve the casing (capitalisation)
 |          of text used in the `tokenize` method. Defaults to True.
 |      :type preserve_case: bool
 |      :param reduce_len: Flag indicating whether to replace repeated character sequences
 |          of length 3 or greater with sequences of length 3. Defaults to False.
 |      :type reduce_len: bool
 |      :param strip_handles: Flag indicating whether to remove Twitter handles of text used
 |          in the `tokenize` method. Defaults to False.
 |      :type strip_handles: bool
 |      :param match_phone_numbers: Flag indicating whether the `tokenize` method should look
 |          for phone numbers. Defaults to True.
 |      :type match_phone_numbers: bool
 |
 |  tokenize(self, text: str) -> list[str]
 |      Tokenize the input text.
 |
 |      :param text: str
 |      :rtype: list(str)
 |      :return: a tokenized list of strings; joining this list returns        the original string if `preserve_case=False`.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  PHONE_WORD_RE
 |      Secondary core TweetTokenizer regex
 |
 |  WORD_RE
 |      Core TweetTokenizer regex
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.TypedMaxentFeatureEncoding
Python Library Documentation: class TypedMaxentFeatureEncoding in module nltk.classify.maxent

class TypedMaxentFeatureEncoding(MaxentFeatureEncodingI)
 |  TypedMaxentFeatureEncoding(labels, mapping, unseen_features=False, alwayson_features=False)
 |
 |  A feature encoding that generates vectors containing integer,
 |  float and binary joint-features of the form:
 |
 |  Binary (for string and boolean features):
 |
 |  |  joint_feat(fs, l) = { 1 if (fs[fname] == fval) and (l == label)
 |  |                      {
 |  |                      { 0 otherwise
 |
 |  Value (for integer and float features):
 |
 |  |  joint_feat(fs, l) = { fval if     (fs[fname] == type(fval))
 |  |                      {         and (l == label)
 |  |                      {
 |  |                      { not encoded otherwise
 |
 |  Where ``fname`` is the name of an input-feature, ``fval`` is a value
 |  for that input-feature, and ``label`` is a label.
 |
 |  Typically, these features are constructed based on a training
 |  corpus, using the ``train()`` method.
 |
 |  For string and boolean features [type(fval) not in (int, float)]
 |  this method will create one feature for each combination of
 |  ``fname``, ``fval``, and ``label`` that occurs at least once in the
 |  training corpus.
 |
 |  For integer and float features [type(fval) in (int, float)] this
 |  method will create one feature for each combination of ``fname``
 |  and ``label`` that occurs at least once in the training corpus.
 |
 |  For binary features the ``unseen_features`` parameter can be used
 |  to add "unseen-value features", which are used whenever an input
 |  feature has a value that was not encountered in the training
 |  corpus.  These features have the form:
 |
 |  |  joint_feat(fs, l) = { 1 if is_unseen(fname, fs[fname])
 |  |                      {      and l == label
 |  |                      {
 |  |                      { 0 otherwise
 |
 |  Where ``is_unseen(fname, fval)`` is true if the encoding does not
 |  contain any joint features that are true when ``fs[fname]==fval``.
 |
 |  The ``alwayson_features`` parameter can be used to add "always-on
 |  features", which have the form:
 |
 |  |  joint_feat(fs, l) = { 1 if (l == label)
 |  |                      {
 |  |                      { 0 otherwise
 |
 |  These always-on features allow the maxent model to directly model
 |  the prior probabilities of each label.
 |
 |  Method resolution order:
 |      TypedMaxentFeatureEncoding
 |      MaxentFeatureEncodingI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, labels, mapping, unseen_features=False, alwayson_features=False)
 |      :param labels: A list of the "known labels" for this encoding.
 |
 |      :param mapping: A dictionary mapping from ``(fname,fval,label)``
 |          tuples to corresponding joint-feature indexes.  These
 |          indexes must be the set of integers from 0...len(mapping).
 |          If ``mapping[fname,fval,label]=id``, then
 |          ``self.encode({..., fname:fval, ...``, label)[id]} is 1;
 |          otherwise, it is 0.
 |
 |      :param unseen_features: If true, then include unseen value
 |         features in the generated joint-feature vectors.
 |
 |      :param alwayson_features: If true, then include always-on
 |         features in the generated joint-feature vectors.
 |
 |  describe(self, f_id)
 |      :return: A string describing the value of the joint-feature
 |          whose index in the generated feature vectors is ``fid``.
 |      :rtype: str
 |
 |  encode(self, featureset, label)
 |      Given a (featureset, label) pair, return the corresponding
 |      vector of joint-feature values.  This vector is represented as
 |      a list of ``(index, value)`` tuples, specifying the value of
 |      each non-zero joint-feature.
 |
 |      :type featureset: dict
 |      :rtype: list(tuple(int, int))
 |
 |  labels(self)
 |      :return: A list of the "known labels" -- i.e., all labels
 |          ``l`` such that ``self.encode(fs,l)`` can be a nonzero
 |          joint-feature vector for some value of ``fs``.
 |      :rtype: list
 |
 |  length(self)
 |      :return: The size of the fixed-length joint-feature vectors
 |          that are generated by this encoding.
 |      :rtype: int
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  train(train_toks, count_cutoff=0, labels=None, **options)
 |      Construct and return new feature encoding, based on a given
 |      training corpus ``train_toks``.  See the class description
 |      ``TypedMaxentFeatureEncoding`` for a description of the
 |      joint-features that will be included in this encoding.
 |
 |      Note: recognized feature values types are (int, float), over
 |      types are interpreted as regular binary features.
 |
 |      :type train_toks: list(tuple(dict, str))
 |      :param train_toks: Training data, represented as a list of
 |          pairs, the first member of which is a feature dictionary,
 |          and the second of which is a classification label.
 |
 |      :type count_cutoff: int
 |      :param count_cutoff: A cutoff value that is used to discard
 |          rare joint-features.  If a joint-feature's value is 1
 |          fewer than ``count_cutoff`` times in the training corpus,
 |          then that joint-feature is not included in the generated
 |          encoding.
 |
 |      :type labels: list
 |      :param labels: A list of labels that should be used by the
 |          classifier.  If not specified, then the set of labels
 |          attested in ``train_toks`` will be used.
 |
 |      :param options: Extra parameters for the constructor, such as
 |          ``unseen_features`` and ``alwayson_features``.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from MaxentFeatureEncodingI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Undefined
Python Library Documentation: class Undefined in module nltk.sem.evaluate

class Undefined(Error)
 |  Method resolution order:
 |      Undefined
 |      Error
 |      builtins.Exception
 |      builtins.BaseException
 |      builtins.object
 |
 |  Data descriptors inherited from Error:
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.Exception:
 |
 |  __init__(self, /, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.Exception:
 |
 |  __new__(*args, **kwargs) class method of builtins.Exception
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.BaseException:
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __reduce__(...)
 |      Helper for pickle.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __setstate__(...)
 |
 |  __str__(self, /)
 |      Return str(self).
 |
 |  add_note(...)
 |      Exception.add_note(note) --
 |      add a note to the exception
 |
 |  with_traceback(...)
 |      Exception.with_traceback(tb) --
 |      set self.__traceback__ to tb and return self.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from builtins.BaseException:
 |
 |  __cause__
 |      exception cause
 |
 |  __context__
 |      exception context
 |
 |  __dict__
 |
 |  __suppress_context__
 |
 |  __traceback__
 |
 |  args
nltk.UniformProbDist
Python Library Documentation: class UniformProbDist in module nltk.probability

class UniformProbDist(ProbDistI)
 |  UniformProbDist(samples)
 |
 |  A probability distribution that assigns equal probability to each
 |  sample in a given set; and a zero probability to all other
 |  samples.
 |
 |  Method resolution order:
 |      UniformProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, samples)
 |      Construct a new uniform probability distribution, that assigns
 |      equal probability to each sample in ``samples``.
 |
 |      :param samples: The samples that should be given uniform
 |          probability.
 |      :type samples: list
 |      :raise ValueError: If ``samples`` is empty.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from ProbDistI:
 |
 |  SUM_TO_ONE = True
nltk.UnigramTagger
Python Library Documentation: class UnigramTagger in module nltk.tag.sequential

class UnigramTagger(NgramTagger)
 |  UnigramTagger(train=None, model=None, backoff=None, cutoff=0, verbose=False)
 |
 |  Unigram Tagger
 |
 |  The UnigramTagger finds the most likely tag for each word in a training
 |  corpus, and then uses that information to assign tags to new tokens.
 |
 |      >>> from nltk.corpus import brown
 |      >>> from nltk.tag import UnigramTagger
 |      >>> test_sent = brown.sents(categories='news')[0]
 |      >>> unigram_tagger = UnigramTagger(brown.tagged_sents(categories='news')[:500])
 |      >>> for tok, tag in unigram_tagger.tag(test_sent):
 |      ...     print("({}, {}), ".format(tok, tag)) # doctest: +NORMALIZE_WHITESPACE
 |      (The, AT), (Fulton, NP-TL), (County, NN-TL), (Grand, JJ-TL),
 |      (Jury, NN-TL), (said, VBD), (Friday, NR), (an, AT),
 |      (investigation, NN), (of, IN), (Atlanta's, NP$), (recent, JJ),
 |      (primary, NN), (election, NN), (produced, VBD), (``, ``),
 |      (no, AT), (evidence, NN), ('', ''), (that, CS), (any, DTI),
 |      (irregularities, NNS), (took, VBD), (place, NN), (., .),
 |
 |  :param train: The corpus of training data, a list of tagged sentences
 |  :type train: list(list(tuple(str, str)))
 |  :param model: The tagger model
 |  :type model: dict
 |  :param backoff: Another tagger which this tagger will consult when it is
 |      unable to tag a word
 |  :type backoff: TaggerI
 |  :param cutoff: The number of instances of training data the tagger must see
 |      in order not to use the backoff tagger
 |  :type cutoff: int
 |
 |  Method resolution order:
 |      UnigramTagger
 |      NgramTagger
 |      ContextTagger
 |      SequentialBackoffTagger
 |      nltk.tag.api.TaggerI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, train=None, model=None, backoff=None, cutoff=0, verbose=False)
 |      :param context_to_tag: A dictionary mapping contexts to tags.
 |      :param backoff: The backoff tagger that should be used for this tagger.
 |
 |  context(self, tokens, index, history)
 |      :return: the context that should be used to look up the tag
 |          for the specified token; or None if the specified token
 |          should not be handled by this tagger.
 |      :rtype: (hashable)
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  json_tag = 'nltk.tag.sequential.UnigramTagger'
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from NgramTagger:
 |
 |  encode_json_obj(self)
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from NgramTagger:
 |
 |  decode_json_obj(obj)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ContextTagger:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  choose_tag(self, tokens, index, history)
 |      Decide which tag should be used for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, return None -- do not consult
 |      the backoff tagger.  This method should be overridden by
 |      subclasses of SequentialBackoffTagger.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  size(self)
 |      :return: The number of entries in the table used by this
 |          tagger to map from contexts to tags.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from SequentialBackoffTagger:
 |
 |  tag(self, tokens)
 |      Determine the most appropriate tag sequence for the given
 |      token sequence, and return a corresponding list of tagged
 |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
 |
 |      :rtype: list(tuple(str, str))
 |
 |  tag_one(self, tokens, index, history)
 |      Determine an appropriate tag for the specified token, and
 |      return that tag.  If this tagger is unable to determine a tag
 |      for the specified token, then its backoff tagger is consulted.
 |
 |      :rtype: str
 |      :type tokens: list
 |      :param tokens: The list of words that are being tagged.
 |      :type index: int
 |      :param index: The index of the word whose tag should be
 |          returned.
 |      :type history: list(str)
 |      :param history: A list of the tags for all words before *index*.
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from SequentialBackoffTagger:
 |
 |  backoff
 |      The backoff tagger for this tagger.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tag.api.TaggerI:
 |
 |  accuracy(self, gold)
 |      Score the accuracy of the tagger against the gold standard.
 |      Strip the tags from the gold standard text, retag it using
 |      the tagger, then compute the accuracy score.
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: float
 |
 |  confusion(self, gold)
 |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
 |      values, with the predictions from ``tag_sents`` as the predicted values.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.confusion(gold_data))
 |             |        -                                                                                     |
 |             |        N                                                                                     |
 |             |        O                                               P                                     |
 |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
 |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
 |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
 |      -------+----------------------------------------------------------------------------------------------+
 |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
 |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
 |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
 |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
 |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
 |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
 |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
 |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
 |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
 |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
 |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
 |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
 |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
 |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
 |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
 |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
 |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
 |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
 |      -------+----------------------------------------------------------------------------------------------+
 |      (row = reference; col = test)
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to run the tagger with,
 |          also used as the reference values in the generated confusion matrix.
 |      :type gold: list(list(tuple(str, str)))
 |      :rtype: ConfusionMatrix
 |
 |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
 |      @deprecated: Use accuracy(gold) instead.
 |
 |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
 |      Tabulate the **recall**, **precision** and **f-measure**
 |      for each tag from ``gold`` or from running ``tag`` on the tokenized
 |      sentences from ``gold``.
 |
 |      >>> from nltk.tag import PerceptronTagger
 |      >>> from nltk.corpus import treebank
 |      >>> tagger = PerceptronTagger()
 |      >>> gold_data = treebank.tagged_sents()[:10]
 |      >>> print(tagger.evaluate_per_tag(gold_data))
 |         Tag | Prec.  | Recall | F-measure
 |      -------+--------+--------+-----------
 |          '' | 1.0000 | 1.0000 | 1.0000
 |           , | 1.0000 | 1.0000 | 1.0000
 |      -NONE- | 0.0000 | 0.0000 | 0.0000
 |           . | 1.0000 | 1.0000 | 1.0000
 |          CC | 1.0000 | 1.0000 | 1.0000
 |          CD | 0.7143 | 1.0000 | 0.8333
 |          DT | 1.0000 | 1.0000 | 1.0000
 |          EX | 1.0000 | 1.0000 | 1.0000
 |          IN | 0.9167 | 0.8800 | 0.8980
 |          JJ | 0.8889 | 0.8889 | 0.8889
 |         JJR | 0.0000 | 0.0000 | 0.0000
 |         JJS | 1.0000 | 1.0000 | 1.0000
 |          MD | 1.0000 | 1.0000 | 1.0000
 |          NN | 0.8000 | 0.9333 | 0.8615
 |         NNP | 0.8929 | 1.0000 | 0.9434
 |         NNS | 0.9500 | 1.0000 | 0.9744
 |         POS | 1.0000 | 1.0000 | 1.0000
 |         PRP | 1.0000 | 1.0000 | 1.0000
 |        PRP$ | 1.0000 | 1.0000 | 1.0000
 |          RB | 0.4000 | 1.0000 | 0.5714
 |         RBR | 1.0000 | 0.5000 | 0.6667
 |          RP | 1.0000 | 1.0000 | 1.0000
 |          TO | 1.0000 | 1.0000 | 1.0000
 |          VB | 1.0000 | 1.0000 | 1.0000
 |         VBD | 0.8571 | 0.8571 | 0.8571
 |         VBG | 1.0000 | 0.8000 | 0.8889
 |         VBN | 1.0000 | 0.8000 | 0.8889
 |         VBP | 1.0000 | 1.0000 | 1.0000
 |         VBZ | 1.0000 | 1.0000 | 1.0000
 |         WDT | 0.0000 | 0.0000 | 0.0000
 |          `` | 1.0000 | 1.0000 | 1.0000
 |      <BLANKLINE>
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives, as used in the f-measure computation. Defaults to 0.5,
 |          where the costs are equal.
 |      :type alpha: float
 |      :param truncate: If specified, then only show the specified
 |          number of values.  Any sorting (e.g., sort_by_count)
 |          will be performed before truncation. Defaults to None
 |      :type truncate: int, optional
 |      :param sort_by_count: Whether to sort the outputs on number of
 |          occurrences of that tag in the ``gold`` data, defaults to False
 |      :type sort_by_count: bool, optional
 |      :return: A tabulated recall, precision and f-measure string
 |      :rtype: str
 |
 |  f_measure(self, gold, alpha=0.5)
 |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to f-measure. The f-measure is the harmonic mean
 |      of the ``precision`` and ``recall``, weighted by ``alpha``.
 |      In particular, given the precision *p* and recall *r* defined by:
 |
 |      - *p* = true positive / (true positive + false negative)
 |      - *r* = true positive / (true positive + false positive)
 |
 |      The f-measure is:
 |
 |      - *1/(alpha/p + (1-alpha)/r)*
 |
 |      With ``alpha = 0.5``, this reduces to:
 |
 |      - *2pr / (p + r)*
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :param alpha: Ratio of the cost of false negative compared to false
 |          positives. Defaults to 0.5, where the costs are equal.
 |      :type alpha: float
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  precision(self, gold)
 |      Compute the precision for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to precision. The precision is defined as:
 |
 |      - *p* = true positive / (true positive + false negative)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to precision
 |      :rtype: Dict[str, float]
 |
 |  recall(self, gold) -> dict[str, float]
 |      Compute the recall for each tag from ``gold`` or from running ``tag``
 |      on the tokenized sentences from ``gold``. Then, return the dictionary
 |      with mappings from tag to recall. The recall is defined as:
 |
 |      - *r* = true positive / (true positive + false positive)
 |
 |      :param gold: The list of tagged sentences to score the tagger on.
 |      :type gold: list(list(tuple(str, str)))
 |      :return: A mapping from tags to recall
 |      :rtype: Dict[str, float]
 |
 |  tag_sents(self, sentences)
 |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
 |
 |          return [self.tag(sent) for sent in sentences]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tag.api.TaggerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.UnsortedChartParser
Python Library Documentation: class UnsortedChartParser in module nltk.parse.pchart

class UnsortedChartParser(BottomUpProbabilisticChartParser)
 |  UnsortedChartParser(grammar, beam_size=0, trace=0)
 |
 |  A bottom-up parser for ``PCFG`` grammars that tries edges in whatever order.
 |
 |  Method resolution order:
 |      UnsortedChartParser
 |      BottomUpProbabilisticChartParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  sort_queue(self, queue, chart)
 |      Sort the given queue of ``Edge`` objects, placing the edge that should
 |      be tried first at the beginning of the queue.  This method
 |      will be called after each ``Edge`` is added to the queue.
 |
 |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
 |          this queue is an edge that could be added to the chart by
 |          the fundamental rule; but that has not yet been added.
 |      :type queue: list(Edge)
 |      :param chart: The chart being used to parse the text.  This
 |          chart can be used to provide extra information for sorting
 |          the queue.
 |      :type chart: Chart
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from BottomUpProbabilisticChartParser:
 |
 |  __init__(self, grammar, beam_size=0, trace=0)
 |      Create a new ``BottomUpProbabilisticChartParser``, that uses
 |      ``grammar`` to parse texts.
 |
 |      :type grammar: PCFG
 |      :param grammar: The grammar used to parse texts.
 |      :type beam_size: int
 |      :param beam_size: The maximum length for the parser's edge queue.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.Valuation
Python Library Documentation: class Valuation in module nltk.sem.evaluate

class Valuation(builtins.dict)
 |  Valuation(xs)
 |
 |  A dictionary which represents a model-theoretic Valuation of non-logical constants.
 |  Keys are strings representing the constants to be interpreted, and values correspond
 |  to individuals (represented as strings) and n-ary relations (represented as sets of tuples
 |  of strings).
 |
 |  An instance of ``Valuation`` will raise a KeyError exception (i.e.,
 |  just behave like a standard  dictionary) if indexed with an expression that
 |  is not in its list of symbols.
 |
 |  Method resolution order:
 |      Valuation
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __getitem__(self, key)
 |      Return self[key].
 |
 |  __init__(self, xs)
 |      :param xs: a list of (symbol, value) pairs.
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  fromstring(s)
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  domain
 |      Set-theoretic domain of the value-space of a Valuation.
 |
 |  symbols
 |      The non-logical constants which the Valuation recognizes.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.Variable
Python Library Documentation: class Variable in module nltk.sem.logic

class Variable(builtins.object)
 |  Variable(name)
 |
 |  Methods defined here:
 |
 |  __eq__(self, other)
 |      Return self==value.
 |
 |  __ge__(self, other) from functools
 |      Return a >= b.  Computed by @total_ordering from (not a < b).
 |
 |  __gt__(self, other) from functools
 |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
 |
 |  __hash__(self)
 |      Return hash(self).
 |
 |  __init__(self, name)
 |      :param name: the name of the variable
 |
 |  __le__(self, other) from functools
 |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
 |
 |  __lt__(self, other)
 |      Return self<value.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  substitute_bindings(self, bindings)
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.ViterbiParser
Python Library Documentation: class ViterbiParser in module nltk.parse.viterbi

class ViterbiParser(nltk.parse.api.ParserI)
 |  ViterbiParser(grammar, trace=0)
 |
 |  A bottom-up ``PCFG`` parser that uses dynamic programming to find
 |  the single most likely parse for a text.  The ``ViterbiParser`` parser
 |  parses texts by filling in a "most likely constituent table".
 |  This table records the most probable tree representation for any
 |  given span and node value.  In particular, it has an entry for
 |  every start index, end index, and node value, recording the most
 |  likely subtree that spans from the start index to the end index,
 |  and has the given node value.
 |
 |  The ``ViterbiParser`` parser fills in this table incrementally.  It starts
 |  by filling in all entries for constituents that span one element
 |  of text (i.e., entries where the end index is one greater than the
 |  start index).  After it has filled in all table entries for
 |  constituents that span one element of text, it fills in the
 |  entries for constitutants that span two elements of text.  It
 |  continues filling in the entries for constituents spanning larger
 |  and larger portions of the text, until the entire table has been
 |  filled.  Finally, it returns the table entry for a constituent
 |  spanning the entire text, whose node value is the grammar's start
 |  symbol.
 |
 |  In order to find the most likely constituent with a given span and
 |  node value, the ``ViterbiParser`` parser considers all productions that
 |  could produce that node value.  For each production, it finds all
 |  children that collectively cover the span and have the node values
 |  specified by the production's right hand side.  If the probability
 |  of the tree formed by applying the production to the children is
 |  greater than the probability of the current entry in the table,
 |  then the table is updated with this new tree.
 |
 |  A pseudo-code description of the algorithm used by
 |  ``ViterbiParser`` is:
 |
 |  | Create an empty most likely constituent table, *MLC*.
 |  | For width in 1...len(text):
 |  |   For start in 1...len(text)-width:
 |  |     For prod in grammar.productions:
 |  |       For each sequence of subtrees [t[1], t[2], ..., t[n]] in MLC,
 |  |         where t[i].label()==prod.rhs[i],
 |  |         and the sequence covers [start:start+width]:
 |  |           old_p = MLC[start, start+width, prod.lhs]
 |  |           new_p = P(t[1])P(t[1])...P(t[n])P(prod)
 |  |           if new_p > old_p:
 |  |             new_tree = Tree(prod.lhs, t[1], t[2], ..., t[n])
 |  |             MLC[start, start+width, prod.lhs] = new_tree
 |  | Return MLC[0, len(text), start_symbol]
 |
 |  :type _grammar: PCFG
 |  :ivar _grammar: The grammar used to parse sentences.
 |  :type _trace: int
 |  :ivar _trace: The level of tracing output that should be generated
 |      when parsing a text.
 |
 |  Method resolution order:
 |      ViterbiParser
 |      nltk.parse.api.ParserI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, grammar, trace=0)
 |      Create a new ``ViterbiParser`` parser, that uses ``grammar`` to
 |      parse texts.
 |
 |      :type grammar: PCFG
 |      :param grammar: The grammar used to parse texts.
 |      :type trace: int
 |      :param trace: The level of tracing that should be used when
 |          parsing a text.  ``0`` will generate no tracing output;
 |          and higher numbers will produce more verbose tracing
 |          output.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  grammar(self)
 |      :return: The grammar used by this parser.
 |
 |  parse(self, tokens)
 |      :return: An iterator that generates parse trees for the sentence.
 |          When possible this list is sorted from most likely to least likely.
 |
 |      :param sent: The sentence to be parsed
 |      :type sent: list(str)
 |      :rtype: iter(Tree)
 |
 |  trace(self, trace=2)
 |      Set the level of tracing output that should be generated when
 |      parsing a text.
 |
 |      :type trace: int
 |      :param trace: The trace level.  A trace level of ``0`` will
 |          generate no tracing output; and higher trace levels will
 |          produce more verbose tracing output.
 |      :rtype: None
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.parse.api.ParserI:
 |
 |  parse_all(self, sent, *args, **kwargs)
 |      :rtype: list(Tree)
 |
 |  parse_one(self, sent, *args, **kwargs)
 |      :rtype: Tree or None
 |
 |  parse_sents(self, sents, *args, **kwargs)
 |      Apply ``self.parse()`` to each element of ``sents``.
 |      :rtype: iter(iter(Tree))
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.parse.api.ParserI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.WekaClassifier
Python Library Documentation: class WekaClassifier in module nltk.classify.weka

class WekaClassifier(nltk.classify.api.ClassifierI)
 |  WekaClassifier(formatter, model_filename)
 |
 |  Method resolution order:
 |      WekaClassifier
 |      nltk.classify.api.ClassifierI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, formatter, model_filename)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  classify_many(self, featuresets)
 |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.classify(fs) for fs in featuresets]
 |
 |      :rtype: list(label)
 |
 |  parse_weka_distribution(self, s)
 |
 |  parse_weka_output(self, lines)
 |
 |  prob_classify_many(self, featuresets)
 |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
 |
 |          return [self.prob_classify(fs) for fs in featuresets]
 |
 |      :rtype: list(ProbDistI)
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  train(model_filename, featuresets, classifier='naivebayes', options=[], quiet=True)
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.classify.api.ClassifierI:
 |
 |  classify(self, featureset)
 |      :return: the most appropriate label for the given featureset.
 |      :rtype: label
 |
 |  labels(self)
 |      :return: the list of category labels used by this classifier.
 |      :rtype: list of (immutable)
 |
 |  prob_classify(self, featureset)
 |      :return: a probability distribution over labels for the given
 |          featureset.
 |      :rtype: ProbDistI
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.classify.api.ClassifierI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.WhitespaceTokenizer
Python Library Documentation: class WhitespaceTokenizer in module nltk.tokenize.regexp

class WhitespaceTokenizer(RegexpTokenizer)
 |  Tokenize a string on whitespace (space, tab, newline).
 |  In general, users should use the string ``split()`` method instead.
 |
 |      >>> from nltk.tokenize import WhitespaceTokenizer
 |      >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
 |      >>> WhitespaceTokenizer().tokenize(s) # doctest: +NORMALIZE_WHITESPACE
 |      ['Good', 'muffins', 'cost', '$3.88', 'in', 'New', 'York.',
 |      'Please', 'buy', 'me', 'two', 'of', 'them.', 'Thanks.']
 |
 |  Method resolution order:
 |      WhitespaceTokenizer
 |      RegexpTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from RegexpTokenizer:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  span_tokenize(self, text)
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  tokenize(self, text)
 |      Return a tokenized copy of *s*.
 |
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.WittenBellProbDist
Python Library Documentation: class WittenBellProbDist in module nltk.probability

class WittenBellProbDist(ProbDistI)
 |  WittenBellProbDist(freqdist, bins=None)
 |
 |  The Witten-Bell estimate of a probability distribution. This distribution
 |  allocates uniform probability mass to as yet unseen events by using the
 |  number of events that have only been seen once. The probability mass
 |  reserved for unseen events is equal to *T / (N + T)*
 |  where *T* is the number of observed event types and *N* is the total
 |  number of observed events. This equates to the maximum likelihood estimate
 |  of a new type event occurring. The remaining probability mass is discounted
 |  such that all probability estimates sum to one, yielding:
 |
 |      - *p = T / Z (N + T)*, if count = 0
 |      - *p = c / (N + T)*, otherwise
 |
 |  Method resolution order:
 |      WittenBellProbDist
 |      ProbDistI
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, freqdist, bins=None)
 |      Creates a distribution of Witten-Bell probability estimates.  This
 |      distribution allocates uniform probability mass to as yet unseen
 |      events by using the number of events that have only been seen once. The
 |      probability mass reserved for unseen events is equal to *T / (N + T)*
 |      where *T* is the number of observed event types and *N* is the total
 |      number of observed events. This equates to the maximum likelihood
 |      estimate of a new type event occurring. The remaining probability mass
 |      is discounted such that all probability estimates sum to one,
 |      yielding:
 |
 |          - *p = T / Z (N + T)*, if count = 0
 |          - *p = c / (N + T)*, otherwise
 |
 |      The parameters *T* and *N* are taken from the ``freqdist`` parameter
 |      (the ``B()`` and ``N()`` values). The normalizing factor *Z* is
 |      calculated using these values along with the ``bins`` parameter.
 |
 |      :param freqdist: The frequency counts upon which to base the
 |          estimation.
 |      :type freqdist: FreqDist
 |      :param bins: The number of possible event types. This must be at least
 |          as large as the number of bins in the ``freqdist``. If None, then
 |          it's assumed to be equal to that of the ``freqdist``
 |      :type bins: int
 |
 |  __repr__(self)
 |      Return a string representation of this ``ProbDist``.
 |
 |      :rtype: str
 |
 |  discount(self)
 |      Return the ratio by which counts are discounted on average: c*/c
 |
 |      :rtype: float
 |
 |  freqdist(self)
 |
 |  max(self)
 |      Return the sample with the greatest probability.  If two or
 |      more samples have the same probability, return one of them;
 |      which sample is returned is undefined.
 |
 |      :rtype: any
 |
 |  prob(self, sample)
 |      Return the probability for a given sample.  Probabilities
 |      are always real numbers in the range [0, 1].
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  samples(self)
 |      Return a list of all samples that have nonzero probabilities.
 |      Use ``prob`` to find the probability of each sample.
 |
 |      :rtype: list
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from ProbDistI:
 |
 |  generate(self)
 |      Return a randomly selected sample from this probability distribution.
 |      The probability of returning each sample ``samp`` is equal to
 |      ``self.prob(samp)``.
 |
 |  logprob(self, sample)
 |      Return the base 2 logarithm of the probability for a given sample.
 |
 |      :param sample: The sample whose probability
 |             should be returned.
 |      :type sample: any
 |      :rtype: float
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from ProbDistI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from ProbDistI:
 |
 |  SUM_TO_ONE = True
nltk.WordNetLemmatizer
Python Library Documentation: class WordNetLemmatizer in module nltk.stem.wordnet

class WordNetLemmatizer(builtins.object)
 |  WordNet Lemmatizer
 |
 |  Provides 3 lemmatizer modes: _morphy(), morphy() and lemmatize().
 |
 |  lemmatize() is a permissive wrapper around _morphy().
 |  It returns the shortest lemma found in WordNet,
 |  or the input string unchanged if nothing is found.
 |
 |  >>> from nltk.stem import WordNetLemmatizer as wnl
 |  >>> print(wnl().lemmatize('us', 'n'))
 |  u
 |
 |  >>> print(wnl().lemmatize('Anythinggoeszxcv'))
 |  Anythinggoeszxcv
 |
 |  Methods defined here:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  lemmatize(self, word: str, pos: str = 'n') -> str
 |      Lemmatize `word` by picking the shortest of the possible lemmas,
 |      using the wordnet corpus reader's built-in _morphy function.
 |      Returns the input word unchanged if it cannot be found in WordNet.
 |
 |      >>> from nltk.stem import WordNetLemmatizer as wnl
 |      >>> print(wnl().lemmatize('dogs'))
 |      dog
 |      >>> print(wnl().lemmatize('churches'))
 |      church
 |      >>> print(wnl().lemmatize('aardwolves'))
 |      aardwolf
 |      >>> print(wnl().lemmatize('abaci'))
 |      abacus
 |      >>> print(wnl().lemmatize('hardrock'))
 |      hardrock
 |
 |      :param word: The input word to lemmatize.
 |      :type word: str
 |      :param pos: The Part Of Speech tag. Valid options are `"n"` for nouns,
 |          `"v"` for verbs, `"a"` for adjectives, `"r"` for adverbs and `"s"`
 |          for satellite adjectives.
 |      :type pos: str
 |      :return: The shortest lemma of `word`, for the given `pos`.
 |
 |  morphy(self, form, pos=None, check_exceptions=True)
 |      morphy() is a restrictive wrapper around _morphy().
 |      It returns the first lemma found in WordNet,
 |      or None if no lemma is found.
 |
 |      >>> from nltk.stem import WordNetLemmatizer as wnl
 |      >>> print(wnl().morphy('us', 'n'))
 |      us
 |
 |      >>> print(wnl().morphy('catss'))
 |      None
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.WordPunctTokenizer
Python Library Documentation: class WordPunctTokenizer in module nltk.tokenize.regexp

class WordPunctTokenizer(RegexpTokenizer)
 |  Tokenize a text into a sequence of alphabetic and
 |  non-alphabetic characters, using the regexp ``\w+|[^\w\s]+``.
 |
 |      >>> from nltk.tokenize import WordPunctTokenizer
 |      >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
 |      >>> WordPunctTokenizer().tokenize(s) # doctest: +NORMALIZE_WHITESPACE
 |      ['Good', 'muffins', 'cost', '$', '3', '.', '88', 'in', 'New', 'York',
 |      '.', 'Please', 'buy', 'me', 'two', 'of', 'them', '.', 'Thanks', '.']
 |
 |  Method resolution order:
 |      WordPunctTokenizer
 |      RegexpTokenizer
 |      nltk.tokenize.api.TokenizerI
 |      abc.ABC
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __abstractmethods__ = frozenset()
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from RegexpTokenizer:
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  span_tokenize(self, text)
 |      Identify the tokens using integer offsets ``(start_i, end_i)``,
 |      where ``s[start_i:end_i]`` is the corresponding token.
 |
 |      :rtype: Iterator[Tuple[int, int]]
 |
 |  tokenize(self, text)
 |      Return a tokenized copy of *s*.
 |
 |      :rtype: List[str]
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from nltk.tokenize.api.TokenizerI:
 |
 |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
 |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.span_tokenize(s) for s in strings]
 |
 |      :yield: List[Tuple[int, int]]
 |
 |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
 |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
 |
 |          return [self.tokenize(s) for s in strings]
 |
 |      :rtype: List[List[str]]
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.accuracy
Python Library Documentation: function accuracy in module nltk.metrics.scores

accuracy(reference, test)
    Given a list of reference values and a corresponding list of test
    values, return the fraction of corresponding values that are
    equal.  In particular, return the fraction of indices
    ``0<i<=len(test)`` such that ``test[i] == reference[i]``.

    :type reference: list
    :param reference: An ordered list of reference values.
    :type test: list
    :param test: A list of values to compare against the corresponding
        reference values.
    :raise ValueError: If ``reference`` and ``length`` do not have the
        same length.
nltk.acyclic_branches_depth_first
Python Library Documentation: function acyclic_branches_depth_first in module nltk.util

acyclic_branches_depth_first(tree, children=<built-in function iter>, depth=-1, cut_mark=None, traversed=None, verbose=False)
    :param tree: the tree root
    :param children: a function taking as argument a tree node
    :param depth: the maximum depth of the search
    :param cut_mark: the mark to add when cycles are truncated
    :param traversed: the set of traversed nodes
    :param verbose: to print warnings when cycles are discarded
    :return: the tree in depth-first order

        Adapted from acyclic_depth_first() above, to
    traverse the nodes of a tree in depth-first order,
    discarding eventual cycles within the same branch,
    but keep duplicate paths in different branches.
    Add cut_mark (when defined) if cycles were truncated.

    The first argument should be the tree root;
    children should be a function taking as argument a tree node
    and returning an iterator of the node's children.

    Catches only only cycles within the same branch,
    but keeping cycles from different branches:

    >>> import nltk
    >>> from nltk.util import acyclic_branches_depth_first as tree
    >>> wn=nltk.corpus.wordnet
    >>> from pprint import pprint
    >>> pprint(tree(wn.synset('certified.a.01'), lambda s:sorted(s.also_sees()), cut_mark='...', depth=4))
    [Synset('certified.a.01'),
     [Synset('authorized.a.01'),
      [Synset('lawful.a.01'),
       [Synset('legal.a.01'),
        "Cycle(Synset('lawful.a.01'),0,...)",
        [Synset('legitimate.a.01'), '...']],
       [Synset('straight.a.06'),
        [Synset('honest.a.01'), '...'],
        "Cycle(Synset('lawful.a.01'),0,...)"]],
      [Synset('legitimate.a.01'),
       "Cycle(Synset('authorized.a.01'),1,...)",
       [Synset('legal.a.01'),
        [Synset('lawful.a.01'), '...'],
        "Cycle(Synset('legitimate.a.01'),0,...)"],
       [Synset('valid.a.01'),
        "Cycle(Synset('legitimate.a.01'),0,...)",
        [Synset('reasonable.a.01'), '...']]],
      [Synset('official.a.01'), "Cycle(Synset('authorized.a.01'),1,...)"]],
     [Synset('documented.a.01')]]
nltk.acyclic_breadth_first
Python Library Documentation: function acyclic_breadth_first in module nltk.util

acyclic_breadth_first(tree, children=<built-in function iter>, maxdepth=-1, verbose=False)
    :param tree: the tree root
    :param children: a function taking as argument a tree node
    :param maxdepth: to limit the search depth
    :param verbose: to print warnings when cycles are discarded
    :return: the tree in breadth-first order

        Adapted from breadth_first() above, to discard cycles.
    Traverse the nodes of a tree in breadth-first order,
    discarding eventual cycles.

    The first argument should be the tree root;
    children should be a function taking as argument a tree node
    and returning an iterator of the node's children.
nltk.acyclic_depth_first
Python Library Documentation: function acyclic_depth_first in module nltk.util

acyclic_depth_first(tree, children=<built-in function iter>, depth=-1, cut_mark=None, traversed=None, verbose=False)
    :param tree: the tree root
    :param children: a function taking as argument a tree node
    :param depth: the maximum depth of the search
    :param cut_mark: the mark to add when cycles are truncated
    :param traversed: the set of traversed nodes
    :param verbose: to print warnings when cycles are discarded
    :return: the tree in depth-first order

    Traverse the nodes of a tree in depth-first order,
    discarding eventual cycles within any branch,
    adding cut_mark (when specified) if cycles were truncated.
    The first argument should be the tree root;
    children should be a function taking as argument a tree node
    and returning an iterator of the node's children.

    Catches all cycles:

    >>> import nltk
    >>> from nltk.util import acyclic_depth_first as acyclic_tree
    >>> wn=nltk.corpus.wordnet
    >>> from pprint import pprint
    >>> pprint(acyclic_tree(wn.synset('dog.n.01'), lambda s:sorted(s.hypernyms()),cut_mark='...'))
    [Synset('dog.n.01'),
     [Synset('canine.n.02'),
      [Synset('carnivore.n.01'),
       [Synset('placental.n.01'),
        [Synset('mammal.n.01'),
         [Synset('vertebrate.n.01'),
          [Synset('chordate.n.01'),
           [Synset('animal.n.01'),
            [Synset('organism.n.01'),
             [Synset('living_thing.n.01'),
              [Synset('whole.n.02'),
               [Synset('object.n.01'),
                [Synset('physical_entity.n.01'),
                 [Synset('entity.n.01')]]]]]]]]]]]]],
     [Synset('domestic_animal.n.01'), "Cycle(Synset('animal.n.01'),-3,...)"]]
nltk.acyclic_dic2tree
Python Library Documentation: function acyclic_dic2tree in module nltk.util

acyclic_dic2tree(node, dic)
    :param node: the root node
    :param dic: the dictionary of children

    Convert acyclic dictionary 'dic', where the keys are nodes, and the
    values are lists of children, to output tree suitable for pprint(),
    starting at root 'node', with subtrees as nested lists.
nltk.add_logs
Python Library Documentation: function add_logs in module nltk.probability

add_logs(logx, logy)
    Given two numbers ``logx`` = *log(x)* and ``logy`` = *log(y)*, return
    *log(x+y)*.  Conceptually, this is the same as returning
    ``log(2**(logx)+2**(logy))``, but the actual implementation
    avoids overflow errors that could result from direct computation.
nltk.agreement
Python Library Documentation: module nltk.metrics.agreement in nltk.metrics

NAME
    nltk.metrics.agreement

DESCRIPTION
    Implementations of inter-annotator agreement coefficients surveyed by Artstein
    and Poesio (2007), Inter-Coder Agreement for Computational Linguistics.

    An agreement coefficient calculates the amount that annotators agreed on label
    assignments beyond what is expected by chance.

    In defining the AnnotationTask class, we use naming conventions similar to the
    paper's terminology.  There are three types of objects in an annotation task:

        the coders (variables "c" and "C")
        the items to be annotated (variables "i" and "I")
        the potential categories to be assigned (variables "k" and "K")

    Additionally, it is often the case that we don't want to treat two different
    labels as complete disagreement, and so the AnnotationTask constructor can also
    take a distance metric as a final argument.  Distance metrics are simply
    functions that take two arguments, and return a value between 0.0 and 1.0
    indicating the distance between them.  If not supplied, the default is binary
    comparison between the arguments.

    The simplest way to initialize an AnnotationTask is with a list of triples,
    each containing a coder's assignment for one object in the task:

        task = AnnotationTask(data=[('c1', '1', 'v1'),('c2', '1', 'v1'),...])

    Note that the data list needs to contain the same number of triples for each
    individual coder, containing category values for the same set of items.

    Alpha (Krippendorff 1980)
    Kappa (Cohen 1960)
    S (Bennet, Albert and Goldstein 1954)
    Pi (Scott 1955)


    TODO: Describe handling of multiple coders and missing data

    Expected results from the Artstein and Poesio survey paper:

        >>> from nltk.metrics.agreement import AnnotationTask
        >>> import os.path
        >>> t = AnnotationTask(data=[x.split() for x in open(os.path.join(os.path.dirname(__file__), "artstein_poesio_example.txt"))])
        >>> t.avg_Ao()
        0.88
        >>> round(t.pi(), 5)
        0.79953
        >>> round(t.S(), 2)
        0.82

        This would have returned a wrong value (0.0) in @785fb79 as coders are in
        the wrong order. Subsequently, all values for pi(), S(), and kappa() would
        have been wrong as they are computed with avg_Ao().
        >>> t2 = AnnotationTask(data=[('b','1','stat'),('a','1','stat')])
        >>> t2.avg_Ao()
        1.0

        The following, of course, also works.
        >>> t3 = AnnotationTask(data=[('a','1','othr'),('b','1','othr')])
        >>> t3.avg_Ao()
        1.0

CLASSES
    builtins.object
        AnnotationTask

    class AnnotationTask(builtins.object)
     |  AnnotationTask(data=None, distance=<function binary_distance at 0x0000028F85576AC0>)
     |
     |  Represents an annotation task, i.e. people assign labels to items.
     |
     |  Notation tries to match notation in Artstein and Poesio (2007).
     |
     |  In general, coders and items can be represented as any hashable object.
     |  Integers, for example, are fine, though strings are more readable.
     |  Labels must support the distance functions applied to them, so e.g.
     |  a string-edit-distance makes no sense if your labels are integers,
     |  whereas interval distance needs numeric values.  A notable case of this
     |  is the MASI metric, which requires Python sets.
     |
     |  Methods defined here:
     |
     |  Ae_kappa(self, cA, cB)
     |
     |  Ao(self, cA, cB)
     |      Observed agreement between two coders on all items.
     |
     |  Disagreement(self, label_freqs)
     |
     |  Do_Kw(self, max_distance=1.0)
     |      Averaged over all labelers
     |
     |  Do_Kw_pairwise(self, cA, cB, max_distance=1.0)
     |      The observed disagreement for the weighted kappa coefficient.
     |
     |  N(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      Implements the "n-notation" used in Artstein and Poesio (2007)
     |
     |      @deprecated: Use Nk, Nik or Nck instead
     |
     |  Nck(self, c, k)
     |
     |  Nik(self, i, k)
     |
     |  Nk(self, k)
     |
     |  S(self)
     |      Bennett, Albert and Goldstein 1954
     |
     |  __init__(self, data=None, distance=<function binary_distance at 0x0000028F85576AC0>)
     |      Initialize an annotation task.
     |
     |      The data argument can be None (to create an empty annotation task) or a sequence of 3-tuples,
     |      each representing a coder's labeling of an item:
     |      ``(coder,item,label)``
     |
     |      The distance argument is a function taking two arguments (labels) and producing a numerical distance.
     |      The distance from a label to itself should be zero:
     |      ``distance(l,l) = 0``
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  agr(self, cA, cB, i, data=None)
     |      Agreement between two coders on a given item
     |
     |  alpha(self)
     |      Krippendorff 1980
     |
     |  avg_Ao(self)
     |      Average observed agreement across all coders and items.
     |
     |  kappa(self)
     |      Cohen 1960
     |      Averages naively over kappas for each coder pair.
     |
     |  kappa_pairwise(self, cA, cB)
     |
     |  load_array(self, array)
     |      Load an sequence of annotation results, appending to any data already loaded.
     |
     |      The argument is a sequence of 3-tuples, each representing a coder's labeling of an item:
     |          (coder,item,label)
     |
     |  multi_kappa(self)
     |      Davies and Fleiss 1982
     |      Averages over observed and expected agreements for each coder pair.
     |
     |  pi(self)
     |      Scott 1955; here, multi-pi.
     |      Equivalent to K from Siegel and Castellan (1988).
     |
     |  weighted_kappa(self, max_distance=1.0)
     |      Cohen 1968
     |
     |  weighted_kappa_pairwise(self, cA, cB, max_distance=1.0)
     |      Cohen 1968
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    log = <Logger nltk.metrics.agreement (WARNING)>

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\metrics\agreement.py

nltk.align
Python Library Documentation: function align in module nltk.metrics.aline

align(str1, str2, epsilon=0)
    Compute the alignment of two phonetic strings.

    :param str str1: First string to be aligned
    :param str str2: Second string to be aligned

    :type epsilon: float (0.0 to 1.0)
    :param epsilon: Adjusts threshold similarity score for near-optimal alignments

    :rtype: list(list(tuple(str, str)))
    :return: Alignment(s) of str1 and str2

    (Kondrak 2002: 51)
nltk.alignment_error_rate
Python Library Documentation: function alignment_error_rate in module nltk.translate.metrics

alignment_error_rate(reference, hypothesis, possible=None)
    Return the Alignment Error Rate (AER) of an alignment
    with respect to a "gold standard" reference alignment.
    Return an error rate between 0.0 (perfect alignment) and 1.0 (no
    alignment).

        >>> from nltk.translate import Alignment
        >>> ref = Alignment([(0, 0), (1, 1), (2, 2)])
        >>> test = Alignment([(0, 0), (1, 2), (2, 1)])
        >>> alignment_error_rate(ref, test) # doctest: +ELLIPSIS
        0.6666666666666667

    :type reference: Alignment
    :param reference: A gold standard alignment (sure alignments)
    :type hypothesis: Alignment
    :param hypothesis: A hypothesis alignment (aka. candidate alignments)
    :type possible: Alignment or None
    :param possible: A gold standard reference of possible alignments
        (defaults to *reference* if None)
    :rtype: float or None
nltk.aline
Python Library Documentation: module nltk.metrics.aline in nltk.metrics

NAME
    nltk.metrics.aline

DESCRIPTION
    ALINE
    https://webdocs.cs.ualberta.ca/~kondrak/
    Copyright 2002 by Grzegorz Kondrak.

    ALINE is an algorithm for aligning phonetic sequences, described in [1].
    This module is a port of Kondrak's (2002) ALINE. It provides functions for
    phonetic sequence alignment and similarity analysis. These are useful in
    historical linguistics, sociolinguistics and synchronic phonology.

    ALINE has parameters that can be tuned for desired output. These parameters are:
    - C_skip, C_sub, C_exp, C_vwl
    - Salience weights
    - Segmental features

    In this implementation, some parameters have been changed from their default
    values as described in [1], in order to replicate published results. All changes
    are noted in comments.

    Example usage
    -------------

    # Get optimal alignment of two phonetic sequences

    >>> align('θin', 'tenwis') # doctest: +SKIP
    [[('θ', 't'), ('i', 'e'), ('n', 'n'), ('-', 'w'), ('-', 'i'), ('-', 's')]]

    [1] G. Kondrak. Algorithms for Language Reconstruction. PhD dissertation,
    University of Toronto.

FUNCTIONS
    R(p, q)
        Return relevant features for segment comparison.

        (Kondrak 2002: 54)

    V(p)
        Return vowel weight if P is vowel.

        (Kondrak 2002: 54)

    align(str1, str2, epsilon=0)
        Compute the alignment of two phonetic strings.

        :param str str1: First string to be aligned
        :param str str2: Second string to be aligned

        :type epsilon: float (0.0 to 1.0)
        :param epsilon: Adjusts threshold similarity score for near-optimal alignments

        :rtype: list(list(tuple(str, str)))
        :return: Alignment(s) of str1 and str2

        (Kondrak 2002: 51)

    delta(p, q)
        Return weighted sum of difference between P and Q.

        (Kondrak 2002: 54)

    demo()
        A demonstration of the result of aligning phonetic sequences
        used in Kondrak's (2002) dissertation.

    diff(p, q, f)
        Returns difference between phonetic segments P and Q for feature F.

        (Kondrak 2002: 52, 54)

    sigma_exp(p, q)
        Returns score of an expansion/compression.

        (Kondrak 2002: 54)

    sigma_skip(p)
        Returns score of an indel of P.

        (Kondrak 2002: 54)

    sigma_sub(p, q)
        Returns score of a substitution of P with Q.

        (Kondrak 2002: 54)

DATA
    C_exp = 45
    C_skip = -10
    C_sub = 35
    C_vwl = 5
    R_c = ['aspirated', 'lateral', 'manner', 'nasal', 'place', 'retroflex'...
    R_v = ['back', 'lateral', 'long', 'manner', 'nasal', 'place', 'retrofl...
    cognate_data = 'jo,ʒə\ntu,ty\nnosotros,nu\nkjen,ki\nke,kwa\ntodos,tu\n...
    consonants = ['B', 'N', 'R', 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', '...
    feature_matrix = {'A': {'aspirated': 'minus', 'back': 'front', 'high':...
    inf = inf
    salience = {'aspirated': 5, 'back': 2, 'high': 3, 'lateral': 10, 'long...
    similarity_matrix = {'affricate': 0.9, 'alveolar': 0.85, 'approximant'...
    vowels = ['A', 'E', 'I', 'O', 'U', 'a', 'e', 'e̞', 'i', 'o', 'o̞', 'u'...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\metrics\aline.py

nltk.api
Python Library Documentation: module nltk.stem.api in nltk.stem

NAME
    nltk.stem.api

DESCRIPTION
    # Natural Language Toolkit: Stemmer Interface
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Trevor Cohn <tacohn@cs.mu.oz.au>
    #         Edward Loper <edloper@gmail.com>
    #         Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.object
        StemmerI

    class StemmerI(builtins.object)
     |  A processing interface for removing morphological affixes from
     |  words.  This process is known as stemming.
     |
     |  Methods defined here:
     |
     |  stem(self, token)
     |      Strip affixes from the token and return the stem.
     |
     |      :param token: The token that should be stemmed.
     |      :type token: str
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset({'stem'})

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\api.py

nltk.app
Python Library Documentation: LazyModule in nltk object

nltk.app = class LazyModule(builtins.object)
 |  nltk.app(name, locals, globals=None)
 |
 |  Lazy module class.
 |
 |  Lazy modules are imported into the given namespaces whenever a
 |  non-special attribute (there are some attributes like __doc__
 |  that class instances handle without calling __getattr__) is
 |  requested. The module is then registered under the given name
 |  in locals usually replacing the import wrapper instance. The
 |  import itself is done using globals as global namespace.
 |
 |  Example of creating a lazy load module:
 |
 |  ISO = LazyModule('ISO',locals(),globals())
 |
 |  Later, requesting an attribute from ISO will load the module
 |  automatically into the locals() namespace, overriding the
 |  LazyModule instance:
 |
 |  t = ISO.Week(1998,1,1)
 |
 |  Methods defined here:
 |
 |  __getattr__(self, name)
 |      Import the module on demand and get the attribute.
 |
 |  __init__(self, name, locals, globals=None)
 |      Create a LazyModule instance wrapping module name.
 |
 |      The module will later on be registered in locals under the
 |      given module name.
 |
 |      globals is optional and defaults to locals.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __setattr__(self, name, value)
 |      Import the module on demand and set the attribute.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.apply_features
Python Library Documentation: function apply_features in module nltk.classify.util

apply_features(feature_func, toks, labeled=None)
    Use the ``LazyMap`` class to construct a lazy list-like
    object that is analogous to ``map(feature_func, toks)``.  In
    particular, if ``labeled=False``, then the returned list-like
    object's values are equal to::

        [feature_func(tok) for tok in toks]

    If ``labeled=True``, then the returned list-like object's values
    are equal to::

        [(feature_func(tok), label) for (tok, label) in toks]

    The primary purpose of this function is to avoid the memory
    overhead involved in storing all the featuresets for every token
    in a corpus.  Instead, these featuresets are constructed lazily,
    as-needed.  The reduction in memory overhead can be especially
    significant when the underlying list of tokens is itself lazy (as
    is the case with many corpus readers).

    :param feature_func: The function that will be applied to each
        token.  It should return a featureset -- i.e., a dict
        mapping feature names to feature values.
    :param toks: The list of tokens to which ``feature_func`` should be
        applied.  If ``labeled=True``, then the list elements will be
        passed directly to ``feature_func()``.  If ``labeled=False``,
        then the list elements should be tuples ``(tok,label)``, and
        ``tok`` will be passed to ``feature_func()``.
    :param labeled: If true, then ``toks`` contains labeled tokens --
        i.e., tuples of the form ``(tok, label)``.  (Default:
        auto-detect based on types.)
nltk.approxrand
Python Library Documentation: function approxrand in module nltk.metrics.scores

approxrand(a, b, **kwargs)
    Returns an approximate significance level between two lists of
    independently generated test values.

    Approximate randomization calculates significance by randomly drawing
    from a sample of the possible permutations. At the limit of the number
    of possible permutations, the significance level is exact. The
    approximate significance level is the sample mean number of times the
    statistic of the permutated lists varies from the actual statistic of
    the unpermuted argument lists.

    :return: a tuple containing an approximate significance level, the count
             of the number of times the pseudo-statistic varied from the
             actual statistic, and the number of shuffles
    :rtype: tuple
    :param a: a list of test values
    :type a: list
    :param b: another list of independently generated test values
    :type b: list
nltk.arity
Python Library Documentation: function arity in module nltk.sem.evaluate

arity(rel)
    Check the arity of a relation.
    :type rel: set of tuples
    :rtype: int of tuple of str
nltk.arlstem
Python Library Documentation: module nltk.stem.arlstem in nltk.stem

NAME
    nltk.stem.arlstem

DESCRIPTION
    ARLSTem Arabic Stemmer
    The details about the implementation of this algorithm are described in:
    K. Abainia, S. Ouamour and H. Sayoud, A Novel Robust Arabic Light Stemmer ,
    Journal of Experimental & Theoretical Artificial Intelligence (JETAI'17),
    Vol. 29, No. 3, 2017, pp. 557-573.
    The ARLSTem is a light Arabic stemmer that is based on removing the affixes
    from the word (i.e. prefixes, suffixes and infixes). It was evaluated and
    compared to several other stemmers using Paice's parameters (under-stemming
    index, over-stemming index and stemming weight), and the results showed that
    ARLSTem is promising and producing high performances. This stemmer is not
    based on any dictionary and can be used on-line effectively.

CLASSES
    nltk.stem.api.StemmerI(builtins.object)
        ARLSTem

    class ARLSTem(nltk.stem.api.StemmerI)
     |  ARLSTem stemmer : a light Arabic Stemming algorithm without any dictionary.
     |  Department of Telecommunication & Information Processing. USTHB University,
     |  Algiers, Algeria.
     |  ARLSTem.stem(token) returns the Arabic stem for the input token.
     |  The ARLSTem Stemmer requires that all tokens are encoded using Unicode
     |  encoding.
     |
     |  Method resolution order:
     |      ARLSTem
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  fem2masc(self, token)
     |      transform the word from the feminine form to the masculine form.
     |
     |  norm(self, token)
     |      normalize the word by removing diacritics, replacing hamzated Alif
     |      with Alif replacing AlifMaqsura with Yaa and removing Waaw at the
     |      beginning.
     |
     |  plur2sing(self, token)
     |      transform the word from the plural form to the singular form.
     |
     |  pref(self, token)
     |      remove prefixes from the words' beginning.
     |
     |  stem(self, token)
     |      call this function to get the word's stem based on ARLSTem .
     |
     |  suff(self, token)
     |      remove suffixes from the word's end.
     |
     |  verb(self, token)
     |      stem the verb prefixes and suffixes or both
     |
     |  verb_t1(self, token)
     |      stem the present prefixes and suffixes
     |
     |  verb_t2(self, token)
     |      stem the future prefixes and suffixes
     |
     |  verb_t3(self, token)
     |      stem the present suffixes
     |
     |  verb_t4(self, token)
     |      stem the present prefixes
     |
     |  verb_t5(self, token)
     |      stem the future prefixes
     |
     |  verb_t6(self, token)
     |      stem the order prefixes
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\arlstem.py

nltk.arlstem2
Python Library Documentation: module nltk.stem.arlstem2 in nltk.stem

NAME
    nltk.stem.arlstem2

DESCRIPTION
    ARLSTem2 Arabic Light Stemmer
    The details about the implementation of this algorithm are described in:
    K. Abainia and H. Rebbani, Comparing the Effectiveness of the Improved ARLSTem
    Algorithm with Existing Arabic Light Stemmers, International Conference on
    Theoretical and Applicative Aspects of Computer Science (ICTAACS'19), Skikda,
    Algeria, December 15-16, 2019.
    ARLSTem2 is an Arabic light stemmer based on removing the affixes from
    the words (i.e. prefixes, suffixes and infixes). It is an improvement
    of the previous Arabic light stemmer (ARLSTem). The new version was compared to
    the original algorithm and several existing Arabic light stemmers, where the
    results showed that the new version considerably improves the under-stemming
    errors that are common to light stemmers. Both ARLSTem and ARLSTem2 can be run
    online and do not use any dictionary.

CLASSES
    nltk.stem.api.StemmerI(builtins.object)
        ARLSTem2

    class ARLSTem2(nltk.stem.api.StemmerI)
     |  Return a stemmed Arabic word after removing affixes. This an improved
     |  version of the previous algorithm, which reduces under-stemming errors.
     |  Typically used in Arabic search engine, information retrieval and NLP.
     |
     |      >>> from nltk.stem import arlstem2
     |      >>> stemmer = ARLSTem2()
     |      >>> word = stemmer.stem('يعمل')
     |      >>> print(word)
     |      عمل
     |
     |  :param token: The input Arabic word (unicode) to be stemmed
     |  :type token: unicode
     |  :return: A unicode Arabic word
     |
     |  Method resolution order:
     |      ARLSTem2
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  adjective(self, token)
     |      remove the infixes from adjectives
     |
     |  fem2masc(self, token)
     |      transform the word from the feminine form to the masculine form.
     |
     |  norm(self, token)
     |      normalize the word by removing diacritics, replace hamzated Alif
     |      with Alif bare, replace AlifMaqsura with Yaa and remove Waaw at the
     |      beginning.
     |
     |  plur2sing(self, token)
     |      transform the word from the plural form to the singular form.
     |
     |  pref(self, token)
     |      remove prefixes from the words' beginning.
     |
     |  stem(self, token)
     |      Strip affixes from the token and return the stem.
     |
     |      :param token: The token that should be stemmed.
     |      :type token: str
     |
     |  stem1(self, token)
     |      call this function to get the first stem
     |
     |  suff(self, token)
     |      remove the suffixes from the word's ending.
     |
     |  verb(self, token)
     |      stem the verb prefixes and suffixes or both
     |
     |  verb_t1(self, token)
     |      stem the present tense co-occurred prefixes and suffixes
     |
     |  verb_t2(self, token)
     |      stem the future tense co-occurred prefixes and suffixes
     |
     |  verb_t3(self, token)
     |      stem the present tense suffixes
     |
     |  verb_t4(self, token)
     |      stem the present tense prefixes
     |
     |  verb_t5(self, token)
     |      stem the future tense prefixes
     |
     |  verb_t6(self, token)
     |      stem the imperative tense prefixes
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\arlstem2.py

nltk.association
Python Library Documentation: module nltk.metrics.association in nltk.metrics

NAME
    nltk.metrics.association

DESCRIPTION
    Provides scoring functions for a number of association measures through a
    generic, abstract implementation in ``NgramAssocMeasures``, and n-specific
    ``BigramAssocMeasures`` and ``TrigramAssocMeasures``.

CLASSES
    builtins.object
        ContingencyMeasures
        NgramAssocMeasures
            BigramAssocMeasures
            QuadgramAssocMeasures
            TrigramAssocMeasures

    class BigramAssocMeasures(NgramAssocMeasures)
     |  A collection of bigram association measures. Each association measure
     |  is provided as a function with three arguments::
     |
     |      bigram_score_fn(n_ii, (n_ix, n_xi), n_xx)
     |
     |  The arguments constitute the marginals of a contingency table, counting
     |  the occurrences of particular events in a corpus. The letter i in the
     |  suffix refers to the appearance of the word in question, while x indicates
     |  the appearance of any word. Thus, for example:
     |
     |  - n_ii counts ``(w1, w2)``, i.e. the bigram being scored
     |  - n_ix counts ``(w1, *)``
     |  - n_xi counts ``(*, w2)``
     |  - n_xx counts ``(*, *)``, i.e. any bigram
     |
     |  This may be shown with respect to a contingency table::
     |
     |              w1    ~w1
     |           ------ ------
     |       w2 | n_ii | n_oi | = n_xi
     |           ------ ------
     |      ~w2 | n_io | n_oo |
     |           ------ ------
     |           = n_ix        TOTAL = n_xx
     |
     |  Method resolution order:
     |      BigramAssocMeasures
     |      NgramAssocMeasures
     |      builtins.object
     |
     |  Class methods defined here:
     |
     |  chi_sq(n_ii, n_ix_xi_tuple, n_xx)
     |      Scores bigrams using chi-square, i.e. phi-sq multiplied by the number
     |      of bigrams, as in Manning and Schutze 5.3.3.
     |
     |  fisher(*marginals)
     |      Scores bigrams using Fisher's Exact Test (Pedersen 1996).  Less
     |      sensitive to small counts than PMI or Chi Sq, but also more expensive
     |      to compute. Requires scipy.
     |
     |  phi_sq(*marginals)
     |      Scores bigrams using phi-square, the square of the Pearson correlation
     |      coefficient.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  dice(n_ii, n_ix_xi_tuple, n_xx)
     |      Scores bigrams using Dice's coefficient.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from NgramAssocMeasures:
     |
     |  jaccard(*marginals)
     |      Scores ngrams using the Jaccard index.
     |
     |  likelihood_ratio(*marginals)
     |      Scores ngrams using likelihood ratios as in Manning and Schutze 5.3.4.
     |
     |  pmi(*marginals)
     |      Scores ngrams by pointwise mutual information, as in Manning and
     |      Schutze 5.4.
     |
     |  poisson_stirling(*marginals)
     |      Scores ngrams using the Poisson-Stirling measure.
     |
     |  student_t(*marginals)
     |      Scores ngrams using Student's t test with independence hypothesis
     |      for unigrams, as in Manning and Schutze 5.3.1.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from NgramAssocMeasures:
     |
     |  mi_like(*marginals, **kwargs)
     |      Scores ngrams using a variant of mutual information. The keyword
     |      argument power sets an exponent (default 3) for the numerator. No
     |      logarithm of the result is calculated.
     |
     |  raw_freq(*marginals)
     |      Scores ngrams by their frequency
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from NgramAssocMeasures:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ContingencyMeasures(builtins.object)
     |  ContingencyMeasures(measures)
     |
     |  Wraps NgramAssocMeasures classes such that the arguments of association
     |  measures are contingency table values rather than marginals.
     |
     |  Methods defined here:
     |
     |  __init__(self, measures)
     |      Constructs a ContingencyMeasures given a NgramAssocMeasures class
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class NgramAssocMeasures(builtins.object)
     |  An abstract class defining a collection of generic association measures.
     |  Each public method returns a score, taking the following arguments::
     |
     |      score_fn(count_of_ngram,
     |               (count_of_n-1gram_1, ..., count_of_n-1gram_j),
     |               (count_of_n-2gram_1, ..., count_of_n-2gram_k),
     |               ...,
     |               (count_of_1gram_1, ..., count_of_1gram_n),
     |               count_of_total_words)
     |
     |  See ``BigramAssocMeasures`` and ``TrigramAssocMeasures``
     |
     |  Inheriting classes should define a property _n, and a method _contingency
     |  which calculates contingency values from marginals in order for all
     |  association measures defined here to be usable.
     |
     |  Class methods defined here:
     |
     |  chi_sq(*marginals)
     |      Scores ngrams using Pearson's chi-square as in Manning and Schutze
     |      5.3.3.
     |
     |  jaccard(*marginals)
     |      Scores ngrams using the Jaccard index.
     |
     |  likelihood_ratio(*marginals)
     |      Scores ngrams using likelihood ratios as in Manning and Schutze 5.3.4.
     |
     |  pmi(*marginals)
     |      Scores ngrams by pointwise mutual information, as in Manning and
     |      Schutze 5.4.
     |
     |  poisson_stirling(*marginals)
     |      Scores ngrams using the Poisson-Stirling measure.
     |
     |  student_t(*marginals)
     |      Scores ngrams using Student's t test with independence hypothesis
     |      for unigrams, as in Manning and Schutze 5.3.1.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  mi_like(*marginals, **kwargs)
     |      Scores ngrams using a variant of mutual information. The keyword
     |      argument power sets an exponent (default 3) for the numerator. No
     |      logarithm of the result is calculated.
     |
     |  raw_freq(*marginals)
     |      Scores ngrams by their frequency
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset({'_contingency', '_marginals'})

    class QuadgramAssocMeasures(NgramAssocMeasures)
     |  A collection of quadgram association measures. Each association measure
     |  is provided as a function with five arguments::
     |
     |      trigram_score_fn(n_iiii,
     |                      (n_iiix, n_iixi, n_ixii, n_xiii),
     |                      (n_iixx, n_ixix, n_ixxi, n_xixi, n_xxii, n_xiix),
     |                      (n_ixxx, n_xixx, n_xxix, n_xxxi),
     |                      n_all)
     |
     |  The arguments constitute the marginals of a contingency table, counting
     |  the occurrences of particular events in a corpus. The letter i in the
     |  suffix refers to the appearance of the word in question, while x indicates
     |  the appearance of any word. Thus, for example:
     |
     |  - n_iiii counts ``(w1, w2, w3, w4)``, i.e. the quadgram being scored
     |  - n_ixxi counts ``(w1, *, *, w4)``
     |  - n_xxxx counts ``(*, *, *, *)``, i.e. any quadgram
     |
     |  Method resolution order:
     |      QuadgramAssocMeasures
     |      NgramAssocMeasures
     |      builtins.object
     |
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from NgramAssocMeasures:
     |
     |  chi_sq(*marginals)
     |      Scores ngrams using Pearson's chi-square as in Manning and Schutze
     |      5.3.3.
     |
     |  jaccard(*marginals)
     |      Scores ngrams using the Jaccard index.
     |
     |  likelihood_ratio(*marginals)
     |      Scores ngrams using likelihood ratios as in Manning and Schutze 5.3.4.
     |
     |  pmi(*marginals)
     |      Scores ngrams by pointwise mutual information, as in Manning and
     |      Schutze 5.4.
     |
     |  poisson_stirling(*marginals)
     |      Scores ngrams using the Poisson-Stirling measure.
     |
     |  student_t(*marginals)
     |      Scores ngrams using Student's t test with independence hypothesis
     |      for unigrams, as in Manning and Schutze 5.3.1.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from NgramAssocMeasures:
     |
     |  mi_like(*marginals, **kwargs)
     |      Scores ngrams using a variant of mutual information. The keyword
     |      argument power sets an exponent (default 3) for the numerator. No
     |      logarithm of the result is calculated.
     |
     |  raw_freq(*marginals)
     |      Scores ngrams by their frequency
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from NgramAssocMeasures:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TrigramAssocMeasures(NgramAssocMeasures)
     |  A collection of trigram association measures. Each association measure
     |  is provided as a function with four arguments::
     |
     |      trigram_score_fn(n_iii,
     |                       (n_iix, n_ixi, n_xii),
     |                       (n_ixx, n_xix, n_xxi),
     |                       n_xxx)
     |
     |  The arguments constitute the marginals of a contingency table, counting
     |  the occurrences of particular events in a corpus. The letter i in the
     |  suffix refers to the appearance of the word in question, while x indicates
     |  the appearance of any word. Thus, for example:
     |
     |  - n_iii counts ``(w1, w2, w3)``, i.e. the trigram being scored
     |  - n_ixx counts ``(w1, *, *)``
     |  - n_xxx counts ``(*, *, *)``, i.e. any trigram
     |
     |  Method resolution order:
     |      TrigramAssocMeasures
     |      NgramAssocMeasures
     |      builtins.object
     |
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from NgramAssocMeasures:
     |
     |  chi_sq(*marginals)
     |      Scores ngrams using Pearson's chi-square as in Manning and Schutze
     |      5.3.3.
     |
     |  jaccard(*marginals)
     |      Scores ngrams using the Jaccard index.
     |
     |  likelihood_ratio(*marginals)
     |      Scores ngrams using likelihood ratios as in Manning and Schutze 5.3.4.
     |
     |  pmi(*marginals)
     |      Scores ngrams by pointwise mutual information, as in Manning and
     |      Schutze 5.4.
     |
     |  poisson_stirling(*marginals)
     |      Scores ngrams using the Poisson-Stirling measure.
     |
     |  student_t(*marginals)
     |      Scores ngrams using Student's t test with independence hypothesis
     |      for unigrams, as in Manning and Schutze 5.3.1.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from NgramAssocMeasures:
     |
     |  mi_like(*marginals, **kwargs)
     |      Scores ngrams using a variant of mutual information. The keyword
     |      argument power sets an exponent (default 3) for the numerator. No
     |      logarithm of the result is calculated.
     |
     |  raw_freq(*marginals)
     |      Scores ngrams by their frequency
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from NgramAssocMeasures:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

DATA
    NGRAM = 0
    TOTAL = -1
    UNIGRAMS = -2

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\metrics\association.py

nltk.bigrams
Python Library Documentation: function bigrams in module nltk.util

bigrams(sequence, **kwargs)
    Return the bigrams generated from a sequence of items, as an iterator.
    For example:

        >>> from nltk.util import bigrams
        >>> list(bigrams([1,2,3,4,5]))
        [(1, 2), (2, 3), (3, 4), (4, 5)]

    Use bigrams for a list version of this function.

    :param sequence: the source data to be converted into bigrams
    :type sequence: sequence or iter
    :rtype: iter(tuple)
nltk.binary_distance
Python Library Documentation: function binary_distance in module nltk.metrics.distance

binary_distance(label1, label2)
    Simple equality test.

    0.0 if the labels are identical, 1.0 if they are different.

    >>> from nltk.metrics import binary_distance
    >>> binary_distance(1,1)
    0.0

    >>> binary_distance(1,3)
    1.0
nltk.binary_search_file
Python Library Documentation: function binary_search_file in module nltk.util

binary_search_file(file, key, cache=None, cacheDepth=-1)
    Return the line from the file with first word key.
    Searches through a sorted file using the binary search algorithm.

    :type file: file
    :param file: the file to be searched through.
    :type key: str
    :param key: the identifier we are searching for.
nltk.binding_ops
Python Library Documentation: function binding_ops in module nltk.sem.logic

binding_ops()
    Binding operators
nltk.bisect
Python Library Documentation: module bisect

NAME
    bisect - Bisection algorithms.

MODULE REFERENCE
    https://docs.python.org/3.12/library/bisect.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

FUNCTIONS
    bisect = bisect_right(a, x, lo=0, hi=None, *, key=None)
        Return the index where to insert item x in list a, assuming a is sorted.

        The return value i is such that all e in a[:i] have e <= x, and all e in
        a[i:] have e > x.  So if x already appears in the list, a.insert(i, x) will
        insert just after the rightmost x already there.

        Optional args lo (default 0) and hi (default len(a)) bound the
        slice of a to be searched.

        A custom key function can be supplied to customize the sort order.

    bisect_left(a, x, lo=0, hi=None, *, key=None)
        Return the index where to insert item x in list a, assuming a is sorted.

        The return value i is such that all e in a[:i] have e < x, and all e in
        a[i:] have e >= x.  So if x already appears in the list, a.insert(i, x) will
        insert just before the leftmost x already there.

        Optional args lo (default 0) and hi (default len(a)) bound the
        slice of a to be searched.

        A custom key function can be supplied to customize the sort order.

    bisect_right(a, x, lo=0, hi=None, *, key=None)
        Return the index where to insert item x in list a, assuming a is sorted.

        The return value i is such that all e in a[:i] have e <= x, and all e in
        a[i:] have e > x.  So if x already appears in the list, a.insert(i, x) will
        insert just after the rightmost x already there.

        Optional args lo (default 0) and hi (default len(a)) bound the
        slice of a to be searched.

        A custom key function can be supplied to customize the sort order.

    insort = insort_right(a, x, lo=0, hi=None, *, key=None)
        Insert item x in list a, and keep it sorted assuming a is sorted.

        If x is already in a, insert it to the right of the rightmost x.

        Optional args lo (default 0) and hi (default len(a)) bound the
        slice of a to be searched.

        A custom key function can be supplied to customize the sort order.

    insort_left(a, x, lo=0, hi=None, *, key=None)
        Insert item x in list a, and keep it sorted assuming a is sorted.

        If x is already in a, insert it to the left of the leftmost x.

        Optional args lo (default 0) and hi (default len(a)) bound the
        slice of a to be searched.

        A custom key function can be supplied to customize the sort order.

    insort_right(a, x, lo=0, hi=None, *, key=None)
        Insert item x in list a, and keep it sorted assuming a is sorted.

        If x is already in a, insert it to the right of the rightmost x.

        Optional args lo (default 0) and hi (default len(a)) bound the
        slice of a to be searched.

        A custom key function can be supplied to customize the sort order.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\bisect.py

nltk.blankline_tokenize
Python Library Documentation: method tokenize in module nltk.tokenize.regexp

tokenize(text) method of nltk.tokenize.regexp.BlanklineTokenizer instance
    Return a tokenized copy of *s*.

    :rtype: List[str]
nltk.bleu
Python Library Documentation: function sentence_bleu in module nltk.translate.bleu_score

sentence_bleu(references, hypothesis, weights=(0.25, 0.25, 0.25, 0.25), smoothing_function=None, auto_reweigh=False)
    Calculate BLEU score (Bilingual Evaluation Understudy) from
    Papineni, Kishore, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002.
    "BLEU: a method for automatic evaluation of machine translation."
    In Proceedings of ACL. https://www.aclweb.org/anthology/P02-1040.pdf

    >>> hypothesis1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which',
    ...               'ensures', 'that', 'the', 'military', 'always',
    ...               'obeys', 'the', 'commands', 'of', 'the', 'party']

    >>> hypothesis2 = ['It', 'is', 'to', 'insure', 'the', 'troops',
    ...               'forever', 'hearing', 'the', 'activity', 'guidebook',
    ...               'that', 'party', 'direct']

    >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that',
    ...               'ensures', 'that', 'the', 'military', 'will', 'forever',
    ...               'heed', 'Party', 'commands']

    >>> reference2 = ['It', 'is', 'the', 'guiding', 'principle', 'which',
    ...               'guarantees', 'the', 'military', 'forces', 'always',
    ...               'being', 'under', 'the', 'command', 'of', 'the',
    ...               'Party']

    >>> reference3 = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the',
    ...               'army', 'always', 'to', 'heed', 'the', 'directions',
    ...               'of', 'the', 'party']

    >>> sentence_bleu([reference1, reference2, reference3], hypothesis1) # doctest: +ELLIPSIS
    0.5045...

    If there is no ngrams overlap for any order of n-grams, BLEU returns the
    value 0. This is because the precision for the order of n-grams without
    overlap is 0, and the geometric mean in the final BLEU score computation
    multiplies the 0 with the precision of other n-grams. This results in 0
    (independently of the precision of the other n-gram orders). The following
    example has zero 3-gram and 4-gram overlaps:

    >>> round(sentence_bleu([reference1, reference2, reference3], hypothesis2),4) # doctest: +ELLIPSIS
    0.0

    To avoid this harsh behaviour when no ngram overlaps are found a smoothing
    function can be used.

    >>> chencherry = SmoothingFunction()
    >>> sentence_bleu([reference1, reference2, reference3], hypothesis2,
    ...     smoothing_function=chencherry.method1) # doctest: +ELLIPSIS
    0.0370...

    The default BLEU calculates a score for up to 4-grams using uniform
    weights (this is called BLEU-4). To evaluate your translations with
    higher/lower order ngrams, use customized weights. E.g. when accounting
    for up to 5-grams with uniform weights (this is called BLEU-5) use:

    >>> weights = (1./5., 1./5., 1./5., 1./5., 1./5.)
    >>> sentence_bleu([reference1, reference2, reference3], hypothesis1, weights) # doctest: +ELLIPSIS
    0.3920...

    Multiple BLEU scores can be computed at once, by supplying a list of weights.
    E.g. for computing BLEU-2, BLEU-3 *and* BLEU-4 in one computation, use:
    >>> weights = [
    ...     (1./2., 1./2.),
    ...     (1./3., 1./3., 1./3.),
    ...     (1./4., 1./4., 1./4., 1./4.)
    ... ]
    >>> sentence_bleu([reference1, reference2, reference3], hypothesis1, weights) # doctest: +ELLIPSIS
    [0.7453..., 0.6240..., 0.5045...]

    :param references: reference sentences
    :type references: list(list(str))
    :param hypothesis: a hypothesis sentence
    :type hypothesis: list(str)
    :param weights: weights for unigrams, bigrams, trigrams and so on (one or a list of weights)
    :type weights: tuple(float) / list(tuple(float))
    :param smoothing_function:
    :type smoothing_function: SmoothingFunction
    :param auto_reweigh: Option to re-normalize the weights uniformly.
    :type auto_reweigh: bool
    :return: The sentence-level BLEU score. Returns a list if multiple weights were supplied.
    :rtype: float / list(float)
nltk.bleu_score
Python Library Documentation: module nltk.translate.bleu_score in nltk.translate

NAME
    nltk.translate.bleu_score - BLEU score implementation.

CLASSES
    builtins.object
        SmoothingFunction
    fractions.Fraction(numbers.Rational)
        Fraction

    class Fraction(fractions.Fraction)
     |  Fraction(numerator=0, denominator=None, _normalize=False)
     |
     |  Fraction with _normalize=False support for 3.12
     |
     |  Method resolution order:
     |      Fraction
     |      fractions.Fraction
     |      numbers.Rational
     |      numbers.Real
     |      numbers.Complex
     |      numbers.Number
     |      builtins.object
     |
     |  Static methods defined here:
     |
     |  __new__(cls, numerator=0, denominator=None, _normalize=False)
     |      Constructs a Rational.
     |
     |      Takes a string like '3/2' or '1.5', another Rational instance, a
     |      numerator/denominator pair, or a float.
     |
     |      Examples
     |      --------
     |
     |      >>> Fraction(10, -8)
     |      Fraction(-5, 4)
     |      >>> Fraction(Fraction(1, 7), 5)
     |      Fraction(1, 35)
     |      >>> Fraction(Fraction(1, 7), Fraction(2, 3))
     |      Fraction(3, 14)
     |      >>> Fraction('314')
     |      Fraction(314, 1)
     |      >>> Fraction('-35/4')
     |      Fraction(-35, 4)
     |      >>> Fraction('3.1415') # conversion from numeric string
     |      Fraction(6283, 2000)
     |      >>> Fraction('-47e-2') # string may include a decimal exponent
     |      Fraction(-47, 100)
     |      >>> Fraction(1.47)  # direct construction from float (exact conversion)
     |      Fraction(6620291452234629, 4503599627370496)
     |      >>> Fraction(2.25)
     |      Fraction(9, 4)
     |      >>> Fraction(Decimal('1.47'))
     |      Fraction(147, 100)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  denominator
     |
     |  numerator
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from fractions.Fraction:
     |
     |  __abs__(a)
     |      abs(a)
     |
     |  __add__(a, b) from fractions.Fraction._operator_fallbacks.<locals>
     |      a + b
     |
     |  __bool__(a)
     |      a != 0
     |
     |  __ceil__(a)
     |      math.ceil(a)
     |
     |  __copy__(self)
     |
     |  __deepcopy__(self, memo)
     |
     |  __divmod__(a, b) from fractions.Fraction._operator_fallbacks.<locals>
     |      (a // b, a % b)
     |
     |  __eq__(a, b)
     |      a == b
     |
     |  __floor__(a)
     |      math.floor(a)
     |
     |  __floordiv__(a, b) from fractions.Fraction._operator_fallbacks.<locals>
     |      a // b
     |
     |  __format__(self, format_spec, /)
     |      Format this fraction according to the given format specification.
     |
     |  __ge__(a, b)
     |      a >= b
     |
     |  __gt__(a, b)
     |      a > b
     |
     |  __hash__(self)
     |      hash(self)
     |
     |  __int__(a, _index=<built-in function index>)
     |      int(a)
     |
     |  __le__(a, b)
     |      a <= b
     |
     |  __lt__(a, b)
     |      a < b
     |
     |  __mod__(a, b) from fractions.Fraction._operator_fallbacks.<locals>
     |      a % b
     |
     |  __mul__(a, b) from fractions.Fraction._operator_fallbacks.<locals>
     |      a * b
     |
     |  __neg__(a)
     |      -a
     |
     |  __pos__(a)
     |      +a: Coerces a subclass instance to Fraction
     |
     |  __pow__(a, b)
     |      a ** b
     |
     |      If b is not an integer, the result will be a float or complex
     |      since roots are generally irrational. If b is an integer, the
     |      result will be rational.
     |
     |  __radd__(b, a) from fractions.Fraction._operator_fallbacks.<locals>
     |      a + b
     |
     |  __rdivmod__(b, a) from fractions.Fraction._operator_fallbacks.<locals>
     |      (a // b, a % b)
     |
     |  __reduce__(self)
     |      Helper for pickle.
     |
     |  __repr__(self)
     |      repr(self)
     |
     |  __rfloordiv__(b, a) from fractions.Fraction._operator_fallbacks.<locals>
     |      a // b
     |
     |  __rmod__(b, a) from fractions.Fraction._operator_fallbacks.<locals>
     |      a % b
     |
     |  __rmul__(b, a) from fractions.Fraction._operator_fallbacks.<locals>
     |      a * b
     |
     |  __round__(self, ndigits=None)
     |      round(self, ndigits)
     |
     |      Rounds half toward even.
     |
     |  __rpow__(b, a)
     |      a ** b
     |
     |  __rsub__(b, a) from fractions.Fraction._operator_fallbacks.<locals>
     |      a - b
     |
     |  __rtruediv__(b, a) from fractions.Fraction._operator_fallbacks.<locals>
     |      a / b
     |
     |  __str__(self)
     |      str(self)
     |
     |  __sub__(a, b) from fractions.Fraction._operator_fallbacks.<locals>
     |      a - b
     |
     |  __truediv__(a, b) from fractions.Fraction._operator_fallbacks.<locals>
     |      a / b
     |
     |  __trunc__(a)
     |      math.trunc(a)
     |
     |  as_integer_ratio(self)
     |      Return a pair of integers, whose ratio is equal to the original Fraction.
     |
     |      The ratio is in lowest terms and has a positive denominator.
     |
     |  is_integer(self)
     |      Return True if the Fraction is an integer.
     |
     |  limit_denominator(self, max_denominator=1000000)
     |      Closest Fraction to self with denominator at most max_denominator.
     |
     |      >>> Fraction('3.141592653589793').limit_denominator(10)
     |      Fraction(22, 7)
     |      >>> Fraction('3.141592653589793').limit_denominator(100)
     |      Fraction(311, 99)
     |      >>> Fraction(4321, 8765).limit_denominator(10000)
     |      Fraction(4321, 8765)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from fractions.Fraction:
     |
     |  from_decimal(dec)
     |      Converts a finite Decimal instance to a rational number, exactly.
     |
     |  from_float(f)
     |      Converts a finite float to a rational number, exactly.
     |
     |      Beware that Fraction.from_float(0.3) != Fraction(3, 10).
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from numbers.Rational:
     |
     |  __float__(self)
     |      float(self) = self.numerator / self.denominator
     |
     |      It's important that this conversion use the integer's "true"
     |      division rather than casting one side to float before dividing
     |      so that ratios of huge integers convert without overflowing.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from numbers.Real:
     |
     |  __complex__(self)
     |      complex(self) == complex(float(self), 0)
     |
     |  conjugate(self)
     |      Conjugate is a no-op for Reals.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from numbers.Real:
     |
     |  imag
     |      Real numbers have no imaginary component.
     |
     |  real
     |      Real numbers are their real component.

    class SmoothingFunction(builtins.object)
     |  SmoothingFunction(epsilon=0.1, alpha=5, k=5)
     |
     |  This is an implementation of the smoothing techniques
     |  for segment-level BLEU scores that was presented in
     |  Boxing Chen and Collin Cherry (2014) A Systematic Comparison of
     |  Smoothing Techniques for Sentence-Level BLEU. In WMT14.
     |  http://acl2014.org/acl2014/W14-33/pdf/W14-3346.pdf
     |
     |  Methods defined here:
     |
     |  __init__(self, epsilon=0.1, alpha=5, k=5)
     |      This will initialize the parameters required for the various smoothing
     |      techniques, the default values are set to the numbers used in the
     |      experiments from Chen and Cherry (2014).
     |
     |      >>> hypothesis1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which', 'ensures',
     |      ...                 'that', 'the', 'military', 'always', 'obeys', 'the',
     |      ...                 'commands', 'of', 'the', 'party']
     |      >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that', 'ensures',
     |      ...               'that', 'the', 'military', 'will', 'forever', 'heed',
     |      ...               'Party', 'commands']
     |
     |      >>> chencherry = SmoothingFunction()
     |      >>> print(sentence_bleu([reference1], hypothesis1)) # doctest: +ELLIPSIS
     |      0.4118...
     |      >>> print(sentence_bleu([reference1], hypothesis1, smoothing_function=chencherry.method0)) # doctest: +ELLIPSIS
     |      0.4118...
     |      >>> print(sentence_bleu([reference1], hypothesis1, smoothing_function=chencherry.method1)) # doctest: +ELLIPSIS
     |      0.4118...
     |      >>> print(sentence_bleu([reference1], hypothesis1, smoothing_function=chencherry.method2)) # doctest: +ELLIPSIS
     |      0.4452...
     |      >>> print(sentence_bleu([reference1], hypothesis1, smoothing_function=chencherry.method3)) # doctest: +ELLIPSIS
     |      0.4118...
     |      >>> print(sentence_bleu([reference1], hypothesis1, smoothing_function=chencherry.method4)) # doctest: +ELLIPSIS
     |      0.4118...
     |      >>> print(sentence_bleu([reference1], hypothesis1, smoothing_function=chencherry.method5)) # doctest: +ELLIPSIS
     |      0.4905...
     |      >>> print(sentence_bleu([reference1], hypothesis1, smoothing_function=chencherry.method6)) # doctest: +ELLIPSIS
     |      0.4135...
     |      >>> print(sentence_bleu([reference1], hypothesis1, smoothing_function=chencherry.method7)) # doctest: +ELLIPSIS
     |      0.4905...
     |
     |      :param epsilon: the epsilon value use in method 1
     |      :type epsilon: float
     |      :param alpha: the alpha value use in method 6
     |      :type alpha: int
     |      :param k: the k value use in method 4
     |      :type k: int
     |
     |  method0(self, p_n, *args, **kwargs)
     |      No smoothing.
     |
     |  method1(self, p_n, *args, **kwargs)
     |      Smoothing method 1: Add *epsilon* counts to precision with 0 counts.
     |
     |  method2(self, p_n, *args, **kwargs)
     |      Smoothing method 2: Add 1 to both numerator and denominator from
     |      Chin-Yew Lin and Franz Josef Och (2004) ORANGE: a Method for
     |      Evaluating Automatic Evaluation Metrics for Machine Translation.
     |      In COLING 2004.
     |
     |  method3(self, p_n, *args, **kwargs)
     |      Smoothing method 3: NIST geometric sequence smoothing
     |      The smoothing is computed by taking 1 / ( 2^k ), instead of 0, for each
     |      precision score whose matching n-gram count is null.
     |      k is 1 for the first 'n' value for which the n-gram match count is null/
     |
     |      For example, if the text contains:
     |
     |      - one 2-gram match
     |      - and (consequently) two 1-gram matches
     |
     |      the n-gram count for each individual precision score would be:
     |
     |      - n=1  =>  prec_count = 2     (two unigrams)
     |      - n=2  =>  prec_count = 1     (one bigram)
     |      - n=3  =>  prec_count = 1/2   (no trigram,  taking 'smoothed' value of 1 / ( 2^k ), with k=1)
     |      - n=4  =>  prec_count = 1/4   (no fourgram, taking 'smoothed' value of 1 / ( 2^k ), with k=2)
     |
     |  method4(self, p_n, references, hypothesis, hyp_len=None, *args, **kwargs)
     |      Smoothing method 4:
     |      Shorter translations may have inflated precision values due to having
     |      smaller denominators; therefore, we give them proportionally
     |      smaller smoothed counts. Instead of scaling to 1/(2^k), Chen and Cherry
     |      suggests dividing by 1/ln(len(T)), where T is the length of the translation.
     |
     |  method5(self, p_n, references, hypothesis, hyp_len=None, *args, **kwargs)
     |      Smoothing method 5:
     |      The matched counts for similar values of n should be similar. To a
     |      calculate the n-gram matched count, it averages the n−1, n and n+1 gram
     |      matched counts.
     |
     |  method6(self, p_n, references, hypothesis, hyp_len=None, *args, **kwargs)
     |      Smoothing method 6:
     |      Interpolates the maximum likelihood estimate of the precision *p_n* with
     |      a prior estimate *pi0*. The prior is estimated by assuming that the ratio
     |      between pn and pn−1 will be the same as that between pn−1 and pn−2; from
     |      Gao and He (2013) Training MRF-Based Phrase Translation Models using
     |      Gradient Ascent. In NAACL.
     |
     |  method7(self, p_n, references, hypothesis, hyp_len=None, *args, **kwargs)
     |      Smoothing method 7:
     |      Interpolates methods 4 and 5.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    brevity_penalty(closest_ref_len, hyp_len)
        Calculate brevity penalty.

        As the modified n-gram precision still has the problem from the short
        length sentence, brevity penalty is used to modify the overall BLEU
        score according to length.

        An example from the paper. There are three references with length 12, 15
        and 17. And a concise hypothesis of the length 12. The brevity penalty is 1.

        >>> reference1 = list('aaaaaaaaaaaa')      # i.e. ['a'] * 12
        >>> reference2 = list('aaaaaaaaaaaaaaa')   # i.e. ['a'] * 15
        >>> reference3 = list('aaaaaaaaaaaaaaaaa') # i.e. ['a'] * 17
        >>> hypothesis = list('aaaaaaaaaaaa')      # i.e. ['a'] * 12
        >>> references = [reference1, reference2, reference3]
        >>> hyp_len = len(hypothesis)
        >>> closest_ref_len =  closest_ref_length(references, hyp_len)
        >>> brevity_penalty(closest_ref_len, hyp_len)
        1.0

        In case a hypothesis translation is shorter than the references, penalty is
        applied.

        >>> references = [['a'] * 28, ['a'] * 28]
        >>> hypothesis = ['a'] * 12
        >>> hyp_len = len(hypothesis)
        >>> closest_ref_len =  closest_ref_length(references, hyp_len)
        >>> brevity_penalty(closest_ref_len, hyp_len)
        0.2635971381157267

        The length of the closest reference is used to compute the penalty. If the
        length of a hypothesis is 12, and the reference lengths are 13 and 2, the
        penalty is applied because the hypothesis length (12) is less then the
        closest reference length (13).

        >>> references = [['a'] * 13, ['a'] * 2]
        >>> hypothesis = ['a'] * 12
        >>> hyp_len = len(hypothesis)
        >>> closest_ref_len =  closest_ref_length(references, hyp_len)
        >>> brevity_penalty(closest_ref_len, hyp_len) # doctest: +ELLIPSIS
        0.9200...

        The brevity penalty doesn't depend on reference order. More importantly,
        when two reference sentences are at the same distance, the shortest
        reference sentence length is used.

        >>> references = [['a'] * 13, ['a'] * 11]
        >>> hypothesis = ['a'] * 12
        >>> hyp_len = len(hypothesis)
        >>> closest_ref_len =  closest_ref_length(references, hyp_len)
        >>> bp1 = brevity_penalty(closest_ref_len, hyp_len)
        >>> hyp_len = len(hypothesis)
        >>> closest_ref_len =  closest_ref_length(reversed(references), hyp_len)
        >>> bp2 = brevity_penalty(closest_ref_len, hyp_len)
        >>> bp1 == bp2 == 1
        True

        A test example from mteval-v13a.pl (starting from the line 705):

        >>> references = [['a'] * 11, ['a'] * 8]
        >>> hypothesis = ['a'] * 7
        >>> hyp_len = len(hypothesis)
        >>> closest_ref_len =  closest_ref_length(references, hyp_len)
        >>> brevity_penalty(closest_ref_len, hyp_len) # doctest: +ELLIPSIS
        0.8668...

        >>> references = [['a'] * 11, ['a'] * 8, ['a'] * 6, ['a'] * 7]
        >>> hypothesis = ['a'] * 7
        >>> hyp_len = len(hypothesis)
        >>> closest_ref_len =  closest_ref_length(references, hyp_len)
        >>> brevity_penalty(closest_ref_len, hyp_len)
        1.0

        :param hyp_len: The length of the hypothesis for a single sentence OR the
            sum of all the hypotheses' lengths for a corpus
        :type hyp_len: int
        :param closest_ref_len: The length of the closest reference for a single
            hypothesis OR the sum of all the closest references for every hypotheses.
        :type closest_ref_len: int
        :return: BLEU's brevity penalty.
        :rtype: float

    closest_ref_length(references, hyp_len)
        This function finds the reference that is the closest length to the
        hypothesis. The closest reference length is referred to as *r* variable
        from the brevity penalty formula in Papineni et. al. (2002)

        :param references: A list of reference translations.
        :type references: list(list(str))
        :param hyp_len: The length of the hypothesis.
        :type hyp_len: int
        :return: The length of the reference that's closest to the hypothesis.
        :rtype: int

    corpus_bleu(list_of_references, hypotheses, weights=(0.25, 0.25, 0.25, 0.25), smoothing_function=None, auto_reweigh=False)
        Calculate a single corpus-level BLEU score (aka. system-level BLEU) for all
        the hypotheses and their respective references.

        Instead of averaging the sentence level BLEU scores (i.e. macro-average
        precision), the original BLEU metric (Papineni et al. 2002) accounts for
        the micro-average precision (i.e. summing the numerators and denominators
        for each hypothesis-reference(s) pairs before the division).

        >>> hyp1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which',
        ...         'ensures', 'that', 'the', 'military', 'always',
        ...         'obeys', 'the', 'commands', 'of', 'the', 'party']
        >>> ref1a = ['It', 'is', 'a', 'guide', 'to', 'action', 'that',
        ...          'ensures', 'that', 'the', 'military', 'will', 'forever',
        ...          'heed', 'Party', 'commands']
        >>> ref1b = ['It', 'is', 'the', 'guiding', 'principle', 'which',
        ...          'guarantees', 'the', 'military', 'forces', 'always',
        ...          'being', 'under', 'the', 'command', 'of', 'the', 'Party']
        >>> ref1c = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the',
        ...          'army', 'always', 'to', 'heed', 'the', 'directions',
        ...          'of', 'the', 'party']

        >>> hyp2 = ['he', 'read', 'the', 'book', 'because', 'he', 'was',
        ...         'interested', 'in', 'world', 'history']
        >>> ref2a = ['he', 'was', 'interested', 'in', 'world', 'history',
        ...          'because', 'he', 'read', 'the', 'book']

        >>> list_of_references = [[ref1a, ref1b, ref1c], [ref2a]]
        >>> hypotheses = [hyp1, hyp2]
        >>> corpus_bleu(list_of_references, hypotheses) # doctest: +ELLIPSIS
        0.5920...

        The example below show that corpus_bleu() is different from averaging
        sentence_bleu() for hypotheses

        >>> score1 = sentence_bleu([ref1a, ref1b, ref1c], hyp1)
        >>> score2 = sentence_bleu([ref2a], hyp2)
        >>> (score1 + score2) / 2 # doctest: +ELLIPSIS
        0.6223...

        Custom weights may be supplied to fine-tune the BLEU score further.
        A tuple of float weights for unigrams, bigrams, trigrams and so on can be given.
        >>> weights = (0.1, 0.3, 0.5, 0.1)
        >>> corpus_bleu(list_of_references, hypotheses, weights=weights) # doctest: +ELLIPSIS
        0.5818...

        This particular weight gave extra value to trigrams.
        Furthermore, multiple weights can be given, resulting in multiple BLEU scores.
        >>> weights = [
        ...     (0.5, 0.5),
        ...     (0.333, 0.333, 0.334),
        ...     (0.25, 0.25, 0.25, 0.25),
        ...     (0.2, 0.2, 0.2, 0.2, 0.2)
        ... ]
        >>> corpus_bleu(list_of_references, hypotheses, weights=weights) # doctest: +ELLIPSIS
        [0.8242..., 0.7067..., 0.5920..., 0.4719...]

        :param list_of_references: a corpus of lists of reference sentences, w.r.t. hypotheses
        :type list_of_references: list(list(list(str)))
        :param hypotheses: a list of hypothesis sentences
        :type hypotheses: list(list(str))
        :param weights: weights for unigrams, bigrams, trigrams and so on (one or a list of weights)
        :type weights: tuple(float) / list(tuple(float))
        :param smoothing_function:
        :type smoothing_function: SmoothingFunction
        :param auto_reweigh: Option to re-normalize the weights uniformly.
        :type auto_reweigh: bool
        :return: The corpus-level BLEU score.
        :rtype: float

    modified_precision(references, hypothesis, n)
        Calculate modified ngram precision.

        The normal precision method may lead to some wrong translations with
        high-precision, e.g., the translation, in which a word of reference
        repeats several times, has very high precision.

        This function only returns the Fraction object that contains the numerator
        and denominator necessary to calculate the corpus-level precision.
        To calculate the modified precision for a single pair of hypothesis and
        references, cast the Fraction object into a float.

        The famous "the the the ... " example shows that you can get BLEU precision
        by duplicating high frequency words.

            >>> reference1 = 'the cat is on the mat'.split()
            >>> reference2 = 'there is a cat on the mat'.split()
            >>> hypothesis1 = 'the the the the the the the'.split()
            >>> references = [reference1, reference2]
            >>> float(modified_precision(references, hypothesis1, n=1)) # doctest: +ELLIPSIS
            0.2857...

        In the modified n-gram precision, a reference word will be considered
        exhausted after a matching hypothesis word is identified, e.g.

            >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that',
            ...               'ensures', 'that', 'the', 'military', 'will',
            ...               'forever', 'heed', 'Party', 'commands']
            >>> reference2 = ['It', 'is', 'the', 'guiding', 'principle', 'which',
            ...               'guarantees', 'the', 'military', 'forces', 'always',
            ...               'being', 'under', 'the', 'command', 'of', 'the',
            ...               'Party']
            >>> reference3 = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the',
            ...               'army', 'always', 'to', 'heed', 'the', 'directions',
            ...               'of', 'the', 'party']
            >>> hypothesis = 'of the'.split()
            >>> references = [reference1, reference2, reference3]
            >>> float(modified_precision(references, hypothesis, n=1))
            1.0
            >>> float(modified_precision(references, hypothesis, n=2))
            1.0

        An example of a normal machine translation hypothesis:

            >>> hypothesis1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which',
            ...               'ensures', 'that', 'the', 'military', 'always',
            ...               'obeys', 'the', 'commands', 'of', 'the', 'party']

            >>> hypothesis2 = ['It', 'is', 'to', 'insure', 'the', 'troops',
            ...               'forever', 'hearing', 'the', 'activity', 'guidebook',
            ...               'that', 'party', 'direct']

            >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that',
            ...               'ensures', 'that', 'the', 'military', 'will',
            ...               'forever', 'heed', 'Party', 'commands']

            >>> reference2 = ['It', 'is', 'the', 'guiding', 'principle', 'which',
            ...               'guarantees', 'the', 'military', 'forces', 'always',
            ...               'being', 'under', 'the', 'command', 'of', 'the',
            ...               'Party']

            >>> reference3 = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the',
            ...               'army', 'always', 'to', 'heed', 'the', 'directions',
            ...               'of', 'the', 'party']
            >>> references = [reference1, reference2, reference3]
            >>> float(modified_precision(references, hypothesis1, n=1)) # doctest: +ELLIPSIS
            0.9444...
            >>> float(modified_precision(references, hypothesis2, n=1)) # doctest: +ELLIPSIS
            0.5714...
            >>> float(modified_precision(references, hypothesis1, n=2)) # doctest: +ELLIPSIS
            0.5882352941176471
            >>> float(modified_precision(references, hypothesis2, n=2)) # doctest: +ELLIPSIS
            0.07692...


        :param references: A list of reference translations.
        :type references: list(list(str))
        :param hypothesis: A hypothesis translation.
        :type hypothesis: list(str)
        :param n: The ngram order.
        :type n: int
        :return: BLEU's modified precision for the nth order ngram.
        :rtype: Fraction

    sentence_bleu(references, hypothesis, weights=(0.25, 0.25, 0.25, 0.25), smoothing_function=None, auto_reweigh=False)
        Calculate BLEU score (Bilingual Evaluation Understudy) from
        Papineni, Kishore, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002.
        "BLEU: a method for automatic evaluation of machine translation."
        In Proceedings of ACL. https://www.aclweb.org/anthology/P02-1040.pdf

        >>> hypothesis1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which',
        ...               'ensures', 'that', 'the', 'military', 'always',
        ...               'obeys', 'the', 'commands', 'of', 'the', 'party']

        >>> hypothesis2 = ['It', 'is', 'to', 'insure', 'the', 'troops',
        ...               'forever', 'hearing', 'the', 'activity', 'guidebook',
        ...               'that', 'party', 'direct']

        >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that',
        ...               'ensures', 'that', 'the', 'military', 'will', 'forever',
        ...               'heed', 'Party', 'commands']

        >>> reference2 = ['It', 'is', 'the', 'guiding', 'principle', 'which',
        ...               'guarantees', 'the', 'military', 'forces', 'always',
        ...               'being', 'under', 'the', 'command', 'of', 'the',
        ...               'Party']

        >>> reference3 = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the',
        ...               'army', 'always', 'to', 'heed', 'the', 'directions',
        ...               'of', 'the', 'party']

        >>> sentence_bleu([reference1, reference2, reference3], hypothesis1) # doctest: +ELLIPSIS
        0.5045...

        If there is no ngrams overlap for any order of n-grams, BLEU returns the
        value 0. This is because the precision for the order of n-grams without
        overlap is 0, and the geometric mean in the final BLEU score computation
        multiplies the 0 with the precision of other n-grams. This results in 0
        (independently of the precision of the other n-gram orders). The following
        example has zero 3-gram and 4-gram overlaps:

        >>> round(sentence_bleu([reference1, reference2, reference3], hypothesis2),4) # doctest: +ELLIPSIS
        0.0

        To avoid this harsh behaviour when no ngram overlaps are found a smoothing
        function can be used.

        >>> chencherry = SmoothingFunction()
        >>> sentence_bleu([reference1, reference2, reference3], hypothesis2,
        ...     smoothing_function=chencherry.method1) # doctest: +ELLIPSIS
        0.0370...

        The default BLEU calculates a score for up to 4-grams using uniform
        weights (this is called BLEU-4). To evaluate your translations with
        higher/lower order ngrams, use customized weights. E.g. when accounting
        for up to 5-grams with uniform weights (this is called BLEU-5) use:

        >>> weights = (1./5., 1./5., 1./5., 1./5., 1./5.)
        >>> sentence_bleu([reference1, reference2, reference3], hypothesis1, weights) # doctest: +ELLIPSIS
        0.3920...

        Multiple BLEU scores can be computed at once, by supplying a list of weights.
        E.g. for computing BLEU-2, BLEU-3 *and* BLEU-4 in one computation, use:
        >>> weights = [
        ...     (1./2., 1./2.),
        ...     (1./3., 1./3., 1./3.),
        ...     (1./4., 1./4., 1./4., 1./4.)
        ... ]
        >>> sentence_bleu([reference1, reference2, reference3], hypothesis1, weights) # doctest: +ELLIPSIS
        [0.7453..., 0.6240..., 0.5045...]

        :param references: reference sentences
        :type references: list(list(str))
        :param hypothesis: a hypothesis sentence
        :type hypothesis: list(str)
        :param weights: weights for unigrams, bigrams, trigrams and so on (one or a list of weights)
        :type weights: tuple(float) / list(tuple(float))
        :param smoothing_function:
        :type smoothing_function: SmoothingFunction
        :param auto_reweigh: Option to re-normalize the weights uniformly.
        :type auto_reweigh: bool
        :return: The sentence-level BLEU score. Returns a list if multiple weights were supplied.
        :rtype: float / list(float)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\bleu_score.py

nltk.bllip
Python Library Documentation: module nltk.parse.bllip in nltk.parse

NAME
    nltk.parse.bllip

DESCRIPTION
    # Natural Language Toolkit: Interface to BLLIP Parser
    #
    # Author: David McClosky <dmcc@bigasterisk.com>
    #
    # Copyright (C) 2001-2026 NLTK Project
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.parse.api.ParserI(builtins.object)
        BllipParser

    class BllipParser(nltk.parse.api.ParserI)
     |  BllipParser(parser_model=None, reranker_features=None, reranker_weights=None, parser_options=None, reranker_options=None)
     |
     |  Interface for parsing with BLLIP Parser. BllipParser objects can be
     |  constructed with the ``BllipParser.from_unified_model_dir`` class
     |  method or manually using the ``BllipParser`` constructor.
     |
     |  Method resolution order:
     |      BllipParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, parser_model=None, reranker_features=None, reranker_weights=None, parser_options=None, reranker_options=None)
     |      Load a BLLIP Parser model from scratch. You'll typically want to
     |      use the ``from_unified_model_dir()`` class method to construct
     |      this object.
     |
     |      :param parser_model: Path to parser model directory
     |      :type parser_model: str
     |
     |      :param reranker_features: Path the reranker model's features file
     |      :type reranker_features: str
     |
     |      :param reranker_weights: Path the reranker model's weights file
     |      :type reranker_weights: str
     |
     |      :param parser_options: optional dictionary of parser options, see
     |          ``bllipparser.RerankingParser.RerankingParser.load_parser_options()``
     |          for more information.
     |      :type parser_options: dict(str)
     |
     |      :param reranker_options: optional
     |          dictionary of reranker options, see
     |          ``bllipparser.RerankingParser.RerankingParser.load_reranker_model()``
     |          for more information.
     |      :type reranker_options: dict(str)
     |
     |  parse(self, sentence)
     |      Use BLLIP Parser to parse a sentence. Takes a sentence as a list
     |      of words; it will be automatically tagged with this BLLIP Parser
     |      instance's tagger.
     |
     |      :return: An iterator that generates parse trees for the sentence
     |          from most likely to least likely.
     |
     |      :param sentence: The sentence to be parsed
     |      :type sentence: list(str)
     |      :rtype: iter(Tree)
     |
     |  tagged_parse(self, word_and_tag_pairs)
     |      Use BLLIP to parse a sentence. Takes a sentence as a list of
     |      (word, tag) tuples; the sentence must have already been tokenized
     |      and tagged. BLLIP will attempt to use the tags provided but may
     |      use others if it can't come up with a complete parse subject
     |      to those constraints. You may also specify a tag as ``None``
     |      to leave a token's tag unconstrained.
     |
     |      :return: An iterator that generates parse trees for the sentence
     |          from most likely to least likely.
     |
     |      :param sentence: Input sentence to parse as (word, tag) pairs
     |      :type sentence: list(tuple(str, str))
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  from_unified_model_dir(model_dir, parser_options=None, reranker_options=None)
     |      Create a ``BllipParser`` object from a unified parsing model
     |      directory. Unified parsing model directories are a standardized
     |      way of storing BLLIP parser and reranker models together on disk.
     |      See ``bllipparser.RerankingParser.get_unified_model_parameters()``
     |      for more information about unified model directories.
     |
     |      :return: A ``BllipParser`` object using the parser and reranker
     |          models in the model directory.
     |
     |      :param model_dir: Path to the unified model directory.
     |      :type model_dir: str
     |      :param parser_options: optional dictionary of parser options, see
     |          ``bllipparser.RerankingParser.RerankingParser.load_parser_options()``
     |          for more information.
     |      :type parser_options: dict(str)
     |      :param reranker_options: optional dictionary of reranker options, see
     |          ``bllipparser.RerankingParser.RerankingParser.load_reranker_model()``
     |          for more information.
     |      :type reranker_options: dict(str)
     |      :rtype: BllipParser
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    __all__ = ['BllipParser']

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\bllip.py

nltk.boolean_ops
Python Library Documentation: function boolean_ops in module nltk.sem.logic

boolean_ops()
    Boolean operators
nltk.boxer
Python Library Documentation: module nltk.sem.boxer in nltk.sem

NAME
    nltk.sem.boxer - An interface to Boxer.

DESCRIPTION
    This interface relies on the latest version of the development (subversion) version of
    C&C and Boxer.

    Usage
    =====

    Set the environment variable CANDC to the bin directory of your CandC installation.
    The models directory should be in the CandC root directory.
    For example::

        /path/to/candc/
        bin/
            candc
            boxer
        models/
            boxer/

CLASSES
    builtins.Exception(builtins.BaseException)
        UnparseableInputException
    builtins.object
        AbstractBoxerDrs
            BoxerDrs
            BoxerIndexed
                BoxerCard
                BoxerEq
                BoxerNamed
                BoxerOr
                BoxerPred
                BoxerProp
                BoxerRel
                BoxerWhq
            BoxerNot
        Boxer
        NltkDrtBoxerDrsInterpreter
        PassthroughBoxerDrsInterpreter
    nltk.sem.drt.DrtParser(nltk.sem.logic.LogicParser)
        BoxerDrsParser
        BoxerOutputDrsParser

    class AbstractBoxerDrs(builtins.object)
     |  Methods defined here:
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  atoms(self)
     |
     |  clean(self)
     |
     |  renumber_sentences(self, f)
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Boxer(builtins.object)
     |  Boxer(boxer_drs_interpreter=None, elimeq=False, bin_dir=None, verbose=False, resolve=True)
     |
     |  This class is an interface to Johan Bos's program Boxer, a wide-coverage
     |  semantic parser that produces Discourse Representation Structures (DRSs).
     |
     |  Methods defined here:
     |
     |  __init__(self, boxer_drs_interpreter=None, elimeq=False, bin_dir=None, verbose=False, resolve=True)
     |      :param boxer_drs_interpreter: A class that converts from the
     |          ``AbstractBoxerDrs`` object hierarchy to a different object.  The
     |          default is ``NltkDrtBoxerDrsInterpreter``, which converts to the NLTK
     |          DRT hierarchy.
     |      :param elimeq: When set to true, Boxer removes all equalities from the
     |          DRSs and discourse referents standing in the equality relation are
     |          unified, but only if this can be done in a meaning-preserving manner.
     |      :param resolve: When set to true, Boxer will resolve all anaphoric DRSs and perform merge-reduction.
     |          Resolution follows Van der Sandt's theory of binding and accommodation.
     |
     |  interpret(self, input, discourse_id=None, question=False, verbose=False)
     |      Use Boxer to give a first order representation.
     |
     |      :param input: str Input sentence to parse
     |      :param occur_index: bool Should predicates be occurrence indexed?
     |      :param discourse_id: str An identifier to be inserted to each occurrence-indexed predicate.
     |      :return: ``drt.DrtExpression``
     |
     |  interpret_multi(self, input, discourse_id=None, question=False, verbose=False)
     |      Use Boxer to give a first order representation.
     |
     |      :param input: list of str Input sentences to parse as a single discourse
     |      :param occur_index: bool Should predicates be occurrence indexed?
     |      :param discourse_id: str An identifier to be inserted to each occurrence-indexed predicate.
     |      :return: ``drt.DrtExpression``
     |
     |  interpret_multi_sents(self, inputs, discourse_ids=None, question=False, verbose=False)
     |      Use Boxer to give a first order representation.
     |
     |      :param inputs: list of list of str Input discourses to parse
     |      :param occur_index: bool Should predicates be occurrence indexed?
     |      :param discourse_ids: list of str Identifiers to be inserted to each occurrence-indexed predicate.
     |      :return: ``drt.DrtExpression``
     |
     |  interpret_sents(self, inputs, discourse_ids=None, question=False, verbose=False)
     |      Use Boxer to give a first order representation.
     |
     |      :param inputs: list of str Input sentences to parse as individual discourses
     |      :param occur_index: bool Should predicates be occurrence indexed?
     |      :param discourse_ids: list of str Identifiers to be inserted to each occurrence-indexed predicate.
     |      :return: list of ``drt.DrtExpression``
     |
     |  set_bin_dir(self, bin_dir, verbose=False)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerCard(BoxerIndexed)
     |  BoxerCard(discourse_id, sent_index, word_indices, var, value, type)
     |
     |  Method resolution order:
     |      BoxerCard
     |      BoxerIndexed
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id, sent_index, word_indices, var, value, type)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BoxerIndexed:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  atoms(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  clean(self)
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerDrs(AbstractBoxerDrs)
     |  BoxerDrs(refs, conds, consequent=None)
     |
     |  Method resolution order:
     |      BoxerDrs
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __init__(self, refs, conds, consequent=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  atoms(self)
     |
     |  clean(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerDrsParser(nltk.sem.drt.DrtParser)
     |  BoxerDrsParser(discourse_id=None)
     |
     |  Reparse the str form of subclasses of ``AbstractBoxerDrs``
     |
     |  Method resolution order:
     |      BoxerDrsParser
     |      nltk.sem.drt.DrtParser
     |      nltk.sem.logic.LogicParser
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id=None)
     |      :param type_check: should type checking be performed
     |          to their types?
     |      :type type_check: bool
     |
     |  attempt_adjuncts(self, expression, context)
     |
     |  get_all_symbols(self)
     |      This method exists to be overridden
     |
     |  get_next_token_variable(self, description)
     |
     |  handle(self, tok, context)
     |      This method is intended to be overridden for logics that
     |      use different operators or expressions
     |
     |  nullableIntToken(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.drt.DrtParser:
     |
     |  get_BooleanExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different boolean operators
     |
     |  handle_DRS(self, tok, context)
     |
     |  handle_conds(self, context)
     |
     |  handle_prop(self, tok, context)
     |
     |  handle_refs(self)
     |
     |  isvariable(self, tok)
     |
     |  make_ApplicationExpression(self, function, argument)
     |
     |  make_BooleanExpression(self, factory, first, second)
     |
     |  make_EqualityExpression(self, first, second)
     |      This method serves as a hook for other logic parsers that
     |      have different equality expression classes
     |
     |  make_LambdaExpression(self, variables, term)
     |
     |  make_NegatedExpression(self, expression)
     |
     |  make_VariableExpression(self, name)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.LogicParser:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  assertNextToken(self, expected)
     |
     |  assertToken(self, tok, expected)
     |
     |  attempt_ApplicationExpression(self, expression, context)
     |      Attempt to make an application expression.  The next tokens are
     |      a list of arguments in parens, then the argument expression is a
     |      function being applied to the arguments.  Otherwise, return the
     |      argument expression.
     |
     |  attempt_BooleanExpression(self, expression, context)
     |      Attempt to make a boolean expression.  If the next token is a boolean
     |      operator, then a BooleanExpression will be returned.  Otherwise, the
     |      parameter will be returned.
     |
     |  attempt_EqualityExpression(self, expression, context)
     |      Attempt to make an equality expression.  If the next token is an
     |      equality operator, then an EqualityExpression will be returned.
     |      Otherwise, the parameter will be returned.
     |
     |  get_QuantifiedExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different quantifiers
     |
     |  handle_lambda(self, tok, context)
     |
     |  handle_negation(self, tok, context)
     |
     |  handle_open(self, tok, context)
     |
     |  handle_quant(self, tok, context)
     |
     |  handle_variable(self, tok, context)
     |
     |  has_priority(self, operation, context)
     |
     |  inRange(self, location)
     |      Return TRUE if the given location is within the buffer
     |
     |  make_QuanifiedExpression(self, factory, variable, term)
     |
     |  parse(self, data, signature=None)
     |      Parse the expression.
     |
     |      :param data: str for the input to be parsed
     |      :param signature: ``dict<str, str>`` that maps variable names to type
     |          strings
     |      :returns: a parsed Expression
     |
     |  process(self, data)
     |      Split the data into tokens
     |
     |  process_next_expression(self, context)
     |      Parse the next complete expression from the stream and return it.
     |
     |  process_quoted_token(self, data_idx, data)
     |
     |  token(self, location=None)
     |      Get the next waiting token.  If a location is given, then
     |      return the token at currentIndex+location without advancing
     |      currentIndex; setting it gives lookahead/lookback capability.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.sem.logic.LogicParser:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.sem.logic.LogicParser:
     |
     |  MAX_PARSE_DEPTH = 200

    class BoxerEq(BoxerIndexed)
     |  BoxerEq(discourse_id, sent_index, word_indices, var1, var2)
     |
     |  Method resolution order:
     |      BoxerEq
     |      BoxerIndexed
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id, sent_index, word_indices, var1, var2)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |
     |  atoms(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BoxerIndexed:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  clean(self)
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerIndexed(AbstractBoxerDrs)
     |  BoxerIndexed(discourse_id, sent_index, word_indices)
     |
     |  Method resolution order:
     |      BoxerIndexed
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __init__(self, discourse_id, sent_index, word_indices)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  atoms(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  clean(self)
     |
     |  renumber_sentences(self, f)
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerNamed(BoxerIndexed)
     |  BoxerNamed(discourse_id, sent_index, word_indices, var, name, type, sense)
     |
     |  Method resolution order:
     |      BoxerNamed
     |      BoxerIndexed
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id, sent_index, word_indices, var, name, type, sense)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |
     |  change_var(self, var)
     |
     |  clean(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BoxerIndexed:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  atoms(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerNot(AbstractBoxerDrs)
     |  BoxerNot(drs)
     |
     |  Method resolution order:
     |      BoxerNot
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __init__(self, drs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  atoms(self)
     |
     |  clean(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerOr(BoxerIndexed)
     |  BoxerOr(discourse_id, sent_index, word_indices, drs1, drs2)
     |
     |  Method resolution order:
     |      BoxerOr
     |      BoxerIndexed
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id, sent_index, word_indices, drs1, drs2)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |
     |  atoms(self)
     |
     |  clean(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BoxerIndexed:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerOutputDrsParser(nltk.sem.drt.DrtParser)
     |  BoxerOutputDrsParser(discourse_id=None)
     |
     |  Method resolution order:
     |      BoxerOutputDrsParser
     |      nltk.sem.drt.DrtParser
     |      nltk.sem.logic.LogicParser
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id=None)
     |      This class is used to parse the Prolog DRS output from Boxer into a
     |      hierarchy of python objects.
     |
     |  attempt_adjuncts(self, expression, context)
     |
     |  get_all_symbols(self)
     |      This method exists to be overridden
     |
     |  handle(self, tok, context)
     |      This method is intended to be overridden for logics that
     |      use different operators or expressions
     |
     |  handle_condition(self, tok, indices)
     |      Handle a DRS condition
     |
     |      :param indices: list of int
     |      :return: list of ``DrtExpression``
     |
     |  handle_drs(self, tok)
     |
     |  parse(self, data, signature=None)
     |      Parse the expression.
     |
     |      :param data: str for the input to be parsed
     |      :param signature: ``dict<str, str>`` that maps variable names to type
     |          strings
     |      :returns: a parsed Expression
     |
     |  parse_condition(self, indices)
     |      Parse a DRS condition
     |
     |      :return: list of ``DrtExpression``
     |
     |  parse_drs(self)
     |
     |  parse_index(self)
     |
     |  parse_variable(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.drt.DrtParser:
     |
     |  get_BooleanExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different boolean operators
     |
     |  handle_DRS(self, tok, context)
     |
     |  handle_conds(self, context)
     |
     |  handle_prop(self, tok, context)
     |
     |  handle_refs(self)
     |
     |  isvariable(self, tok)
     |
     |  make_ApplicationExpression(self, function, argument)
     |
     |  make_BooleanExpression(self, factory, first, second)
     |
     |  make_EqualityExpression(self, first, second)
     |      This method serves as a hook for other logic parsers that
     |      have different equality expression classes
     |
     |  make_LambdaExpression(self, variables, term)
     |
     |  make_NegatedExpression(self, expression)
     |
     |  make_VariableExpression(self, name)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.LogicParser:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  assertNextToken(self, expected)
     |
     |  assertToken(self, tok, expected)
     |
     |  attempt_ApplicationExpression(self, expression, context)
     |      Attempt to make an application expression.  The next tokens are
     |      a list of arguments in parens, then the argument expression is a
     |      function being applied to the arguments.  Otherwise, return the
     |      argument expression.
     |
     |  attempt_BooleanExpression(self, expression, context)
     |      Attempt to make a boolean expression.  If the next token is a boolean
     |      operator, then a BooleanExpression will be returned.  Otherwise, the
     |      parameter will be returned.
     |
     |  attempt_EqualityExpression(self, expression, context)
     |      Attempt to make an equality expression.  If the next token is an
     |      equality operator, then an EqualityExpression will be returned.
     |      Otherwise, the parameter will be returned.
     |
     |  get_QuantifiedExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different quantifiers
     |
     |  get_next_token_variable(self, description)
     |
     |  handle_lambda(self, tok, context)
     |
     |  handle_negation(self, tok, context)
     |
     |  handle_open(self, tok, context)
     |
     |  handle_quant(self, tok, context)
     |
     |  handle_variable(self, tok, context)
     |
     |  has_priority(self, operation, context)
     |
     |  inRange(self, location)
     |      Return TRUE if the given location is within the buffer
     |
     |  make_QuanifiedExpression(self, factory, variable, term)
     |
     |  process(self, data)
     |      Split the data into tokens
     |
     |  process_next_expression(self, context)
     |      Parse the next complete expression from the stream and return it.
     |
     |  process_quoted_token(self, data_idx, data)
     |
     |  token(self, location=None)
     |      Get the next waiting token.  If a location is given, then
     |      return the token at currentIndex+location without advancing
     |      currentIndex; setting it gives lookahead/lookback capability.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.sem.logic.LogicParser:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.sem.logic.LogicParser:
     |
     |  MAX_PARSE_DEPTH = 200

    class BoxerPred(BoxerIndexed)
     |  BoxerPred(discourse_id, sent_index, word_indices, var, name, pos, sense)
     |
     |  Method resolution order:
     |      BoxerPred
     |      BoxerIndexed
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id, sent_index, word_indices, var, name, pos, sense)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |
     |  change_var(self, var)
     |
     |  clean(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BoxerIndexed:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  atoms(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerProp(BoxerIndexed)
     |  BoxerProp(discourse_id, sent_index, word_indices, var, drs)
     |
     |  Method resolution order:
     |      BoxerProp
     |      BoxerIndexed
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id, sent_index, word_indices, var, drs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |
     |  atoms(self)
     |
     |  clean(self)
     |
     |  referenced_labels(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BoxerIndexed:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerRel(BoxerIndexed)
     |  BoxerRel(discourse_id, sent_index, word_indices, var1, var2, rel, sense)
     |
     |  Method resolution order:
     |      BoxerRel
     |      BoxerIndexed
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id, sent_index, word_indices, var1, var2, rel, sense)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |
     |  clean(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BoxerIndexed:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  atoms(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoxerWhq(BoxerIndexed)
     |  BoxerWhq(discourse_id, sent_index, word_indices, ans_types, drs1, variable, drs2)
     |
     |  Method resolution order:
     |      BoxerWhq
     |      BoxerIndexed
     |      AbstractBoxerDrs
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, discourse_id, sent_index, word_indices, ans_types, drs1, variable, drs2)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |
     |  atoms(self)
     |
     |  clean(self)
     |
     |  renumber_sentences(self, f)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BoxerIndexed:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from AbstractBoxerDrs
     |      Return hash(self).
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractBoxerDrs:
     |
     |  variable_types(self)
     |
     |  variables(self)
     |      :return: (set<variables>, set<events>, set<propositions>)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractBoxerDrs:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class NltkDrtBoxerDrsInterpreter(builtins.object)
     |  NltkDrtBoxerDrsInterpreter(occur_index=False)
     |
     |  Methods defined here:
     |
     |  __init__(self, occur_index=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  interpret(self, ex)
     |      :param ex: ``AbstractBoxerDrs``
     |      :return: ``DrtExpression``
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class PassthroughBoxerDrsInterpreter(builtins.object)
     |  Methods defined here:
     |
     |  interpret(self, ex)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class UnparseableInputException(builtins.Exception)
     |  Method resolution order:
     |      UnparseableInputException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

FUNCTIONS
    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\sem\boxer.py

nltk.bracket_parse
Python Library Documentation: function bracket_parse in module nltk.tree.parsing

bracket_parse(s)
    Use Tree.read(s, remove_empty_top_bracketing=True) instead.
nltk.breadth_first
Python Library Documentation: function breadth_first in module nltk.util

breadth_first(tree, children=<built-in function iter>, maxdepth=-1)
    Traverse the nodes of a tree in breadth-first order.
    (No check for cycles.)
    The first argument should be the tree root;
    children should be a function taking as argument a tree node
    and returning an iterator of the node's children.
nltk.brill
Python Library Documentation: module nltk.tag.brill in nltk.tag

NAME
    nltk.tag.brill

DESCRIPTION
    # Natural Language Toolkit: Transformation-based learning
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Marcus Uneson <marcus.uneson@gmail.com>
    #   based on previous (nltk2) version by
    #   Christopher Maloof, Edward Loper, Steven Bird
    # URL: <https://www.nltk.org/>
    # For license information, see  LICENSE.TXT

CLASSES
    nltk.tag.api.TaggerI(builtins.object)
        BrillTagger
    nltk.tbl.feature.Feature(builtins.object)
        Pos
        Word

    class BrillTagger(nltk.tag.api.TaggerI)
     |  BrillTagger(initial_tagger, rules, training_stats=None)
     |
     |  Brill's transformational rule-based tagger.  Brill taggers use an
     |  initial tagger (such as ``tag.DefaultTagger``) to assign an initial
     |  tag sequence to a text; and then apply an ordered list of
     |  transformational rules to correct the tags of individual tokens.
     |  These transformation rules are specified by the ``TagRule``
     |  interface.
     |
     |  Brill taggers can be created directly, from an initial tagger and
     |  a list of transformational rules; but more often, Brill taggers
     |  are created by learning rules from a training corpus, using one
     |  of the TaggerTrainers available.
     |
     |  Method resolution order:
     |      BrillTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, initial_tagger, rules, training_stats=None)
     |      :param initial_tagger: The initial tagger
     |      :type initial_tagger: TaggerI
     |
     |      :param rules: An ordered list of transformation rules that
     |          should be used to correct the initial tagging.
     |      :type rules: list(TagRule)
     |
     |      :param training_stats: A dictionary of statistics collected
     |          during training, for possible later use
     |      :type training_stats: dict
     |
     |  batch_tag_incremental(self, sequences, gold)
     |      Tags by applying each rule to the entire corpus (rather than all rules to a
     |      single sequence). The point is to collect statistics on the test set for
     |      individual rules.
     |
     |      NOTE: This is inefficient (does not build any index, so will traverse the entire
     |      corpus N times for N rules) -- usually you would not care about statistics for
     |      individual rules and thus use batch_tag() instead
     |
     |      :param sequences: lists of token sequences (sentences, in some applications) to be tagged
     |      :type sequences: list of list of strings
     |      :param gold: the gold standard
     |      :type gold: list of list of strings
     |      :returns: tuple of (tagged_sequences, ordered list of rule scores (one for each rule))
     |
     |  encode_json_obj(self)
     |
     |  print_template_statistics(self, test_stats=None, printunused=True)
     |      Print a list of all templates, ranked according to efficiency.
     |
     |      If test_stats is available, the templates are ranked according to their
     |      relative contribution (summed for all rules created from a given template,
     |      weighted by score) to the performance on the test set. If no test_stats, then
     |      statistics collected during training are used instead. There is also
     |      an unweighted measure (just counting the rules). This is less informative,
     |      though, as many low-score rules will appear towards end of training.
     |
     |      :param test_stats: dictionary of statistics collected during testing
     |      :type test_stats: dict of str -> any (but usually numbers)
     |      :param printunused: if True, print a list of all unused templates
     |      :type printunused: bool
     |      :return: None
     |      :rtype: None
     |
     |  rules(self)
     |      Return the ordered list of  transformation rules that this tagger has learnt
     |
     |      :return: the ordered list of transformation rules that correct the initial tagging
     |      :rtype: list of Rules
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  train_stats(self, statistic=None)
     |      Return a named statistic collected during training, or a dictionary of all
     |      available statistics if no name given
     |
     |      :param statistic: name of statistic
     |      :type statistic: str
     |      :return: some statistic collected during training of this tagger
     |      :rtype: any (but usually a number)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.BrillTagger'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Pos(nltk.tbl.feature.Feature)
     |  Pos(positions, end=None)
     |
     |  Feature which examines the tags of nearby tokens.
     |
     |  Method resolution order:
     |      Pos
     |      nltk.tbl.feature.Feature
     |      builtins.object
     |
     |  Static methods defined here:
     |
     |  extract_property(tokens, index)
     |      @return: The given token's tag.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.brill.Pos'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tbl.feature.Feature:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other)
     |      Return self>=value.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __init__(self, positions, end=None)
     |      Construct a Feature which may apply at C{positions}.
     |
     |      >>> # For instance, importing some concrete subclasses (Feature is abstract)
     |      >>> from nltk.tag.brill import Word, Pos
     |
     |      >>> # Feature Word, applying at one of [-2, -1]
     |      >>> Word([-2,-1])
     |      Word([-2, -1])
     |
     |      >>> # Positions need not be contiguous
     |      >>> Word([-2,-1, 1])
     |      Word([-2, -1, 1])
     |
     |      >>> # Contiguous ranges can alternatively be specified giving the
     |      >>> # two endpoints (inclusive)
     |      >>> Pos(-3, -1)
     |      Pos([-3, -2, -1])
     |
     |      >>> # In two-arg form, start <= end is enforced
     |      >>> Pos(2, 1)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |        File "nltk/tbl/template.py", line 306, in __init__
     |          raise TypeError
     |      ValueError: illegal interval specification: (start=2, end=1)
     |
     |      :type positions: list of int
     |      :param positions: the positions at which this features should apply
     |      :raises ValueError: illegal position specifications
     |
     |      An alternative calling convention, for contiguous positions only,
     |      is Feature(start, end):
     |
     |      :type start: int
     |      :param start: start of range where this feature should apply
     |      :type end: int
     |      :param end: end of range (NOTE: inclusive!) where this feature should apply
     |
     |  __le__(self, other)
     |      Return self<=value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  encode_json_obj(self)
     |
     |  intersects(self, other)
     |      Return True if the positions of this Feature intersects with those of other
     |
     |      More precisely, return True if this feature refers to the same property as other;
     |      and there is some overlap in the positions they look at.
     |
     |      #For instance, importing a concrete subclass (Feature is abstract)
     |      >>> from nltk.tag.brill import Word, Pos
     |
     |      >>> Word([-3,-2,-1]).intersects(Word([-3,-2]))
     |      True
     |
     |      >>> Word([-3,-2,-1]).intersects(Word([-3,-2, 0]))
     |      True
     |
     |      >>> Word([-3,-2,-1]).intersects(Word([0]))
     |      False
     |
     |      #Feature subclasses must agree
     |      >>> Word([-3,-2,-1]).intersects(Pos([-3,-2]))
     |      False
     |
     |      :param other: feature with which to compare
     |      :type other: (subclass of) Feature
     |      :return: True if feature classes agree and there is some overlap in the positions they look at
     |      :rtype: bool
     |
     |  issuperset(self, other)
     |      Return True if this Feature always returns True when other does
     |
     |      More precisely, return True if this feature refers to the same property as other;
     |      and this Feature looks at all positions that other does (and possibly
     |      other positions in addition).
     |
     |      #For instance, importing a concrete subclass (Feature is abstract)
     |      >>> from nltk.tag.brill import Word, Pos
     |
     |      >>> Word([-3,-2,-1]).issuperset(Word([-3,-2]))
     |      True
     |
     |      >>> Word([-3,-2,-1]).issuperset(Word([-3,-2, 0]))
     |      False
     |
     |      #Feature subclasses must agree
     |      >>> Word([-3,-2,-1]).issuperset(Pos([-3,-2]))
     |      False
     |
     |      :param other: feature with which to compare
     |      :type other: (subclass of) Feature
     |      :return: True if this feature is superset, otherwise False
     |      :rtype: bool
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from nltk.tbl.feature.Feature:
     |
     |  decode_json_obj(obj)
     |
     |  expand(starts, winlens, excludezero=False)
     |      Return a list of features, one for each start point in starts
     |      and for each window length in winlen. If excludezero is True,
     |      no Features containing 0 in its positions will be generated
     |      (many tbl trainers have a special representation for the
     |      target feature at [0])
     |
     |      For instance, importing a concrete subclass (Feature is abstract)
     |
     |      >>> from nltk.tag.brill import Word
     |
     |      First argument gives the possible start positions, second the
     |      possible window lengths
     |
     |      >>> Word.expand([-3,-2,-1], [1])
     |      [Word([-3]), Word([-2]), Word([-1])]
     |
     |      >>> Word.expand([-2,-1], [1])
     |      [Word([-2]), Word([-1])]
     |
     |      >>> Word.expand([-3,-2,-1], [1,2])
     |      [Word([-3]), Word([-2]), Word([-1]), Word([-3, -2]), Word([-2, -1])]
     |
     |      >>> Word.expand([-2,-1], [1])
     |      [Word([-2]), Word([-1])]
     |
     |      A third optional argument excludes all Features whose positions contain zero
     |
     |      >>> Word.expand([-2,-1,0], [1,2], excludezero=False)
     |      [Word([-2]), Word([-1]), Word([0]), Word([-2, -1]), Word([-1, 0])]
     |
     |      >>> Word.expand([-2,-1,0], [1,2], excludezero=True)
     |      [Word([-2]), Word([-1]), Word([-2, -1])]
     |
     |      All window lengths must be positive
     |
     |      >>> Word.expand([-2,-1], [0])
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |        File "nltk/tag/tbl/template.py", line 371, in expand
     |          :param starts: where to start looking for Feature
     |      ValueError: non-positive window length in [0]
     |
     |      :param starts: where to start looking for Feature
     |      :type starts: list of ints
     |      :param winlens: window lengths where to look for Feature
     |      :type starts: list of ints
     |      :param excludezero: do not output any Feature with 0 in any of its positions.
     |      :type excludezero: bool
     |      :returns: list of Features
     |      :raises ValueError: for non-positive window lengths
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tbl.feature.Feature:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.tbl.feature.Feature:
     |
     |  PROPERTY_NAME = None
     |
     |  __hash__ = None

    class Word(nltk.tbl.feature.Feature)
     |  Word(positions, end=None)
     |
     |  Feature which examines the text (word) of nearby tokens.
     |
     |  Method resolution order:
     |      Word
     |      nltk.tbl.feature.Feature
     |      builtins.object
     |
     |  Static methods defined here:
     |
     |  extract_property(tokens, index)
     |      @return: The given token's text.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.brill.Word'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tbl.feature.Feature:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other)
     |      Return self>=value.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __init__(self, positions, end=None)
     |      Construct a Feature which may apply at C{positions}.
     |
     |      >>> # For instance, importing some concrete subclasses (Feature is abstract)
     |      >>> from nltk.tag.brill import Word, Pos
     |
     |      >>> # Feature Word, applying at one of [-2, -1]
     |      >>> Word([-2,-1])
     |      Word([-2, -1])
     |
     |      >>> # Positions need not be contiguous
     |      >>> Word([-2,-1, 1])
     |      Word([-2, -1, 1])
     |
     |      >>> # Contiguous ranges can alternatively be specified giving the
     |      >>> # two endpoints (inclusive)
     |      >>> Pos(-3, -1)
     |      Pos([-3, -2, -1])
     |
     |      >>> # In two-arg form, start <= end is enforced
     |      >>> Pos(2, 1)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |        File "nltk/tbl/template.py", line 306, in __init__
     |          raise TypeError
     |      ValueError: illegal interval specification: (start=2, end=1)
     |
     |      :type positions: list of int
     |      :param positions: the positions at which this features should apply
     |      :raises ValueError: illegal position specifications
     |
     |      An alternative calling convention, for contiguous positions only,
     |      is Feature(start, end):
     |
     |      :type start: int
     |      :param start: start of range where this feature should apply
     |      :type end: int
     |      :param end: end of range (NOTE: inclusive!) where this feature should apply
     |
     |  __le__(self, other)
     |      Return self<=value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  encode_json_obj(self)
     |
     |  intersects(self, other)
     |      Return True if the positions of this Feature intersects with those of other
     |
     |      More precisely, return True if this feature refers to the same property as other;
     |      and there is some overlap in the positions they look at.
     |
     |      #For instance, importing a concrete subclass (Feature is abstract)
     |      >>> from nltk.tag.brill import Word, Pos
     |
     |      >>> Word([-3,-2,-1]).intersects(Word([-3,-2]))
     |      True
     |
     |      >>> Word([-3,-2,-1]).intersects(Word([-3,-2, 0]))
     |      True
     |
     |      >>> Word([-3,-2,-1]).intersects(Word([0]))
     |      False
     |
     |      #Feature subclasses must agree
     |      >>> Word([-3,-2,-1]).intersects(Pos([-3,-2]))
     |      False
     |
     |      :param other: feature with which to compare
     |      :type other: (subclass of) Feature
     |      :return: True if feature classes agree and there is some overlap in the positions they look at
     |      :rtype: bool
     |
     |  issuperset(self, other)
     |      Return True if this Feature always returns True when other does
     |
     |      More precisely, return True if this feature refers to the same property as other;
     |      and this Feature looks at all positions that other does (and possibly
     |      other positions in addition).
     |
     |      #For instance, importing a concrete subclass (Feature is abstract)
     |      >>> from nltk.tag.brill import Word, Pos
     |
     |      >>> Word([-3,-2,-1]).issuperset(Word([-3,-2]))
     |      True
     |
     |      >>> Word([-3,-2,-1]).issuperset(Word([-3,-2, 0]))
     |      False
     |
     |      #Feature subclasses must agree
     |      >>> Word([-3,-2,-1]).issuperset(Pos([-3,-2]))
     |      False
     |
     |      :param other: feature with which to compare
     |      :type other: (subclass of) Feature
     |      :return: True if this feature is superset, otherwise False
     |      :rtype: bool
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from nltk.tbl.feature.Feature:
     |
     |  decode_json_obj(obj)
     |
     |  expand(starts, winlens, excludezero=False)
     |      Return a list of features, one for each start point in starts
     |      and for each window length in winlen. If excludezero is True,
     |      no Features containing 0 in its positions will be generated
     |      (many tbl trainers have a special representation for the
     |      target feature at [0])
     |
     |      For instance, importing a concrete subclass (Feature is abstract)
     |
     |      >>> from nltk.tag.brill import Word
     |
     |      First argument gives the possible start positions, second the
     |      possible window lengths
     |
     |      >>> Word.expand([-3,-2,-1], [1])
     |      [Word([-3]), Word([-2]), Word([-1])]
     |
     |      >>> Word.expand([-2,-1], [1])
     |      [Word([-2]), Word([-1])]
     |
     |      >>> Word.expand([-3,-2,-1], [1,2])
     |      [Word([-3]), Word([-2]), Word([-1]), Word([-3, -2]), Word([-2, -1])]
     |
     |      >>> Word.expand([-2,-1], [1])
     |      [Word([-2]), Word([-1])]
     |
     |      A third optional argument excludes all Features whose positions contain zero
     |
     |      >>> Word.expand([-2,-1,0], [1,2], excludezero=False)
     |      [Word([-2]), Word([-1]), Word([0]), Word([-2, -1]), Word([-1, 0])]
     |
     |      >>> Word.expand([-2,-1,0], [1,2], excludezero=True)
     |      [Word([-2]), Word([-1]), Word([-2, -1])]
     |
     |      All window lengths must be positive
     |
     |      >>> Word.expand([-2,-1], [0])
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |        File "nltk/tag/tbl/template.py", line 371, in expand
     |          :param starts: where to start looking for Feature
     |      ValueError: non-positive window length in [0]
     |
     |      :param starts: where to start looking for Feature
     |      :type starts: list of ints
     |      :param winlens: window lengths where to look for Feature
     |      :type starts: list of ints
     |      :param excludezero: do not output any Feature with 0 in any of its positions.
     |      :type excludezero: bool
     |      :returns: list of Features
     |      :raises ValueError: for non-positive window lengths
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tbl.feature.Feature:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.tbl.feature.Feature:
     |
     |  PROPERTY_NAME = None
     |
     |  __hash__ = None

FUNCTIONS
    brill24()
        Return 24 templates of the seminal TBL paper, Brill (1995)

    describe_template_sets()
        Print the available template sets in this demo, with a short description"

    fntbl37()
        Return 37 templates taken from the postagging task of the
        fntbl distribution https://www.cs.jhu.edu/~rflorian/fntbl/
        (37 is after excluding a handful which do not condition on Pos[0];
        fntbl can do that but the current nltk implementation cannot.)

    nltkdemo18()
        Return 18 templates, from the original nltk demo, in multi-feature syntax

    nltkdemo18plus()
        Return 18 templates, from the original nltk demo, and additionally a few
        multi-feature ones (the motivation is easy comparison with nltkdemo18)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\brill.py

nltk.brill_trainer
Python Library Documentation: module nltk.tag.brill_trainer in nltk.tag

NAME
    nltk.tag.brill_trainer

DESCRIPTION
    # Natural Language Toolkit: Transformation-based learning
    #
    # Copyright (C) 2001-2013 NLTK Project
    # Author: Marcus Uneson <marcus.uneson@gmail.com>
    #   based on previous (nltk2) version by
    #   Christopher Maloof, Edward Loper, Steven Bird
    # URL: <https://www.nltk.org/>
    # For license information, see  LICENSE.TXT

CLASSES
    builtins.object
        BrillTaggerTrainer

    class BrillTaggerTrainer(builtins.object)
     |  BrillTaggerTrainer(initial_tagger, templates, trace=0, deterministic=None, ruleformat='str')
     |
     |  A trainer for tbl taggers.
     |
     |  Methods defined here:
     |
     |  __init__(self, initial_tagger, templates, trace=0, deterministic=None, ruleformat='str')
     |      Construct a Brill tagger from a baseline tagger and a
     |      set of templates
     |
     |      :param initial_tagger: the baseline tagger
     |      :type initial_tagger: Tagger
     |      :param templates: templates to be used in training
     |      :type templates: list of Templates
     |      :param trace: verbosity level
     |      :type trace: int
     |      :param deterministic: if True, adjudicate ties deterministically
     |      :type deterministic: bool
     |      :param ruleformat: format of reported Rules
     |      :type ruleformat: str
     |      :return: An untrained BrillTagger
     |      :rtype: BrillTagger
     |
     |  train(self, train_sents, max_rules=200, min_score=2, min_acc=None)
     |      Trains the Brill tagger on the corpus *train_sents*,
     |      producing at most *max_rules* transformations, each of which
     |      reduces the net number of errors in the corpus by at least
     |      *min_score*, and each of which has accuracy not lower than
     |      *min_acc*.
     |
     |      >>> # Relevant imports
     |      >>> from nltk.tbl.template import Template
     |      >>> from nltk.tag.brill import Pos, Word
     |      >>> from nltk.tag import untag, RegexpTagger, BrillTaggerTrainer
     |
     |      >>> # Load some data
     |      >>> from nltk.corpus import treebank
     |      >>> training_data = treebank.tagged_sents()[:100]
     |      >>> baseline_data = treebank.tagged_sents()[100:200]
     |      >>> gold_data = treebank.tagged_sents()[200:300]
     |      >>> testing_data = [untag(s) for s in gold_data]
     |
     |      >>> backoff = RegexpTagger([
     |      ... (r'^-?[0-9]+(\.[0-9]+)?$', 'CD'),  # cardinal numbers
     |      ... (r'(The|the|A|a|An|an)$', 'AT'),   # articles
     |      ... (r'.*able$', 'JJ'),                # adjectives
     |      ... (r'.*ness$', 'NN'),                # nouns formed from adjectives
     |      ... (r'.*ly$', 'RB'),                  # adverbs
     |      ... (r'.*s$', 'NNS'),                  # plural nouns
     |      ... (r'.*ing$', 'VBG'),                # gerunds
     |      ... (r'.*ed$', 'VBD'),                 # past tense verbs
     |      ... (r'.*', 'NN')                      # nouns (default)
     |      ... ])
     |
     |      >>> baseline = backoff #see NOTE1
     |      >>> baseline.accuracy(gold_data) #doctest: +ELLIPSIS
     |      0.243...
     |
     |      >>> # Set up templates
     |      >>> Template._cleartemplates() #clear any templates created in earlier tests
     |      >>> templates = [Template(Pos([-1])), Template(Pos([-1]), Word([0]))]
     |
     |      >>> # Construct a BrillTaggerTrainer
     |      >>> tt = BrillTaggerTrainer(baseline, templates, trace=3)
     |
     |      >>> tagger1 = tt.train(training_data, max_rules=10)
     |      TBL train (fast) (seqs: 100; tokens: 2417; tpls: 2; min score: 2; min acc: None)
     |      Finding initial useful rules...
     |          Found 847 useful rules.
     |      <BLANKLINE>
     |                 B      |
     |         S   F   r   O  |        Score = Fixed - Broken
     |         c   i   o   t  |  R     Fixed = num tags changed incorrect -> correct
     |         o   x   k   h  |  u     Broken = num tags changed correct -> incorrect
     |         r   e   e   e  |  l     Other = num tags changed incorrect -> incorrect
     |         e   d   n   r  |  e
     |      ------------------+-------------------------------------------------------
     |       132 132   0   0  | AT->DT if Pos:NN@[-1]
     |        85  85   0   0  | NN->, if Pos:NN@[-1] & Word:,@[0]
     |        69  69   0   0  | NN->. if Pos:NN@[-1] & Word:.@[0]
     |        51  51   0   0  | NN->IN if Pos:NN@[-1] & Word:of@[0]
     |        47  63  16 162  | NN->IN if Pos:NNS@[-1]
     |        33  33   0   0  | NN->TO if Pos:NN@[-1] & Word:to@[0]
     |        26  26   0   0  | IN->. if Pos:NNS@[-1] & Word:.@[0]
     |        24  24   0   0  | IN->, if Pos:NNS@[-1] & Word:,@[0]
     |        22  27   5  24  | NN->-NONE- if Pos:VBD@[-1]
     |        17  17   0   0  | NN->CC if Pos:NN@[-1] & Word:and@[0]
     |
     |      >>> tagger1.rules()[1:3]
     |      (Rule('001', 'NN', ',', [(Pos([-1]),'NN'), (Word([0]),',')]), Rule('001', 'NN', '.', [(Pos([-1]),'NN'), (Word([0]),'.')]))
     |
     |      >>> train_stats = tagger1.train_stats()
     |      >>> [train_stats[stat] for stat in ['initialerrors', 'finalerrors', 'rulescores']]
     |      [1776, 1270, [132, 85, 69, 51, 47, 33, 26, 24, 22, 17]]
     |
     |      >>> tagger1.print_template_statistics(printunused=False)
     |      TEMPLATE STATISTICS (TRAIN)  2 templates, 10 rules)
     |      TRAIN (   2417 tokens) initial  1776 0.2652 final:  1270 0.4746
     |      #ID | Score (train) |  #Rules     | Template
     |      --------------------------------------------
     |      001 |   305   0.603 |   7   0.700 | Template(Pos([-1]),Word([0]))
     |      000 |   201   0.397 |   3   0.300 | Template(Pos([-1]))
     |      <BLANKLINE>
     |      <BLANKLINE>
     |
     |      >>> round(tagger1.accuracy(gold_data),5)
     |      0.43834
     |
     |      >>> tagged, test_stats = tagger1.batch_tag_incremental(testing_data, gold_data)
     |
     |      >>> tagged[33][12:] == [('foreign', 'IN'), ('debt', 'NN'), ('of', 'IN'), ('$', 'NN'), ('64', 'CD'),
     |      ... ('billion', 'NN'), ('*U*', 'NN'), ('--', 'NN'), ('the', 'DT'), ('third-highest', 'NN'), ('in', 'NN'),
     |      ... ('the', 'DT'), ('developing', 'VBG'), ('world', 'NN'), ('.', '.')]
     |      True
     |
     |      >>> [test_stats[stat] for stat in ['initialerrors', 'finalerrors', 'rulescores']]
     |      [1859, 1380, [100, 85, 67, 58, 27, 36, 27, 16, 31, 32]]
     |
     |      >>> # A high-accuracy tagger
     |      >>> tagger2 = tt.train(training_data, max_rules=10, min_acc=0.99)
     |      TBL train (fast) (seqs: 100; tokens: 2417; tpls: 2; min score: 2; min acc: 0.99)
     |      Finding initial useful rules...
     |          Found 847 useful rules.
     |      <BLANKLINE>
     |                 B      |
     |         S   F   r   O  |        Score = Fixed - Broken
     |         c   i   o   t  |  R     Fixed = num tags changed incorrect -> correct
     |         o   x   k   h  |  u     Broken = num tags changed correct -> incorrect
     |         r   e   e   e  |  l     Other = num tags changed incorrect -> incorrect
     |         e   d   n   r  |  e
     |      ------------------+-------------------------------------------------------
     |       132 132   0   0  | AT->DT if Pos:NN@[-1]
     |        85  85   0   0  | NN->, if Pos:NN@[-1] & Word:,@[0]
     |        69  69   0   0  | NN->. if Pos:NN@[-1] & Word:.@[0]
     |        51  51   0   0  | NN->IN if Pos:NN@[-1] & Word:of@[0]
     |        36  36   0   0  | NN->TO if Pos:NN@[-1] & Word:to@[0]
     |        26  26   0   0  | NN->. if Pos:NNS@[-1] & Word:.@[0]
     |        24  24   0   0  | NN->, if Pos:NNS@[-1] & Word:,@[0]
     |        19  19   0   6  | NN->VB if Pos:TO@[-1]
     |        18  18   0   0  | CD->-NONE- if Pos:NN@[-1] & Word:0@[0]
     |        18  18   0   0  | NN->CC if Pos:NN@[-1] & Word:and@[0]
     |
     |      >>> round(tagger2.accuracy(gold_data), 8)
     |      0.43996744
     |
     |      >>> tagger2.rules()[2:4]
     |      (Rule('001', 'NN', '.', [(Pos([-1]),'NN'), (Word([0]),'.')]), Rule('001', 'NN', 'IN', [(Pos([-1]),'NN'), (Word([0]),'of')]))
     |
     |      # NOTE1: (!!FIXME) A far better baseline uses nltk.tag.UnigramTagger,
     |      # with a RegexpTagger only as backoff. For instance,
     |      # >>> baseline = UnigramTagger(baseline_data, backoff=backoff)
     |      # However, as of Nov 2013, nltk.tag.UnigramTagger does not yield consistent results
     |      # between python versions. The simplistic backoff above is a workaround to make doctests
     |      # get consistent input.
     |
     |      :param train_sents: training data
     |      :type train_sents: list(list(tuple))
     |      :param max_rules: output at most max_rules rules
     |      :type max_rules: int
     |      :param min_score: stop training when no rules better than min_score can be found
     |      :type min_score: int
     |      :param min_acc: discard any rule with lower accuracy than min_acc
     |      :type min_acc: float or None
     |      :return: the learned tagger
     |      :rtype: BrillTagger
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\brill_trainer.py

nltk.build_opener
Python Library Documentation: function build_opener in module urllib.request

build_opener(*handlers)
    Create an opener object from a list of handlers.

    The opener will use several default handlers, including support
    for HTTP, FTP and when applicable HTTPS.

    If any of the handlers passed as arguments are subclasses of the
    default handlers, the default handlers will not be used.
nltk.call_megam
Python Library Documentation: function call_megam in module nltk.classify.megam

call_megam(args)
    Call the ``megam`` binary with the given arguments.
nltk.casual
Python Library Documentation: module nltk.tokenize.casual in nltk.tokenize

NAME
    nltk.tokenize.casual

DESCRIPTION
    Twitter-aware tokenizer, designed to be flexible and easy to adapt to new
    domains and tasks. The basic logic is this:

    1. The tuple REGEXPS defines a list of regular expression
       strings.

    2. The REGEXPS strings are put, in order, into a compiled
       regular expression object called WORD_RE, under the TweetTokenizer
       class.

    3. The tokenization is done by WORD_RE.findall(s), where s is the
       user-supplied string, inside the tokenize() method of the class
       TweetTokenizer.

    4. When instantiating Tokenizer objects, there are several options:
        * preserve_case. By default, it is set to True. If it is set to
          False, then the tokenizer will downcase everything except for
          emoticons.
        * reduce_len. By default, it is set to False. It specifies whether
          to replace repeated character sequences of length 3 or greater
          with sequences of length 3.
        * strip_handles. By default, it is set to False. It specifies
          whether to remove Twitter handles of text used in the
          `tokenize` method.
        * match_phone_numbers. By default, it is set to True. It indicates
          whether the `tokenize` method should look for phone numbers.

CLASSES
    nltk.tokenize.api.TokenizerI(abc.ABC)
        TweetTokenizer

    class TweetTokenizer(nltk.tokenize.api.TokenizerI)
     |  TweetTokenizer(preserve_case=True, reduce_len=False, strip_handles=False, match_phone_numbers=True)
     |
     |  Tokenizer for tweets.
     |
     |      >>> from nltk.tokenize import TweetTokenizer
     |      >>> tknzr = TweetTokenizer()
     |      >>> s0 = "This is a cooool #dummysmiley: :-) :-P <3 and some arrows < > -> <--"
     |      >>> tknzr.tokenize(s0) # doctest: +NORMALIZE_WHITESPACE
     |      ['This', 'is', 'a', 'cooool', '#dummysmiley', ':', ':-)', ':-P', '<3', 'and', 'some', 'arrows', '<', '>', '->',
     |       '<--']
     |
     |  Examples using `strip_handles` and `reduce_len parameters`:
     |
     |      >>> tknzr = TweetTokenizer(strip_handles=True, reduce_len=True)
     |      >>> s1 = '@remy: This is waaaaayyyy too much for you!!!!!!'
     |      >>> tknzr.tokenize(s1)
     |      [':', 'This', 'is', 'waaayyy', 'too', 'much', 'for', 'you', '!', '!', '!']
     |
     |  Method resolution order:
     |      TweetTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, preserve_case=True, reduce_len=False, strip_handles=False, match_phone_numbers=True)
     |      Create a `TweetTokenizer` instance with settings for use in the `tokenize` method.
     |
     |      :param preserve_case: Flag indicating whether to preserve the casing (capitalisation)
     |          of text used in the `tokenize` method. Defaults to True.
     |      :type preserve_case: bool
     |      :param reduce_len: Flag indicating whether to replace repeated character sequences
     |          of length 3 or greater with sequences of length 3. Defaults to False.
     |      :type reduce_len: bool
     |      :param strip_handles: Flag indicating whether to remove Twitter handles of text used
     |          in the `tokenize` method. Defaults to False.
     |      :type strip_handles: bool
     |      :param match_phone_numbers: Flag indicating whether the `tokenize` method should look
     |          for phone numbers. Defaults to True.
     |      :type match_phone_numbers: bool
     |
     |  tokenize(self, text: str) -> list[str]
     |      Tokenize the input text.
     |
     |      :param text: str
     |      :rtype: list(str)
     |      :return: a tokenized list of strings; joining this list returns        the original string if `preserve_case=False`.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  PHONE_WORD_RE
     |      Secondary core TweetTokenizer regex
     |
     |  WORD_RE
     |      Core TweetTokenizer regex
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    casual_tokenize(text, preserve_case=True, reduce_len=False, strip_handles=False, match_phone_numbers=True)
        Convenience function for wrapping the tokenizer.

    reduce_lengthening(text)
        Replace repeated character sequences of length 3 or greater with sequences
        of length 3.

    remove_handles(text)
        Remove Twitter username handles from text.

DATA
    EMOTICONS = '\n    (?:\n      [<>]?\n      [:;=8]               ... |\...
    EMOTICON_RE = regex.Regex("\n    (?:\n      [<>]?\n      [:;=8...eart\...
    ENT_RE = regex.Regex('&(#?(x?))([^&;\\s]+);', flags=regex.V0)
    FLAGS = '\n  (?:\n    [\\U0001F1E6-\\U0001F1FF]{2}  # all enc...0062\\...
    HANDLES_RE = regex.Regex('(?<![A-Za-z0-9_!@#\\$%&*])@(([A-Za-...0-9_])...
    HANG_RE = regex.Regex('([^a-zA-Z0-9])\\1{3,}', flags=regex.V0)
    List = typing.List
        A generic version of list.

    PHONE_REGEX = '\n    (?:\n      (?:            # (international)\n... ...
    REGEXPS = ('\t\t\t# Capture 1: entire matched URL\n  (?:\n  https...id...
    REGEXPS_PHONE = ('\t\t\t# Capture 1: entire matched URL\n  (?:\n  http...
    URLS = '\t\t\t# Capture 1: entire matched URL\n  (?:\n  https...id mat...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\casual.py

nltk.casual_tokenize
Python Library Documentation: function casual_tokenize in module nltk.tokenize.casual

casual_tokenize(text, preserve_case=True, reduce_len=False, strip_handles=False, match_phone_numbers=True)
    Convenience function for wrapping the tokenizer.
nltk.ccg
Python Library Documentation: package nltk.ccg in nltk

NAME
    nltk.ccg - Combinatory Categorial Grammar.

DESCRIPTION
    For more information see nltk/doc/contrib/ccg/ccg.pdf

PACKAGE CONTENTS
    api
    chart
    combinator
    lexicon
    logic

DATA
    BackwardApplication = <nltk.ccg.combinator.BackwardCombinator object>
    BackwardBx = <nltk.ccg.combinator.BackwardCombinator object>
    BackwardComposition = <nltk.ccg.combinator.BackwardCombinator object>
    BackwardSx = <nltk.ccg.combinator.BackwardCombinator object>
    BackwardT = <nltk.ccg.combinator.BackwardCombinator object>
    ForwardApplication = <nltk.ccg.combinator.ForwardCombinator object>
    ForwardComposition = <nltk.ccg.combinator.ForwardCombinator object>
    ForwardSubstitution = <nltk.ccg.combinator.ForwardCombinator object>
    ForwardT = <nltk.ccg.combinator.ForwardCombinator object>

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\ccg\__init__.py

nltk.chain
Python Library Documentation: class chain in module itertools

class chain(builtins.object)
 |  chain(*iterables) --> chain object
 |
 |  Return a chain object whose .__next__() method returns elements from the
 |  first iterable until it is exhausted, then elements from the next
 |  iterable, until all of the iterables are exhausted.
 |
 |  Methods defined here:
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __next__(self, /)
 |      Implement next(self).
 |
 |  __reduce__(...)
 |      Return state information for pickling.
 |
 |  __setstate__(...)
 |      Set state information for unpickling.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  from_iterable(iterable, /)
 |      Alternative chain() constructor taking a single iterable argument that evaluates lazily.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.chart
Python Library Documentation: module nltk.parse.chart in nltk.parse

NAME
    nltk.parse.chart

DESCRIPTION
    Data classes and parser implementations for "chart parsers", which
    use dynamic programming to efficiently parse a text.  A chart
    parser derives parse trees for a text by iteratively adding "edges"
    to a "chart."  Each edge represents a hypothesis about the tree
    structure for a subsequence of the text.  The chart is a
    "blackboard" for composing and combining these hypotheses.

    When a chart parser begins parsing a text, it creates a new (empty)
    chart, spanning the text.  It then incrementally adds new edges to the
    chart.  A set of "chart rules" specifies the conditions under which
    new edges should be added to the chart.  Once the chart reaches a
    stage where none of the chart rules adds any new edges, parsing is
    complete.

    Charts are encoded with the ``Chart`` class, and edges are encoded with
    the ``TreeEdge`` and ``LeafEdge`` classes.  The chart parser module
    defines three chart parsers:

      - ``ChartParser`` is a simple and flexible chart parser.  Given a
        set of chart rules, it will apply those rules to the chart until
        no more edges are added.

      - ``SteppingChartParser`` is a subclass of ``ChartParser`` that can
        be used to step through the parsing process.

CLASSES
    builtins.object
        Chart
        ChartRuleI
            AbstractChartRule
                BottomUpPredictRule
                    BottomUpPredictCombineRule
                        FilteredBottomUpPredictCombineRule
                EmptyPredictRule
                FundamentalRule
                    SingleEdgeFundamentalRule
                        FilteredSingleEdgeFundamentalRule
                LeafInitRule
                TopDownInitRule
                TopDownPredictRule
                    CachedTopDownPredictRule
        EdgeI
            LeafEdge
            TreeEdge
    nltk.parse.api.ParserI(builtins.object)
        ChartParser
            BottomUpChartParser
            BottomUpLeftCornerChartParser
            LeftCornerChartParser
            SteppingChartParser
            TopDownChartParser

    class AbstractChartRule(ChartRuleI)
     |  An abstract base class for chart rules.  ``AbstractChartRule``
     |  provides:
     |
     |  - A default implementation for ``apply``.
     |  - A default implementation for ``apply_everywhere``,
     |    (Currently, this implementation assumes that ``NUM_EDGES <= 3``.)
     |  - A default implementation for ``__str__``, which returns a
     |    name based on the rule's class name.
     |
     |  Method resolution order:
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply(self, chart, grammar, *edges)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BottomUpChartParser(ChartParser)
     |  BottomUpChartParser(grammar, **parser_args)
     |
     |  A ``ChartParser`` using a bottom-up parsing strategy.
     |  See ``ChartParser`` for more information.
     |
     |  Method resolution order:
     |      BottomUpChartParser
     |      ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BottomUpLeftCornerChartParser(ChartParser)
     |  BottomUpLeftCornerChartParser(grammar, **parser_args)
     |
     |  A ``ChartParser`` using a bottom-up left-corner parsing strategy.
     |  This strategy is often more efficient than standard bottom-up.
     |  See ``ChartParser`` for more information.
     |
     |  Method resolution order:
     |      BottomUpLeftCornerChartParser
     |      ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BottomUpPredictCombineRule(BottomUpPredictRule)
     |  A rule licensing any edge corresponding to a production whose
     |  right-hand side begins with a complete edge's left-hand side.  In
     |  particular, this rule specifies that ``[A -> alpha \*]``
     |  licenses the edge ``[B -> A \* beta]`` for each grammar
     |  production ``B -> A beta``.
     |
     |  :note: This is like ``BottomUpPredictRule``, but it also applies
     |      the ``FundamentalRule`` to the resulting edge.
     |
     |  Method resolution order:
     |      BottomUpPredictCombineRule
     |      BottomUpPredictRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BottomUpPredictRule(AbstractChartRule)
     |  A rule licensing any edge corresponding to a production whose
     |  right-hand side begins with a complete edge's left-hand side.  In
     |  particular, this rule specifies that ``[A -> alpha \*]`` licenses
     |  the edge ``[B -> \* A beta]`` for each grammar production ``B -> A beta``.
     |
     |  Method resolution order:
     |      BottomUpPredictRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class CachedTopDownPredictRule(TopDownPredictRule)
     |  A cached version of ``TopDownPredictRule``.  After the first time
     |  this rule is applied to an edge with a given ``end`` and ``next``,
     |  it will not generate any more edges for edges with that ``end`` and
     |  ``next``.
     |
     |  If ``chart`` or ``grammar`` are changed, then the cache is flushed.
     |
     |  Method resolution order:
     |      CachedTopDownPredictRule
     |      TopDownPredictRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from TopDownPredictRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Chart(builtins.object)
     |  Chart(tokens)
     |
     |  A blackboard for hypotheses about the syntactic constituents of a
     |  sentence.  A chart contains a set of edges, and each edge encodes
     |  a single hypothesis about the structure of some portion of the
     |  sentence.
     |
     |  The ``select`` method can be used to select a specific collection
     |  of edges.  For example ``chart.select(is_complete=True, start=0)``
     |  yields all complete edges whose start indices are 0.  To ensure
     |  the efficiency of these selection operations, ``Chart`` dynamically
     |  creates and maintains an index for each set of attributes that
     |  have been selected on.
     |
     |  In order to reconstruct the trees that are represented by an edge,
     |  the chart associates each edge with a set of child pointer lists.
     |  A child pointer list is a list of the edges that license an
     |  edge's right-hand side.
     |
     |  :ivar _tokens: The sentence that the chart covers.
     |  :ivar _num_leaves: The number of tokens.
     |  :ivar _edges: A list of the edges in the chart
     |  :ivar _edge_to_cpls: A dictionary mapping each edge to a set
     |      of child pointer lists that are associated with that edge.
     |  :ivar _indexes: A dictionary mapping tuples of edge attributes
     |      to indices, where each index maps the corresponding edge
     |      attribute values to lists of edges.
     |
     |  Methods defined here:
     |
     |  __init__(self, tokens)
     |      Construct a new chart. The chart is initialized with the
     |      leaf edges corresponding to the terminal leaves.
     |
     |      :type tokens: list
     |      :param tokens: The sentence that this chart will be used to parse.
     |
     |  __iter__ = iteredges(self)
     |
     |  child_pointer_lists(self, edge)
     |      Return the set of child pointer lists for the given edge.
     |      Each child pointer list is a list of edges that have
     |      been used to form this edge.
     |
     |      :rtype: list(list(EdgeI))
     |
     |  dot_digraph(self)
     |
     |  edges(self)
     |      Return a list of all edges in this chart.  New edges
     |      that are added to the chart after the call to edges()
     |      will *not* be contained in this list.
     |
     |      :rtype: list(EdgeI)
     |      :see: ``iteredges``, ``select``
     |
     |  initialize(self)
     |      Clear the chart.
     |
     |  insert(self, edge, *child_pointer_lists)
     |      Add a new edge to the chart, and return True if this operation
     |      modified the chart.  In particular, return true iff the chart
     |      did not already contain ``edge``, or if it did not already associate
     |      ``child_pointer_lists`` with ``edge``.
     |
     |      :type edge: EdgeI
     |      :param edge: The new edge
     |      :type child_pointer_lists: sequence of tuple(EdgeI)
     |      :param child_pointer_lists: A sequence of lists of the edges that
     |          were used to form this edge.  This list is used to reconstruct
     |          the trees (or partial trees) that are associated with ``edge``.
     |      :rtype: bool
     |
     |  insert_with_backpointer(self, new_edge, previous_edge, child_edge)
     |      Add a new edge to the chart, using a pointer to the previous edge.
     |
     |  iteredges(self)
     |      Return an iterator over the edges in this chart.  It is
     |      not guaranteed that new edges which are added to the
     |      chart before the iterator is exhausted will also be generated.
     |
     |      :rtype: iter(EdgeI)
     |      :see: ``edges``, ``select``
     |
     |  leaf(self, index)
     |      Return the leaf value of the word at the given index.
     |
     |      :rtype: str
     |
     |  leaves(self)
     |      Return a list of the leaf values of each word in the
     |      chart's sentence.
     |
     |      :rtype: list(str)
     |
     |  num_edges(self)
     |      Return the number of edges contained in this chart.
     |
     |      :rtype: int
     |
     |  num_leaves(self)
     |      Return the number of words in this chart's sentence.
     |
     |      :rtype: int
     |
     |  parses(self, root, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      Return an iterator of the complete tree structures that span
     |      the entire chart, and whose root node is ``root``.
     |
     |  pretty_format(self, width=None)
     |      Return a pretty-printed string representation of this chart.
     |
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |      :rtype: str
     |
     |  pretty_format_edge(self, edge, width=None)
     |      Return a pretty-printed string representation of a given edge
     |      in this chart.
     |
     |      :rtype: str
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |
     |  pretty_format_leaves(self, width=None)
     |      Return a pretty-printed string representation of this
     |      chart's leaves.  This string can be used as a header
     |      for calls to ``pretty_format_edge``.
     |
     |  select(self, **restrictions)
     |      Return an iterator over the edges in this chart.  Any
     |      new edges that are added to the chart before the iterator
     |      is exahusted will also be generated.  ``restrictions``
     |      can be used to restrict the set of edges that will be
     |      generated.
     |
     |      :param span: Only generate edges ``e`` where ``e.span()==span``
     |      :param start: Only generate edges ``e`` where ``e.start()==start``
     |      :param end: Only generate edges ``e`` where ``e.end()==end``
     |      :param length: Only generate edges ``e`` where ``e.length()==length``
     |      :param lhs: Only generate edges ``e`` where ``e.lhs()==lhs``
     |      :param rhs: Only generate edges ``e`` where ``e.rhs()==rhs``
     |      :param nextsym: Only generate edges ``e`` where
     |          ``e.nextsym()==nextsym``
     |      :param dot: Only generate edges ``e`` where ``e.dot()==dot``
     |      :param is_complete: Only generate edges ``e`` where
     |          ``e.is_complete()==is_complete``
     |      :param is_incomplete: Only generate edges ``e`` where
     |          ``e.is_incomplete()==is_incomplete``
     |      :rtype: iter(EdgeI)
     |
     |  trees(self, edge, tree_class=<class 'nltk.tree.tree.Tree'>, complete=False)
     |      Return an iterator of the tree structures that are associated
     |      with ``edge``.
     |
     |      If ``edge`` is incomplete, then the unexpanded children will be
     |      encoded as childless subtrees, whose node value is the
     |      corresponding terminal or nonterminal.
     |
     |      :rtype: list(Tree)
     |      :note: If two trees share a common subtree, then the same
     |          Tree may be used to encode that subtree in
     |          both trees.  If you need to eliminate this subtree
     |          sharing, then create a deep copy of each tree.
     |      :raise ValueError: if more than ``MAX_PARSE_TREES`` parse-tree nodes
     |          would be built, which a highly-ambiguous grammar reaches at an
     |          exponential rate (CWE-770).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ChartParser(nltk.parse.api.ParserI)
     |  ChartParser(grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C01340>, <nltk.parse.chart.EmptyPredictRule object at 0x0000028F98C01370>, <nltk.parse.chart.BottomUpPredictCombineRule object at 0x0000028F98C013A0>, <nltk.parse.chart.SingleEdgeFundamentalRule object at 0x0000028F98C013D0>], trace=0, trace_chart_width=50, use_agenda=True, chart_class=<class 'nltk.parse.chart.Chart'>)
     |
     |  A generic chart parser.  A "strategy", or list of
     |  ``ChartRuleI`` instances, is used to decide what edges to add to
     |  the chart.  In particular, ``ChartParser`` uses the following
     |  algorithm to parse texts:
     |
     |  | Until no new edges are added:
     |  |   For each *rule* in *strategy*:
     |  |     Apply *rule* to any applicable edges in the chart.
     |  | Return any complete parses in the chart
     |
     |  Method resolution order:
     |      ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C01340>, <nltk.parse.chart.EmptyPredictRule object at 0x0000028F98C01370>, <nltk.parse.chart.BottomUpPredictCombineRule object at 0x0000028F98C013A0>, <nltk.parse.chart.SingleEdgeFundamentalRule object at 0x0000028F98C013D0>], trace=0, trace_chart_width=50, use_agenda=True, chart_class=<class 'nltk.parse.chart.Chart'>)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ChartRuleI(builtins.object)
     |  A rule that specifies what new edges are licensed by any given set
     |  of existing edges.  Each chart rule expects a fixed number of
     |  edges, as indicated by the class variable ``NUM_EDGES``.  In
     |  particular:
     |
     |  - A chart rule with ``NUM_EDGES=0`` specifies what new edges are
     |    licensed, regardless of existing edges.
     |  - A chart rule with ``NUM_EDGES=1`` specifies what new edges are
     |    licensed by a single existing edge.
     |  - A chart rule with ``NUM_EDGES=2`` specifies what new edges are
     |    licensed by a pair of existing edges.
     |
     |  :type NUM_EDGES: int
     |  :cvar NUM_EDGES: The number of existing edges that this rule uses
     |      to license new edges.  Typically, this number ranges from zero
     |      to two.
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, *edges)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class EdgeI(builtins.object)
     |  A hypothesis about the structure of part of a sentence.
     |  Each edge records the fact that a structure is (partially)
     |  consistent with the sentence.  An edge contains:
     |
     |  - A span, indicating what part of the sentence is
     |    consistent with the hypothesized structure.
     |  - A left-hand side, specifying what kind of structure is
     |    hypothesized.
     |  - A right-hand side, specifying the contents of the
     |    hypothesized structure.
     |  - A dot position, indicating how much of the hypothesized
     |    structure is consistent with the sentence.
     |
     |  Every edge is either complete or incomplete:
     |
     |  - An edge is complete if its structure is fully consistent
     |    with the sentence.
     |  - An edge is incomplete if its structure is partially
     |    consistent with the sentence.  For every incomplete edge, the
     |    span specifies a possible prefix for the edge's structure.
     |
     |  There are two kinds of edge:
     |
     |  - A ``TreeEdge`` records which trees have been found to
     |    be (partially) consistent with the text.
     |  - A ``LeafEdge`` records the tokens occurring in the text.
     |
     |  The ``EdgeI`` interface provides a common interface to both types
     |  of edge, allowing chart parsers to treat them in a uniform manner.
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  dot(self)
     |      Return this edge's dot position, which indicates how much of
     |      the hypothesized structure is consistent with the
     |      sentence.  In particular, ``self.rhs[:dot]`` is consistent
     |      with ``tokens[self.start():self.end()]``.
     |
     |      :rtype: int
     |
     |  end(self)
     |      Return the end index of this edge's span.
     |
     |      :rtype: int
     |
     |  is_complete(self)
     |      Return True if this edge's structure is fully consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  is_incomplete(self)
     |      Return True if this edge's structure is partially consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  length(self)
     |      Return the length of this edge's span.
     |
     |      :rtype: int
     |
     |  lhs(self)
     |      Return this edge's left-hand side, which specifies what kind
     |      of structure is hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the left-hand side values for each edge type.
     |
     |  nextsym(self)
     |      Return the element of this edge's right-hand side that
     |      immediately follows its dot.
     |
     |      :rtype: Nonterminal or terminal or None
     |
     |  rhs(self)
     |      Return this edge's right-hand side, which specifies
     |      the content of the structure hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the right-hand side values for each edge type.
     |
     |  span(self)
     |      Return a tuple ``(s, e)``, where ``tokens[s:e]`` is the
     |      portion of the sentence that is consistent with this
     |      edge's structure.
     |
     |      :rtype: tuple(int, int)
     |
     |  start(self)
     |      Return the start index of this edge's span.
     |
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class EmptyPredictRule(AbstractChartRule)
     |  A rule that inserts all empty productions as passive edges,
     |  in every position in the chart.
     |
     |  Method resolution order:
     |      EmptyPredictRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FilteredBottomUpPredictCombineRule(BottomUpPredictCombineRule)
     |  Method resolution order:
     |      FilteredBottomUpPredictCombineRule
     |      BottomUpPredictCombineRule
     |      BottomUpPredictRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from BottomUpPredictCombineRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FilteredSingleEdgeFundamentalRule(SingleEdgeFundamentalRule)
     |  Method resolution order:
     |      FilteredSingleEdgeFundamentalRule
     |      SingleEdgeFundamentalRule
     |      FundamentalRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods inherited from SingleEdgeFundamentalRule:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from SingleEdgeFundamentalRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FundamentalRule(AbstractChartRule)
     |  A rule that joins two adjacent edges to form a single combined
     |  edge.  In particular, this rule specifies that any pair of edges
     |
     |  - ``[A -> alpha \* B beta][i:j]``
     |  - ``[B -> gamma \*][j:k]``
     |
     |  licenses the edge:
     |
     |  - ``[A -> alpha B * beta][i:j]``
     |
     |  Method resolution order:
     |      FundamentalRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, left_edge, right_edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 2
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LeafEdge(EdgeI)
     |  LeafEdge(leaf, index)
     |
     |  An edge that records the fact that a leaf value is consistent with
     |  a word in the sentence.  A leaf edge consists of:
     |
     |  - An index, indicating the position of the word.
     |  - A leaf, specifying the word's content.
     |
     |  A leaf edge's left-hand side is its leaf value, and its right hand
     |  side is ``()``.  Its span is ``[index, index+1]``, and its dot
     |  position is ``0``.
     |
     |  Method resolution order:
     |      LeafEdge
     |      EdgeI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, leaf, index)
     |      Construct a new ``LeafEdge``.
     |
     |      :param leaf: The new edge's leaf value, specifying the word
     |          that is recorded by this edge.
     |      :param index: The new edge's index, specifying the position of
     |          the word that is recorded by this edge.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  dot(self)
     |      Return this edge's dot position, which indicates how much of
     |      the hypothesized structure is consistent with the
     |      sentence.  In particular, ``self.rhs[:dot]`` is consistent
     |      with ``tokens[self.start():self.end()]``.
     |
     |      :rtype: int
     |
     |  end(self)
     |      Return the end index of this edge's span.
     |
     |      :rtype: int
     |
     |  is_complete(self)
     |      Return True if this edge's structure is fully consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  is_incomplete(self)
     |      Return True if this edge's structure is partially consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  length(self)
     |      Return the length of this edge's span.
     |
     |      :rtype: int
     |
     |  lhs(self)
     |      Return this edge's left-hand side, which specifies what kind
     |      of structure is hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the left-hand side values for each edge type.
     |
     |  nextsym(self)
     |      Return the element of this edge's right-hand side that
     |      immediately follows its dot.
     |
     |      :rtype: Nonterminal or terminal or None
     |
     |  rhs(self)
     |      Return this edge's right-hand side, which specifies
     |      the content of the structure hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the right-hand side values for each edge type.
     |
     |  span(self)
     |      Return a tuple ``(s, e)``, where ``tokens[s:e]`` is the
     |      portion of the sentence that is consistent with this
     |      edge's structure.
     |
     |      :rtype: tuple(int, int)
     |
     |  start(self)
     |      Return the start index of this edge's span.
     |
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from EdgeI:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from EdgeI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LeafInitRule(AbstractChartRule)
     |  Method resolution order:
     |      LeafInitRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LeftCornerChartParser(ChartParser)
     |  LeftCornerChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      LeftCornerChartParser
     |      ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SingleEdgeFundamentalRule(FundamentalRule)
     |  A rule that joins a given edge with adjacent edges in the chart,
     |  to form combined edges.  In particular, this rule specifies that
     |  either of the edges:
     |
     |  - ``[A -> alpha \* B beta][i:j]``
     |  - ``[B -> gamma \*][j:k]``
     |
     |  licenses the edge:
     |
     |  - ``[A -> alpha B * beta][i:j]``
     |
     |  if the other edge is already in the chart.
     |
     |  :note: This is basically ``FundamentalRule``, with one edge left
     |      unspecified.
     |
     |  Method resolution order:
     |      SingleEdgeFundamentalRule
     |      FundamentalRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SteppingChartParser(ChartParser)
     |  SteppingChartParser(grammar, strategy=[], trace=0)
     |
     |  A ``ChartParser`` that allows you to step through the parsing
     |  process, adding a single edge at a time.  It also allows you to
     |  change the parser's strategy or grammar midway through parsing a
     |  text.
     |
     |  The ``initialize`` method is used to start parsing a text.  ``step``
     |  adds a single edge to the chart.  ``set_strategy`` changes the
     |  strategy used by the chart parser.  ``parses`` returns the set of
     |  parses that has been found by the chart parser.
     |
     |  :ivar _restart: Records whether the parser's strategy, grammar,
     |      or chart has been changed.  If so, then ``step`` must restart
     |      the parsing algorithm.
     |
     |  Method resolution order:
     |      SteppingChartParser
     |      ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, strategy=[], trace=0)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  chart(self)
     |      Return the chart that is used by this parser.
     |
     |  current_chartrule(self)
     |      Return the chart rule used to generate the most recent edge.
     |
     |  grammar(self)
     |      Return the grammar used by this parser.
     |
     |  initialize(self, tokens)
     |      Begin parsing the given tokens.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  parses(self, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      Return the parse trees currently contained in the chart.
     |
     |  set_chart(self, chart)
     |      Load a given chart into the chart parser.
     |
     |  set_grammar(self, grammar)
     |      Change the grammar used by the parser.
     |
     |  set_strategy(self, strategy)
     |      Change the strategy that the parser uses to decide which edges
     |      to add to the chart.
     |
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart.
     |
     |  step(self)
     |      Return a generator that adds edges to the chart, one at a
     |      time.  Each time the generator is resumed, it adds a single
     |      edge and yields that edge.  If no more edges can be added,
     |      then it yields None.
     |
     |      If the parser's strategy, grammar, or chart is changed, then
     |      the generator will continue adding edges using the new
     |      strategy, grammar, or chart.
     |
     |      Note that this generator never terminates, since the grammar
     |      or strategy might be changed to values that would add new
     |      edges.  Instead, it yields None when no more edges can be
     |      added with the current strategy and grammar.
     |
     |  strategy(self)
     |      Return the strategy used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TopDownChartParser(ChartParser)
     |  TopDownChartParser(grammar, **parser_args)
     |
     |  A ``ChartParser`` using a top-down parsing strategy.
     |  See ``ChartParser`` for more information.
     |
     |  Method resolution order:
     |      TopDownChartParser
     |      ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TopDownInitRule(AbstractChartRule)
     |  A rule licensing edges corresponding to the grammar productions for
     |  the grammar's start symbol.  In particular, this rule specifies that
     |  ``[S -> \* alpha][0:i]`` is licensed for each grammar production
     |  ``S -> alpha``, where ``S`` is the grammar's start symbol.
     |
     |  Method resolution order:
     |      TopDownInitRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TopDownPredictRule(AbstractChartRule)
     |  A rule licensing edges corresponding to the grammar productions
     |  for the nonterminal following an incomplete edge's dot.  In
     |  particular, this rule specifies that
     |  ``[A -> alpha \* B beta][i:j]`` licenses the edge
     |  ``[B -> \* gamma][j:j]`` for each grammar production ``B -> gamma``.
     |
     |  :note: This rule corresponds to the Predictor Rule in Earley parsing.
     |
     |  Method resolution order:
     |      TopDownPredictRule
     |      AbstractChartRule
     |      ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TreeEdge(EdgeI)
     |  TreeEdge(span, lhs, rhs, dot=0)
     |
     |  An edge that records the fact that a tree is (partially)
     |  consistent with the sentence.  A tree edge consists of:
     |
     |  - A span, indicating what part of the sentence is
     |    consistent with the hypothesized tree.
     |  - A left-hand side, specifying the hypothesized tree's node
     |    value.
     |  - A right-hand side, specifying the hypothesized tree's
     |    children.  Each element of the right-hand side is either a
     |    terminal, specifying a token with that terminal as its leaf
     |    value; or a nonterminal, specifying a subtree with that
     |    nonterminal's symbol as its node value.
     |  - A dot position, indicating which children are consistent
     |    with part of the sentence.  In particular, if ``dot`` is the
     |    dot position, ``rhs`` is the right-hand size, ``(start,end)``
     |    is the span, and ``sentence`` is the list of tokens in the
     |    sentence, then ``tokens[start:end]`` can be spanned by the
     |    children specified by ``rhs[:dot]``.
     |
     |  For more information about edges, see the ``EdgeI`` interface.
     |
     |  Method resolution order:
     |      TreeEdge
     |      EdgeI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, span, lhs, rhs, dot=0)
     |      Construct a new ``TreeEdge``.
     |
     |      :type span: tuple(int, int)
     |      :param span: A tuple ``(s, e)``, where ``tokens[s:e]`` is the
     |          portion of the sentence that is consistent with the new
     |          edge's structure.
     |      :type lhs: Nonterminal
     |      :param lhs: The new edge's left-hand side, specifying the
     |          hypothesized tree's node value.
     |      :type rhs: list(Nonterminal and str)
     |      :param rhs: The new edge's right-hand side, specifying the
     |          hypothesized tree's children.
     |      :type dot: int
     |      :param dot: The position of the new edge's dot.  This position
     |          specifies what prefix of the production's right hand side
     |          is consistent with the text.  In particular, if
     |          ``sentence`` is the list of tokens in the sentence, then
     |          ``okens[span[0]:span[1]]`` can be spanned by the
     |          children specified by ``rhs[:dot]``.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  dot(self)
     |      Return this edge's dot position, which indicates how much of
     |      the hypothesized structure is consistent with the
     |      sentence.  In particular, ``self.rhs[:dot]`` is consistent
     |      with ``tokens[self.start():self.end()]``.
     |
     |      :rtype: int
     |
     |  end(self)
     |      Return the end index of this edge's span.
     |
     |      :rtype: int
     |
     |  is_complete(self)
     |      Return True if this edge's structure is fully consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  is_incomplete(self)
     |      Return True if this edge's structure is partially consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  length(self)
     |      Return the length of this edge's span.
     |
     |      :rtype: int
     |
     |  lhs(self)
     |      Return this edge's left-hand side, which specifies what kind
     |      of structure is hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the left-hand side values for each edge type.
     |
     |  move_dot_forward(self, new_end)
     |      Return a new ``TreeEdge`` formed from this edge.
     |      The new edge's dot position is increased by ``1``,
     |      and its end index will be replaced by ``new_end``.
     |
     |      :param new_end: The new end index.
     |      :type new_end: int
     |      :rtype: TreeEdge
     |
     |  nextsym(self)
     |      Return the element of this edge's right-hand side that
     |      immediately follows its dot.
     |
     |      :rtype: Nonterminal or terminal or None
     |
     |  rhs(self)
     |      Return this edge's right-hand side, which specifies
     |      the content of the structure hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the right-hand side values for each edge type.
     |
     |  span(self)
     |      Return a tuple ``(s, e)``, where ``tokens[s:e]`` is the
     |      portion of the sentence that is consistent with this
     |      edge's structure.
     |
     |      :rtype: tuple(int, int)
     |
     |  start(self)
     |      Return the start index of this edge's span.
     |
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  from_production(production, index)
     |      Return a new ``TreeEdge`` formed from the given production.
     |      The new edge's left-hand side and right-hand side will
     |      be taken from ``production``; its span will be
     |      ``(index,index)``; and its dot position will be ``0``.
     |
     |      :rtype: TreeEdge
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from EdgeI:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from EdgeI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo(choice=None, print_times=True, print_grammar=False, print_trees=True, trace=2, sent='I saw John with a dog with my cookie', numparses=5)
        A demonstration of the chart parsers.

    demo_grammar()

DATA
    BU_LC_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nltk.parse....
    BU_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nltk.parse.cha...
    LC_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nltk.parse.cha...
    MAX_PARSE_TREES = 1000000
    TD_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nltk.parse.cha...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\chart.py

nltk.chat
Python Library Documentation: LazyModule in nltk object

nltk.chat = class LazyModule(builtins.object)
 |  nltk.chat(name, locals, globals=None)
 |
 |  Lazy module class.
 |
 |  Lazy modules are imported into the given namespaces whenever a
 |  non-special attribute (there are some attributes like __doc__
 |  that class instances handle without calling __getattr__) is
 |  requested. The module is then registered under the given name
 |  in locals usually replacing the import wrapper instance. The
 |  import itself is done using globals as global namespace.
 |
 |  Example of creating a lazy load module:
 |
 |  ISO = LazyModule('ISO',locals(),globals())
 |
 |  Later, requesting an attribute from ISO will load the module
 |  automatically into the locals() namespace, overriding the
 |  LazyModule instance:
 |
 |  t = ISO.Week(1998,1,1)
 |
 |  Methods defined here:
 |
 |  __getattr__(self, name)
 |      Import the module on demand and get the attribute.
 |
 |  __init__(self, name, locals, globals=None)
 |      Create a LazyModule instance wrapping module name.
 |
 |      The module will later on be registered in locals under the
 |      given module name.
 |
 |      globals is optional and defaults to locals.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __setattr__(self, name, value)
 |      Import the module on demand and set the attribute.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.chomsky_normal_form
Python Library Documentation: function chomsky_normal_form in module nltk.tree.transforms

chomsky_normal_form(tree, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
nltk.choose
Python Library Documentation: function choose in module nltk.util

choose(n, k)
    This function is a fast way to calculate binomial coefficients, commonly
    known as nCk, i.e. the number of combinations of n things taken k at a time.
    (https://en.wikipedia.org/wiki/Binomial_coefficient).

    This is the *scipy.special.comb()* with long integer computation but this
    approximation is faster, see https://github.com/nltk/nltk/issues/1181

        >>> choose(4, 2)
        6
        >>> choose(6, 2)
        15

    :param n: The number of things.
    :type n: int
    :param r: The number of times a thing is taken.
    :type r: int
nltk.chrf
Python Library Documentation: function sentence_chrf in module nltk.translate.chrf_score

sentence_chrf(reference, hypothesis, min_len=1, max_len=6, beta=3.0, ignore_whitespace=True)
    Calculates the sentence level CHRF (Character n-gram F-score) described in
     - Maja Popovic. 2015. CHRF: Character n-gram F-score for Automatic MT Evaluation.
       In Proceedings of the 10th Workshop on Machine Translation.
       https://www.statmt.org/wmt15/pdf/WMT49.pdf
     - Maja Popovic. 2016. CHRF Deconstructed: β Parameters and n-gram Weights.
       In Proceedings of the 1st Conference on Machine Translation.
       https://www.statmt.org/wmt16/pdf/W16-2341.pdf

    This implementation of CHRF only supports a single reference at the moment.

    For details not reported in the paper, consult Maja Popovic's original
    implementation: https://github.com/m-popovic/chrF

    The code should output results equivalent to running CHRF++ with the
    following options: -nw 0 -b 3

    An example from the original BLEU paper
    https://www.aclweb.org/anthology/P02-1040.pdf

        >>> ref1 = str('It is a guide to action that ensures that the military '
        ...            'will forever heed Party commands').split()
        >>> hyp1 = str('It is a guide to action which ensures that the military '
        ...            'always obeys the commands of the party').split()
        >>> hyp2 = str('It is to insure the troops forever hearing the activity '
        ...            'guidebook that party direct').split()
        >>> sentence_chrf(ref1, hyp1) # doctest: +ELLIPSIS
        0.6349...
        >>> sentence_chrf(ref1, hyp2) # doctest: +ELLIPSIS
        0.3330...

    The infamous "the the the ... " example

        >>> ref = 'the cat is on the mat'.split()
        >>> hyp = 'the the the the the the the'.split()
        >>> sentence_chrf(ref, hyp)  # doctest: +ELLIPSIS
        0.1468...

    An example to show that this function allows users to use strings instead of
    tokens, i.e. list(str) as inputs.

        >>> ref1 = str('It is a guide to action that ensures that the military '
        ...            'will forever heed Party commands')
        >>> hyp1 = str('It is a guide to action which ensures that the military '
        ...            'always obeys the commands of the party')
        >>> sentence_chrf(ref1, hyp1) # doctest: +ELLIPSIS
        0.6349...
        >>> type(ref1) == type(hyp1) == str
        True
        >>> sentence_chrf(ref1.split(), hyp1.split()) # doctest: +ELLIPSIS
        0.6349...

    To skip the unigrams and only use 2- to 3-grams:

        >>> sentence_chrf(ref1, hyp1, min_len=2, max_len=3) # doctest: +ELLIPSIS
        0.6617...

    :param references: reference sentence
    :type references: list(str) / str
    :param hypothesis: a hypothesis sentence
    :type hypothesis: list(str) / str
    :param min_len: The minimum order of n-gram this function should extract.
    :type min_len: int
    :param max_len: The maximum order of n-gram this function should extract.
    :type max_len: int
    :param beta: the parameter to assign more importance to recall over precision
    :type beta: float
    :param ignore_whitespace: ignore whitespace characters in scoring
    :type ignore_whitespace: bool
    :return: the sentence level CHRF score.
    :rtype: float
nltk.chrf_score
Python Library Documentation: module nltk.translate.chrf_score in nltk.translate

NAME
    nltk.translate.chrf_score - ChrF score implementation

FUNCTIONS
    chrf_precision_recall_fscore_support(reference, hypothesis, n, beta=3.0, epsilon=1e-16)
        This function computes the precision, recall and fscore from the ngram
        overlaps. It returns the `support` which is the true positive score.

        By underspecifying the input type, the function will be agnostic as to how
        it computes the ngrams and simply take the whichever element in the list;
        it could be either token or character.

        :param reference: The reference sentence.
        :type reference: list
        :param hypothesis: The hypothesis sentence.
        :type hypothesis: list
        :param n: Extract up to the n-th order ngrams
        :type n: int
        :param beta: The parameter to assign more importance to recall over precision.
        :type beta: float
        :param epsilon: The fallback value if the hypothesis or reference is empty.
        :type epsilon: float
        :return: Returns the precision, recall and f-score and support (true positive).
        :rtype: tuple(float)

    corpus_chrf(references, hypotheses, min_len=1, max_len=6, beta=3.0, ignore_whitespace=True)
        Calculates the corpus level CHRF (Character n-gram F-score), it is the
        macro-averaged value of the sentence/segment level CHRF score.

        This implementation of CHRF only supports a single reference at the moment.

            >>> ref1 = str('It is a guide to action that ensures that the military '
            ...            'will forever heed Party commands').split()
            >>> ref2 = str('It is the guiding principle which guarantees the military '
            ...            'forces always being under the command of the Party').split()
            >>>
            >>> hyp1 = str('It is a guide to action which ensures that the military '
            ...            'always obeys the commands of the party').split()
            >>> hyp2 = str('It is to insure the troops forever hearing the activity '
            ...            'guidebook that party direct')
            >>> corpus_chrf([ref1, ref2, ref1, ref2], [hyp1, hyp2, hyp2, hyp1]) # doctest: +ELLIPSIS
            0.3910...

        :param references: a corpus of list of reference sentences, w.r.t. hypotheses
        :type references: list(list(str))
        :param hypotheses: a list of hypothesis sentences
        :type hypotheses: list(list(str))
        :param min_len: The minimum order of n-gram this function should extract.
        :type min_len: int
        :param max_len: The maximum order of n-gram this function should extract.
        :type max_len: int
        :param beta: the parameter to assign more importance to recall over precision
        :type beta: float
        :param ignore_whitespace: ignore whitespace characters in scoring
        :type ignore_whitespace: bool
        :return: the sentence level CHRF score.
        :rtype: float

    sentence_chrf(reference, hypothesis, min_len=1, max_len=6, beta=3.0, ignore_whitespace=True)
        Calculates the sentence level CHRF (Character n-gram F-score) described in
         - Maja Popovic. 2015. CHRF: Character n-gram F-score for Automatic MT Evaluation.
           In Proceedings of the 10th Workshop on Machine Translation.
           https://www.statmt.org/wmt15/pdf/WMT49.pdf
         - Maja Popovic. 2016. CHRF Deconstructed: β Parameters and n-gram Weights.
           In Proceedings of the 1st Conference on Machine Translation.
           https://www.statmt.org/wmt16/pdf/W16-2341.pdf

        This implementation of CHRF only supports a single reference at the moment.

        For details not reported in the paper, consult Maja Popovic's original
        implementation: https://github.com/m-popovic/chrF

        The code should output results equivalent to running CHRF++ with the
        following options: -nw 0 -b 3

        An example from the original BLEU paper
        https://www.aclweb.org/anthology/P02-1040.pdf

            >>> ref1 = str('It is a guide to action that ensures that the military '
            ...            'will forever heed Party commands').split()
            >>> hyp1 = str('It is a guide to action which ensures that the military '
            ...            'always obeys the commands of the party').split()
            >>> hyp2 = str('It is to insure the troops forever hearing the activity '
            ...            'guidebook that party direct').split()
            >>> sentence_chrf(ref1, hyp1) # doctest: +ELLIPSIS
            0.6349...
            >>> sentence_chrf(ref1, hyp2) # doctest: +ELLIPSIS
            0.3330...

        The infamous "the the the ... " example

            >>> ref = 'the cat is on the mat'.split()
            >>> hyp = 'the the the the the the the'.split()
            >>> sentence_chrf(ref, hyp)  # doctest: +ELLIPSIS
            0.1468...

        An example to show that this function allows users to use strings instead of
        tokens, i.e. list(str) as inputs.

            >>> ref1 = str('It is a guide to action that ensures that the military '
            ...            'will forever heed Party commands')
            >>> hyp1 = str('It is a guide to action which ensures that the military '
            ...            'always obeys the commands of the party')
            >>> sentence_chrf(ref1, hyp1) # doctest: +ELLIPSIS
            0.6349...
            >>> type(ref1) == type(hyp1) == str
            True
            >>> sentence_chrf(ref1.split(), hyp1.split()) # doctest: +ELLIPSIS
            0.6349...

        To skip the unigrams and only use 2- to 3-grams:

            >>> sentence_chrf(ref1, hyp1, min_len=2, max_len=3) # doctest: +ELLIPSIS
            0.6617...

        :param references: reference sentence
        :type references: list(str) / str
        :param hypothesis: a hypothesis sentence
        :type hypothesis: list(str) / str
        :param min_len: The minimum order of n-gram this function should extract.
        :type min_len: int
        :param max_len: The maximum order of n-gram this function should extract.
        :type max_len: int
        :param beta: the parameter to assign more importance to recall over precision
        :type beta: float
        :param ignore_whitespace: ignore whitespace characters in scoring
        :type ignore_whitespace: bool
        :return: the sentence level CHRF score.
        :rtype: float

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\chrf_score.py

nltk.chunk
Python Library Documentation: package nltk.chunk in nltk

NAME
    nltk.chunk

DESCRIPTION
    Classes and interfaces for identifying non-overlapping linguistic
    groups (such as base noun phrases) in unrestricted text.  This task is
    called "chunk parsing" or "chunking", and the identified groups are
    called "chunks".  The chunked text is represented using a shallow
    tree called a "chunk structure."  A chunk structure is a tree
    containing tokens and chunks, where each chunk is a subtree containing
    only tokens.  For example, the chunk structure for base noun phrase
    chunks in the sentence "I saw the big dog on the hill" is::

      (SENTENCE:
        (NP: <I>)
        <saw>
        (NP: <the> <big> <dog>)
        <on>
        (NP: <the> <hill>))

    To convert a chunk structure back to a list of tokens, simply use the
    chunk structure's ``leaves()`` method.

    This module defines ``ChunkParserI``, a standard interface for
    chunking texts; and ``RegexpChunkParser``, a regular-expression based
    implementation of that interface. It also defines ``ChunkScore``, a
    utility class for scoring chunk parsers.

    RegexpChunkParser
    =================

    ``RegexpChunkParser`` is an implementation of the chunk parser interface
    that uses regular-expressions over tags to chunk a text.  Its
    ``parse()`` method first constructs a ``ChunkString``, which encodes a
    particular chunking of the input text.  Initially, nothing is
    chunked.  ``parse.RegexpChunkParser`` then applies a sequence of
    ``RegexpChunkRule`` rules to the ``ChunkString``, each of which modifies
    the chunking that it encodes.  Finally, the ``ChunkString`` is
    transformed back into a chunk structure, which is returned.

    ``RegexpChunkParser`` can only be used to chunk a single kind of phrase.
    For example, you can use an ``RegexpChunkParser`` to chunk the noun
    phrases in a text, or the verb phrases in a text; but you can not
    use it to simultaneously chunk both noun phrases and verb phrases in
    the same text.  (This is a limitation of ``RegexpChunkParser``, not of
    chunk parsers in general.)

    RegexpChunkRules
    ----------------

    A ``RegexpChunkRule`` is a transformational rule that updates the
    chunking of a text by modifying its ``ChunkString``.  Each
    ``RegexpChunkRule`` defines the ``apply()`` method, which modifies
    the chunking encoded by a ``ChunkString``.  The
    ``RegexpChunkRule`` class itself can be used to implement any
    transformational rule based on regular expressions.  There are
    also a number of subclasses, which can be used to implement
    simpler types of rules:

        - ``ChunkRule`` chunks anything that matches a given regular
          expression.
        - ``StripRule`` strips anything that matches a given regular
          expression.
        - ``UnChunkRule`` will un-chunk any chunk that matches a given
          regular expression.
        - ``MergeRule`` can be used to merge two contiguous chunks.
        - ``SplitRule`` can be used to split a single chunk into two
          smaller chunks.
        - ``ExpandLeftRule`` will expand a chunk to incorporate new
          unchunked material on the left.
        - ``ExpandRightRule`` will expand a chunk to incorporate new
          unchunked material on the right.

    Tag Patterns
    ~~~~~~~~~~~~

    A ``RegexpChunkRule`` uses a modified version of regular
    expression patterns, called "tag patterns".  Tag patterns are
    used to match sequences of tags.  Examples of tag patterns are::

         r'(<DT>|<JJ>|<NN>)+'
         r'<NN>+'
         r'<NN.*>'

    The differences between regular expression patterns and tag
    patterns are:

        - In tag patterns, ``'<'`` and ``'>'`` act as parentheses; so
          ``'<NN>+'`` matches one or more repetitions of ``'<NN>'``, not
          ``'<NN'`` followed by one or more repetitions of ``'>'``.
        - Whitespace in tag patterns is ignored.  So
          ``'<DT> | <NN>'`` is equivalent to ``'<DT>|<NN>'``
        - In tag patterns, ``'.'`` is equivalent to ``'[^{}<>]'``; so
          ``'<NN.*>'`` matches any single tag starting with ``'NN'``.

    The function ``tag_pattern2re_pattern`` can be used to transform
    a tag pattern to an equivalent regular expression pattern.

    Efficiency
    ----------

    Preliminary tests indicate that ``RegexpChunkParser`` can chunk at a
    rate of about 300 tokens/second, with a moderately complex rule set.

    There may be problems if ``RegexpChunkParser`` is used with more than
    5,000 tokens at a time.  In particular, evaluation of some regular
    expressions may cause the Python regular expression engine to
    exceed its maximum recursion depth.  We have attempted to minimize
    these problems, but it is impossible to avoid them completely.  We
    therefore recommend that you apply the chunk parser to a single
    sentence at a time.

    Emacs Tip
    ---------

    If you evaluate the following elisp expression in emacs, it will
    colorize a ``ChunkString`` when you use an interactive python shell
    with emacs or xemacs ("C-c !")::

        (let ()
          (defconst comint-mode-font-lock-keywords
            '(("<[^>]+>" 0 'font-lock-reference-face)
              ("[{}]" 0 'font-lock-function-name-face)))
          (add-hook 'comint-mode-hook (lambda () (turn-on-font-lock))))

    You can evaluate this code by copying it to a temporary buffer,
    placing the cursor after the last close parenthesis, and typing
    "``C-x C-e``".  You should evaluate it before running the interactive
    session.  The change will last until you close emacs.

    Unresolved Issues
    -----------------

    If we use the ``re`` module for regular expressions, Python's
    regular expression engine generates "maximum recursion depth
    exceeded" errors when processing very large texts, even for
    regular expressions that should not require any recursion.  We
    therefore use the ``pre`` module instead.  But note that ``pre``
    does not include Unicode support, so this module will not work
    with unicode strings.  Note also that ``pre`` regular expressions
    are not quite as advanced as ``re`` ones (e.g., no leftward
    zero-length assertions).

    :type CHUNK_TAG_PATTERN: regexp
    :var CHUNK_TAG_PATTERN: A regular expression to test whether a tag
         pattern is valid.

PACKAGE CONTENTS
    api
    named_entity
    regexp
    util

FUNCTIONS
    ne_chunk(tagged_tokens, binary=False)
        Use NLTK's currently recommended named entity chunker to
        chunk the given list of tagged tokens.

        >>> from nltk.chunk import ne_chunk
        >>> from nltk.corpus import treebank
        >>> from pprint import pprint
        >>> pprint(ne_chunk(treebank.tagged_sents()[2][8:14])) # doctest: +NORMALIZE_WHITESPACE
        Tree('S', [('chairman', 'NN'), ('of', 'IN'), Tree('ORGANIZATION', [('Consolidated', 'NNP'), ('Gold', 'NNP'), ('Fields', 'NNP')]), ('PLC', 'NNP')])

    ne_chunk_sents(tagged_sentences, binary=False)
        Use NLTK's currently recommended named entity chunker to chunk the
        given list of tagged sentences, each consisting of a list of tagged tokens.

    ne_chunker(fmt='multiclass')
        Load NLTK's currently recommended named entity chunker.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\chunk\__init__.py

nltk.cistem
Python Library Documentation: module nltk.stem.cistem in nltk.stem

NAME
    nltk.stem.cistem

DESCRIPTION
    # Natural Language Toolkit: CISTEM Stemmer for German
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Leonie Weissweiler <l.weissweiler@outlook.de>
    #         Tom Aarsen <> (modifications)
    # Algorithm: Leonie Weissweiler <l.weissweiler@outlook.de>
    #            Alexander Fraser <fraser@cis.lmu.de>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.stem.api.StemmerI(builtins.object)
        Cistem

    class Cistem(nltk.stem.api.StemmerI)
     |  Cistem(case_insensitive: bool = False)
     |
     |  CISTEM Stemmer for German
     |
     |  This is the official Python implementation of the CISTEM stemmer.
     |  It is based on the paper
     |  Leonie Weissweiler, Alexander Fraser (2017). Developing a Stemmer for German
     |  Based on a Comparative Analysis of Publicly Available Stemmers.
     |  In Proceedings of the German Society for Computational Linguistics and Language
     |  Technology (GSCL)
     |  which can be read here:
     |  https://www.cis.lmu.de/~weissweiler/cistem/
     |
     |  In the paper, we conducted an analysis of publicly available stemmers,
     |  developed two gold standards for German stemming and evaluated the stemmers
     |  based on the two gold standards. We then proposed the stemmer implemented here
     |  and show that it achieves slightly better f-measure than the other stemmers and
     |  is thrice as fast as the Snowball stemmer for German while being about as fast
     |  as most other stemmers.
     |
     |  case_insensitive is a a boolean specifying if case-insensitive stemming
     |  should be used. Case insensitivity improves performance only if words in the
     |  text may be incorrectly upper case. For all-lowercase and correctly cased
     |  text, best performance is achieved by setting case_insensitive for false.
     |
     |  :param case_insensitive: if True, the stemming is case insensitive. False by default.
     |  :type case_insensitive: bool
     |
     |  Method resolution order:
     |      Cistem
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, case_insensitive: bool = False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  segment(self, word: str) -> tuple[str, str]
     |      This method works very similarly to stem (:func:'cistem.stem'). The difference is that in
     |      addition to returning the stem, it also returns the rest that was removed at
     |      the end. To be able to return the stem unchanged so the stem and the rest
     |      can be concatenated to form the original word, all subsitutions that altered
     |      the stem in any other way than by removing letters at the end were left out.
     |
     |      :param word: The word that is to be stemmed.
     |      :type word: str
     |      :return: A tuple of the stemmed word and the removed suffix.
     |      :rtype: Tuple[str, str]
     |
     |      >>> from nltk.stem.cistem import Cistem
     |      >>> stemmer = Cistem()
     |      >>> s1 = "Speicherbehältern"
     |      >>> stemmer.segment(s1)
     |      ('speicherbehält', 'ern')
     |      >>> s2 = "Grenzpostens"
     |      >>> stemmer.segment(s2)
     |      ('grenzpost', 'ens')
     |      >>> s3 = "Ausgefeiltere"
     |      >>> stemmer.segment(s3)
     |      ('ausgefeilt', 'ere')
     |      >>> stemmer = Cistem(True)
     |      >>> stemmer.segment(s1)
     |      ('speicherbehäl', 'tern')
     |      >>> stemmer.segment(s2)
     |      ('grenzpo', 'stens')
     |      >>> stemmer.segment(s3)
     |      ('ausgefeil', 'tere')
     |
     |  stem(self, word: str) -> str
     |      Stems the input word.
     |
     |      :param word: The word that is to be stemmed.
     |      :type word: str
     |      :return: The stemmed word.
     |      :rtype: str
     |
     |      >>> from nltk.stem.cistem import Cistem
     |      >>> stemmer = Cistem()
     |      >>> s1 = "Speicherbehältern"
     |      >>> stemmer.stem(s1)
     |      'speicherbehalt'
     |      >>> s2 = "Grenzpostens"
     |      >>> stemmer.stem(s2)
     |      'grenzpost'
     |      >>> s3 = "Ausgefeiltere"
     |      >>> stemmer.stem(s3)
     |      'ausgefeilt'
     |      >>> stemmer = Cistem(True)
     |      >>> stemmer.stem(s1)
     |      'speicherbehal'
     |      >>> stemmer.stem(s2)
     |      'grenzpo'
     |      >>> stemmer.stem(s3)
     |      'ausgefeil'
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  replace_back(word: str) -> str
     |
     |  replace_to(word: str) -> str
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  repl_xx = re.compile('(.)\\1')
     |
     |  repl_xx_back = re.compile('(.)\\*')
     |
     |  strip_ge = re.compile('^ge(.{4,})')
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    Tuple = typing.Tuple
        Deprecated alias to builtins.tuple.

        Tuple[X, Y] is the cross-product type of X and Y.

        Example: Tuple[T1, T2] is a tuple of two elements corresponding
        to type variables T1 and T2.  Tuple[int, float, str] is a tuple
        of an int, a float and a string.

        To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\cistem.py

nltk.classify
Python Library Documentation: package nltk.classify in nltk

NAME
    nltk.classify

DESCRIPTION
    Classes and interfaces for labeling tokens with category labels (or
    "class labels").  Typically, labels are represented with strings
    (such as ``'health'`` or ``'sports'``).  Classifiers can be used to
    perform a wide range of classification tasks.  For example,
    classifiers can be used...

    - to classify documents by topic
    - to classify ambiguous words by which word sense is intended
    - to classify acoustic signals by which phoneme they represent
    - to classify sentences by their author

    Features
    ========
    In order to decide which category label is appropriate for a given
    token, classifiers examine one or more 'features' of the token.  These
    "features" are typically chosen by hand, and indicate which aspects
    of the token are relevant to the classification decision.  For
    example, a document classifier might use a separate feature for each
    word, recording how often that word occurred in the document.

    Featuresets
    ===========
    The features describing a token are encoded using a "featureset",
    which is a dictionary that maps from "feature names" to "feature
    values".  Feature names are unique strings that indicate what aspect
    of the token is encoded by the feature.  Examples include
    ``'prevword'``, for a feature whose value is the previous word; and
    ``'contains-word(library)'`` for a feature that is true when a document
    contains the word ``'library'``.  Feature values are typically
    booleans, numbers, or strings, depending on which feature they
    describe.

    Featuresets are typically constructed using a "feature detector"
    (also known as a "feature extractor").  A feature detector is a
    function that takes a token (and sometimes information about its
    context) as its input, and returns a featureset describing that token.
    For example, the following feature detector converts a document
    (stored as a list of words) to a featureset describing the set of
    words included in the document:

        >>> # Define a feature detector function.
        >>> def document_features(document):
        ...     return dict([('contains-word(%s)' % w, True) for w in document])

    Feature detectors are typically applied to each token before it is fed
    to the classifier:

        >>> # Classify each Gutenberg document.
        >>> from nltk.corpus import gutenberg
        >>> for fileid in gutenberg.fileids(): # doctest: +SKIP
        ...     doc = gutenberg.words(fileid) # doctest: +SKIP
        ...     print(fileid, classifier.classify(document_features(doc))) # doctest: +SKIP

    The parameters that a feature detector expects will vary, depending on
    the task and the needs of the feature detector.  For example, a
    feature detector for word sense disambiguation (WSD) might take as its
    input a sentence, and the index of a word that should be classified,
    and return a featureset for that word.  The following feature detector
    for WSD includes features describing the left and right contexts of
    the target word:

        >>> def wsd_features(sentence, index):
        ...     featureset = {}
        ...     for i in range(max(0, index-3), index):
        ...         featureset['left-context(%s)' % sentence[i]] = True
        ...     for i in range(index, max(index+3, len(sentence))):
        ...         featureset['right-context(%s)' % sentence[i]] = True
        ...     return featureset

    Training Classifiers
    ====================
    Most classifiers are built by training them on a list of hand-labeled
    examples, known as the "training set".  Training sets are represented
    as lists of ``(featuredict, label)`` tuples.

PACKAGE CONTENTS
    api
    decisiontree
    maxent
    megam
    naivebayes
    positivenaivebayes
    rte_classify
    scikitlearn
    senna
    svm
    tadm
    textcat
    util
    weka

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\__init__.py

nltk.clause
Python Library Documentation: function clause in module nltk.sem.relextract

clause(reldict, relsym)
    Print the relation in clausal form.
    :param reldict: a relation dictionary
    :type reldict: defaultdict
    :param relsym: a label for the relation
    :type relsym: str
nltk.clean_html
Python Library Documentation: function clean_html in module nltk.util

clean_html(html)
nltk.clean_url
Python Library Documentation: function clean_url in module nltk.util

clean_url(url)
nltk.cluster
Python Library Documentation: package nltk.cluster in nltk

NAME
    nltk.cluster

DESCRIPTION
    This module contains a number of basic clustering algorithms. Clustering
    describes the task of discovering groups of similar items with a large
    collection. It is also describe as unsupervised machine learning, as the data
    from which it learns is unannotated with class information, as is the case for
    supervised learning.  Annotated data is difficult and expensive to obtain in
    the quantities required for the majority of supervised learning algorithms.
    This problem, the knowledge acquisition bottleneck, is common to most natural
    language processing tasks, thus fueling the need for quality unsupervised
    approaches.

    This module contains a k-means clusterer, E-M clusterer and a group average
    agglomerative clusterer (GAAC). All these clusterers involve finding good
    cluster groupings for a set of vectors in multi-dimensional space.

    The K-means clusterer starts with k arbitrary chosen means then allocates each
    vector to the cluster with the closest mean. It then recalculates the means of
    each cluster as the centroid of the vectors in the cluster. This process
    repeats until the cluster memberships stabilise. This is a hill-climbing
    algorithm which may converge to a local maximum. Hence the clustering is
    often repeated with random initial means and the most commonly occurring
    output means are chosen.

    The GAAC clusterer starts with each of the *N* vectors as singleton clusters.
    It then iteratively merges pairs of clusters which have the closest centroids.
    This continues until there is only one cluster. The order of merges gives rise
    to a dendrogram - a tree with the earlier merges lower than later merges. The
    membership of a given number of clusters *c*, *1 <= c <= N*, can be found by
    cutting the dendrogram at depth *c*.

    The Gaussian EM clusterer models the vectors as being produced by a mixture
    of k Gaussian sources. The parameters of these sources (prior probability,
    mean and covariance matrix) are then found to maximise the likelihood of the
    given data. This is done with the expectation maximisation algorithm. It
    starts with k arbitrarily chosen means, priors and covariance matrices. It
    then calculates the membership probabilities for each vector in each of the
    clusters - this is the 'E' step. The cluster parameters are then updated in
    the 'M' step using the maximum likelihood estimate from the cluster membership
    probabilities. This process continues until the likelihood of the data does
    not significantly increase.

    They all extend the ClusterI interface which defines common operations
    available with each clusterer. These operations include:

    - cluster: clusters a sequence of vectors
    - classify: assign a vector to a cluster
    - classification_probdist: give the probability distribution over cluster memberships

    The current existing classifiers also extend cluster.VectorSpace, an
    abstract class which allows for singular value decomposition (SVD) and vector
    normalisation. SVD is used to reduce the dimensionality of the vector space in
    such a manner as to preserve as much of the variation as possible, by
    reparameterising the axes in order of variability and discarding all bar the
    first d dimensions. Normalisation ensures that vectors fall in the unit
    hypersphere.

    Usage example (see also demo())::

        from nltk import cluster
        from nltk.cluster import euclidean_distance
        from numpy import array

        vectors = [array(f) for f in [[3, 3], [1, 2], [4, 2], [4, 0]]]

        # initialise the clusterer (will also assign the vectors to clusters)
        clusterer = cluster.KMeansClusterer(2, euclidean_distance)
        clusterer.cluster(vectors, True)

        # classify a new vector
        print(clusterer.classify(array([3, 3])))

    Note that the vectors must use numpy array-like
    objects. nltk_contrib.unimelb.tacohn.SparseArrays may be used for
    efficiency when required.

PACKAGE CONTENTS
    api
    em
    gaac
    kmeans
    util

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\cluster\__init__.py

nltk.collapse_unary
Python Library Documentation: function collapse_unary in module nltk.tree.transforms

collapse_unary(tree, collapsePOS=False, collapseRoot=False, joinChar='+')
    Collapse subtrees with a single child (ie. unary productions)
    into a new non-terminal (Tree node) joined by 'joinChar'.
    This is useful when working with algorithms that do not allow
    unary productions, and completely removing the unary productions
    would require loss of useful information.  The Tree is modified
    directly (since it is passed by reference) and no value is returned.

    :param tree: The Tree to be collapsed
    :type  tree: Tree
    :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
                        Part-of-Speech tags) since they are always unary productions
    :type  collapsePOS: bool
    :param collapseRoot: 'False' (default) will not modify the root production
                         if it is unary.  For the Penn WSJ treebank corpus, this corresponds
                         to the TOP -> productions.
    :type collapseRoot: bool
    :param joinChar: A string used to connect collapsed node values (default = "+")
    :type  joinChar: str
nltk.collections
Python Library Documentation: module nltk.collections in nltk

NAME
    nltk.collections

DESCRIPTION
    # Natural Language Toolkit: Collections
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.dict(builtins.object)
        OrderedDict
        Trie
    builtins.object
        AbstractLazySequence
            LazyConcatenation
            LazyIteratorList
            LazyMap
                LazyZip
                    LazyEnumerate
            LazySubsequence

    class AbstractLazySequence(builtins.object)
     |  An abstract base class for read-only sequences whose values are
     |  computed as needed.  Lazy sequences act like tuples -- they can be
     |  indexed, sliced, and iterated over; but they may not be modified.
     |
     |  The most common application of lazy sequences in NLTK is for
     |  corpus view objects, which provide access to the contents of a
     |  corpus without loading the entire corpus into memory, by loading
     |  pieces of the corpus from disk as needed.
     |
     |  The result of modifying a mutable element of a lazy sequence is
     |  undefined.  In particular, the modifications made to the element
     |  may or may not persist, depending on whether and when the lazy
     |  sequence caches that element's value or reconstructs it from
     |  scratch.
     |
     |  Subclasses are required to define two methods: ``__len__()``
     |  and ``iterate_from()``.
     |
     |  Methods defined here:
     |
     |  __add__(self, other)
     |      Return a list concatenating self with other.
     |
     |  __contains__(self, value)
     |      Return true if this list contains ``value``.
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __getitem__(self, i)
     |      Return the *i* th token in the corpus file underlying this
     |      corpus view.  Negative indices and spans are both supported.
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      :raise ValueError: Corpus view objects are unhashable.
     |
     |  __iter__(self)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __len__(self)
     |      Return the number of tokens in the corpus file underlying this
     |      corpus view.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __radd__(self, other)
     |      Return a list concatenating other with self.
     |
     |  __repr__(self)
     |      Return a string representation for this corpus view that is
     |      similar to a list's representation; but if it would be more
     |      than 60 characters long, it is truncated.
     |
     |  __rmul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  count(self, value)
     |      Return the number of times this list contains ``value``.
     |
     |  index(self, value, start=None, stop=None)
     |      Return the index of the first occurrence of ``value`` in this
     |      list that is greater than or equal to ``start`` and less than
     |      ``stop``.  Negative start and stop values are treated like negative
     |      slice bounds -- i.e., they count from the end of the list.
     |
     |  iterate_from(self, start)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view, starting at the token number
     |      ``start``.  If ``start>=len(self)``, then this iterator will
     |      generate no tokens.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LazyConcatenation(AbstractLazySequence)
     |  LazyConcatenation(list_of_lists)
     |
     |  A lazy sequence formed by concatenating a list of lists.  This
     |  underlying list of lists may itself be lazy.  ``LazyConcatenation``
     |  maintains an index that it uses to keep track of the relationship
     |  between offsets in the concatenated lists and offsets in the
     |  sublists.
     |
     |  Method resolution order:
     |      LazyConcatenation
     |      AbstractLazySequence
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, list_of_lists)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __len__(self)
     |      Return the number of tokens in the corpus file underlying this
     |      corpus view.
     |
     |  iterate_from(self, start_index)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view, starting at the token number
     |      ``start``.  If ``start>=len(self)``, then this iterator will
     |      generate no tokens.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractLazySequence:
     |
     |  __add__(self, other)
     |      Return a list concatenating self with other.
     |
     |  __contains__(self, value)
     |      Return true if this list contains ``value``.
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __getitem__(self, i)
     |      Return the *i* th token in the corpus file underlying this
     |      corpus view.  Negative indices and spans are both supported.
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      :raise ValueError: Corpus view objects are unhashable.
     |
     |  __iter__(self)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __radd__(self, other)
     |      Return a list concatenating other with self.
     |
     |  __repr__(self)
     |      Return a string representation for this corpus view that is
     |      similar to a list's representation; but if it would be more
     |      than 60 characters long, it is truncated.
     |
     |  __rmul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  count(self, value)
     |      Return the number of times this list contains ``value``.
     |
     |  index(self, value, start=None, stop=None)
     |      Return the index of the first occurrence of ``value`` in this
     |      list that is greater than or equal to ``start`` and less than
     |      ``stop``.  Negative start and stop values are treated like negative
     |      slice bounds -- i.e., they count from the end of the list.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractLazySequence:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LazyEnumerate(LazyZip)
     |  LazyEnumerate(lst)
     |
     |  A lazy sequence whose elements are tuples, each containing a count (from
     |  zero) and a value yielded by underlying sequence.  ``LazyEnumerate`` is
     |  useful for obtaining an indexed list. The tuples are constructed lazily
     |  -- i.e., when you read a value from the list, ``LazyEnumerate`` will
     |  calculate that value by forming a tuple from the count of the i-th
     |  element and the i-th element of the underlying sequence.
     |
     |  ``LazyEnumerate`` is essentially a lazy version of the Python primitive
     |  function ``enumerate``.  In particular, the following two expressions are
     |  equivalent:
     |
     |      >>> from nltk.collections import LazyEnumerate
     |      >>> sequence = ['first', 'second', 'third']
     |      >>> list(enumerate(sequence))
     |      [(0, 'first'), (1, 'second'), (2, 'third')]
     |      >>> list(LazyEnumerate(sequence))
     |      [(0, 'first'), (1, 'second'), (2, 'third')]
     |
     |  Lazy enumerations can be useful for conserving memory in cases where the
     |  argument sequences are particularly long.
     |
     |  A typical example of a use case for this class is obtaining an indexed
     |  list for a long sequence of values.  By constructing tuples lazily and
     |  avoiding the creation of an additional long sequence, memory usage can be
     |  significantly reduced.
     |
     |  Method resolution order:
     |      LazyEnumerate
     |      LazyZip
     |      LazyMap
     |      AbstractLazySequence
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, lst)
     |      :param lst: the underlying list
     |      :type lst: list
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from LazyZip:
     |
     |  __len__(self)
     |      Return the number of tokens in the corpus file underlying this
     |      corpus view.
     |
     |  iterate_from(self, index)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view, starting at the token number
     |      ``start``.  If ``start>=len(self)``, then this iterator will
     |      generate no tokens.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from LazyMap:
     |
     |  __getitem__(self, index)
     |      Return the *i* th token in the corpus file underlying this
     |      corpus view.  Negative indices and spans are both supported.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractLazySequence:
     |
     |  __add__(self, other)
     |      Return a list concatenating self with other.
     |
     |  __contains__(self, value)
     |      Return true if this list contains ``value``.
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      :raise ValueError: Corpus view objects are unhashable.
     |
     |  __iter__(self)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __radd__(self, other)
     |      Return a list concatenating other with self.
     |
     |  __repr__(self)
     |      Return a string representation for this corpus view that is
     |      similar to a list's representation; but if it would be more
     |      than 60 characters long, it is truncated.
     |
     |  __rmul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  count(self, value)
     |      Return the number of times this list contains ``value``.
     |
     |  index(self, value, start=None, stop=None)
     |      Return the index of the first occurrence of ``value`` in this
     |      list that is greater than or equal to ``start`` and less than
     |      ``stop``.  Negative start and stop values are treated like negative
     |      slice bounds -- i.e., they count from the end of the list.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractLazySequence:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LazyIteratorList(AbstractLazySequence)
     |  LazyIteratorList(it, known_len=None)
     |
     |  Wraps an iterator, loading its elements on demand
     |  and making them subscriptable.
     |  __repr__ displays only the first few elements.
     |
     |  Method resolution order:
     |      LazyIteratorList
     |      AbstractLazySequence
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __add__(self, other)
     |      Return a list concatenating self with other.
     |
     |  __init__(self, it, known_len=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __len__(self)
     |      Return the number of tokens in the corpus file underlying this
     |      corpus view.
     |
     |  __radd__(self, other)
     |      Return a list concatenating other with self.
     |
     |  iterate_from(self, start)
     |      Create a new iterator over this list starting at the given offset.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractLazySequence:
     |
     |  __contains__(self, value)
     |      Return true if this list contains ``value``.
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __getitem__(self, i)
     |      Return the *i* th token in the corpus file underlying this
     |      corpus view.  Negative indices and spans are both supported.
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      :raise ValueError: Corpus view objects are unhashable.
     |
     |  __iter__(self)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return a string representation for this corpus view that is
     |      similar to a list's representation; but if it would be more
     |      than 60 characters long, it is truncated.
     |
     |  __rmul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  count(self, value)
     |      Return the number of times this list contains ``value``.
     |
     |  index(self, value, start=None, stop=None)
     |      Return the index of the first occurrence of ``value`` in this
     |      list that is greater than or equal to ``start`` and less than
     |      ``stop``.  Negative start and stop values are treated like negative
     |      slice bounds -- i.e., they count from the end of the list.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractLazySequence:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LazyMap(AbstractLazySequence)
     |  LazyMap(function, *lists, **config)
     |
     |  A lazy sequence whose elements are formed by applying a given
     |  function to each element in one or more underlying lists.  The
     |  function is applied lazily -- i.e., when you read a value from the
     |  list, ``LazyMap`` will calculate that value by applying its
     |  function to the underlying lists' value(s).  ``LazyMap`` is
     |  essentially a lazy version of the Python primitive function
     |  ``map``.  In particular, the following two expressions are
     |  equivalent:
     |
     |      >>> from nltk.collections import LazyMap
     |      >>> function = str
     |      >>> sequence = [1,2,3]
     |      >>> map(function, sequence) # doctest: +SKIP
     |      ['1', '2', '3']
     |      >>> list(LazyMap(function, sequence))
     |      ['1', '2', '3']
     |
     |  Like the Python ``map`` primitive, if the source lists do not have
     |  equal size, then the value None will be supplied for the
     |  'missing' elements.
     |
     |  Lazy maps can be useful for conserving memory, in cases where
     |  individual values take up a lot of space.  This is especially true
     |  if the underlying list's values are constructed lazily, as is the
     |  case with many corpus readers.
     |
     |  A typical example of a use case for this class is performing
     |  feature detection on the tokens in a corpus.  Since featuresets
     |  are encoded as dictionaries, which can take up a lot of memory,
     |  using a ``LazyMap`` can significantly reduce memory usage when
     |  training and running classifiers.
     |
     |  Method resolution order:
     |      LazyMap
     |      AbstractLazySequence
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __getitem__(self, index)
     |      Return the *i* th token in the corpus file underlying this
     |      corpus view.  Negative indices and spans are both supported.
     |
     |  __init__(self, function, *lists, **config)
     |      :param function: The function that should be applied to
     |          elements of ``lists``.  It should take as many arguments
     |          as there are ``lists``.
     |      :param lists: The underlying lists.
     |      :param cache_size: Determines the size of the cache used
     |          by this lazy map.  (default=5)
     |
     |  __len__(self)
     |      Return the number of tokens in the corpus file underlying this
     |      corpus view.
     |
     |  iterate_from(self, index)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view, starting at the token number
     |      ``start``.  If ``start>=len(self)``, then this iterator will
     |      generate no tokens.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractLazySequence:
     |
     |  __add__(self, other)
     |      Return a list concatenating self with other.
     |
     |  __contains__(self, value)
     |      Return true if this list contains ``value``.
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      :raise ValueError: Corpus view objects are unhashable.
     |
     |  __iter__(self)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __radd__(self, other)
     |      Return a list concatenating other with self.
     |
     |  __repr__(self)
     |      Return a string representation for this corpus view that is
     |      similar to a list's representation; but if it would be more
     |      than 60 characters long, it is truncated.
     |
     |  __rmul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  count(self, value)
     |      Return the number of times this list contains ``value``.
     |
     |  index(self, value, start=None, stop=None)
     |      Return the index of the first occurrence of ``value`` in this
     |      list that is greater than or equal to ``start`` and less than
     |      ``stop``.  Negative start and stop values are treated like negative
     |      slice bounds -- i.e., they count from the end of the list.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractLazySequence:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LazySubsequence(AbstractLazySequence)
     |  LazySubsequence(source, start, stop)
     |
     |  A subsequence produced by slicing a lazy sequence.  This slice
     |  keeps a reference to its source sequence, and generates its values
     |  by looking them up in the source sequence.
     |
     |  Method resolution order:
     |      LazySubsequence
     |      AbstractLazySequence
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, source, start, stop)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __len__(self)
     |      Return the number of tokens in the corpus file underlying this
     |      corpus view.
     |
     |  iterate_from(self, start)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view, starting at the token number
     |      ``start``.  If ``start>=len(self)``, then this iterator will
     |      generate no tokens.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(cls, source, start, stop)
     |      Construct a new slice from a given underlying sequence.  The
     |      ``start`` and ``stop`` indices should be absolute indices --
     |      i.e., they should not be negative (for indexing from the back
     |      of a list) or greater than the length of ``source``.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MIN_SIZE = 100
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractLazySequence:
     |
     |  __add__(self, other)
     |      Return a list concatenating self with other.
     |
     |  __contains__(self, value)
     |      Return true if this list contains ``value``.
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __getitem__(self, i)
     |      Return the *i* th token in the corpus file underlying this
     |      corpus view.  Negative indices and spans are both supported.
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      :raise ValueError: Corpus view objects are unhashable.
     |
     |  __iter__(self)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __radd__(self, other)
     |      Return a list concatenating other with self.
     |
     |  __repr__(self)
     |      Return a string representation for this corpus view that is
     |      similar to a list's representation; but if it would be more
     |      than 60 characters long, it is truncated.
     |
     |  __rmul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  count(self, value)
     |      Return the number of times this list contains ``value``.
     |
     |  index(self, value, start=None, stop=None)
     |      Return the index of the first occurrence of ``value`` in this
     |      list that is greater than or equal to ``start`` and less than
     |      ``stop``.  Negative start and stop values are treated like negative
     |      slice bounds -- i.e., they count from the end of the list.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractLazySequence:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LazyZip(LazyMap)
     |  LazyZip(*lists)
     |
     |  A lazy sequence whose elements are tuples, each containing the i-th
     |  element from each of the argument sequences.  The returned list is
     |  truncated in length to the length of the shortest argument sequence. The
     |  tuples are constructed lazily -- i.e., when you read a value from the
     |  list, ``LazyZip`` will calculate that value by forming a tuple from
     |  the i-th element of each of the argument sequences.
     |
     |  ``LazyZip`` is essentially a lazy version of the Python primitive function
     |  ``zip``.  In particular, an evaluated LazyZip is equivalent to a zip:
     |
     |      >>> from nltk.collections import LazyZip
     |      >>> sequence1, sequence2 = [1, 2, 3], ['a', 'b', 'c']
     |      >>> zip(sequence1, sequence2) # doctest: +SKIP
     |      [(1, 'a'), (2, 'b'), (3, 'c')]
     |      >>> list(LazyZip(sequence1, sequence2))
     |      [(1, 'a'), (2, 'b'), (3, 'c')]
     |      >>> sequences = [sequence1, sequence2, [6,7,8,9]]
     |      >>> list(zip(*sequences)) == list(LazyZip(*sequences))
     |      True
     |
     |  Lazy zips can be useful for conserving memory in cases where the argument
     |  sequences are particularly long.
     |
     |  A typical example of a use case for this class is combining long sequences
     |  of gold standard and predicted values in a classification or tagging task
     |  in order to calculate accuracy.  By constructing tuples lazily and
     |  avoiding the creation of an additional long sequence, memory usage can be
     |  significantly reduced.
     |
     |  Method resolution order:
     |      LazyZip
     |      LazyMap
     |      AbstractLazySequence
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, *lists)
     |      :param lists: the underlying lists
     |      :type lists: list(list)
     |
     |  __len__(self)
     |      Return the number of tokens in the corpus file underlying this
     |      corpus view.
     |
     |  iterate_from(self, index)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view, starting at the token number
     |      ``start``.  If ``start>=len(self)``, then this iterator will
     |      generate no tokens.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from LazyMap:
     |
     |  __getitem__(self, index)
     |      Return the *i* th token in the corpus file underlying this
     |      corpus view.  Negative indices and spans are both supported.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractLazySequence:
     |
     |  __add__(self, other)
     |      Return a list concatenating self with other.
     |
     |  __contains__(self, value)
     |      Return true if this list contains ``value``.
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      :raise ValueError: Corpus view objects are unhashable.
     |
     |  __iter__(self)
     |      Return an iterator that generates the tokens in the corpus
     |      file underlying this corpus view.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __radd__(self, other)
     |      Return a list concatenating other with self.
     |
     |  __repr__(self)
     |      Return a string representation for this corpus view that is
     |      similar to a list's representation; but if it would be more
     |      than 60 characters long, it is truncated.
     |
     |  __rmul__(self, count)
     |      Return a list concatenating self with itself ``count`` times.
     |
     |  count(self, value)
     |      Return the number of times this list contains ``value``.
     |
     |  index(self, value, start=None, stop=None)
     |      Return the index of the first occurrence of ``value`` in this
     |      list that is greater than or equal to ``start`` and less than
     |      ``stop``.  Negative start and stop values are treated like negative
     |      slice bounds -- i.e., they count from the end of the list.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractLazySequence:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class OrderedDict(builtins.dict)
     |  OrderedDict(data=None, **kwargs)
     |
     |  Method resolution order:
     |      OrderedDict
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __delitem__(self, key)
     |      Delete self[key].
     |
     |  __getitem__(self, key)
     |      Return self[key].
     |
     |  __init__(self, data=None, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |      Implement iter(self).
     |
     |  __missing__(self, key)
     |
     |  __setitem__(self, key, item)
     |      Set self[key] to value.
     |
     |  clear(self)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  copy(self)
     |      D.copy() -> a shallow copy of D
     |
     |  items(self)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(self, data=None, keys=None)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  popitem(self)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, failobj=None)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(self, data)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(self)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

    class Trie(builtins.dict)
     |  Trie(strings=None)
     |
     |  A Trie implementation for strings
     |
     |  Method resolution order:
     |      Trie
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, strings=None)
     |      Builds a Trie object, which is built around a ``dict``
     |
     |      If ``strings`` is provided, it will add the ``strings``, which
     |      consist of a ``list`` of ``strings``, to the Trie.
     |      Otherwise, it'll construct an empty Trie.
     |
     |      :param strings: List of strings to insert into the trie
     |          (Default is ``None``)
     |      :type strings: list(str)
     |
     |  __missing__(self, key)
     |
     |  insert(self, string)
     |      Inserts ``string`` into the Trie
     |
     |      :param string: String to insert into the trie
     |      :type string: str
     |
     |      :Example:
     |
     |      >>> from nltk.collections import Trie
     |      >>> trie = Trie(["abc", "def"])
     |      >>> expected = {'a': {'b': {'c': {True: None}}},                         'd': {'e': {'f': {True: None}}}}
     |      >>> trie == expected
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  LEAF = True
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  copy(...)
     |      D.copy() -> a shallow copy of D
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\collections.py

nltk.collocations
Python Library Documentation: module nltk.collocations in nltk

NAME
    nltk.collocations

DESCRIPTION
    Tools to identify collocations --- words that often appear consecutively
    --- within corpora. They may also be used to find other associations between
    word occurrences.
    See Manning and Schutze ch. 5 at https://nlp.stanford.edu/fsnlp/promo/colloc.pdf
    and the Text::NSP Perl package at http://ngram.sourceforge.net

    Finding collocations requires first calculating the frequencies of words and
    their appearance in the context of other words. Often the collection of words
    will then requiring filtering to only retain useful content terms. Each ngram
    of words may then be scored according to some association measure, in order
    to determine the relative likelihood of each ngram being a collocation.

    The ``BigramCollocationFinder`` and ``TrigramCollocationFinder`` classes provide
    these functionalities, dependent on being provided a function which scores a
    ngram given appropriate frequency counts. A number of standard association
    measures are provided in bigram_measures and trigram_measures.

CLASSES
    AbstractCollocationFinder(builtins.object)
        BigramCollocationFinder
        QuadgramCollocationFinder
        TrigramCollocationFinder

    class BigramCollocationFinder(AbstractCollocationFinder)
     |  BigramCollocationFinder(word_fd, bigram_fd, window_size=2)
     |
     |  A tool for the finding and ranking of bigram collocations or other
     |  association measures. It is often useful to use from_words() rather than
     |  constructing an instance directly.
     |
     |  Method resolution order:
     |      BigramCollocationFinder
     |      AbstractCollocationFinder
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, word_fd, bigram_fd, window_size=2)
     |      Construct a BigramCollocationFinder, given FreqDists for
     |      appearances of words and (possibly non-contiguous) bigrams.
     |
     |  score_ngram(self, score_fn, w1, w2)
     |      Returns the score for a given bigram using the given scoring
     |      function.  Following Church and Hanks (1990), counts are scaled by
     |      a factor of 1/(window_size - 1).
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  from_words(words, window_size=2)
     |      Construct a BigramCollocationFinder for all bigrams in the given
     |      sequence.  When window_size > 2, count non-contiguous bigrams, in the
     |      style of Church and Hanks's (1990) association ratio.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  default_ws = 2
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractCollocationFinder:
     |
     |  above_score(self, score_fn, min_score)
     |      Returns a sequence of ngrams, ordered by decreasing score, whose
     |      scores each exceed the given minimum score.
     |
     |  apply_freq_filter(self, min_freq)
     |      Removes candidate ngrams which have frequency less than min_freq.
     |
     |  apply_ngram_filter(self, fn)
     |      Removes candidate ngrams (w1, w2, ...) where fn(w1, w2, ...)
     |      evaluates to True.
     |
     |  apply_word_filter(self, fn)
     |      Removes candidate ngrams (w1, w2, ...) where any of (fn(w1), fn(w2),
     |      ...) evaluates to True.
     |
     |  nbest(self, score_fn, n)
     |      Returns the top n ngrams when scored by the given function.
     |
     |  score_ngrams(self, score_fn)
     |      Returns a sequence of (ngram, score) pairs ordered from highest to
     |      lowest score, as determined by the scoring function provided.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from AbstractCollocationFinder:
     |
     |  from_documents(documents)
     |      Constructs a collocation finder given a collection of documents,
     |      each of which is a list (or iterable) of tokens.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractCollocationFinder:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class QuadgramCollocationFinder(AbstractCollocationFinder)
     |  QuadgramCollocationFinder(word_fd, quadgram_fd, ii, iii, ixi, ixxi, iixi, ixii)
     |
     |  A tool for the finding and ranking of quadgram collocations or other association measures.
     |  It is often useful to use from_words() rather than constructing an instance directly.
     |
     |  Method resolution order:
     |      QuadgramCollocationFinder
     |      AbstractCollocationFinder
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, word_fd, quadgram_fd, ii, iii, ixi, ixxi, iixi, ixii)
     |      Construct a QuadgramCollocationFinder, given FreqDists for appearances of words,
     |      bigrams, trigrams, two words with one word and two words between them, three words
     |      with a word between them in both variations.
     |
     |  score_ngram(self, score_fn, w1, w2, w3, w4)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  from_words(words, window_size=4)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  default_ws = 4
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractCollocationFinder:
     |
     |  above_score(self, score_fn, min_score)
     |      Returns a sequence of ngrams, ordered by decreasing score, whose
     |      scores each exceed the given minimum score.
     |
     |  apply_freq_filter(self, min_freq)
     |      Removes candidate ngrams which have frequency less than min_freq.
     |
     |  apply_ngram_filter(self, fn)
     |      Removes candidate ngrams (w1, w2, ...) where fn(w1, w2, ...)
     |      evaluates to True.
     |
     |  apply_word_filter(self, fn)
     |      Removes candidate ngrams (w1, w2, ...) where any of (fn(w1), fn(w2),
     |      ...) evaluates to True.
     |
     |  nbest(self, score_fn, n)
     |      Returns the top n ngrams when scored by the given function.
     |
     |  score_ngrams(self, score_fn)
     |      Returns a sequence of (ngram, score) pairs ordered from highest to
     |      lowest score, as determined by the scoring function provided.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from AbstractCollocationFinder:
     |
     |  from_documents(documents)
     |      Constructs a collocation finder given a collection of documents,
     |      each of which is a list (or iterable) of tokens.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractCollocationFinder:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TrigramCollocationFinder(AbstractCollocationFinder)
     |  TrigramCollocationFinder(word_fd, bigram_fd, wildcard_fd, trigram_fd)
     |
     |  A tool for the finding and ranking of trigram collocations or other
     |  association measures. It is often useful to use from_words() rather than
     |  constructing an instance directly.
     |
     |  Method resolution order:
     |      TrigramCollocationFinder
     |      AbstractCollocationFinder
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, word_fd, bigram_fd, wildcard_fd, trigram_fd)
     |      Construct a TrigramCollocationFinder, given FreqDists for
     |      appearances of words, bigrams, two words with any word between them,
     |      and trigrams.
     |
     |  bigram_finder(self)
     |      Constructs a bigram collocation finder with the bigram and unigram
     |      data from this finder. Note that this does not include any filtering
     |      applied to this finder.
     |
     |  score_ngram(self, score_fn, w1, w2, w3)
     |      Returns the score for a given trigram using the given scoring
     |      function.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  from_words(words, window_size=3)
     |      Construct a TrigramCollocationFinder for all trigrams in the given
     |      sequence.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  default_ws = 3
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractCollocationFinder:
     |
     |  above_score(self, score_fn, min_score)
     |      Returns a sequence of ngrams, ordered by decreasing score, whose
     |      scores each exceed the given minimum score.
     |
     |  apply_freq_filter(self, min_freq)
     |      Removes candidate ngrams which have frequency less than min_freq.
     |
     |  apply_ngram_filter(self, fn)
     |      Removes candidate ngrams (w1, w2, ...) where fn(w1, w2, ...)
     |      evaluates to True.
     |
     |  apply_word_filter(self, fn)
     |      Removes candidate ngrams (w1, w2, ...) where any of (fn(w1), fn(w2),
     |      ...) evaluates to True.
     |
     |  nbest(self, score_fn, n)
     |      Returns the top n ngrams when scored by the given function.
     |
     |  score_ngrams(self, score_fn)
     |      Returns a sequence of (ngram, score) pairs ordered from highest to
     |      lowest score, as determined by the scoring function provided.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from AbstractCollocationFinder:
     |
     |  from_documents(documents)
     |      Constructs a collocation finder given a collection of documents,
     |      each of which is a list (or iterable) of tokens.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from AbstractCollocationFinder:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    __all__ = ['BigramCollocationFinder', 'TrigramCollocationFinder', 'Qua...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\collocations.py

nltk.combinations
Python Library Documentation: class combinations in module itertools

class combinations(builtins.object)
 |  combinations(iterable, r)
 |
 |  Return successive r-length combinations of elements in the iterable.
 |
 |  combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3)
 |
 |  Methods defined here:
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __next__(self, /)
 |      Implement next(self).
 |
 |  __reduce__(...)
 |      Return state information for pickling.
 |
 |  __setstate__(...)
 |      Set state information for unpickling.
 |
 |  __sizeof__(...)
 |      Returns size in memory, in bytes.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.config_java
Python Library Documentation: function config_java in module nltk.internals

config_java(bin=None, options=None, verbose=False)
    Configure nltk's java interface, by letting nltk know where it can
    find the Java binary, and what extra options (if any) should be
    passed to Java when it is run.

    :param bin: The full path to the Java binary.  If not specified,
        then nltk will search the system for a Java binary; and if
        one is not found, it will raise a ``LookupError`` exception.
    :type bin: str
    :param options: A list of options that should be passed to the
        Java binary when it is called.  A common value is
        ``'-Xmx512m'``, which tells Java binary to increase
        the maximum heap size to 512 megabytes.  If no options are
        specified, then do not modify the options list.
    :type options: list(str)
nltk.config_megam
Python Library Documentation: function config_megam in module nltk.classify.megam

config_megam(bin=None)
    Configure NLTK's interface to the ``megam`` maxent optimization
    package.

    :param bin: The full path to the ``megam`` binary.  If not specified,
        then nltk will search the system for a ``megam`` binary; and if
        one is not found, it will raise a ``LookupError`` exception.
    :type bin: str
nltk.config_weka
Python Library Documentation: function config_weka in module nltk.classify.weka

config_weka(classpath=None)
nltk.conflicts
Python Library Documentation: function conflicts in module nltk.featstruct

conflicts(fstruct1, fstruct2, trace=0)
    Return a list of the feature paths of all features which are
    assigned incompatible values by ``fstruct1`` and ``fstruct2``.

    :rtype: list(tuple)
nltk.confusionmatrix
Python Library Documentation: module nltk.metrics.confusionmatrix in nltk.metrics

NAME
    nltk.metrics.confusionmatrix

DESCRIPTION
    # Natural Language Toolkit: Confusion Matrices
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Edward Loper <edloper@gmail.com>
    #         Steven Bird <stevenbird1@gmail.com>
    #         Tom Aarsen <>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.object
        ConfusionMatrix

    class ConfusionMatrix(builtins.object)
     |  ConfusionMatrix(reference, test, sort_by_count=False)
     |
     |  The confusion matrix between a list of reference values and a
     |  corresponding list of test values.  Entry *[r,t]* of this
     |  matrix is a count of the number of times that the reference value
     |  *r* corresponds to the test value *t*.  E.g.:
     |
     |      >>> from nltk.metrics import ConfusionMatrix
     |      >>> ref  = 'DET NN VB DET JJ NN NN IN DET NN'.split()
     |      >>> test = 'DET VB VB DET NN NN NN IN DET NN'.split()
     |      >>> cm = ConfusionMatrix(ref, test)
     |      >>> print(cm['NN', 'NN'])
     |      3
     |
     |  Note that the diagonal entries *Ri=Tj* of this matrix
     |  corresponds to correct values; and the off-diagonal entries
     |  correspond to incorrect values.
     |
     |  Methods defined here:
     |
     |  __getitem__(self, li_lj_tuple)
     |      :return: The number of times that value ``li`` was expected and
     |      value ``lj`` was given.
     |      :rtype: int
     |
     |  __init__(self, reference, test, sort_by_count=False)
     |      Construct a new confusion matrix from a list of reference
     |      values and a corresponding list of test values.
     |
     |      :type reference: list
     |      :param reference: An ordered list of reference values.
     |      :type test: list
     |      :param test: A list of values to compare against the
     |          corresponding reference values.
     |      :raise ValueError: If ``reference`` and ``length`` do not have
     |          the same length.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  evaluate(self, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each value in this confusion matrix.
     |
     |      >>> reference = "DET NN VB DET JJ NN NN IN DET NN".split()
     |      >>> test = "DET VB VB DET NN NN NN IN DET NN".split()
     |      >>> cm = ConfusionMatrix(reference, test)
     |      >>> print(cm.evaluate())
     |      Tag | Prec.  | Recall | F-measure
     |      ----+--------+--------+-----------
     |      DET | 1.0000 | 1.0000 | 1.0000
     |       IN | 1.0000 | 1.0000 | 1.0000
     |       JJ | 0.0000 | 0.0000 | 0.0000
     |       NN | 0.7500 | 0.7500 | 0.7500
     |       VB | 0.5000 | 1.0000 | 0.6667
     |      <BLANKLINE>
     |
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values. Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on frequency
     |          in the reference label. Defaults to False.
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, value, alpha=0.5)
     |      Given a value used in the confusion matrix, return the f-measure
     |      that corresponds to this value. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param value: value used in the ConfusionMatrix
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: the F-measure corresponding to ``value``.
     |      :rtype: float
     |
     |  key(self)
     |
     |  precision(self, value)
     |      Given a value in the confusion matrix, return the precision
     |      that corresponds to this value. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      and can loosely be considered the ratio of how often ``value``
     |      was predicted correctly relative to the number of predictions
     |      for ``value``.
     |
     |      :param value: value used in the ConfusionMatrix
     |      :return: the precision corresponding to ``value``.
     |      :rtype: float
     |
     |  pretty_format(self, show_percents=False, values_in_chart=True, truncate=None, sort_by_count=False)
     |      :return: A multi-line string representation of this confusion matrix.
     |      :type truncate: int
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation.
     |      :param sort_by_count: If true, then sort by the count of each
     |          label in the reference data.  I.e., labels that occur more
     |          frequently in the reference label will be towards the left
     |          edge of the matrix, and labels that occur less frequently
     |          will be towards the right edge.
     |
     |      @todo: add marginals?
     |
     |  recall(self, value)
     |      Given a value in the confusion matrix, return the recall
     |      that corresponds to this value. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      and can loosely be considered the ratio of how often ``value``
     |      was predicted correctly relative to how often ``value`` was
     |      the true result.
     |
     |      :param value: value used in the ConfusionMatrix
     |      :return: the recall corresponding to ``value``.
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\metrics\confusionmatrix.py

nltk.conllstr2tree
Python Library Documentation: function conllstr2tree in module nltk.chunk.util

conllstr2tree(s, chunk_types=('NP', 'PP', 'VP'), root_label='S')
    Return a chunk structure for a single sentence
    encoded in the given CONLL 2000 style string.
    This function converts a CoNLL IOB string into a tree.
    It uses the specified chunk types
    (defaults to NP, PP and VP), and creates a tree rooted at a node
    labeled S (by default).

    :param s: The CoNLL string to be converted.
    :type s: str
    :param chunk_types: The chunk types to be converted.
    :type chunk_types: tuple
    :param root_label: The node label to use for the root.
    :type root_label: str
    :rtype: Tree
nltk.conlltags2tree
Python Library Documentation: function conlltags2tree in module nltk.chunk.util

conlltags2tree(sentence, chunk_types=('NP', 'PP', 'VP'), root_label='S', strict=False)
    Convert the CoNLL IOB format to a tree.
nltk.corenlp
Python Library Documentation: module nltk.parse.corenlp in nltk.parse

NAME
    nltk.parse.corenlp

DESCRIPTION
    # Natural Language Toolkit: Interface to the CoreNLP REST API.
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Dmitrijs Milajevs <dimazest@gmail.com>
    #
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.OSError(builtins.Exception)
        CoreNLPServerError
    builtins.object
        CoreNLPServer
    nltk.parse.api.ParserI(builtins.object)
        GenericCoreNLPParser(nltk.parse.api.ParserI, nltk.tokenize.api.TokenizerI, nltk.tag.api.TaggerI)
            CoreNLPDependencyParser
            CoreNLPParser
    nltk.tag.api.TaggerI(builtins.object)
        GenericCoreNLPParser(nltk.parse.api.ParserI, nltk.tokenize.api.TokenizerI, nltk.tag.api.TaggerI)
            CoreNLPDependencyParser
            CoreNLPParser
    nltk.tokenize.api.TokenizerI(abc.ABC)
        GenericCoreNLPParser(nltk.parse.api.ParserI, nltk.tokenize.api.TokenizerI, nltk.tag.api.TaggerI)
            CoreNLPDependencyParser
            CoreNLPParser

    class CoreNLPDependencyParser(GenericCoreNLPParser)
     |  CoreNLPDependencyParser(url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
     |
     |  Dependency parser.
     |
     |  Skip these tests if CoreNLP is likely not ready.
     |  >>> from nltk.test.setup_fixt import check_jar
     |  >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
     |
     |  The recommended usage of `CoreNLPParser` is using the context manager notation:
     |  >>> with CoreNLPServer() as server:
     |  ...     dep_parser = CoreNLPDependencyParser(url=server.url)
     |  ...     parse, = dep_parser.raw_parse(
     |  ...         'The quick brown fox jumps over the lazy dog.'
     |  ...     )
     |  ...     print(parse.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
     |  The        DT      4       det
     |  quick      JJ      4       amod
     |  brown      JJ      4       amod
     |  fox        NN      5       nsubj
     |  jumps      VBZ     0       ROOT
     |  over       IN      9       case
     |  the        DT      9       det
     |  lazy       JJ      9       amod
     |  dog        NN      5       obl
     |  .  .       5       punct
     |
     |  Alternatively, the server can be started using the following notation.
     |  Note that `CoreNLPServer` does not need to be used if the CoreNLP server is started
     |  outside of Python.
     |  >>> server = CoreNLPServer()
     |  >>> server.start()
     |  >>> dep_parser = CoreNLPDependencyParser(url=server.url)
     |  >>> parse, = dep_parser.raw_parse('The quick brown fox jumps over the lazy dog.')
     |  >>> print(parse.tree())  # doctest: +NORMALIZE_WHITESPACE
     |  (jumps (fox The quick brown) (dog over the lazy) .)
     |
     |  >>> for governor, dep, dependent in parse.triples():
     |  ...     print(governor, dep, dependent)  # doctest: +NORMALIZE_WHITESPACE
     |  ('jumps', 'VBZ') nsubj ('fox', 'NN')
     |  ('fox', 'NN') det ('The', 'DT')
     |  ('fox', 'NN') amod ('quick', 'JJ')
     |  ('fox', 'NN') amod ('brown', 'JJ')
     |  ('jumps', 'VBZ') obl ('dog', 'NN')
     |  ('dog', 'NN') case ('over', 'IN')
     |  ('dog', 'NN') det ('the', 'DT')
     |  ('dog', 'NN') amod ('lazy', 'JJ')
     |  ('jumps', 'VBZ') punct ('.', '.')
     |
     |  >>> (parse_fox, ), (parse_dog, ) = dep_parser.raw_parse_sents(
     |  ...     [
     |  ...         'The quick brown fox jumps over the lazy dog.',
     |  ...         'The quick grey wolf jumps over the lazy fox.',
     |  ...     ]
     |  ... )
     |  >>> print(parse_fox.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
     |  The        DT      4       det
     |  quick      JJ      4       amod
     |  brown      JJ      4       amod
     |  fox        NN      5       nsubj
     |  jumps      VBZ     0       ROOT
     |  over       IN      9       case
     |  the        DT      9       det
     |  lazy       JJ      9       amod
     |  dog        NN      5       obl
     |  .  .       5       punct
     |
     |  >>> print(parse_dog.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
     |  The        DT      4       det
     |  quick      JJ      4       amod
     |  grey       JJ      4       amod
     |  wolf       NN      5       nsubj
     |  jumps      VBZ     0       ROOT
     |  over       IN      9       case
     |  the        DT      9       det
     |  lazy       JJ      9       amod
     |  fox        NN      5       obl
     |  .  .       5       punct
     |
     |  >>> (parse_dog, ), (parse_friends, ) = dep_parser.parse_sents(
     |  ...     [
     |  ...         "I 'm a dog".split(),
     |  ...         "This is my friends ' cat ( the tabby )".split(),
     |  ...     ]
     |  ... )
     |  >>> print(parse_dog.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
     |  I   PRP     4       nsubj
     |  'm  VBP     4       cop
     |  a   DT      4       det
     |  dog NN      0       ROOT
     |
     |  >>> print(parse_friends.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
     |  This       DT      6       nsubj
     |  is VBZ     6       cop
     |  my PRP$    4       nmod:poss
     |  friends    NNS     6       nmod:poss
     |  '  POS     4       case
     |  cat        NN      0       ROOT
     |  (  -LRB-   9       punct
     |  the        DT      9       det
     |  tabby      NN      6       dep
     |  )  -RRB-   9       punct
     |
     |  >>> parse_john, parse_mary, = dep_parser.parse_text(
     |  ...     'John loves Mary. Mary walks.'
     |  ... )
     |
     |  >>> print(parse_john.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
     |  John       NNP     2       nsubj
     |  loves      VBZ     0       ROOT
     |  Mary       NNP     2       obj
     |  .  .       2       punct
     |
     |  >>> print(parse_mary.to_conll(4))  # doctest: +NORMALIZE_WHITESPACE
     |  Mary        NNP     2       nsubj
     |  walks       VBZ     0       ROOT
     |  .   .       2       punct
     |
     |  Special cases
     |
     |  Non-breaking space inside of a token.
     |
     |  >>> len(
     |  ...     next(
     |  ...         dep_parser.raw_parse(
     |  ...             'Anhalt said children typically treat a 20-ounce soda bottle as one '
     |  ...             'serving, while it actually contains 2 1/2 servings.'
     |  ...         )
     |  ...     ).nodes
     |  ... )
     |  23
     |
     |  Phone  numbers.
     |
     |  >>> len(
     |  ...     next(
     |  ...         dep_parser.raw_parse('This is not going to crash: 01 111 555.')
     |  ...     ).nodes
     |  ... )
     |  10
     |
     |  >>> print(
     |  ...     next(
     |  ...         dep_parser.raw_parse('The underscore _ should not simply disappear.')
     |  ...     ).to_conll(4)
     |  ... )  # doctest: +NORMALIZE_WHITESPACE
     |  The        DT      2       det
     |  underscore NN      7       nsubj
     |  _  NFP     7       punct
     |  should     MD      7       aux
     |  not        RB      7       advmod
     |  simply     RB      7       advmod
     |  disappear  VB      0       ROOT
     |  .  .       7       punct
     |
     |  >>> print(
     |  ...     next(
     |  ...         dep_parser.raw_parse(
     |  ...             'for all of its insights into the dream world of teen life , and its electronic expression through '
     |  ...             'cyber culture , the film gives no quarter to anyone seeking to pull a cohesive story out of its 2 '
     |  ...             '1/2-hour running time .'
     |  ...         )
     |  ...     ).to_conll(4)
     |  ... )  # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
     |  for        IN      2       case
     |  all        DT      24      obl
     |  of IN      5       case
     |  its        PRP$    5       nmod:poss
     |  insights   NNS     2       nmod
     |  into       IN      9       case
     |  the        DT      9       det
     |  dream      NN      9       compound
     |  world      NN      5       nmod
     |  of IN      12      case
     |  teen       NN      12      compound
     |  ...
     |
     |  >>> server.stop()
     |
     |  Method resolution order:
     |      CoreNLPDependencyParser
     |      GenericCoreNLPParser
     |      nltk.parse.api.ParserI
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  make_tree(self, result)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  parser_annotator = 'depparse'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from GenericCoreNLPParser:
     |
     |  __init__(self, url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  api_call(self, data, properties=None, timeout=60)
     |
     |  parse_sents(self, sentences, *args, **kwargs)
     |      Parse multiple sentences.
     |
     |      Takes multiple sentences as a list where each sentence is a list of
     |      words. Each sentence will be automatically tagged with this
     |      CoreNLPParser instance's tagger.
     |
     |      If a whitespace exists inside a token, then the token will be treated as
     |      several tokens.
     |
     |      :param sentences: Input sentences to parse
     |      :type sentences: list(list(str))
     |      :rtype: iter(iter(Tree))
     |
     |  parse_text(self, text, *args, **kwargs)
     |      Parse a piece of text.
     |
     |      The text might contain several sentences which will be split by CoreNLP.
     |
     |      :param str text: text to be split.
     |      :returns: an iterable of syntactic structures.  # TODO: should it be an iterable of iterables?
     |
     |  raw_parse(self, sentence, properties=None, *args, **kwargs)
     |      Parse a sentence.
     |
     |      Takes a sentence as a string; before parsing, it will be automatically
     |      tokenized and tagged by the CoreNLP Parser.
     |
     |      :param sentence: Input sentence to parse
     |      :type sentence: str
     |      :rtype: iter(Tree)
     |
     |  raw_parse_sents(self, sentences, verbose=False, properties=None, *args, **kwargs)
     |      Parse multiple sentences.
     |
     |      Takes multiple sentences as a list of strings. Each sentence will be
     |      automatically tokenized and tagged.
     |
     |      :param sentences: Input sentences to parse.
     |      :type sentences: list(str)
     |      :rtype: iter(iter(Tree))
     |
     |  raw_tag_sents(self, sentences, properties=None)
     |      Tag multiple sentences.
     |
     |      Takes multiple sentences as a list where each sentence is a string.
     |
     |      :param sentences: Input sentences to tag
     |      :type sentences: list(str)
     |      :rtype: list(list(list(tuple(str, str)))
     |
     |  tag(self, sentence: str, properties=None) -> list[tuple[str, str]]
     |      Tag a list of tokens.
     |
     |      :rtype: list(tuple(str, str))
     |
     |      Skip these tests if CoreNLP is likely not ready.
     |      >>> from nltk.test.setup_fixt import check_jar
     |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
     |
     |      The CoreNLP server can be started using the following notation, although
     |      we recommend the `with CoreNLPServer() as server:` context manager notation
     |      to ensure that the server is always stopped.
     |      >>> server = CoreNLPServer()
     |      >>> server.start()
     |      >>> parser = CoreNLPParser(url=server.url, tagtype='ner')
     |      >>> tokens = 'Rami Eid is studying at Stony Brook University in NY'.split()
     |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
     |      [('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'), ('at', 'O'), ('Stony', 'ORGANIZATION'),
     |      ('Brook', 'ORGANIZATION'), ('University', 'ORGANIZATION'), ('in', 'O'), ('NY', 'STATE_OR_PROVINCE')]
     |
     |      >>> parser = CoreNLPParser(url=server.url, tagtype='pos')
     |      >>> tokens = "What is the airspeed of an unladen swallow ?".split()
     |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
     |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'),
     |      ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'),
     |      ('unladen', 'JJ'), ('swallow', 'VB'), ('?', '.')]
     |      >>> server.stop()
     |
     |  tag_sents(self, sentences, properties=None)
     |      Tag multiple sentences.
     |
     |      Takes multiple sentences as a list where each sentence is a list of
     |      tokens.
     |
     |      :param sentences: Input sentences to tag
     |      :type sentences: list(list(str))
     |      :rtype: list(list(tuple(str, str))
     |
     |  tokenize(self, text, properties=None)
     |      Tokenize a string of text.
     |
     |      Skip these tests if CoreNLP is likely not ready.
     |      >>> from nltk.test.setup_fixt import check_jar
     |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
     |
     |      The CoreNLP server can be started using the following notation, although
     |      we recommend the `with CoreNLPServer() as server:` context manager notation
     |      to ensure that the server is always stopped.
     |      >>> server = CoreNLPServer()
     |      >>> server.start()
     |      >>> parser = CoreNLPParser(url=server.url)
     |
     |      >>> text = 'Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\nThanks.'
     |      >>> list(parser.tokenize(text))
     |      ['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York', '.', 'Please', 'buy', 'me', 'two', 'of', 'them', '.', 'Thanks', '.']
     |
     |      >>> s = "The colour of the wall is blue."
     |      >>> list(
     |      ...     parser.tokenize(
     |      ...         'The colour of the wall is blue.',
     |      ...             properties={'tokenize.options': 'americanize=true'},
     |      ...     )
     |      ... )
     |      ['The', 'colour', 'of', 'the', 'wall', 'is', 'blue', '.']
     |      >>> server.stop()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, sent, *args, **kwargs)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]

    class CoreNLPParser(GenericCoreNLPParser)
     |  CoreNLPParser(url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
     |
     |  Skip these tests if CoreNLP is likely not ready.
     |  >>> from nltk.test.setup_fixt import check_jar
     |  >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
     |
     |  The recommended usage of `CoreNLPParser` is using the context manager notation:
     |  >>> with CoreNLPServer() as server:
     |  ...     parser = CoreNLPParser(url=server.url)
     |  ...     next(
     |  ...         parser.raw_parse('The quick brown fox jumps over the lazy dog.')
     |  ...     ).pretty_print()  # doctest: +NORMALIZE_WHITESPACE
     |                          ROOT
     |                          |
     |                          S
     |          _______________|__________________________
     |          |                         VP               |
     |          |                _________|___             |
     |          |               |             PP           |
     |          |               |     ________|___         |
     |          NP              |    |            NP       |
     |      ____|__________     |    |     _______|____    |
     |      DT   JJ    JJ   NN  VBZ   IN   DT      JJ   NN  .
     |      |    |     |    |    |    |    |       |    |   |
     |      The quick brown fox jumps over the     lazy dog  .
     |
     |  Alternatively, the server can be started using the following notation.
     |  Note that `CoreNLPServer` does not need to be used if the CoreNLP server is started
     |  outside of Python.
     |  >>> server = CoreNLPServer()
     |  >>> server.start()
     |  >>> parser = CoreNLPParser(url=server.url)
     |
     |  >>> (parse_fox, ), (parse_wolf, ) = parser.raw_parse_sents(
     |  ...     [
     |  ...         'The quick brown fox jumps over the lazy dog.',
     |  ...         'The quick grey wolf jumps over the lazy fox.',
     |  ...     ]
     |  ... )
     |
     |  >>> parse_fox.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
     |                       ROOT
     |                        |
     |                        S
     |         _______________|__________________________
     |        |                         VP               |
     |        |                _________|___             |
     |        |               |             PP           |
     |        |               |     ________|___         |
     |        NP              |    |            NP       |
     |    ____|__________     |    |     _______|____    |
     |   DT   JJ    JJ   NN  VBZ   IN   DT      JJ   NN  .
     |   |    |     |    |    |    |    |       |    |   |
     |  The quick brown fox jumps over the     lazy dog  .
     |
     |  >>> parse_wolf.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
     |                       ROOT
     |                        |
     |                        S
     |         _______________|__________________________
     |        |                         VP               |
     |        |                _________|___             |
     |        |               |             PP           |
     |        |               |     ________|___         |
     |        NP              |    |            NP       |
     |    ____|_________      |    |     _______|____    |
     |   DT   JJ   JJ   NN   VBZ   IN   DT      JJ   NN  .
     |   |    |    |    |     |    |    |       |    |   |
     |  The quick grey wolf jumps over the     lazy fox  .
     |
     |  >>> (parse_dog, ), (parse_friends, ) = parser.parse_sents(
     |  ...     [
     |  ...         "I 'm a dog".split(),
     |  ...         "This is my friends ' cat ( the tabby )".split(),
     |  ...     ]
     |  ... )
     |
     |  >>> parse_dog.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
     |          ROOT
     |           |
     |           S
     |    _______|____
     |   |            VP
     |   |    ________|___
     |   NP  |            NP
     |   |   |         ___|___
     |  PRP VBP       DT      NN
     |   |   |        |       |
     |   I   'm       a      dog
     |
     |  >>> parse_friends.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
     |       ROOT
     |        |
     |        S
     |    ____|___________
     |   |                VP
     |   |     ___________|_____________
     |   |    |                         NP
     |   |    |                  _______|________________________
     |   |    |                 NP           |        |          |
     |   |    |            _____|_______     |        |          |
     |   NP   |           NP            |    |        NP         |
     |   |    |     ______|_________    |    |     ___|____      |
     |   DT  VBZ  PRP$   NNS       POS  NN -LRB-  DT       NN  -RRB-
     |   |    |    |      |         |   |    |    |        |     |
     |  This  is   my  friends      '  cat -LRB- the     tabby -RRB-
     |
     |  >>> parse_john, parse_mary, = parser.parse_text(
     |  ...     'John loves Mary. Mary walks.'
     |  ... )
     |
     |  >>> parse_john.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
     |        ROOT
     |         |
     |         S
     |    _____|_____________
     |   |          VP       |
     |   |      ____|___     |
     |   NP    |        NP   |
     |   |     |        |    |
     |  NNP   VBZ      NNP   .
     |   |     |        |    |
     |  John loves     Mary  .
     |
     |  >>> parse_mary.pretty_print()  # doctest: +NORMALIZE_WHITESPACE
     |        ROOT
     |         |
     |         S
     |    _____|____
     |   NP    VP   |
     |   |     |    |
     |  NNP   VBZ   .
     |   |     |    |
     |  Mary walks  .
     |
     |  Special cases
     |
     |  >>> next(
     |  ...     parser.raw_parse(
     |  ...         'NASIRIYA, Iraq—Iraqi doctors who treated former prisoner of war '
     |  ...         'Jessica Lynch have angrily dismissed claims made in her biography '
     |  ...         'that she was raped by her Iraqi captors.'
     |  ...     )
     |  ... ).height()
     |  14
     |
     |  >>> next(
     |  ...     parser.raw_parse(
     |  ...         "The broader Standard & Poor's 500 Index <.SPX> was 0.46 points lower, or "
     |  ...         '0.05 percent, at 997.02.'
     |  ...     )
     |  ... ).height()
     |  11
     |
     |  >>> server.stop()
     |
     |  Method resolution order:
     |      CoreNLPParser
     |      GenericCoreNLPParser
     |      nltk.parse.api.ParserI
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  make_tree(self, result)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  parser_annotator = 'parse'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from GenericCoreNLPParser:
     |
     |  __init__(self, url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  api_call(self, data, properties=None, timeout=60)
     |
     |  parse_sents(self, sentences, *args, **kwargs)
     |      Parse multiple sentences.
     |
     |      Takes multiple sentences as a list where each sentence is a list of
     |      words. Each sentence will be automatically tagged with this
     |      CoreNLPParser instance's tagger.
     |
     |      If a whitespace exists inside a token, then the token will be treated as
     |      several tokens.
     |
     |      :param sentences: Input sentences to parse
     |      :type sentences: list(list(str))
     |      :rtype: iter(iter(Tree))
     |
     |  parse_text(self, text, *args, **kwargs)
     |      Parse a piece of text.
     |
     |      The text might contain several sentences which will be split by CoreNLP.
     |
     |      :param str text: text to be split.
     |      :returns: an iterable of syntactic structures.  # TODO: should it be an iterable of iterables?
     |
     |  raw_parse(self, sentence, properties=None, *args, **kwargs)
     |      Parse a sentence.
     |
     |      Takes a sentence as a string; before parsing, it will be automatically
     |      tokenized and tagged by the CoreNLP Parser.
     |
     |      :param sentence: Input sentence to parse
     |      :type sentence: str
     |      :rtype: iter(Tree)
     |
     |  raw_parse_sents(self, sentences, verbose=False, properties=None, *args, **kwargs)
     |      Parse multiple sentences.
     |
     |      Takes multiple sentences as a list of strings. Each sentence will be
     |      automatically tokenized and tagged.
     |
     |      :param sentences: Input sentences to parse.
     |      :type sentences: list(str)
     |      :rtype: iter(iter(Tree))
     |
     |  raw_tag_sents(self, sentences, properties=None)
     |      Tag multiple sentences.
     |
     |      Takes multiple sentences as a list where each sentence is a string.
     |
     |      :param sentences: Input sentences to tag
     |      :type sentences: list(str)
     |      :rtype: list(list(list(tuple(str, str)))
     |
     |  tag(self, sentence: str, properties=None) -> list[tuple[str, str]]
     |      Tag a list of tokens.
     |
     |      :rtype: list(tuple(str, str))
     |
     |      Skip these tests if CoreNLP is likely not ready.
     |      >>> from nltk.test.setup_fixt import check_jar
     |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
     |
     |      The CoreNLP server can be started using the following notation, although
     |      we recommend the `with CoreNLPServer() as server:` context manager notation
     |      to ensure that the server is always stopped.
     |      >>> server = CoreNLPServer()
     |      >>> server.start()
     |      >>> parser = CoreNLPParser(url=server.url, tagtype='ner')
     |      >>> tokens = 'Rami Eid is studying at Stony Brook University in NY'.split()
     |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
     |      [('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'), ('at', 'O'), ('Stony', 'ORGANIZATION'),
     |      ('Brook', 'ORGANIZATION'), ('University', 'ORGANIZATION'), ('in', 'O'), ('NY', 'STATE_OR_PROVINCE')]
     |
     |      >>> parser = CoreNLPParser(url=server.url, tagtype='pos')
     |      >>> tokens = "What is the airspeed of an unladen swallow ?".split()
     |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
     |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'),
     |      ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'),
     |      ('unladen', 'JJ'), ('swallow', 'VB'), ('?', '.')]
     |      >>> server.stop()
     |
     |  tag_sents(self, sentences, properties=None)
     |      Tag multiple sentences.
     |
     |      Takes multiple sentences as a list where each sentence is a list of
     |      tokens.
     |
     |      :param sentences: Input sentences to tag
     |      :type sentences: list(list(str))
     |      :rtype: list(list(tuple(str, str))
     |
     |  tokenize(self, text, properties=None)
     |      Tokenize a string of text.
     |
     |      Skip these tests if CoreNLP is likely not ready.
     |      >>> from nltk.test.setup_fixt import check_jar
     |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
     |
     |      The CoreNLP server can be started using the following notation, although
     |      we recommend the `with CoreNLPServer() as server:` context manager notation
     |      to ensure that the server is always stopped.
     |      >>> server = CoreNLPServer()
     |      >>> server.start()
     |      >>> parser = CoreNLPParser(url=server.url)
     |
     |      >>> text = 'Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\nThanks.'
     |      >>> list(parser.tokenize(text))
     |      ['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York', '.', 'Please', 'buy', 'me', 'two', 'of', 'them', '.', 'Thanks', '.']
     |
     |      >>> s = "The colour of the wall is blue."
     |      >>> list(
     |      ...     parser.tokenize(
     |      ...         'The colour of the wall is blue.',
     |      ...             properties={'tokenize.options': 'americanize=true'},
     |      ...     )
     |      ... )
     |      ['The', 'colour', 'of', 'the', 'wall', 'is', 'blue', '.']
     |      >>> server.stop()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, sent, *args, **kwargs)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]

    class CoreNLPServer(builtins.object)
     |  CoreNLPServer(path_to_jar=None, path_to_models_jar=None, verbose=False, java_options=None, corenlp_options=None, port=None)
     |
     |  Methods defined here:
     |
     |  __enter__(self)
     |      Start the CoreNLP server
     |
     |      This method checks the status of the started server and stops the server process
     |      if those checks fail. If you want the server process to **not** be stopped in that case,
     |      use the :meth:`.start`/ :meth:`.stop` methods.
     |
     |      :raises CoreNLPServerError: If the server fails to start.
     |
     |  __exit__(self, exc_type, exc_val, exc_tb)
     |
     |  __init__(self, path_to_jar=None, path_to_models_jar=None, verbose=False, java_options=None, corenlp_options=None, port=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  start(self, stdout='devnull', stderr='devnull')
     |      Start the CoreNLP server
     |
     |      This method checks the status of the started server, but does **not** stop
     |      the server process if those checks fail. If you want the server process
     |      to be stopped in that case, either use this class as a context manager
     |      (see :meth:`.__enter__()`) or catch :exc:`~corenlp.CoreNLPServerError`
     |      exception and stop the server manually.
     |
     |      :param stdout, stderr: Specifies where CoreNLP output is redirected. Valid values are 'devnull', 'stdout', 'pipe'
     |      :raises CoreNLPServerError: If the server fails to start or a status check fails
     |          (in which case the server process remains running).
     |
     |  stop(self)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class CoreNLPServerError(builtins.OSError)
     |  Exceptions associated with the Core NLP server.
     |
     |  Method resolution order:
     |      CoreNLPServerError
     |      builtins.OSError
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.OSError:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.OSError:
     |
     |  __new__(*args, **kwargs) class method of builtins.OSError
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.OSError:
     |
     |  characters_written
     |
     |  errno
     |      POSIX exception code
     |
     |  filename
     |      exception filename
     |
     |  filename2
     |      second exception filename
     |
     |  strerror
     |      exception strerror
     |
     |  winerror
     |      Win32 exception code
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class GenericCoreNLPParser(nltk.parse.api.ParserI, nltk.tokenize.api.TokenizerI, nltk.tag.api.TaggerI)
     |  GenericCoreNLPParser(url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
     |
     |  Interface to the CoreNLP Parser.
     |
     |  Method resolution order:
     |      GenericCoreNLPParser
     |      nltk.parse.api.ParserI
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, url='http://localhost:9000', encoding='utf8', tagtype=None, strict_json=True)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  api_call(self, data, properties=None, timeout=60)
     |
     |  parse_sents(self, sentences, *args, **kwargs)
     |      Parse multiple sentences.
     |
     |      Takes multiple sentences as a list where each sentence is a list of
     |      words. Each sentence will be automatically tagged with this
     |      CoreNLPParser instance's tagger.
     |
     |      If a whitespace exists inside a token, then the token will be treated as
     |      several tokens.
     |
     |      :param sentences: Input sentences to parse
     |      :type sentences: list(list(str))
     |      :rtype: iter(iter(Tree))
     |
     |  parse_text(self, text, *args, **kwargs)
     |      Parse a piece of text.
     |
     |      The text might contain several sentences which will be split by CoreNLP.
     |
     |      :param str text: text to be split.
     |      :returns: an iterable of syntactic structures.  # TODO: should it be an iterable of iterables?
     |
     |  raw_parse(self, sentence, properties=None, *args, **kwargs)
     |      Parse a sentence.
     |
     |      Takes a sentence as a string; before parsing, it will be automatically
     |      tokenized and tagged by the CoreNLP Parser.
     |
     |      :param sentence: Input sentence to parse
     |      :type sentence: str
     |      :rtype: iter(Tree)
     |
     |  raw_parse_sents(self, sentences, verbose=False, properties=None, *args, **kwargs)
     |      Parse multiple sentences.
     |
     |      Takes multiple sentences as a list of strings. Each sentence will be
     |      automatically tokenized and tagged.
     |
     |      :param sentences: Input sentences to parse.
     |      :type sentences: list(str)
     |      :rtype: iter(iter(Tree))
     |
     |  raw_tag_sents(self, sentences, properties=None)
     |      Tag multiple sentences.
     |
     |      Takes multiple sentences as a list where each sentence is a string.
     |
     |      :param sentences: Input sentences to tag
     |      :type sentences: list(str)
     |      :rtype: list(list(list(tuple(str, str)))
     |
     |  tag(self, sentence: str, properties=None) -> list[tuple[str, str]]
     |      Tag a list of tokens.
     |
     |      :rtype: list(tuple(str, str))
     |
     |      Skip these tests if CoreNLP is likely not ready.
     |      >>> from nltk.test.setup_fixt import check_jar
     |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
     |
     |      The CoreNLP server can be started using the following notation, although
     |      we recommend the `with CoreNLPServer() as server:` context manager notation
     |      to ensure that the server is always stopped.
     |      >>> server = CoreNLPServer()
     |      >>> server.start()
     |      >>> parser = CoreNLPParser(url=server.url, tagtype='ner')
     |      >>> tokens = 'Rami Eid is studying at Stony Brook University in NY'.split()
     |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
     |      [('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'), ('at', 'O'), ('Stony', 'ORGANIZATION'),
     |      ('Brook', 'ORGANIZATION'), ('University', 'ORGANIZATION'), ('in', 'O'), ('NY', 'STATE_OR_PROVINCE')]
     |
     |      >>> parser = CoreNLPParser(url=server.url, tagtype='pos')
     |      >>> tokens = "What is the airspeed of an unladen swallow ?".split()
     |      >>> parser.tag(tokens)  # doctest: +NORMALIZE_WHITESPACE
     |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'),
     |      ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'),
     |      ('unladen', 'JJ'), ('swallow', 'VB'), ('?', '.')]
     |      >>> server.stop()
     |
     |  tag_sents(self, sentences, properties=None)
     |      Tag multiple sentences.
     |
     |      Takes multiple sentences as a list where each sentence is a list of
     |      tokens.
     |
     |      :param sentences: Input sentences to tag
     |      :type sentences: list(list(str))
     |      :rtype: list(list(tuple(str, str))
     |
     |  tokenize(self, text, properties=None)
     |      Tokenize a string of text.
     |
     |      Skip these tests if CoreNLP is likely not ready.
     |      >>> from nltk.test.setup_fixt import check_jar
     |      >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
     |
     |      The CoreNLP server can be started using the following notation, although
     |      we recommend the `with CoreNLPServer() as server:` context manager notation
     |      to ensure that the server is always stopped.
     |      >>> server = CoreNLPServer()
     |      >>> server.start()
     |      >>> parser = CoreNLPParser(url=server.url)
     |
     |      >>> text = 'Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\nThanks.'
     |      >>> list(parser.tokenize(text))
     |      ['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York', '.', 'Please', 'buy', 'me', 'two', 'of', 'them', '.', 'Thanks', '.']
     |
     |      >>> s = "The colour of the wall is blue."
     |      >>> list(
     |      ...     parser.tokenize(
     |      ...         'The colour of the wall is blue.',
     |      ...             properties={'tokenize.options': 'americanize=true'},
     |      ...     )
     |      ... )
     |      ['The', 'colour', 'of', 'the', 'wall', 'is', 'blue', '.']
     |      >>> server.stop()
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, sent, *args, **kwargs)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]

FUNCTIONS
    transform(sentence)

    try_port(port=0)

DATA
    List = typing.List
        A generic version of list.

    Tuple = typing.Tuple
        Deprecated alias to builtins.tuple.

        Tuple[X, Y] is the cross-product type of X and Y.

        Example: Tuple[T1, T2] is a tuple of two elements corresponding
        to type variables T1 and T2.  Tuple[int, float, str] is a tuple
        of an int, a float and a string.

        To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\corenlp.py

nltk.corpus
Python Library Documentation: LazyModule in nltk object

nltk.corpus = class LazyModule(builtins.object)
 |  nltk.corpus(name, locals, globals=None)
 |
 |  Lazy module class.
 |
 |  Lazy modules are imported into the given namespaces whenever a
 |  non-special attribute (there are some attributes like __doc__
 |  that class instances handle without calling __getattr__) is
 |  requested. The module is then registered under the given name
 |  in locals usually replacing the import wrapper instance. The
 |  import itself is done using globals as global namespace.
 |
 |  Example of creating a lazy load module:
 |
 |  ISO = LazyModule('ISO',locals(),globals())
 |
 |  Later, requesting an attribute from ISO will load the module
 |  automatically into the locals() namespace, overriding the
 |  LazyModule instance:
 |
 |  t = ISO.Week(1998,1,1)
 |
 |  Methods defined here:
 |
 |  __getattr__(self, name)
 |      Import the module on demand and get the attribute.
 |
 |  __init__(self, name, locals, globals=None)
 |      Create a LazyModule instance wrapping module name.
 |
 |      The module will later on be registered in locals under the
 |      given module name.
 |
 |      globals is optional and defaults to locals.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __setattr__(self, name, value)
 |      Import the module on demand and set the attribute.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.corpus_lepor
Python Library Documentation: function corpus_lepor in module nltk.translate.lepor

corpus_lepor(references: list[list[str]], hypothesis: list[str], alpha: float = 1.0, beta: float = 1.0, tokenizer: collections.abc.Callable[[str], list[str]] = None) -> list[list[float]]
    Calculate LEPOR score for list of sentences from Han, A. L.-F. (2017).
    LEPOR: An Augmented Machine Translation Evaluation Metric. https://arxiv.org/abs/1703.08748v2

    >>> hypothesis = ['a bird is on a stone.', 'scary crow was not bad.']

    >>> references = [['a bird behind the stone.', 'a bird is on the rock'],
    ...              ['scary cow was good.', 'scary crow was elegant.']]

    >>> corpus_lepor(references, hypothesis)
    [[0.7824248013113159, 0.7931427828105261], [0.5639427891892225, 0.7860963170056643]]


    :param references: Reference sentences
    :type references: list(list(str))
    :param hypothesis: Hypothesis sentences
    :type hypothesis: list(str)
    :param alpha: A parameter to set weight fot recall.
    :type alpha: float
    :param beta: A parameter to set weight fot precision.
    :type beta: float
    :param tokenizer: A callable tokenizer that will accept a string and returns a list of tokens.
    :type tokenizer: Callable[[str], List[str]]

    :return: The Lepor score. Returns a list for all sentences
    :rtype: list(list(float))
nltk.crf
Python Library Documentation: module nltk.tag.crf in nltk.tag

NAME
    nltk.tag.crf - A module for POS tagging using CRFSuite

CLASSES
    nltk.tag.api.TaggerI(builtins.object)
        CRFTagger

    class CRFTagger(nltk.tag.api.TaggerI)
     |  CRFTagger(feature_func=None, verbose=False, training_opt=None)
     |
     |  A module for POS tagging using CRFSuite https://pypi.python.org/pypi/python-crfsuite
     |
     |  >>> from nltk.tag import CRFTagger
     |  >>> ct = CRFTagger()  # doctest: +SKIP
     |
     |  >>> train_data = [
     |  ...     [('University','Noun'), ('is','Verb'), ('a','Det'),
     |  ...      ('good','Adj'), ('place','Noun')],
     |  ...     [('dog','Noun'), ('eat','Verb'), ('meat','Noun')],
     |  ... ]
     |
     |  >>> ct.train(train_data, 'model.crf.tagger')  # doctest: +SKIP
     |  >>> ct.tag_sents([['dog','is','good'], ['Cat','eat','meat']])  # doctest: +SKIP
     |  [[('dog', 'Noun'), ('is', 'Verb'), ('good', 'Adj')],
     |   [('Cat', 'Noun'), ('eat', 'Verb'), ('meat', 'Noun')]]
     |
     |  >>> gold_sentences = [
     |  ...     [('dog','Noun'), ('is','Verb'), ('good','Adj')],
     |  ...     [('Cat','Noun'), ('eat','Verb'), ('meat','Noun')],
     |  ... ]
     |  >>> ct.accuracy(gold_sentences)  # doctest: +SKIP
     |  1.0
     |
     |  Setting learned model file
     |  >>> ct = CRFTagger()  # doctest: +SKIP
     |  >>> ct.set_model_file('model.crf.tagger')  # doctest: +SKIP
     |  >>> ct.accuracy(gold_sentences)  # doctest: +SKIP
     |  1.0
     |
     |  Default features are cached by token surface form. Call
     |  ``clear_feature_cache()`` to drop the cache (e.g. between long-running
     |  open-vocabulary tagging passes). A custom ``feature_func`` bypasses
     |  the cache.
     |
     |  Method resolution order:
     |      CRFTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, feature_func=None, verbose=False, training_opt=None)
     |      Initialize the CRFSuite tagger
     |
     |      :param feature_func: Function that extracts features for each token
     |          of a sentence. Takes two parameters (``tokens``, ``idx``) and
     |          returns the feature list for ``tokens[idx]``. See the built-in
     |          ``_get_features`` for an example.
     |      :param verbose: Emit debugging messages during training.
     |      :type verbose: bool
     |      :param training_opt: python-crfsuite training options.
     |      :type training_opt: dict
     |
     |      Set of possible training options (using LBFGS training algorithm).
     |          :'feature.minfreq': Minimum frequency of features.
     |          :'feature.possible_states': Force generating possible state features.
     |          :'feature.possible_transitions': Force generating possible transition
     |              features.
     |          :'c1': Coefficient for L1 regularization.
     |          :'c2': Coefficient for L2 regularization.
     |          :'max_iterations': Maximum number of iterations for L-BFGS.
     |          :'num_memories': Number of limited memories for approximating the
     |              inverse Hessian matrix.
     |          :'epsilon': Epsilon for testing the convergence of the objective.
     |          :'period': Duration of iterations for the stopping criterion.
     |          :'delta': Threshold for the stopping criterion; L-BFGS stops when
     |              the log-likelihood improvement over the last ${period}
     |              iterations is no greater than this threshold.
     |          :'linesearch': Line search algorithm used in L-BFGS updates:
     |
     |              - 'MoreThuente': More and Thuente's method,
     |              - 'Backtracking': Backtracking method with regular Wolfe condition,
     |              - 'StrongBacktracking': Backtracking method with strong Wolfe condition
     |          :'max_linesearch':  Maximum number of trials for the line search.
     |
     |  clear_feature_cache(self)
     |      Drop the default-feature cache.
     |
     |      The cache is vocabulary-bounded, but long-running processes that
     |      ingest open-vocabulary streams (URLs, tweets, generated text) may
     |      want to reset it explicitly. A custom ``feature_func`` bypasses
     |      the cache, so this is a no-op for non-default extractors.
     |
     |  set_model_file(self, model_file)
     |
     |  tag(self, tokens)
     |      Tag a sentence using the python-crfsuite tagger. Before using this
     |      function, the model file must be specified by either:
     |
     |      - Train a new model using ``train`` function
     |      - Use the pre-trained model which is set via ``set_model_file`` function
     |
     |      :param tokens: tokens to tag.
     |      :type tokens: list(str)
     |      :return: list of tagged tokens.
     |      :rtype: list(tuple(str,str))
     |
     |  tag_sents(self, sentences=None, **kwargs)
     |      Tag a list of sentences. Before using this function, the model file
     |      must be specified by either:
     |
     |      - Train a new model using ``train`` function
     |      - Use the pre-trained model which is set via ``set_model_file`` function
     |
     |      :param sentences: sentences to tag.
     |      :type sentences: list(list(str))
     |      :param sents: deprecated alias for ``sentences``; emits ``DeprecationWarning``.
     |      :return: list of tagged sentences.
     |      :rtype: list(list(tuple(str,str)))
     |
     |  train(self, train_data, model_file)
     |      Train the CRF tagger using CRFSuite
     |
     |      :param train_data: list of annotated sentences.
     |      :type train_data: list(list(tuple(str,str)))
     |      :param model_file: path where the trained model will be written.
     |      :type model_file: str
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    pycrfsuite = None

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\crf.py

nltk.custom_distance
Python Library Documentation: function custom_distance in module nltk.metrics.distance

custom_distance(file)
nltk.cut_string
Python Library Documentation: function cut_string in module nltk.util

cut_string(s, width=70)
    Cut off and return a given width of a string

    Return the same as s[:width] if width >= 0 or s[-width:] if
    width < 0, as long as s has no unicode combining characters.
    If it has combining characters make sure the returned string's
    visible width matches the called-for width.

    :param s: the string to cut
    :type s: str
    :param width: the display_width
    :type width: int
nltk.data
Python Library Documentation: module nltk.data in nltk

NAME
    nltk.data

DESCRIPTION
    Functions to find and load NLTK resource files, such as corpora,
    grammars, and saved processing objects.  Resource files are identified
    using URLs, such as ``nltk:corpora/abc/rural.txt`` or
    ``https://raw.githubusercontent.com/nltk/nltk/develop/nltk/test/toy.cfg``.
    The following URL protocols are supported:

      - ``file:path``: Specifies the file whose path is *path*.
        Both relative and absolute paths may be used.

      - ``https://host/path``: Specifies the file stored on the web
        server *host* at path *path*.

      - ``nltk:path``: Specifies the file stored in the NLTK data
        package at *path*.  NLTK will search for these files in the
        directories specified by ``nltk.data.path``.

    If no protocol is specified, then the default protocol ``nltk:`` will
    be used.

    This module provides to functions that can be used to access a
    resource file, given its URL: ``load()`` loads a given resource, and
    adds it to a resource cache; and ``retrieve()`` copies a given resource
    to a local file.

CLASSES
    builtins.object
        LazyLoader
        PathPointer
            FileSystemPathPointer(PathPointer, builtins.str)
                GzipFileSystemPathPointer
        SeekableUnicodeStreamReader
    nltk.pathsec.ZipFile(zipfile.ZipFile)
        OpenOnDemandZipFile

    class FileSystemPathPointer(PathPointer, builtins.str)
     |  FileSystemPathPointer(_path)
     |
     |  A path pointer that identifies a file which can be accessed
     |  directly via a given absolute path.
     |
     |  Method resolution order:
     |      FileSystemPathPointer
     |      PathPointer
     |      builtins.str
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, _path)
     |      Create a new path pointer for the given absolute path.
     |
     |      :raise IOError: If the given path does not exist.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  file_size(self)
     |      Return the size of the file pointed to by this path pointer,
     |      in bytes.
     |
     |      :raise IOError: If the path specified by this pointer does
     |          not contain a readable file.
     |
     |  join(self, fileid)
     |      Harden join() to prevent traversal & ensure corpus-root sandbox.
     |
     |  open(self, encoding=None)
     |      Secure open — prevents absolute direct access outside pointer root.
     |      Path validation is enforced by pathsec.open() which checks the
     |      resolved path against allowed NLTK data roots.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  path
     |      The absolute path identified by this path pointer.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.str:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __format__(self, format_spec, /)
     |      Return a formatted version of the string as described by format_spec.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(...)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __sizeof__(self, /)
     |      Return the size of the string in memory, in bytes.
     |
     |  capitalize(self, /)
     |      Return a capitalized version of the string.
     |
     |      More specifically, make the first character have upper case and the rest lower
     |      case.
     |
     |  casefold(self, /)
     |      Return a version of the string suitable for caseless comparisons.
     |
     |  center(self, width, fillchar=' ', /)
     |      Return a centered string of length width.
     |
     |      Padding is done using the specified fill character (default is a space).
     |
     |  count(...)
     |      S.count(sub[, start[, end]]) -> int
     |
     |      Return the number of non-overlapping occurrences of substring sub in
     |      string S[start:end].  Optional arguments start and end are
     |      interpreted as in slice notation.
     |
     |  encode(self, /, encoding='utf-8', errors='strict')
     |      Encode the string using the codec registered for encoding.
     |
     |      encoding
     |        The encoding in which to encode the string.
     |      errors
     |        The error handling scheme to use for encoding errors.
     |        The default is 'strict' meaning that encoding errors raise a
     |        UnicodeEncodeError.  Other possible values are 'ignore', 'replace' and
     |        'xmlcharrefreplace' as well as any other name registered with
     |        codecs.register_error that can handle UnicodeEncodeErrors.
     |
     |  endswith(...)
     |      S.endswith(suffix[, start[, end]]) -> bool
     |
     |      Return True if S ends with the specified suffix, False otherwise.
     |      With optional start, test S beginning at that position.
     |      With optional end, stop comparing S at that position.
     |      suffix can also be a tuple of strings to try.
     |
     |  expandtabs(self, /, tabsize=8)
     |      Return a copy where all tab characters are expanded using spaces.
     |
     |      If tabsize is not given, a tab size of 8 characters is assumed.
     |
     |  find(...)
     |      S.find(sub[, start[, end]]) -> int
     |
     |      Return the lowest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Return -1 on failure.
     |
     |  format(...)
     |      S.format(*args, **kwargs) -> str
     |
     |      Return a formatted version of S, using substitutions from args and kwargs.
     |      The substitutions are identified by braces ('{' and '}').
     |
     |  format_map(...)
     |      S.format_map(mapping) -> str
     |
     |      Return a formatted version of S, using substitutions from mapping.
     |      The substitutions are identified by braces ('{' and '}').
     |
     |  index(...)
     |      S.index(sub[, start[, end]]) -> int
     |
     |      Return the lowest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Raises ValueError when the substring is not found.
     |
     |  isalnum(self, /)
     |      Return True if the string is an alpha-numeric string, False otherwise.
     |
     |      A string is alpha-numeric if all characters in the string are alpha-numeric and
     |      there is at least one character in the string.
     |
     |  isalpha(self, /)
     |      Return True if the string is an alphabetic string, False otherwise.
     |
     |      A string is alphabetic if all characters in the string are alphabetic and there
     |      is at least one character in the string.
     |
     |  isascii(self, /)
     |      Return True if all characters in the string are ASCII, False otherwise.
     |
     |      ASCII characters have code points in the range U+0000-U+007F.
     |      Empty string is ASCII too.
     |
     |  isdecimal(self, /)
     |      Return True if the string is a decimal string, False otherwise.
     |
     |      A string is a decimal string if all characters in the string are decimal and
     |      there is at least one character in the string.
     |
     |  isdigit(self, /)
     |      Return True if the string is a digit string, False otherwise.
     |
     |      A string is a digit string if all characters in the string are digits and there
     |      is at least one character in the string.
     |
     |  isidentifier(self, /)
     |      Return True if the string is a valid Python identifier, False otherwise.
     |
     |      Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
     |      such as "def" or "class".
     |
     |  islower(self, /)
     |      Return True if the string is a lowercase string, False otherwise.
     |
     |      A string is lowercase if all cased characters in the string are lowercase and
     |      there is at least one cased character in the string.
     |
     |  isnumeric(self, /)
     |      Return True if the string is a numeric string, False otherwise.
     |
     |      A string is numeric if all characters in the string are numeric and there is at
     |      least one character in the string.
     |
     |  isprintable(self, /)
     |      Return True if the string is printable, False otherwise.
     |
     |      A string is printable if all of its characters are considered printable in
     |      repr() or if it is empty.
     |
     |  isspace(self, /)
     |      Return True if the string is a whitespace string, False otherwise.
     |
     |      A string is whitespace if all characters in the string are whitespace and there
     |      is at least one character in the string.
     |
     |  istitle(self, /)
     |      Return True if the string is a title-cased string, False otherwise.
     |
     |      In a title-cased string, upper- and title-case characters may only
     |      follow uncased characters and lowercase characters only cased ones.
     |
     |  isupper(self, /)
     |      Return True if the string is an uppercase string, False otherwise.
     |
     |      A string is uppercase if all cased characters in the string are uppercase and
     |      there is at least one cased character in the string.
     |
     |  ljust(self, width, fillchar=' ', /)
     |      Return a left-justified string of length width.
     |
     |      Padding is done using the specified fill character (default is a space).
     |
     |  lower(self, /)
     |      Return a copy of the string converted to lowercase.
     |
     |  lstrip(self, chars=None, /)
     |      Return a copy of the string with leading whitespace removed.
     |
     |      If chars is given and not None, remove characters in chars instead.
     |
     |  partition(self, sep, /)
     |      Partition the string into three parts using the given separator.
     |
     |      This will search for the separator in the string.  If the separator is found,
     |      returns a 3-tuple containing the part before the separator, the separator
     |      itself, and the part after it.
     |
     |      If the separator is not found, returns a 3-tuple containing the original string
     |      and two empty strings.
     |
     |  removeprefix(self, prefix, /)
     |      Return a str with the given prefix string removed if present.
     |
     |      If the string starts with the prefix string, return string[len(prefix):].
     |      Otherwise, return a copy of the original string.
     |
     |  removesuffix(self, suffix, /)
     |      Return a str with the given suffix string removed if present.
     |
     |      If the string ends with the suffix string and that suffix is not empty,
     |      return string[:-len(suffix)]. Otherwise, return a copy of the original
     |      string.
     |
     |  replace(self, old, new, count=-1, /)
     |      Return a copy with all occurrences of substring old replaced by new.
     |
     |        count
     |          Maximum number of occurrences to replace.
     |          -1 (the default value) means replace all occurrences.
     |
     |      If the optional argument count is given, only the first count occurrences are
     |      replaced.
     |
     |  rfind(...)
     |      S.rfind(sub[, start[, end]]) -> int
     |
     |      Return the highest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Return -1 on failure.
     |
     |  rindex(...)
     |      S.rindex(sub[, start[, end]]) -> int
     |
     |      Return the highest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Raises ValueError when the substring is not found.
     |
     |  rjust(self, width, fillchar=' ', /)
     |      Return a right-justified string of length width.
     |
     |      Padding is done using the specified fill character (default is a space).
     |
     |  rpartition(self, sep, /)
     |      Partition the string into three parts using the given separator.
     |
     |      This will search for the separator in the string, starting at the end. If
     |      the separator is found, returns a 3-tuple containing the part before the
     |      separator, the separator itself, and the part after it.
     |
     |      If the separator is not found, returns a 3-tuple containing two empty strings
     |      and the original string.
     |
     |  rsplit(self, /, sep=None, maxsplit=-1)
     |      Return a list of the substrings in the string, using sep as the separator string.
     |
     |        sep
     |          The separator used to split the string.
     |
     |          When set to None (the default value), will split on any whitespace
     |          character (including \n \r \t \f and spaces) and will discard
     |          empty strings from the result.
     |        maxsplit
     |          Maximum number of splits.
     |          -1 (the default value) means no limit.
     |
     |      Splitting starts at the end of the string and works to the front.
     |
     |  rstrip(self, chars=None, /)
     |      Return a copy of the string with trailing whitespace removed.
     |
     |      If chars is given and not None, remove characters in chars instead.
     |
     |  split(self, /, sep=None, maxsplit=-1)
     |      Return a list of the substrings in the string, using sep as the separator string.
     |
     |        sep
     |          The separator used to split the string.
     |
     |          When set to None (the default value), will split on any whitespace
     |          character (including \n \r \t \f and spaces) and will discard
     |          empty strings from the result.
     |        maxsplit
     |          Maximum number of splits.
     |          -1 (the default value) means no limit.
     |
     |      Splitting starts at the front of the string and works to the end.
     |
     |      Note, str.split() is mainly useful for data that has been intentionally
     |      delimited.  With natural text that includes punctuation, consider using
     |      the regular expression module.
     |
     |  splitlines(self, /, keepends=False)
     |      Return a list of the lines in the string, breaking at line boundaries.
     |
     |      Line breaks are not included in the resulting list unless keepends is given and
     |      true.
     |
     |  startswith(...)
     |      S.startswith(prefix[, start[, end]]) -> bool
     |
     |      Return True if S starts with the specified prefix, False otherwise.
     |      With optional start, test S beginning at that position.
     |      With optional end, stop comparing S at that position.
     |      prefix can also be a tuple of strings to try.
     |
     |  strip(self, chars=None, /)
     |      Return a copy of the string with leading and trailing whitespace removed.
     |
     |      If chars is given and not None, remove characters in chars instead.
     |
     |  swapcase(self, /)
     |      Convert uppercase characters to lowercase and lowercase characters to uppercase.
     |
     |  title(self, /)
     |      Return a version of the string where each word is titlecased.
     |
     |      More specifically, words start with uppercased characters and all remaining
     |      cased characters have lower case.
     |
     |  translate(self, table, /)
     |      Replace each character in the string using the given translation table.
     |
     |        table
     |          Translation table, which must be a mapping of Unicode ordinals to
     |          Unicode ordinals, strings, or None.
     |
     |      The table must implement lookup/indexing via __getitem__, for instance a
     |      dictionary or list.  If this operation raises LookupError, the character is
     |      left untouched.  Characters mapped to None are deleted.
     |
     |  upper(self, /)
     |      Return a copy of the string converted to uppercase.
     |
     |  zfill(self, width, /)
     |      Pad a numeric string with zeros on the left, to fill a field of the given width.
     |
     |      The string is never truncated.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.str:
     |
     |  __new__(*args, **kwargs) class method of builtins.str
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  maketrans(...)
     |      Return a translation table usable for str.translate().
     |
     |      If there is only one argument, it must be a dictionary mapping Unicode
     |      ordinals (integers) or characters to Unicode ordinals, strings or None.
     |      Character keys will be then converted to ordinals.
     |      If there are two arguments, they must be strings of equal length, and
     |      in the resulting dictionary, each character in x will be mapped to the
     |      character at the same position in y. If there is a third argument, it
     |      must be a string, whose characters will be mapped to None in the result.

    class GzipFileSystemPathPointer(FileSystemPathPointer)
     |  GzipFileSystemPathPointer(_path)
     |
     |  A subclass of ``FileSystemPathPointer`` that identifies a gzip-compressed
     |  file located at a given absolute path.  ``GzipFileSystemPathPointer`` is
     |  appropriate for loading large gzip-compressed pickle objects efficiently.
     |
     |  Method resolution order:
     |      GzipFileSystemPathPointer
     |      FileSystemPathPointer
     |      PathPointer
     |      builtins.str
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  open(self, encoding=None)
     |      Secure open — prevents absolute direct access outside pointer root.
     |      Path validation is enforced by pathsec.open() which checks the
     |      resolved path against allowed NLTK data roots.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from FileSystemPathPointer:
     |
     |  __init__(self, _path)
     |      Create a new path pointer for the given absolute path.
     |
     |      :raise IOError: If the given path does not exist.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  file_size(self)
     |      Return the size of the file pointed to by this path pointer,
     |      in bytes.
     |
     |      :raise IOError: If the path specified by this pointer does
     |          not contain a readable file.
     |
     |  join(self, fileid)
     |      Harden join() to prevent traversal & ensure corpus-root sandbox.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from FileSystemPathPointer:
     |
     |  path
     |      The absolute path identified by this path pointer.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from FileSystemPathPointer:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.str:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __format__(self, format_spec, /)
     |      Return a formatted version of the string as described by format_spec.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(...)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __sizeof__(self, /)
     |      Return the size of the string in memory, in bytes.
     |
     |  capitalize(self, /)
     |      Return a capitalized version of the string.
     |
     |      More specifically, make the first character have upper case and the rest lower
     |      case.
     |
     |  casefold(self, /)
     |      Return a version of the string suitable for caseless comparisons.
     |
     |  center(self, width, fillchar=' ', /)
     |      Return a centered string of length width.
     |
     |      Padding is done using the specified fill character (default is a space).
     |
     |  count(...)
     |      S.count(sub[, start[, end]]) -> int
     |
     |      Return the number of non-overlapping occurrences of substring sub in
     |      string S[start:end].  Optional arguments start and end are
     |      interpreted as in slice notation.
     |
     |  encode(self, /, encoding='utf-8', errors='strict')
     |      Encode the string using the codec registered for encoding.
     |
     |      encoding
     |        The encoding in which to encode the string.
     |      errors
     |        The error handling scheme to use for encoding errors.
     |        The default is 'strict' meaning that encoding errors raise a
     |        UnicodeEncodeError.  Other possible values are 'ignore', 'replace' and
     |        'xmlcharrefreplace' as well as any other name registered with
     |        codecs.register_error that can handle UnicodeEncodeErrors.
     |
     |  endswith(...)
     |      S.endswith(suffix[, start[, end]]) -> bool
     |
     |      Return True if S ends with the specified suffix, False otherwise.
     |      With optional start, test S beginning at that position.
     |      With optional end, stop comparing S at that position.
     |      suffix can also be a tuple of strings to try.
     |
     |  expandtabs(self, /, tabsize=8)
     |      Return a copy where all tab characters are expanded using spaces.
     |
     |      If tabsize is not given, a tab size of 8 characters is assumed.
     |
     |  find(...)
     |      S.find(sub[, start[, end]]) -> int
     |
     |      Return the lowest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Return -1 on failure.
     |
     |  format(...)
     |      S.format(*args, **kwargs) -> str
     |
     |      Return a formatted version of S, using substitutions from args and kwargs.
     |      The substitutions are identified by braces ('{' and '}').
     |
     |  format_map(...)
     |      S.format_map(mapping) -> str
     |
     |      Return a formatted version of S, using substitutions from mapping.
     |      The substitutions are identified by braces ('{' and '}').
     |
     |  index(...)
     |      S.index(sub[, start[, end]]) -> int
     |
     |      Return the lowest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Raises ValueError when the substring is not found.
     |
     |  isalnum(self, /)
     |      Return True if the string is an alpha-numeric string, False otherwise.
     |
     |      A string is alpha-numeric if all characters in the string are alpha-numeric and
     |      there is at least one character in the string.
     |
     |  isalpha(self, /)
     |      Return True if the string is an alphabetic string, False otherwise.
     |
     |      A string is alphabetic if all characters in the string are alphabetic and there
     |      is at least one character in the string.
     |
     |  isascii(self, /)
     |      Return True if all characters in the string are ASCII, False otherwise.
     |
     |      ASCII characters have code points in the range U+0000-U+007F.
     |      Empty string is ASCII too.
     |
     |  isdecimal(self, /)
     |      Return True if the string is a decimal string, False otherwise.
     |
     |      A string is a decimal string if all characters in the string are decimal and
     |      there is at least one character in the string.
     |
     |  isdigit(self, /)
     |      Return True if the string is a digit string, False otherwise.
     |
     |      A string is a digit string if all characters in the string are digits and there
     |      is at least one character in the string.
     |
     |  isidentifier(self, /)
     |      Return True if the string is a valid Python identifier, False otherwise.
     |
     |      Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
     |      such as "def" or "class".
     |
     |  islower(self, /)
     |      Return True if the string is a lowercase string, False otherwise.
     |
     |      A string is lowercase if all cased characters in the string are lowercase and
     |      there is at least one cased character in the string.
     |
     |  isnumeric(self, /)
     |      Return True if the string is a numeric string, False otherwise.
     |
     |      A string is numeric if all characters in the string are numeric and there is at
     |      least one character in the string.
     |
     |  isprintable(self, /)
     |      Return True if the string is printable, False otherwise.
     |
     |      A string is printable if all of its characters are considered printable in
     |      repr() or if it is empty.
     |
     |  isspace(self, /)
     |      Return True if the string is a whitespace string, False otherwise.
     |
     |      A string is whitespace if all characters in the string are whitespace and there
     |      is at least one character in the string.
     |
     |  istitle(self, /)
     |      Return True if the string is a title-cased string, False otherwise.
     |
     |      In a title-cased string, upper- and title-case characters may only
     |      follow uncased characters and lowercase characters only cased ones.
     |
     |  isupper(self, /)
     |      Return True if the string is an uppercase string, False otherwise.
     |
     |      A string is uppercase if all cased characters in the string are uppercase and
     |      there is at least one cased character in the string.
     |
     |  ljust(self, width, fillchar=' ', /)
     |      Return a left-justified string of length width.
     |
     |      Padding is done using the specified fill character (default is a space).
     |
     |  lower(self, /)
     |      Return a copy of the string converted to lowercase.
     |
     |  lstrip(self, chars=None, /)
     |      Return a copy of the string with leading whitespace removed.
     |
     |      If chars is given and not None, remove characters in chars instead.
     |
     |  partition(self, sep, /)
     |      Partition the string into three parts using the given separator.
     |
     |      This will search for the separator in the string.  If the separator is found,
     |      returns a 3-tuple containing the part before the separator, the separator
     |      itself, and the part after it.
     |
     |      If the separator is not found, returns a 3-tuple containing the original string
     |      and two empty strings.
     |
     |  removeprefix(self, prefix, /)
     |      Return a str with the given prefix string removed if present.
     |
     |      If the string starts with the prefix string, return string[len(prefix):].
     |      Otherwise, return a copy of the original string.
     |
     |  removesuffix(self, suffix, /)
     |      Return a str with the given suffix string removed if present.
     |
     |      If the string ends with the suffix string and that suffix is not empty,
     |      return string[:-len(suffix)]. Otherwise, return a copy of the original
     |      string.
     |
     |  replace(self, old, new, count=-1, /)
     |      Return a copy with all occurrences of substring old replaced by new.
     |
     |        count
     |          Maximum number of occurrences to replace.
     |          -1 (the default value) means replace all occurrences.
     |
     |      If the optional argument count is given, only the first count occurrences are
     |      replaced.
     |
     |  rfind(...)
     |      S.rfind(sub[, start[, end]]) -> int
     |
     |      Return the highest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Return -1 on failure.
     |
     |  rindex(...)
     |      S.rindex(sub[, start[, end]]) -> int
     |
     |      Return the highest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Raises ValueError when the substring is not found.
     |
     |  rjust(self, width, fillchar=' ', /)
     |      Return a right-justified string of length width.
     |
     |      Padding is done using the specified fill character (default is a space).
     |
     |  rpartition(self, sep, /)
     |      Partition the string into three parts using the given separator.
     |
     |      This will search for the separator in the string, starting at the end. If
     |      the separator is found, returns a 3-tuple containing the part before the
     |      separator, the separator itself, and the part after it.
     |
     |      If the separator is not found, returns a 3-tuple containing two empty strings
     |      and the original string.
     |
     |  rsplit(self, /, sep=None, maxsplit=-1)
     |      Return a list of the substrings in the string, using sep as the separator string.
     |
     |        sep
     |          The separator used to split the string.
     |
     |          When set to None (the default value), will split on any whitespace
     |          character (including \n \r \t \f and spaces) and will discard
     |          empty strings from the result.
     |        maxsplit
     |          Maximum number of splits.
     |          -1 (the default value) means no limit.
     |
     |      Splitting starts at the end of the string and works to the front.
     |
     |  rstrip(self, chars=None, /)
     |      Return a copy of the string with trailing whitespace removed.
     |
     |      If chars is given and not None, remove characters in chars instead.
     |
     |  split(self, /, sep=None, maxsplit=-1)
     |      Return a list of the substrings in the string, using sep as the separator string.
     |
     |        sep
     |          The separator used to split the string.
     |
     |          When set to None (the default value), will split on any whitespace
     |          character (including \n \r \t \f and spaces) and will discard
     |          empty strings from the result.
     |        maxsplit
     |          Maximum number of splits.
     |          -1 (the default value) means no limit.
     |
     |      Splitting starts at the front of the string and works to the end.
     |
     |      Note, str.split() is mainly useful for data that has been intentionally
     |      delimited.  With natural text that includes punctuation, consider using
     |      the regular expression module.
     |
     |  splitlines(self, /, keepends=False)
     |      Return a list of the lines in the string, breaking at line boundaries.
     |
     |      Line breaks are not included in the resulting list unless keepends is given and
     |      true.
     |
     |  startswith(...)
     |      S.startswith(prefix[, start[, end]]) -> bool
     |
     |      Return True if S starts with the specified prefix, False otherwise.
     |      With optional start, test S beginning at that position.
     |      With optional end, stop comparing S at that position.
     |      prefix can also be a tuple of strings to try.
     |
     |  strip(self, chars=None, /)
     |      Return a copy of the string with leading and trailing whitespace removed.
     |
     |      If chars is given and not None, remove characters in chars instead.
     |
     |  swapcase(self, /)
     |      Convert uppercase characters to lowercase and lowercase characters to uppercase.
     |
     |  title(self, /)
     |      Return a version of the string where each word is titlecased.
     |
     |      More specifically, words start with uppercased characters and all remaining
     |      cased characters have lower case.
     |
     |  translate(self, table, /)
     |      Replace each character in the string using the given translation table.
     |
     |        table
     |          Translation table, which must be a mapping of Unicode ordinals to
     |          Unicode ordinals, strings, or None.
     |
     |      The table must implement lookup/indexing via __getitem__, for instance a
     |      dictionary or list.  If this operation raises LookupError, the character is
     |      left untouched.  Characters mapped to None are deleted.
     |
     |  upper(self, /)
     |      Return a copy of the string converted to uppercase.
     |
     |  zfill(self, width, /)
     |      Pad a numeric string with zeros on the left, to fill a field of the given width.
     |
     |      The string is never truncated.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.str:
     |
     |  __new__(*args, **kwargs) class method of builtins.str
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  maketrans(...)
     |      Return a translation table usable for str.translate().
     |
     |      If there is only one argument, it must be a dictionary mapping Unicode
     |      ordinals (integers) or characters to Unicode ordinals, strings or None.
     |      Character keys will be then converted to ordinals.
     |      If there are two arguments, they must be strings of equal length, and
     |      in the resulting dictionary, each character in x will be mapped to the
     |      character at the same position in y. If there is a third argument, it
     |      must be a string, whose characters will be mapped to None in the result.

    class LazyLoader(builtins.object)
     |  LazyLoader(_path)
     |
     |  Methods defined here:
     |
     |  __getattr__(self, attr)
     |
     |  __init__(self, _path)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class OpenOnDemandZipFile(nltk.pathsec.ZipFile)
     |  OpenOnDemandZipFile(filename)
     |
     |  A subclass of ``ZipFile`` that closes its file pointer
     |  whenever it is not using it; and re-opens it when it needs to read
     |  data from the zipfile.  This is useful for reducing the number of
     |  open file handles when many zip files are being accessed at once.
     |  ``OpenOnDemandZipFile`` must be constructed from a filename, not a
     |  file-like object (to allow re-opening).  ``OpenOnDemandZipFile`` is
     |  read-only (i.e. ``write()`` and ``writestr()`` are disabled.
     |
     |  Method resolution order:
     |      OpenOnDemandZipFile
     |      nltk.pathsec.ZipFile
     |      zipfile.ZipFile
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, filename)
     |      Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
     |      or append 'a'.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  read(self, name)
     |      Return file bytes for name. 'pwd' is the password to decrypt
     |      encrypted files.
     |
     |  write(self, *args, **kwargs)
     |      :raise NotImplementedError: OpenOnDemandZipfile is read-only
     |
     |  writestr(self, *args, **kwargs)
     |      :raise NotImplementedError: OpenOnDemandZipfile is read-only
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.pathsec.ZipFile:
     |
     |  extract(self, member, path=None, pwd=None)
     |      Extract a member from the archive to the current working directory,
     |      using its full name. Its file information is extracted as accurately
     |      as possible. `member' may be a filename or a ZipInfo object. You can
     |      specify a different directory using `path'. You can specify the
     |      password to decrypt the file using 'pwd'.
     |
     |  extractall(self, path=None, members=None, pwd=None)
     |      Extract all members from the archive to the current working
     |      directory. `path' specifies a different directory to extract to.
     |      `members' is optional and must be a subset of the list returned
     |      by namelist(). You can specify the password to decrypt all files
     |      using 'pwd'.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from zipfile.ZipFile:
     |
     |  __del__(self)
     |      Call the "close()" method in case the user forgot.
     |
     |  __enter__(self)
     |
     |  __exit__(self, type, value, traceback)
     |
     |  close(self)
     |      Close the file, and for mode 'w', 'x' and 'a' write the ending
     |      records.
     |
     |  getinfo(self, name)
     |      Return the instance of ZipInfo given 'name'.
     |
     |  infolist(self)
     |      Return a list of class ZipInfo instances for files in the
     |      archive.
     |
     |  mkdir(self, zinfo_or_directory_name, mode=511)
     |      Creates a directory inside the zip archive.
     |
     |  namelist(self)
     |      Return a list of file names in the archive.
     |
     |  open(self, name, mode='r', pwd=None, *, force_zip64=False)
     |      Return file-like object for 'name'.
     |
     |      name is a string for the file name within the ZIP file, or a ZipInfo
     |      object.
     |
     |      mode should be 'r' to read a file already in the ZIP file, or 'w' to
     |      write to a file newly added to the archive.
     |
     |      pwd is the password to decrypt files (only used for reading).
     |
     |      When writing, if the file size is not known in advance but may exceed
     |      2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large
     |      files.  If the size is known in advance, it is best to pass a ZipInfo
     |      instance for name, with zinfo.file_size set.
     |
     |  printdir(self, file=None)
     |      Print a table of contents for the zip file.
     |
     |  setpassword(self, pwd)
     |      Set default password for encrypted files.
     |
     |  testzip(self)
     |      Read all the files and check the CRC.
     |
     |      Return None if all files could be read successfully, or the name
     |      of the offending file otherwise.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from zipfile.ZipFile:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  comment
     |      The comment text associated with the ZIP file.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from zipfile.ZipFile:
     |
     |  fp = None

    class PathPointer(builtins.object)
     |  An abstract base class for 'path pointers,' used by NLTK's data
     |  package to identify specific paths.  Two subclasses exist:
     |  ``FileSystemPathPointer`` identifies a file that can be accessed
     |  directly via a given absolute path.  ``ZipFilePathPointer``
     |  identifies a file contained within a zipfile, that can be accessed
     |  by reading that zipfile.
     |
     |  Methods defined here:
     |
     |  file_size(self)
     |      Return the size of the file pointed to by this path pointer,
     |      in bytes.
     |
     |      :raise IOError: If the path specified by this pointer does
     |          not contain a readable file.
     |
     |  join(self, fileid)
     |      Return a new path pointer formed by starting at the path
     |      identified by this pointer, and then following the relative
     |      path given by ``fileid``.  The path components of ``fileid``
     |      should be separated by forward slashes, regardless of
     |      the underlying file system's path separator character.
     |
     |  open(self, encoding=None)
     |      Return a seekable read-only stream that can be used to read
     |      the contents of the file identified by this path pointer.
     |
     |      :raise IOError: If the path specified by this pointer does
     |          not contain a readable file.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset({'file_size', 'join', 'open'})

    class SeekableUnicodeStreamReader(builtins.object)
     |  SeekableUnicodeStreamReader(stream, encoding, errors='strict')
     |
     |  A stream reader that automatically encodes the source byte stream
     |  into unicode (like ``codecs.StreamReader``); but still supports the
     |  ``seek()`` and ``tell()`` operations correctly.  This is in contrast
     |  to ``codecs.StreamReader``, which provide *broken* ``seek()`` and
     |  ``tell()`` methods.
     |
     |  This class was motivated by ``StreamBackedCorpusView``, which
     |  makes extensive use of ``seek()`` and ``tell()``, and needs to be
     |  able to handle unicode-encoded files.
     |
     |  Note: this class requires stateless decoders.  To my knowledge,
     |  this shouldn't cause a problem with any of python's builtin
     |  unicode encodings.
     |
     |  Methods defined here:
     |
     |  __del__(self)
     |
     |  __enter__(self)
     |
     |  __exit__(self, type, value, traceback)
     |
     |  __init__(self, stream, encoding, errors='strict')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self)
     |      Return self
     |
     |  __next__(self)
     |
     |  char_seek_forward(self, offset)
     |      Move the read pointer forward by ``offset`` characters.
     |
     |  close(self)
     |      Close the underlying stream.
     |
     |  discard_line(self)
     |
     |  next(self)
     |      Return the next decoded line from the underlying stream.
     |
     |  read(self, size=None)
     |      Read up to ``size`` bytes, decode them using this reader's
     |      encoding, and return the resulting unicode string.
     |
     |      :param size: The maximum number of bytes to read.  If not
     |          specified, then read as many bytes as possible.
     |      :type size: int
     |      :rtype: unicode
     |
     |  readline(self, size=None)
     |      Read a line of text, decode it using this reader's encoding,
     |      and return the resulting unicode string.
     |
     |      :param size: The maximum number of bytes to read.  If no
     |          newline is encountered before ``size`` bytes have been read,
     |          then the returned value may not be a complete line of text.
     |      :type size: int
     |
     |  readlines(self, sizehint=None, keepends=True)
     |      Read this file's contents, decode them using this reader's
     |      encoding, and return it as a list of unicode lines.
     |
     |      :rtype: list(unicode)
     |      :param sizehint: Ignored.
     |      :param keepends: If false, then strip newlines.
     |
     |  seek(self, offset, whence=0)
     |      Move the stream to a new file position.  If the reader is
     |      maintaining any buffers, then they will be cleared.
     |
     |      :param offset: A byte count offset.
     |      :param whence: If 0, then the offset is from the start of the file
     |          (offset should be positive), if 1, then the offset is from the
     |          current position (offset may be positive or negative); and if 2,
     |          then the offset is from the end of the file (offset should
     |          typically be negative).
     |
     |  tell(self)
     |      Return the current file position on the underlying byte
     |      stream.  If this reader is maintaining any buffers, then the
     |      returned file position will be the position of the beginning
     |      of those buffers.
     |
     |  xreadlines(self)
     |      Return self
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  closed
     |      True if the underlying stream is closed.
     |
     |  mode
     |      The mode of the underlying stream.
     |
     |  name
     |      The name of the underlying stream.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  DEBUG = True

FUNCTIONS
    BufferedGzipFile(*args, **kwargs)
        A ``GzipFile`` subclass for compatibility with older nltk releases.

        Use ``GzipFile`` directly as it also buffers in all supported
        Python versions.

        @deprecated: Use gzip.GzipFile instead as it also uses a buffer.

    clear_cache()
        Remove all objects from the resource cache.
        :see: load()

    find(resource_name, paths=None)
        Find the given resource by searching through the directories and
        zip files in paths, where a None or empty string specifies an absolute path.
        Returns a corresponding path name.  If the given resource is not
        found, raise a ``LookupError``, whose message gives a pointer to
        the installation instructions for the NLTK downloader.

        Zip File Handling:

          - If ``resource_name`` contains a component with a ``.zip``
            extension, then it is assumed to be a zipfile; and the
            remaining path components are used to look inside the zipfile.

          - If any element of ``nltk.data.path`` has a ``.zip`` extension,
            then it is assumed to be a zipfile.

          - If a given resource name that does not contain any zipfile
            component is not found initially, then ``find()`` will make a
            second attempt to find that resource, by replacing each
            component *p* in the path with *p.zip/p*.  For example, this
            allows ``find()`` to map the resource name
            ``corpora/chat80/cities.pl`` to a zip file path pointer to
            ``corpora/chat80.zip/chat80/cities.pl``.

          - When using ``find()`` to locate a directory contained in a
            zipfile, the resource name must end with the forward slash
            character.  Otherwise, ``find()`` will not locate the
            directory.

        :type resource_name: str or unicode
        :param resource_name: The name of the resource to search for.
            Resource names are posix-style relative path names, such as
            ``corpora/brown``.  Directory names will be
            automatically converted to a platform-appropriate path separator.
        :rtype: str

    load(resource_url, format='auto', cache=True, verbose=False, logic_parser=None, fstruct_reader=None, encoding=None)
        Load a given resource from the NLTK data package.  The following
        resource formats are currently supported:

          - ``pickle``
          - ``json``
          - ``yaml``
          - ``cfg`` (context free grammars)
          - ``pcfg`` (probabilistic CFGs)
          - ``fcfg`` (feature-based CFGs)
          - ``fol`` (formulas of First Order Logic)
          - ``logic`` (Logical formulas to be parsed by the given logic_parser)
          - ``val`` (valuation of First Order Logic model)
          - ``text`` (the file contents as a unicode string)
          - ``raw`` (the raw file contents as a byte string)

        If no format is specified, ``load()`` will attempt to determine a
        format based on the resource name's file extension.  If that
        fails, ``load()`` will raise a ``ValueError`` exception.

        For all text formats (everything except ``pickle``, ``json``, ``yaml`` and ``raw``),
        it tries to decode the raw contents using UTF-8, and if that doesn't
        work, it tries with ISO-8859-1 (Latin-1), unless the ``encoding``
        is specified.

        :type resource_url: str
        :param resource_url: A URL specifying where the resource should be
            loaded from.  The default protocol is "nltk:", which searches
            for the file in the the NLTK data package.
        :type cache: bool
        :param cache: If true, add this resource to a cache.  If load()
            finds a resource in its cache, then it will return it from the
            cache rather than loading it.
        :type verbose: bool
        :param verbose: If true, print a message when loading a resource.
            Messages are not displayed when a resource is retrieved from
            the cache.
        :type logic_parser: LogicParser
        :param logic_parser: The parser that will be used to parse logical
            expressions.
        :type fstruct_reader: FeatStructReader
        :param fstruct_reader: The parser that will be used to parse the
            feature structure of an fcfg.
        :type encoding: str
        :param encoding: the encoding of the input; only used for text formats.

    retrieve(resource_url, filename=None, verbose=True)
        Copy the given resource to a local file.  If no filename is
        specified, then use the URL's filename.  If there is already a
        file named ``filename``, then raise a ``ValueError``.

        :type resource_url: str
        :param resource_url: A URL specifying where the resource should be
            loaded from.  The default protocol is "nltk:", which searches
            for the file in the the NLTK data package.

    show_cfg(resource_url, escape='##')
        Write out a grammar file, ignoring escaped and empty lines.

        :type resource_url: str
        :param resource_url: A URL specifying where the resource should be
            loaded from.  The default protocol is "nltk:", which searches
            for the file in the the NLTK data package.
        :type escape: str
        :param escape: Prepended string that signals lines to be ignored

DATA
    AUTO_FORMATS = {'cfg': 'cfg', 'fcfg': 'fcfg', 'fol': 'fol', 'json': 'j...
    FORMATS = {'cfg': 'A context free grammar.', 'fcfg': 'A feature CFG.',...
    __all__ = ['path', 'PathPointer', 'FileSystemPathPointer', 'BufferedGz...
    path = [r'C:\Users\Youse/nltk_data', r'C:\Users\Youse\AppData\Local\Pr...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\data.py

nltk.decisiontree
Python Library Documentation: module nltk.classify.decisiontree in nltk.classify

NAME
    nltk.classify.decisiontree

DESCRIPTION
    A classifier model that decides which label to assign to a token on
    the basis of a tree structure, where branches correspond to conditions
    on feature values, and leaves correspond to label assignments.

CLASSES
    nltk.classify.api.ClassifierI(builtins.object)
        DecisionTreeClassifier

    class DecisionTreeClassifier(nltk.classify.api.ClassifierI)
     |  DecisionTreeClassifier(label, feature_name=None, decisions=None, default=None)
     |
     |  Method resolution order:
     |      DecisionTreeClassifier
     |      nltk.classify.api.ClassifierI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, label, feature_name=None, decisions=None, default=None)
     |      :param label: The most likely label for tokens that reach
     |          this node in the decision tree.  If this decision tree
     |          has no children, then this label will be assigned to
     |          any token that reaches this decision tree.
     |      :param feature_name: The name of the feature that this
     |          decision tree selects for.
     |      :param decisions: A dictionary mapping from feature values
     |          for the feature identified by ``feature_name`` to
     |          child decision trees.
     |      :param default: The child that will be used if the value of
     |          feature ``feature_name`` does not match any of the keys in
     |          ``decisions``.  This is used when constructing binary
     |          decision trees.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  classify(self, featureset)
     |      :return: the most appropriate label for the given featureset.
     |      :rtype: label
     |
     |  error(self, labeled_featuresets)
     |
     |  labels(self)
     |      :return: the list of category labels used by this classifier.
     |      :rtype: list of (immutable)
     |
     |  pretty_format(self, width=70, prefix='', depth=4)
     |      Return a string containing a pretty-printed version of this
     |      decision tree.  Each line in this string corresponds to a
     |      single decision tree node or leaf, and indentation is used to
     |      display the structure of the decision tree.
     |
     |  pseudocode(self, prefix='', depth=4)
     |      Return a string representation of this decision tree that
     |      expresses the decisions it makes as a nested set of pseudocode
     |      if statements.
     |
     |  refine(self, labeled_featuresets, entropy_cutoff, depth_cutoff, support_cutoff, binary=False, feature_values=None, verbose=False)
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  best_binary_stump(feature_names, labeled_featuresets, feature_values, verbose=False)
     |
     |  best_stump(feature_names, labeled_featuresets, verbose=False)
     |
     |  binary_stump(feature_name, feature_value, labeled_featuresets)
     |
     |  leaf(labeled_featuresets)
     |
     |  stump(feature_name, labeled_featuresets)
     |
     |  train(labeled_featuresets, entropy_cutoff=0.05, depth_cutoff=100, support_cutoff=10, binary=False, feature_values=None, verbose=False)
     |      :param binary: If true, then treat all feature/value pairs as
     |          individual binary features, rather than using a single n-way
     |          branch for each feature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.api.ClassifierI:
     |
     |  classify_many(self, featuresets)
     |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.classify(fs) for fs in featuresets]
     |
     |      :rtype: list(label)
     |
     |  prob_classify(self, featureset)
     |      :return: a probability distribution over labels for the given
     |          featureset.
     |      :rtype: ProbDistI
     |
     |  prob_classify_many(self, featuresets)
     |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.prob_classify(fs) for fs in featuresets]
     |
     |      :rtype: list(ProbDistI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.classify.api.ClassifierI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()

    f(x)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\decisiontree.py

nltk.decorator
Python Library Documentation: function decorator in module nltk.decorators

decorator(caller)
    General purpose decorator factory: takes a caller function as
    input and returns a decorator with the same attributes.
    A caller function is any function like this::

     def caller(func, *args, **kw):
         # do something
         return func(*args, **kw)

    Here is an example of usage:

    >>> @decorator
    ... def chatty(f, *args, **kw):
    ...     print("Calling %r" % f.__name__)
    ...     return f(*args, **kw)

    >>> chatty.__name__
    'chatty'

    >>> @chatty
    ... def f(): pass
    ...
    >>> f()
    Calling 'f'

    decorator can also take in input a class with a .caller method; in this
    case it converts the class into a factory of callable decorator objects.
    See the documentation for an example.
nltk.decorators
Python Library Documentation: module nltk.decorators in nltk

NAME
    nltk.decorators

DESCRIPTION
    Decorator module by Michele Simionato <michelesimionato@libero.it>
    Copyright Michele Simionato, distributed under the terms of the BSD License (see below).
    http://www.phyast.pitt.edu/~micheles/python/documentation.html

    Included in NLTK for its support of a nice memoization decorator.

FUNCTIONS
    __call__(self, func)
        # helper used in decorator_factory

    decorator(caller)
        General purpose decorator factory: takes a caller function as
        input and returns a decorator with the same attributes.
        A caller function is any function like this::

         def caller(func, *args, **kw):
             # do something
             return func(*args, **kw)

        Here is an example of usage:

        >>> @decorator
        ... def chatty(f, *args, **kw):
        ...     print("Calling %r" % f.__name__)
        ...     return f(*args, **kw)

        >>> chatty.__name__
        'chatty'

        >>> @chatty
        ... def f(): pass
        ...
        >>> f()
        Calling 'f'

        decorator can also take in input a class with a .caller method; in this
        case it converts the class into a factory of callable decorator objects.
        See the documentation for an example.

    getinfo(func)
        Returns an info dictionary containing:
        - name (the name of the function : str)
        - argnames (the names of the arguments : list)
        - defaults (the values of the default arguments : tuple)
        - signature (the signature : str)
        - fullsignature (the full signature : Signature)
        - doc (the docstring : str)
        - module (the module name : str)
        - dict (the function __dict__ : str)

        >>> def f(self, x=1, y=2, *args, **kw): pass

        >>> info = getinfo(f)

        >>> info["name"]
        'f'
        >>> info["argnames"]
        ['self', 'x', 'y', 'args', 'kw']

        >>> info["defaults"]
        (1, 2)

        >>> info["signature"]
        'self, x, y, *args, **kw'

        >>> info["fullsignature"]
        <Signature (self, x=1, y=2, *args, **kw)>

    new_wrapper(wrapper, model)
        An improvement over functools.update_wrapper. The wrapper is a generic
        callable object. It works by generating a copy of the wrapper with the
        right signature and by updating the copy, not the original.
        Moreovoer, 'model' can be a dictionary with keys 'name', 'doc', 'module',
        'dict', 'defaults'.

DATA
    __all__ = ['decorator', 'new_wrapper', 'getinfo']
    __docformat__ = 'restructuredtext en'

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\decorators.py

nltk.defaultdict
Python Library Documentation: class defaultdict in module collections

class defaultdict(builtins.dict)
 |  defaultdict(default_factory=None, /, [...]) --> dict with default factory
 |
 |  The default factory is called without arguments to produce
 |  a new value when a key is not present, in __getitem__ only.
 |  A defaultdict compares equal to a dict with the same items.
 |  All remaining arguments are treated the same as if they were
 |  passed to the dict constructor, including keyword arguments.
 |
 |  Method resolution order:
 |      defaultdict
 |      builtins.dict
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __copy__(...)
 |      D.copy() -> a shallow copy of D.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __init__(self, /, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __missing__(...)
 |      __missing__(key) # Called by __getitem__ for missing key; pseudo-code:
 |      if self.default_factory is None: raise KeyError((key,))
 |      self[key] = value = self.default_factory()
 |      return value
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __reduce__(...)
 |      Return state information for pickling.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  default_factory
 |      Factory for default value called by __missing__().
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from builtins.dict:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods inherited from builtins.dict:
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods inherited from builtins.dict:
 |
 |  __new__(*args, **kwargs) class method of builtins.dict
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from builtins.dict:
 |
 |  __hash__ = None
nltk.demo
Python Library Documentation: function demo in module nltk

demo()
    # FIXME:  override any accidentally imported demo, see https://github.com/nltk/nltk/issues/2116
nltk.dependencygraph
Python Library Documentation: module nltk.parse.dependencygraph in nltk.parse

NAME
    nltk.parse.dependencygraph

DESCRIPTION
    Tools for reading and writing dependency trees.
    The input is assumed to be in Malt-TAB format
    (https://stp.lingfil.uu.se/~nivre/research/MaltXML.html).

CLASSES
    builtins.Exception(builtins.BaseException)
        DependencyGraphError
    builtins.object
        DependencyGraph

    class DependencyGraph(builtins.object)
     |  DependencyGraph(tree_str=None, cell_extractor=None, zero_based=False, cell_separator=None, top_relation_label='ROOT')
     |
     |  A container for the nodes and labelled edges of a dependency structure.
     |
     |  Methods defined here:
     |
     |  __init__(self, tree_str=None, cell_extractor=None, zero_based=False, cell_separator=None, top_relation_label='ROOT')
     |      Dependency graph.
     |
     |      We place a dummy `TOP` node with the index 0, since the root node is
     |      often assigned 0 as its head. This also means that the indexing of the
     |      nodes corresponds directly to the Malt-TAB format, which starts at 1.
     |
     |      If zero-based is True, then Malt-TAB-like input with node numbers
     |      starting at 0 and the root node assigned -1 (as produced by, e.g.,
     |      zpar).
     |
     |      :param str cell_separator: the cell separator. If not provided, cells
     |          are split by whitespace.
     |
     |      :param str top_relation_label: the label by which the top relation is
     |          identified, for examlple, `ROOT`, `null` or `TOP`.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  add_arc(self, head_address, mod_address)
     |      Adds an arc from the node specified by head_address to the
     |      node specified by the mod address.
     |
     |  add_node(self, node)
     |
     |  connect_graph(self)
     |      Fully connects all non-root nodes.  All nodes are set to be dependents
     |      of the root node.
     |
     |  contains_address(self, node_address)
     |      Returns true if the graph contains a node with the given node
     |      address, false otherwise.
     |
     |  contains_cycle(self)
     |      Check whether there are cycles.
     |
     |      >>> dg = DependencyGraph(treebank_data)
     |      >>> dg.contains_cycle()
     |      False
     |
     |      >>> cyclic_dg = DependencyGraph()
     |      >>> top = {'word': None, 'deps': [1], 'rel': 'TOP', 'address': 0}
     |      >>> child1 = {'word': None, 'deps': [2], 'rel': 'NTOP', 'address': 1}
     |      >>> child2 = {'word': None, 'deps': [4], 'rel': 'NTOP', 'address': 2}
     |      >>> child3 = {'word': None, 'deps': [1], 'rel': 'NTOP', 'address': 3}
     |      >>> child4 = {'word': None, 'deps': [3], 'rel': 'NTOP', 'address': 4}
     |      >>> cyclic_dg.nodes = {
     |      ...     0: top,
     |      ...     1: child1,
     |      ...     2: child2,
     |      ...     3: child3,
     |      ...     4: child4,
     |      ... }
     |      >>> cyclic_dg.root = top
     |
     |      >>> cyclic_dg.contains_cycle()
     |      [1, 2, 4, 3]
     |
     |  get_by_address(self, node_address)
     |      Return the node with the given address.
     |
     |  get_cycle_path(self, curr_node, goal_node_index)
     |
     |  left_children(self, node_index)
     |      Returns the number of left children under the node specified
     |      by the given address.
     |
     |  nx_graph(self)
     |      Convert the data in a ``nodelist`` into a networkx labeled directed graph.
     |
     |  redirect_arcs(self, originals, redirect)
     |      Redirects arcs to any of the nodes in the originals list
     |      to the redirect node address.
     |
     |  remove_by_address(self, address)
     |      Removes the node with the given address.  References
     |      to this node in others will still exist.
     |
     |  right_children(self, node_index)
     |      Returns the number of right children under the node specified
     |      by the given address.
     |
     |  to_conll(self, style)
     |      The dependency graph in CoNLL format.
     |
     |      :param style: the style to use for the format (3, 4, 10 columns)
     |      :type style: int
     |      :rtype: str
     |
     |  to_dot(self)
     |      Return a dot representation suitable for using with Graphviz.
     |
     |      >>> dg = DependencyGraph(
     |      ...     'John N 2\n'
     |      ...     'loves V 0\n'
     |      ...     'Mary N 2'
     |      ... )
     |      >>> print(dg.to_dot())
     |      digraph G{
     |      edge [dir=forward]
     |      node [shape=plaintext]
     |      <BLANKLINE>
     |      0 [label="0 (None)"]
     |      0 -> 2 [label="ROOT"]
     |      1 [label="1 (John)"]
     |      2 [label="2 (loves)"]
     |      2 -> 1 [label=""]
     |      2 -> 3 [label=""]
     |      3 [label="3 (Mary)"]
     |      }
     |
     |  tree(self)
     |      Starting with the ``root`` node, build a dependency tree using the NLTK
     |      ``Tree`` constructor. Dependency labels are omitted.
     |
     |  triples(self, node=None)
     |      Extract dependency triples of the form:
     |      ((head word, head tag), rel, (dep word, dep tag))
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  load(filename, zero_based=False, cell_separator=None, top_relation_label='ROOT')
     |      :param filename: a name of a file in Malt-TAB format
     |      :param zero_based: nodes in the input file are numbered starting from 0
     |          rather than 1 (as produced by, e.g., zpar)
     |      :param str cell_separator: the cell separator. If not provided, cells
     |          are split by whitespace.
     |      :param str top_relation_label: the label by which the top relation is
     |          identified, for examlple, `ROOT`, `null` or `TOP`.
     |
     |      :return: a list of DependencyGraphs
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DependencyGraphError(builtins.Exception)
     |  Dependency graph exception.
     |
     |  Method resolution order:
     |      DependencyGraphError
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

FUNCTIONS
    conll_demo()
        A demonstration of how to read a string representation of
        a CoNLL format dependency tree.

    conll_file_demo()

    cycle_finding_demo()

    demo()

    dot2img(dot_string, t='svg')
        Create image representation fom dot_string, using the 'dot' program
        from the Graphviz package.

        Use the 't' argument to specify the image file format, for ex. 'jpeg', 'eps',
        'json', 'png' or 'webp' (Running 'dot -T:' lists all available formats).

        Note that the "capture_output" option of subprocess.run() is only available
        with text formats (like svg), but not with binary image formats (like png).

    malt_demo(nx=False)
        A demonstration of the result of reading a dependency
        version of the first sentence of the Penn Treebank.

DATA
    conll_data1 = '\n1   Ze                ze                Pron  P...unt...
    conll_data2 = '1   Cathy             Cathy             N     N ...unt ...
    treebank_data = 'Pierre  NNP     2       NMOD\nVinken  NNP     8  ...D...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\dependencygraph.py

nltk.deprecated
Python Library Documentation: function deprecated in module nltk.internals

deprecated(message)
    A decorator used to mark functions as deprecated.  This will cause
    a warning to be printed the when the function is used.  Usage:

        >>> from nltk.internals import deprecated
        >>> @deprecated('Use foo() instead')
        ... def bar(x):
        ...     print(x/10)
nltk.deque
Python Library Documentation: class deque in module collections

class deque(builtins.object)
 |  deque([iterable[, maxlen]]) --> deque object
 |
 |  A list-like sequence optimized for data accesses near its endpoints.
 |
 |  Methods defined here:
 |
 |  __add__(self, value, /)
 |      Return self+value.
 |
 |  __contains__(self, key, /)
 |      Return bool(key in self).
 |
 |  __copy__(...)
 |      Return a shallow copy of a deque.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __iadd__(self, value, /)
 |      Implement self+=value.
 |
 |  __imul__(self, value, /)
 |      Implement self*=value.
 |
 |  __init__(self, /, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __mul__(self, value, /)
 |      Return self*value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __reduce__(...)
 |      Return state information for pickling.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __reversed__(...)
 |      D.__reversed__() -- return a reverse iterator over the deque
 |
 |  __rmul__(self, value, /)
 |      Return value*self.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -- size of D in memory, in bytes
 |
 |  append(...)
 |      Add an element to the right side of the deque.
 |
 |  appendleft(...)
 |      Add an element to the left side of the deque.
 |
 |  clear(...)
 |      Remove all elements from the deque.
 |
 |  copy(...)
 |      Return a shallow copy of a deque.
 |
 |  count(...)
 |      D.count(value) -- return number of occurrences of value
 |
 |  extend(...)
 |      Extend the right side of the deque with elements from the iterable
 |
 |  extendleft(...)
 |      Extend the left side of the deque with elements from the iterable
 |
 |  index(...)
 |      D.index(value, [start, [stop]]) -- return first index of value.
 |      Raises ValueError if the value is not present.
 |
 |  insert(...)
 |      D.insert(index, object) -- insert object before index
 |
 |  pop(...)
 |      Remove and return the rightmost element.
 |
 |  popleft(...)
 |      Remove and return the leftmost element.
 |
 |  remove(...)
 |      D.remove(value) -- remove first occurrence of value.
 |
 |  reverse(...)
 |      D.reverse() -- reverse *IN PLACE*
 |
 |  rotate(...)
 |      Rotate the deque n steps to the right (default n=1).  If n is negative, rotates left.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  maxlen
 |      maximum size of a deque or None if unbounded
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __hash__ = None
nltk.destructive
Python Library Documentation: module nltk.tokenize.destructive in nltk.tokenize

NAME
    nltk.tokenize.destructive

DESCRIPTION
    # Natural Language Toolkit: NLTK's very own tokenizer.
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Liling Tan
    #         Tom Aarsen <> (modifications)
    # URL: <https://www.nltk.org>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.object
        MacIntyreContractions
    nltk.tokenize.api.TokenizerI(abc.ABC)
        NLTKWordTokenizer

    class MacIntyreContractions(builtins.object)
     |  List of contractions adapted from Robert MacIntyre's tokenizer.
     |
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  CONTRACTIONS2 = [r'(?i)\b(can)(?#X)(not)\b', r"(?i)\b(d)(?#X)('ye)\b",...
     |
     |  CONTRACTIONS3 = [r"(?i) ('t)(?#X)(is)\b", r"(?i) ('t)(?#X)(was)\b"]
     |
     |  CONTRACTIONS4 = [r'(?i)\b(whad)(dd)(ya)\b', r'(?i)\b(wha)(t)(cha)\b']

    class NLTKWordTokenizer(nltk.tokenize.api.TokenizerI)
     |  The NLTK tokenizer that has improved upon the TreebankWordTokenizer.
     |
     |  This is the method that is invoked by ``word_tokenize()``.  It assumes that the
     |  text has already been segmented into sentences, e.g. using ``sent_tokenize()``.
     |
     |  The tokenizer is "destructive" such that the regexes applied will munge the
     |  input string to a state beyond re-construction. It is possible to apply
     |  `TreebankWordDetokenizer.detokenize` to the tokenized outputs of
     |  `NLTKDestructiveWordTokenizer.tokenize` but there's no guarantees to
     |  revert to the original string.
     |
     |  Method resolution order:
     |      NLTKWordTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  span_tokenize(self, text: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Returns the spans of the tokens in ``text``.
     |      Uses the post-hoc nltk.tokens.align_tokens to return the offset spans.
     |
     |          >>> from nltk.tokenize import NLTKWordTokenizer
     |          >>> s = '''Good muffins cost $3.88\nin New (York).  Please (buy) me\ntwo of them.\n(Thanks).'''
     |          >>> expected = [(0, 4), (5, 12), (13, 17), (18, 19), (19, 23),
     |          ... (24, 26), (27, 30), (31, 32), (32, 36), (36, 37), (37, 38),
     |          ... (40, 46), (47, 48), (48, 51), (51, 52), (53, 55), (56, 59),
     |          ... (60, 62), (63, 68), (69, 70), (70, 76), (76, 77), (77, 78)]
     |          >>> list(NLTKWordTokenizer().span_tokenize(s)) == expected
     |          True
     |          >>> expected = ['Good', 'muffins', 'cost', '$', '3.88', 'in',
     |          ... 'New', '(', 'York', ')', '.', 'Please', '(', 'buy', ')',
     |          ... 'me', 'two', 'of', 'them.', '(', 'Thanks', ')', '.']
     |          >>> [s[start:end] for start, end in NLTKWordTokenizer().span_tokenize(s)] == expected
     |          True
     |
     |      :param text: A string with a sentence or sentences.
     |      :type text: str
     |      :yield: Tuple[int, int]
     |
     |  tokenize(self, text: str, convert_parentheses: bool = False, return_str: bool = False) -> list[str]
     |      Return a tokenized copy of `text`.
     |
     |      >>> from nltk.tokenize import NLTKWordTokenizer
     |      >>> s = '''Good muffins cost $3.88 (roughly 3,36 euros)\nin New York.  Please buy me\ntwo of them.\nThanks.'''
     |      >>> NLTKWordTokenizer().tokenize(s) # doctest: +NORMALIZE_WHITESPACE
     |      ['Good', 'muffins', 'cost', '$', '3.88', '(', 'roughly', '3,36',
     |      'euros', ')', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two',
     |      'of', 'them.', 'Thanks', '.']
     |      >>> NLTKWordTokenizer().tokenize(s, convert_parentheses=True) # doctest: +NORMALIZE_WHITESPACE
     |      ['Good', 'muffins', 'cost', '$', '3.88', '-LRB-', 'roughly', '3,36',
     |      'euros', '-RRB-', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two',
     |      'of', 'them.', 'Thanks', '.']
     |
     |
     |      :param text: A string with a sentence or sentences.
     |      :type text: str
     |      :param convert_parentheses: if True, replace parentheses to PTB symbols,
     |          e.g. `(` to `-LRB-`. Defaults to False.
     |      :type convert_parentheses: bool, optional
     |      :param return_str: If True, return tokens as space-separated string,
     |          defaults to False.
     |      :type return_str: bool, optional
     |      :return: List of tokens from `text`.
     |      :rtype: List[str]
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  CONTRACTIONS2 = [re.compile('(?i)\\b(can)(?#X)(not)\\b', re.IGNORECASE...
     |
     |  CONTRACTIONS3 = [re.compile("(?i) ('t)(?#X)(is)\\b", re.IGNORECASE), r...
     |
     |  CONVERT_PARENTHESES = [(re.compile('\\('), '-LRB-'), (re.compile('\\)'...
     |
     |  DOUBLE_DASHES = (re.compile('--'), ' -- ')
     |
     |  ENDING_QUOTES = [(re.compile('([»”’])'), r' \1 '), (re.compile("''"), ...
     |
     |  PARENS_BRACKETS = (re.compile('[\\]\\[\\(\\)\\{\\}\\<\\>]'), r' \g<0> ...
     |
     |  PUNCTUATION = [(re.compile('([^\\.])(\\.)([\\]\\)}>"\\\'»”’ ]*)\\s*$')...
     |
     |  STARTING_QUOTES = [(re.compile('([«“‘„]|[`]+)'), r' \1 '), (re.compile...
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    List = typing.List
        A generic version of list.

    Tuple = typing.Tuple
        Deprecated alias to builtins.tuple.

        Tuple[X, Y] is the cross-product type of X and Y.

        Example: Tuple[T1, T2] is a tuple of two elements corresponding
        to type variables T1 and T2.  Tuple[int, float, str] is a tuple
        of an int, a float and a string.

        To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\destructive.py

nltk.discourse
Python Library Documentation: module nltk.inference.discourse in nltk.inference

NAME
    nltk.inference.discourse

DESCRIPTION
    Module for incrementally developing simple discourses, and checking for semantic ambiguity,
    consistency and informativeness.

    Many of the ideas are based on the CURT family of programs of Blackburn and Bos
    (see http://homepages.inf.ed.ac.uk/jbos/comsem/book1.html).

    Consistency checking is carried out  by using the ``mace`` module to call the Mace4 model builder.
    Informativeness checking is carried out with a call to ``Prover.prove()`` from
    the ``inference``  module.

    ``DiscourseTester`` is a constructor for discourses.
    The basic data structure is a list of sentences, stored as ``self._sentences``. Each sentence in the list
    is assigned a "sentence ID" (``sid``) of the form ``s``\ *i*. For example::

        s0: A boxer walks
        s1: Every boxer chases a girl

    Each sentence can be ambiguous between a number of readings, each of which receives a
    "reading ID" (``rid``) of the form ``s``\ *i* -``r``\ *j*. For example::

        s0 readings:

        s0-r1: some x.(boxer(x) & walk(x))
        s0-r0: some x.(boxerdog(x) & walk(x))

    A "thread" is a list of readings, represented as a list of ``rid``\ s.
    Each thread receives a "thread ID" (``tid``) of the form ``d``\ *i*.
    For example::

        d0: ['s0-r0', 's1-r0']

    The set of all threads for a discourse is the Cartesian product of all the readings of the sequences of sentences.
    (This is not intended to scale beyond very short discourses!) The method ``readings(filter=True)`` will only show
    those threads which are consistent (taking into account any background assumptions).

CLASSES
    builtins.object
        DiscourseTester
        ReadingCommand
            CfgReadingCommand
            DrtGlueReadingCommand

    class CfgReadingCommand(ReadingCommand)
     |  CfgReadingCommand(gramfile=None)
     |
     |  Method resolution order:
     |      CfgReadingCommand
     |      ReadingCommand
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, gramfile=None)
     |      :param gramfile: name of file where grammar can be loaded
     |      :type gramfile: str
     |
     |  combine_readings(self, readings)
     |      :see: ReadingCommand.combine_readings()
     |
     |  parse_to_readings(self, sentence)
     |      :see: ReadingCommand.parse_to_readings()
     |
     |  to_fol(self, expression)
     |      :see: ReadingCommand.to_fol()
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ReadingCommand:
     |
     |  process_thread(self, sentence_readings)
     |      This method should be used to handle dependencies between readings such
     |      as resolving anaphora.
     |
     |      :param sentence_readings: readings to process
     |      :type sentence_readings: list(Expression)
     |      :return: the list of readings after processing
     |      :rtype: list(Expression)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ReadingCommand:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DiscourseTester(builtins.object)
     |  DiscourseTester(input, reading_command=None, background=None)
     |
     |  Check properties of an ongoing discourse.
     |
     |  Methods defined here:
     |
     |  __init__(self, input, reading_command=None, background=None)
     |      Initialize a ``DiscourseTester``.
     |
     |      :param input: the discourse sentences
     |      :type input: list of str
     |      :param background: Formulas which express background assumptions
     |      :type background: list(Expression)
     |
     |  add_background(self, background, verbose=False)
     |      Add a list of background assumptions for reasoning about the discourse.
     |
     |      When called,  this method also updates the discourse model's set of readings and threads.
     |      :param background: Formulas which contain background information
     |      :type background: list(Expression)
     |
     |  add_sentence(self, sentence, informchk=False, consistchk=False)
     |      Add a sentence to the current discourse.
     |
     |      Updates ``self._input`` and ``self._sentences``.
     |      :param sentence: An input sentence
     |      :type sentence: str
     |      :param informchk: if ``True``, check that the result of adding the sentence is thread-informative. Updates ``self._readings``.
     |      :param consistchk: if ``True``, check that the result of adding the sentence is thread-consistent. Updates ``self._readings``.
     |
     |  background(self)
     |      Show the current background assumptions.
     |
     |  expand_threads(self, thread_id, threads=None)
     |      Given a thread ID, find the list of ``logic.Expression`` objects corresponding to the reading IDs in that thread.
     |
     |      :param thread_id: thread ID
     |      :type thread_id: str
     |      :param threads: a mapping from thread IDs to lists of reading IDs
     |      :type threads: dict
     |      :return: A list of pairs ``(rid, reading)`` where reading is the ``logic.Expression`` associated with a reading ID
     |      :rtype: list of tuple
     |
     |  grammar(self)
     |      Print out the grammar in use for parsing input sentences
     |
     |  models(self, thread_id=None, show=True, verbose=False)
     |      Call Mace4 to build a model for each current discourse thread.
     |
     |      :param thread_id: thread ID
     |      :type thread_id: str
     |      :param show: If ``True``, display the model that has been found.
     |
     |  readings(self, sentence=None, threaded=False, verbose=True, filter=False, show_thread_readings=False)
     |      Construct and show the readings of the discourse (or of a single sentence).
     |
     |      :param sentence: test just this sentence
     |      :type sentence: str
     |      :param threaded: if ``True``, print out each thread ID and the corresponding thread.
     |      :param filter: if ``True``, only print out consistent thread IDs and threads.
     |
     |  retract_sentence(self, sentence, verbose=True)
     |      Remove a sentence from the current discourse.
     |
     |      Updates ``self._input``, ``self._sentences`` and ``self._readings``.
     |      :param sentence: An input sentence
     |      :type sentence: str
     |      :param verbose: If ``True``,  report on the updated list of sentences.
     |
     |  sentences(self)
     |      Display the list of sentences in the current discourse.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  multiply(discourse, readings)
     |      Multiply every thread in ``discourse`` by every reading in ``readings``.
     |
     |      Given discourse = [['A'], ['B']], readings = ['a', 'b', 'c'] , returns
     |      [['A', 'a'], ['A', 'b'], ['A', 'c'], ['B', 'a'], ['B', 'b'], ['B', 'c']]
     |
     |      :param discourse: the current list of readings
     |      :type discourse: list of lists
     |      :param readings: an additional list of readings
     |      :type readings: list(Expression)
     |      :rtype: A list of lists
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DrtGlueReadingCommand(ReadingCommand)
     |  DrtGlueReadingCommand(semtype_file=None, remove_duplicates=False, depparser=None)
     |
     |  Method resolution order:
     |      DrtGlueReadingCommand
     |      ReadingCommand
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, semtype_file=None, remove_duplicates=False, depparser=None)
     |      :param semtype_file: name of file where grammar can be loaded
     |      :param remove_duplicates: should duplicates be removed?
     |      :param depparser: the dependency parser
     |
     |  combine_readings(self, readings)
     |      :see: ReadingCommand.combine_readings()
     |
     |  parse_to_readings(self, sentence)
     |      :see: ReadingCommand.parse_to_readings()
     |
     |  process_thread(self, sentence_readings)
     |      :see: ReadingCommand.process_thread()
     |
     |  to_fol(self, expression)
     |      :see: ReadingCommand.to_fol()
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ReadingCommand:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ReadingCommand(builtins.object)
     |  Methods defined here:
     |
     |  combine_readings(self, readings)
     |      :param readings: readings to combine
     |      :type readings: list(Expression)
     |      :return: one combined reading
     |      :rtype: Expression
     |
     |  parse_to_readings(self, sentence)
     |      :param sentence: the sentence to read
     |      :type sentence: str
     |
     |  process_thread(self, sentence_readings)
     |      This method should be used to handle dependencies between readings such
     |      as resolving anaphora.
     |
     |      :param sentence_readings: readings to process
     |      :type sentence_readings: list(Expression)
     |      :return: the list of readings after processing
     |      :rtype: list(Expression)
     |
     |  to_fol(self, expression)
     |      Convert this expression into a First-Order Logic expression.
     |
     |      :param expression: an expression
     |      :type expression: Expression
     |      :return: a FOL version of the input expression
     |      :rtype: Expression
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset({'combine_readings', 'parse_to_reading...

FUNCTIONS
    add(a, b, /)
        Same as a + b.

    and_(a, b, /)
        Same as a & b.

    demo()

    discourse_demo(reading_command=None)
        Illustrate the various methods of ``DiscourseTester``

    drt_discourse_demo(reading_command=None)
        Illustrate the various methods of ``DiscourseTester``

    load_fol(s)
        Temporarily duplicated from ``nltk.sem.util``.
        Convert a  file of first order formulas into a list of ``Expression`` objects.

        :param s: the contents of the file
        :type s: str
        :return: a list of parsed formulas.
        :rtype: list(Expression)

    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

    spacer(num=30)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\inference\discourse.py

nltk.distance
Python Library Documentation: module nltk.metrics.distance in nltk.metrics

NAME
    nltk.metrics.distance - Distance Metrics.

DESCRIPTION
    Compute the distance between two items (usually strings).
    As metrics, they must satisfy the following three requirements:

    1. d(a, a) = 0
    2. d(a, b) >= 0
    3. d(a, c) <= d(a, b) + d(b, c)

FUNCTIONS
    binary_distance(label1, label2)
        Simple equality test.

        0.0 if the labels are identical, 1.0 if they are different.

        >>> from nltk.metrics import binary_distance
        >>> binary_distance(1,1)
        0.0

        >>> binary_distance(1,3)
        1.0

    custom_distance(file)

    demo()

    edit_distance(s1, s2, substitution_cost=1, transpositions=False)
        Calculate the Levenshtein edit-distance between two strings.
        The edit distance is the number of characters that need to be
        substituted, inserted, or deleted, to transform s1 into s2.  For
        example, transforming "rain" to "shine" requires three steps,
        consisting of two substitutions and one insertion:
        "rain" -> "sain" -> "shin" -> "shine".  These operations could have
        been done in other orders, but at least three steps are needed.

        Allows specifying the cost of substitution edits (e.g., "a" -> "b"),
        because sometimes it makes sense to assign greater penalties to
        substitutions.

        This also optionally allows transposition edits (e.g., "ab" -> "ba"),
        though this is disabled by default.

        :param s1, s2: The strings to be analysed
        :param transpositions: Whether to allow transposition edits
        :type s1: str
        :type s2: str
        :type substitution_cost: int
        :type transpositions: bool
        :rtype: int

    edit_distance_align(s1, s2, substitution_cost=1)
        Calculate the minimum Levenshtein edit-distance based alignment
        mapping between two strings. The alignment finds the mapping
        from string s1 to s2 that minimizes the edit distance cost.
        For example, mapping "rain" to "shine" would involve 2
        substitutions, 2 matches and an insertion resulting in
        the following mapping:
        [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (4, 5)]
        NB: (0, 0) is the start state without any letters associated
        See more: https://web.stanford.edu/class/cs124/lec/med.pdf

        In case of multiple valid minimum-distance alignments, the
        backtrace has the following operation precedence:

        1. Substitute s1 and s2 characters
        2. Skip s1 character
        3. Skip s2 character

        The backtrace is carried out in reverse string order.

        This function does not support transposition.

        :param s1, s2: The strings to be aligned
        :type s1: str
        :type s2: str
        :type substitution_cost: int
        :rtype: List[Tuple(int, int)]

    fractional_presence(label)

    interval_distance(label1, label2)
        Krippendorff's interval distance metric

        >>> from nltk.metrics import interval_distance
        >>> interval_distance(1,10)
        81

        Krippendorff 1980, Content Analysis: An Introduction to its Methodology

    jaccard_distance(label1, label2)
        Distance metric comparing set-similarity.

    jaro_similarity(s1, s2)
        Computes the Jaro similarity between 2 sequences from:

            Matthew A. Jaro (1989). Advances in record linkage methodology
            as applied to the 1985 census of Tampa Florida. Journal of the
            American Statistical Association. 84 (406): 414-20.

        The Jaro distance between is the min no. of single-character transpositions
        required to change one word into another. The Jaro similarity formula from
        https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance :

            ``jaro_sim = 0 if m = 0 else 1/3 * (m/|s_1| + m/s_2 + (m-t)/m)``

        where
            - `|s_i|` is the length of string `s_i`
            - `m` is the no. of matching characters
            - `t` is the half no. of possible transpositions.

    jaro_winkler_similarity(s1, s2, p=0.1, max_l=4)
        The Jaro Winkler distance is an extension of the Jaro similarity in:

            William E. Winkler. 1990. String Comparator Metrics and Enhanced
            Decision Rules in the Fellegi-Sunter Model of Record Linkage.
            Proceedings of the Section on Survey Research Methods.
            American Statistical Association: 354-359.

        such that:

            jaro_winkler_sim = jaro_sim + ( l * p * (1 - jaro_sim) )

        where,

        - jaro_sim is the output from the Jaro Similarity,
            see jaro_similarity()
        - l is the length of common prefix at the start of the string
            - this implementation provides an upperbound for the l value
                to keep the prefixes.A common value of this upperbound is 4.
        - p is the constant scaling factor to overweigh common prefixes.
            The Jaro-Winkler similarity will fall within the [0, 1] bound,
            given that max(p)<=0.25 , default is p=0.1 in Winkler (1990)


        Test using outputs from https://www.census.gov/srd/papers/pdf/rr93-8.pdf
        from "Table 5 Comparison of String Comparators Rescaled between 0 and 1"

        >>> winkler_examples = [("billy", "billy"), ("billy", "bill"), ("billy", "blily"),
        ... ("massie", "massey"), ("yvette", "yevett"), ("billy", "bolly"), ("dwayne", "duane"),
        ... ("dixon", "dickson"), ("billy", "susan")]

        >>> winkler_scores = [1.000, 0.967, 0.947, 0.944, 0.911, 0.893, 0.858, 0.853, 0.000]
        >>> jaro_scores =    [1.000, 0.933, 0.933, 0.889, 0.889, 0.867, 0.822, 0.790, 0.000]

        One way to match the values on the Winkler's paper is to provide a different
        p scaling factor for different pairs of strings, e.g.

        >>> p_factors = [0.1, 0.125, 0.20, 0.125, 0.20, 0.20, 0.20, 0.15, 0.1]

        >>> for (s1, s2), jscore, wscore, p in zip(winkler_examples, jaro_scores, winkler_scores, p_factors):
        ...     assert round(jaro_similarity(s1, s2), 3) == jscore
        ...     assert round(jaro_winkler_similarity(s1, s2, p=p), 3) == wscore


        Test using outputs from https://www.census.gov/srd/papers/pdf/rr94-5.pdf from
        "Table 2.1. Comparison of String Comparators Using Last Names, First Names, and Street Names"

        >>> winkler_examples = [('SHACKLEFORD', 'SHACKELFORD'), ('DUNNINGHAM', 'CUNNIGHAM'),
        ... ('NICHLESON', 'NICHULSON'), ('JONES', 'JOHNSON'), ('MASSEY', 'MASSIE'),
        ... ('ABROMS', 'ABRAMS'), ('HARDIN', 'MARTINEZ'), ('ITMAN', 'SMITH'),
        ... ('JERALDINE', 'GERALDINE'), ('MARHTA', 'MARTHA'), ('MICHELLE', 'MICHAEL'),
        ... ('JULIES', 'JULIUS'), ('TANYA', 'TONYA'), ('DWAYNE', 'DUANE'), ('SEAN', 'SUSAN'),
        ... ('JON', 'JOHN'), ('JON', 'JAN'), ('BROOKHAVEN', 'BRROKHAVEN'),
        ... ('BROOK HALLOW', 'BROOK HLLW'), ('DECATUR', 'DECATIR'), ('FITZRUREITER', 'FITZENREITER'),
        ... ('HIGBEE', 'HIGHEE'), ('HIGBEE', 'HIGVEE'), ('LACURA', 'LOCURA'), ('IOWA', 'IONA'), ('1ST', 'IST')]

        >>> jaro_scores =   [0.970, 0.896, 0.926, 0.790, 0.889, 0.889, 0.722, 0.467, 0.926,
        ... 0.944, 0.869, 0.889, 0.867, 0.822, 0.783, 0.917, 0.000, 0.933, 0.944, 0.905,
        ... 0.856, 0.889, 0.889, 0.889, 0.833, 0.000]

        >>> winkler_scores = [0.982, 0.896, 0.956, 0.832, 0.944, 0.922, 0.722, 0.467, 0.926,
        ... 0.961, 0.921, 0.933, 0.880, 0.858, 0.805, 0.933, 0.000, 0.947, 0.967, 0.943,
        ... 0.913, 0.922, 0.922, 0.900, 0.867, 0.000]

        One way to match the values on the Winkler's paper is to provide a different
        p scaling factor for different pairs of strings, e.g.

        >>> p_factors = [0.1, 0.1, 0.1, 0.1, 0.125, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.20,
        ... 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]


        >>> for (s1, s2), jscore, wscore, p in zip(winkler_examples, jaro_scores, winkler_scores, p_factors):
        ...     if (s1, s2) in [('JON', 'JAN'), ('1ST', 'IST')]:
        ...         continue  # Skip bad examples from the paper.
        ...     assert round(jaro_similarity(s1, s2), 3) == jscore
        ...     assert round(jaro_winkler_similarity(s1, s2, p=p), 3) == wscore



        This test-case proves that the output of Jaro-Winkler similarity depends on
        the product  l * p and not on the product max_l * p. Here the product max_l * p > 1
        however the product l * p <= 1

        >>> round(jaro_winkler_similarity('TANYA', 'TONYA', p=0.1, max_l=100), 3)
        0.88

        Test edge cases for very short or empty strings.

        >>> jaro_similarity("", "") == 1.0
        True
        >>> jaro_similarity("", "nonempty") == 0.0
        True
        >>> jaro_similarity("a", "a") == 1.0
        True
        >>> jaro_similarity("a", "b") == 0.0
        True
        >>> jaro_winkler_similarity("", "") == 1.0
        True
        >>> jaro_winkler_similarity("a", "a") == 1.0
        True

    masi_distance(label1, label2)
        Distance metric that takes into account partial agreement when multiple
        labels are assigned.

        >>> from nltk.metrics import masi_distance
        >>> masi_distance(set([1, 2]), set([1, 2, 3, 4]))
        0.665

        Passonneau 2006, Measuring Agreement on Set-Valued Items (MASI)
        for Semantic and Pragmatic Annotation.

    presence(label)
        Higher-order function to test presence of a given label

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\metrics\distance.py

nltk.download
Python Library Documentation: method download in module nltk.downloader

download(info_or_id=None, download_dir=None, quiet=False, force=False, prefix='[nltk_data] ', halt_on_error=True, raise_on_error=False, print_error_to=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='cp1252'>, hf=False) method of nltk.downloader.Downloader instance
nltk.download_gui
Python Library Documentation: function download_gui in module nltk.downloader

download_gui()
nltk.download_shell
Python Library Documentation: function download_shell in module nltk.downloader

download_shell()
nltk.downloader
Python Library Documentation: module nltk.downloader in nltk

NAME
    nltk.downloader

DESCRIPTION
    The NLTK corpus and module downloader.  This module defines several
    interfaces which can be used to download corpora, models, and other
    data packages that can be used with NLTK.

    Downloading Packages
    ====================
    If called with no arguments, ``download()`` will display an interactive
    interface which can be used to download and install new packages.
    If Tkinter is available, then a graphical interface will be shown,
    otherwise a simple text interface will be provided.

    Individual packages can be downloaded by calling the ``download()``
    function with a single argument, giving the package identifier for the
    package that should be downloaded:

        >>> download('treebank') # doctest: +SKIP
        [nltk_data] Downloading package 'treebank'...
        [nltk_data]   Unzipping corpora/treebank.zip.

    NLTK also provides a number of "package collections", consisting of
    a group of related packages.  To download all packages in a
    colleciton, simply call ``download()`` with the collection's
    identifier:

        >>> download('all-corpora') # doctest: +SKIP
        [nltk_data] Downloading package 'abc'...
        [nltk_data]   Unzipping corpora/abc.zip.
        [nltk_data] Downloading package 'alpino'...
        [nltk_data]   Unzipping corpora/alpino.zip.
          ...
        [nltk_data] Downloading package 'words'...
        [nltk_data]   Unzipping corpora/words.zip.

    Download Directory
    ==================
    By default, packages are installed in either a system-wide directory
    (if Python has sufficient access to write to it); or in the current
    user's home directory.  However, the ``download_dir`` argument may be
    used to specify a different installation target, if desired.

    See ``Downloader.default_download_dir()`` for more a detailed
    description of how the default download directory is chosen.

    NLTK Download Server
    ====================
    Before downloading any packages, the corpus and module downloader
    contacts the NLTK download server, to retrieve an index file
    describing the available packages.  By default, this index file is
    loaded from ``https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml``.
    If necessary, it is possible to create a new ``Downloader`` object,
    specifying a different URL for the package index file.

    Usage::

        python nltk/downloader.py [-d DATADIR] [-q] [-f] [-k] PACKAGE_IDS

    or::

        python -m nltk.downloader [-d DATADIR] [-q] [-f] [-k] PACKAGE_IDS

CLASSES
    builtins.object
        Collection
        Downloader
        DownloaderGUI
        DownloaderMessage
            ErrorMessage
            FinishCollectionMessage
            FinishDownloadMessage
            FinishPackageMessage
            FinishUnzipMessage
            ProgressMessage
            SelectDownloadDirMessage
            StaleMessage
            StartCollectionMessage
            StartDownloadMessage
            StartPackageMessage
            StartUnzipMessage
            UpToDateMessage
        DownloaderShell
        Package

    class Collection(builtins.object)
     |  Collection(id, children, name=None, **kw)
     |
     |  A directory entry for a collection of downloadable packages.
     |  These entries are extracted from the XML index file that is
     |  downloaded by ``Downloader``.
     |
     |  Methods defined here:
     |
     |  __init__(self, id, children, name=None, **kw)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  fromxml(xml)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Downloader(builtins.object)
     |  Downloader(server_index_url=None, download_dir=None)
     |
     |  A class used to access the NLTK data server, which can be used to
     |  download corpora and other data packages.
     |
     |  Methods defined here:
     |
     |  __init__(self, server_index_url=None, download_dir=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  clear_status_cache(self, id=None)
     |
     |  collections(self)
     |
     |  corpora(self)
     |
     |  default_download_dir(self)
     |      Return the directory to which packages will be downloaded by
     |      default.  This value can be overridden using the constructor,
     |      or on a case-by-case basis using the ``download_dir`` argument when
     |      calling ``download()``.
     |
     |      On Windows, the default download directory is
     |      ``PYTHONHOME/lib/nltk``, where *PYTHONHOME* is the
     |      directory containing Python, e.g. ``C:\Python25``.
     |
     |      On all other platforms, the default directory is the first of
     |      the following which exists or which can be created with write
     |      permission: ``/usr/share/nltk_data``, ``/usr/local/share/nltk_data``,
     |      ``/usr/lib/nltk_data``, ``/usr/local/lib/nltk_data``, ``~/nltk_data``.
     |
     |  download(self, info_or_id=None, download_dir=None, quiet=False, force=False, prefix='[nltk_data] ', halt_on_error=True, raise_on_error=False, print_error_to=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='cp1252'>, hf=False)
     |
     |  incr_download(self, info_or_id, download_dir=None, force=False)
     |
     |  index(self)
     |      Return the XML index describing the packages available from
     |      the data server.  If necessary, this index will be downloaded
     |      from the data server.
     |
     |  info(self, id)
     |      Return the ``Package`` or ``Collection`` record for the
     |      given item.
     |
     |  is_installed(self, info_or_id, download_dir=None)
     |
     |  is_stale(self, info_or_id, download_dir=None)
     |
     |  list(self, download_dir=None, show_packages=True, show_collections=True, header=True, more_prompt=False, skip_installed=False)
     |
     |  models(self)
     |
     |  packages(self)
     |
     |  status(self, info_or_id, download_dir=None)
     |      Return a constant describing the status of the given package
     |      or collection.  Status can be one of ``INSTALLED``,
     |      ``NOT_INSTALLED``, ``STALE``, or ``PARTIAL``.
     |
     |  update(self, quiet=False, prefix='[nltk_data] ')
     |      Re-download any packages whose status is STALE.
     |
     |  xmlinfo(self, id)
     |      Return the XML info record for the given item
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  download_dir
     |      The default directory to which packages will be downloaded.
     |      This defaults to the value returned by ``default_download_dir()``.
     |      To override this default on a case-by-case basis, use the
     |      ``download_dir`` argument when calling ``download()``.
     |
     |  url
     |      The URL for the data server's index file.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  DEFAULT_URL = 'https://raw.githubusercontent.com/nltk/nltk_data/gh-pag...
     |
     |  INDEX_TIMEOUT = 3600
     |
     |  INSTALLED = 'installed'
     |
     |  NOT_INSTALLED = 'not installed'
     |
     |  PARTIAL = 'partial'
     |
     |  STALE = 'out of date'

    class DownloaderGUI(builtins.object)
     |  DownloaderGUI(dataserver, use_threads=True)
     |
     |  Graphical interface for downloading packages from the NLTK data
     |  server.
     |
     |  Methods defined here:
     |
     |  __init__(self, dataserver, use_threads=True)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  about(self, *e)
     |
     |  destroy(self, *e)
     |
     |  help(self, *e)
     |
     |  mainloop(self, *args, **kwargs)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  COLUMNS = ['', 'Identifier', 'Name', 'Size', 'Status', 'Unzipped Size'...
     |
     |  COLUMN_WEIGHTS = {'': 0, 'Name': 5, 'Size': 0, 'Status': 0}
     |
     |  COLUMN_WIDTHS = {'': 1, 'Identifier': 20, 'Name': 45, 'Size': 10, 'Sta...
     |
     |  DEFAULT_COLUMN_WIDTH = 30
     |
     |  HELP = 'This tool can be used to download a variety of c...\t Select p...
     |
     |  INITIAL_COLUMNS = ['', 'Identifier', 'Name', 'Size', 'Status']
     |
     |  c = 'Status'

    class DownloaderMessage(builtins.object)
     |  A status message object, used by ``incr_download`` to
     |  communicate its progress.
     |
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DownloaderShell(builtins.object)
     |  DownloaderShell(dataserver)
     |
     |  Methods defined here:
     |
     |  __init__(self, dataserver)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  run(self)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ErrorMessage(DownloaderMessage)
     |  ErrorMessage(package, message)
     |
     |  Data server encountered an error
     |
     |  Method resolution order:
     |      ErrorMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, package, message)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FinishCollectionMessage(DownloaderMessage)
     |  FinishCollectionMessage(collection)
     |
     |  Data server has finished working on a collection of packages.
     |
     |  Method resolution order:
     |      FinishCollectionMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, collection)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FinishDownloadMessage(DownloaderMessage)
     |  FinishDownloadMessage(package)
     |
     |  Data server has finished downloading a package.
     |
     |  Method resolution order:
     |      FinishDownloadMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, package)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FinishPackageMessage(DownloaderMessage)
     |  FinishPackageMessage(package)
     |
     |  Data server has finished working on a package.
     |
     |  Method resolution order:
     |      FinishPackageMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, package)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FinishUnzipMessage(DownloaderMessage)
     |  FinishUnzipMessage(package)
     |
     |  Data server has finished unzipping a package.
     |
     |  Method resolution order:
     |      FinishUnzipMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, package)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Package(builtins.object)
     |  Package(id, url, name=None, subdir='', size=None, unzipped_size=None, checksum=None, svn_revision=None, copyright='Unknown', contact='Unknown', license='Unknown', author='Unknown', unzip=True, **kw)
     |
     |  A directory entry for a downloadable package.  These entries are
     |  extracted from the XML index file that is downloaded by
     |  ``Downloader``.  Each package consists of a single file; but if
     |  that file is a zip file, then it can be automatically decompressed
     |  when the package is installed.
     |
     |  Methods defined here:
     |
     |  __init__(self, id, url, name=None, subdir='', size=None, unzipped_size=None, checksum=None, svn_revision=None, copyright='Unknown', contact='Unknown', license='Unknown', author='Unknown', unzip=True, **kw)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  fromxml(xml)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProgressMessage(DownloaderMessage)
     |  ProgressMessage(progress)
     |
     |  Indicates how much progress the data server has made
     |
     |  Method resolution order:
     |      ProgressMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, progress)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SelectDownloadDirMessage(DownloaderMessage)
     |  SelectDownloadDirMessage(download_dir)
     |
     |  Indicates what download directory the data server is using
     |
     |  Method resolution order:
     |      SelectDownloadDirMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, download_dir)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StaleMessage(DownloaderMessage)
     |  StaleMessage(package)
     |
     |  The package download file is out-of-date or corrupt
     |
     |  Method resolution order:
     |      StaleMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, package)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StartCollectionMessage(DownloaderMessage)
     |  StartCollectionMessage(collection)
     |
     |  Data server has started working on a collection of packages.
     |
     |  Method resolution order:
     |      StartCollectionMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, collection)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StartDownloadMessage(DownloaderMessage)
     |  StartDownloadMessage(package)
     |
     |  Data server has started downloading a package.
     |
     |  Method resolution order:
     |      StartDownloadMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, package)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StartPackageMessage(DownloaderMessage)
     |  StartPackageMessage(package)
     |
     |  Data server has started working on a package.
     |
     |  Method resolution order:
     |      StartPackageMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, package)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StartUnzipMessage(DownloaderMessage)
     |  StartUnzipMessage(package)
     |
     |  Data server has started unzipping a package.
     |
     |  Method resolution order:
     |      StartUnzipMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, package)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class UpToDateMessage(DownloaderMessage)
     |  UpToDateMessage(package)
     |
     |  The package download file is already up-to-date
     |
     |  Method resolution order:
     |      UpToDateMessage
     |      DownloaderMessage
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, package)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DownloaderMessage:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    build_index(root, base_url)
        Create a new data.xml index file, by combining the xml description
        files for various packages and collections.  ``root`` should be the
        path to a directory containing the package xml and zip files; and
        the collection xml files.  The ``root`` directory is expected to
        have the following subdirectories::

          root/
            packages/ .................. subdirectory for packages
              corpora/ ................. zip & xml files for corpora
              grammars/ ................ zip & xml files for grammars
              taggers/ ................. zip & xml files for taggers
              tokenizers/ .............. zip & xml files for tokenizers
              etc.
            collections/ ............... xml files for collections

        For each package, there should be two files: ``package.zip``
        (where *package* is the package name)
        which contains the package itself as a compressed zip file; and
        ``package.xml``, which is an xml description of the package.  The
        zipfile ``package.zip`` should expand to a single subdirectory
        named ``package/``.  The base filename ``package`` must match
        the identifier given in the package's xml file.

        For each collection, there should be a single file ``collection.zip``
        describing the collection, where *collection* is the name of the collection.

        All identifiers (for both packages and collections) must be unique.

    download(info_or_id=None, download_dir=None, quiet=False, force=False, prefix='[nltk_data] ', halt_on_error=True, raise_on_error=False, print_error_to=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='cp1252'>, hf=False) method of Downloader instance

    download_gui()

    download_shell()

    md5 = openssl_md5(string=b'', *, usedforsecurity=True)
        Returns a md5 hash object; optionally initialized with a string

    md5_hexdigest(file)
        Calculate and return the MD5 checksum for a given file.
        ``file`` may either be a filename or an open stream.

    sha256 = openssl_sha256(string=b'', *, usedforsecurity=True)
        Returns a sha256 hash object; optionally initialized with a string

    sha256_hexdigest(file)
        Calculate and return the SHA-256 checksum for a given file.
        ``file`` may either be a filename or an open stream.

    unzip(filename, root, verbose=True)
        Extract the contents of the zip file ``filename`` into the
        directory ``root``.

    update()

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\downloader.py

nltk.draw
Python Library Documentation: package nltk.draw in nltk

NAME
    nltk.draw

DESCRIPTION
    # Natural Language Toolkit: graphical representations package
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Edward Loper <edloper@gmail.com>
    #         Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

PACKAGE CONTENTS
    cfg
    dispersion
    table
    tree
    util

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\draw\__init__.py

nltk.drt
Python Library Documentation: module nltk.sem.drt in nltk.sem

NAME
    nltk.sem.drt

DESCRIPTION
    # Natural Language Toolkit: Discourse Representation Theory (DRT)
    #
    # Author: Dan Garrette <dhgarrette@gmail.com>
    #
    # Copyright (C) 2001-2026 NLTK Project
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.Exception(builtins.BaseException)
        AnaphoraResolutionException
    builtins.list(builtins.object)
        PossibleAntecedents(builtins.list, DrtExpression, nltk.sem.logic.Expression)
    builtins.object
        DrsDrawer
        DrtExpression
            DRS(DrtExpression, nltk.sem.logic.Expression)
            DrtAbstractVariableExpression(DrtExpression, nltk.sem.logic.AbstractVariableExpression)
                DrtConstantExpression(DrtAbstractVariableExpression, nltk.sem.logic.ConstantExpression)
                DrtFunctionVariableExpression(DrtAbstractVariableExpression, nltk.sem.logic.FunctionVariableExpression)
                DrtIndividualVariableExpression(DrtAbstractVariableExpression, nltk.sem.logic.IndividualVariableExpression)
                    DrtEventVariableExpression(DrtIndividualVariableExpression, nltk.sem.logic.EventVariableExpression)
            DrtApplicationExpression(DrtExpression, nltk.sem.logic.ApplicationExpression)
            DrtBinaryExpression(DrtExpression, nltk.sem.logic.BinaryExpression)
                DrtBooleanExpression(DrtBinaryExpression, nltk.sem.logic.BooleanExpression)
                    DrtConcatenation
                    DrtOrExpression(DrtBooleanExpression, nltk.sem.logic.OrExpression)
                DrtEqualityExpression(DrtBinaryExpression, nltk.sem.logic.EqualityExpression)
            DrtLambdaExpression(DrtExpression, nltk.sem.logic.LambdaExpression)
            DrtNegatedExpression(DrtExpression, nltk.sem.logic.NegatedExpression)
            DrtProposition(DrtExpression, nltk.sem.logic.Expression)
            PossibleAntecedents(builtins.list, DrtExpression, nltk.sem.logic.Expression)
    nltk.sem.logic.LogicParser(builtins.object)
        DrtParser
    nltk.sem.logic.Tokens(builtins.object)
        DrtTokens

    class AnaphoraResolutionException(builtins.Exception)
     |  Method resolution order:
     |      AnaphoraResolutionException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class DRS(DrtExpression, nltk.sem.logic.Expression)
     |  DRS(refs, conds, consequent=None)
     |
     |  A Discourse Representation Structure.
     |
     |  Method resolution order:
     |      DRS
     |      DrtExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Defines equality modulo alphabetic variance.
     |      If we are comparing \x.M  and \y.N, then check equality of M and N[x/y].
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, refs, conds, consequent=None)
     |      :param refs: list of ``DrtIndividualVariableExpression`` for the
     |          discourse referents
     |      :param conds: list of ``Expression`` for the conditions
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  eliminate_equality(self)
     |
     |  fol(self)
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace all instances of variable v with expression E in self,
     |      where v is free in self.
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  visit_structured(self, function, combinator)
     |      :see: Expression.visit_structured()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  findtype(self, variable)
     |      Find the type of the given variable as it is used in this expression.
     |      For example, finding the type of "P" in "P(x) & Q(x,y)" yields "<e,t>"
     |
     |      :param variable: Variable
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects

    class DrsDrawer(builtins.object)
     |  DrsDrawer(drs, size_canvas=True, canvas=None)
     |
     |  Methods defined here:
     |
     |  __init__(self, drs, size_canvas=True, canvas=None)
     |      :param drs: ``DrtExpression``, The DRS to be drawn
     |      :param size_canvas: bool, True if the canvas size should be the exact size of the DRS
     |      :param canvas: ``Canvas`` The canvas on which to draw the DRS.  If none is given, create a new canvas.
     |
     |  draw(self, x=6, y=10)
     |      Draw the DRS
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  BUFFER = 3
     |
     |  OUTERSPACE = 6
     |
     |  TOPSPACE = 10

    class DrtAbstractVariableExpression(DrtExpression, nltk.sem.logic.AbstractVariableExpression)
     |  DrtAbstractVariableExpression(variable)
     |
     |  Method resolution order:
     |      DrtAbstractVariableExpression
     |      DrtExpression
     |      nltk.sem.logic.AbstractVariableExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  eliminate_equality(self)
     |
     |  fol(self)
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.AbstractVariableExpression:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtApplicationExpression(DrtExpression, nltk.sem.logic.ApplicationExpression)
     |  DrtApplicationExpression(function, argument)
     |
     |  Method resolution order:
     |      DrtApplicationExpression
     |      DrtExpression
     |      nltk.sem.logic.ApplicationExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  fol(self)
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  eliminate_equality(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.ApplicationExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, function, argument)
     |      :param function: ``Expression``, for the function expression
     |      :param argument: ``Expression``, for the argument
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  is_atom(self)
     |      Is this expression an atom (as opposed to a lambda expression applied
     |      to a term)?
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  uncurry(self)
     |      Uncurry this application expression
     |
     |      return: A tuple (base-function, arg-list)
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from nltk.sem.logic.ApplicationExpression:
     |
     |  args
     |      Return uncurried arg-list
     |
     |  pred
     |      Return uncurried base-function.
     |      If this is an atom, then the result will be a variable expression.
     |      Otherwise, it will be a lambda expression.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtBinaryExpression(DrtExpression, nltk.sem.logic.BinaryExpression)
     |  DrtBinaryExpression(first, second)
     |
     |  Method resolution order:
     |      DrtBinaryExpression
     |      DrtExpression
     |      nltk.sem.logic.BinaryExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  eliminate_equality(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtBooleanExpression(DrtBinaryExpression, nltk.sem.logic.BooleanExpression)
     |  DrtBooleanExpression(first, second)
     |
     |  Method resolution order:
     |      DrtBooleanExpression
     |      DrtBinaryExpression
     |      DrtExpression
     |      nltk.sem.logic.BooleanExpression
     |      nltk.sem.logic.BinaryExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods inherited from DrtBinaryExpression:
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  eliminate_equality(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtConcatenation(DrtBooleanExpression)
     |  DrtConcatenation(first, second, consequent=None)
     |
     |  DRS of the form '(DRS + DRS)'
     |
     |  Method resolution order:
     |      DrtConcatenation
     |      DrtBooleanExpression
     |      DrtBinaryExpression
     |      DrtExpression
     |      nltk.sem.logic.BooleanExpression
     |      nltk.sem.logic.BinaryExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Defines equality modulo alphabetic variance.
     |      If we are comparing \x.M  and \y.N, then check equality of M and N[x/y].
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second, consequent=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  eliminate_equality(self)
     |
     |  fol(self)
     |
     |  getOp(self)
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace all instances of variable v with expression E in self,
     |      where v is free in self.
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.BinaryExpression:
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtConstantExpression(DrtAbstractVariableExpression, nltk.sem.logic.ConstantExpression)
     |  DrtConstantExpression(variable)
     |
     |  Method resolution order:
     |      DrtConstantExpression
     |      DrtAbstractVariableExpression
     |      DrtExpression
     |      nltk.sem.logic.ConstantExpression
     |      nltk.sem.logic.AbstractVariableExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods inherited from DrtAbstractVariableExpression:
     |
     |  eliminate_equality(self)
     |
     |  fol(self)
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.ConstantExpression:
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.AbstractVariableExpression:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtEqualityExpression(DrtBinaryExpression, nltk.sem.logic.EqualityExpression)
     |  DrtEqualityExpression(first, second)
     |
     |  Method resolution order:
     |      DrtEqualityExpression
     |      DrtBinaryExpression
     |      DrtExpression
     |      nltk.sem.logic.EqualityExpression
     |      nltk.sem.logic.BinaryExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  fol(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtBinaryExpression:
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  eliminate_equality(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.EqualityExpression:
     |
     |  getOp(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtEventVariableExpression(DrtIndividualVariableExpression, nltk.sem.logic.EventVariableExpression)
     |  DrtEventVariableExpression(variable)
     |
     |  Method resolution order:
     |      DrtEventVariableExpression
     |      DrtIndividualVariableExpression
     |      DrtAbstractVariableExpression
     |      DrtExpression
     |      nltk.sem.logic.EventVariableExpression
     |      nltk.sem.logic.IndividualVariableExpression
     |      nltk.sem.logic.AbstractVariableExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods inherited from DrtAbstractVariableExpression:
     |
     |  eliminate_equality(self)
     |
     |  fol(self)
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.IndividualVariableExpression:
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.AbstractVariableExpression:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtExpression(builtins.object)
     |  This is the base abstract DRT Expression from which every DRT
     |  Expression extends.
     |
     |  Methods defined here:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  eliminate_equality(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  get_refs(self, recursive=False)
     |      Return the set of discourse referents in this DRS.
     |      :param recursive: bool Also find discourse referents in subterms?
     |      :return: list of ``Variable`` objects
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DrtFunctionVariableExpression(DrtAbstractVariableExpression, nltk.sem.logic.FunctionVariableExpression)
     |  DrtFunctionVariableExpression(variable)
     |
     |  Method resolution order:
     |      DrtFunctionVariableExpression
     |      DrtAbstractVariableExpression
     |      DrtExpression
     |      nltk.sem.logic.FunctionVariableExpression
     |      nltk.sem.logic.AbstractVariableExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods inherited from DrtAbstractVariableExpression:
     |
     |  eliminate_equality(self)
     |
     |  fol(self)
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.FunctionVariableExpression:
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.AbstractVariableExpression:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtIndividualVariableExpression(DrtAbstractVariableExpression, nltk.sem.logic.IndividualVariableExpression)
     |  DrtIndividualVariableExpression(variable)
     |
     |  Method resolution order:
     |      DrtIndividualVariableExpression
     |      DrtAbstractVariableExpression
     |      DrtExpression
     |      nltk.sem.logic.IndividualVariableExpression
     |      nltk.sem.logic.AbstractVariableExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods inherited from DrtAbstractVariableExpression:
     |
     |  eliminate_equality(self)
     |
     |  fol(self)
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.IndividualVariableExpression:
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.AbstractVariableExpression:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtLambdaExpression(DrtExpression, nltk.sem.logic.LambdaExpression)
     |  DrtLambdaExpression(variable, term)
     |
     |  Method resolution order:
     |      DrtLambdaExpression
     |      DrtExpression
     |      nltk.sem.logic.LambdaExpression
     |      nltk.sem.logic.VariableBinderExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  alpha_convert(self, newvar)
     |      Rename all occurrences of the variable introduced by this variable
     |      binder in the expression to ``newvar``.
     |      :param newvar: ``Variable``, for the new variable
     |
     |  fol(self)
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  eliminate_equality(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.LambdaExpression:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.VariableBinderExpression:
     |
     |  __eq__(self, other)
     |      Defines equality modulo alphabetic variance.  If we are comparing
     |      \x.M  and \y.N, then check equality of M and N[x/y].
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, variable, term)
     |      :param variable: ``Variable``, for the variable
     |      :param term: ``Expression``, for the term
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  visit_structured(self, function, combinator)
     |      :see: Expression.visit_structured()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects

    class DrtNegatedExpression(DrtExpression, nltk.sem.logic.NegatedExpression)
     |  DrtNegatedExpression(term)
     |
     |  Method resolution order:
     |      DrtNegatedExpression
     |      DrtExpression
     |      nltk.sem.logic.NegatedExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  fol(self)
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  eliminate_equality(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.NegatedExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, term)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      Find the type of the given variable as it is used in this expression.
     |      For example, finding the type of "P" in "P(x) & Q(x,y)" yields "<e,t>"
     |
     |      :param variable: Variable
     |
     |  negate(self)
     |      :see: Expression.negate()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtOrExpression(DrtBooleanExpression, nltk.sem.logic.OrExpression)
     |  DrtOrExpression(first, second)
     |
     |  Method resolution order:
     |      DrtOrExpression
     |      DrtBooleanExpression
     |      DrtBinaryExpression
     |      DrtExpression
     |      nltk.sem.logic.OrExpression
     |      nltk.sem.logic.BooleanExpression
     |      nltk.sem.logic.BinaryExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  fol(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtBinaryExpression:
     |
     |  get_refs(self, recursive=False)
     |      :see: AbstractExpression.get_refs()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  eliminate_equality(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.OrExpression:
     |
     |  getOp(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

    class DrtParser(nltk.sem.logic.LogicParser)
     |  A lambda calculus expression parser.
     |
     |  Method resolution order:
     |      DrtParser
     |      nltk.sem.logic.LogicParser
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      :param type_check: should type checking be performed
     |          to their types?
     |      :type type_check: bool
     |
     |  get_BooleanExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different boolean operators
     |
     |  get_all_symbols(self)
     |      This method exists to be overridden
     |
     |  handle(self, tok, context)
     |      This method is intended to be overridden for logics that
     |      use different operators or expressions
     |
     |  handle_DRS(self, tok, context)
     |
     |  handle_conds(self, context)
     |
     |  handle_prop(self, tok, context)
     |
     |  handle_refs(self)
     |
     |  isvariable(self, tok)
     |
     |  make_ApplicationExpression(self, function, argument)
     |
     |  make_BooleanExpression(self, factory, first, second)
     |
     |  make_EqualityExpression(self, first, second)
     |      This method serves as a hook for other logic parsers that
     |      have different equality expression classes
     |
     |  make_LambdaExpression(self, variables, term)
     |
     |  make_NegatedExpression(self, expression)
     |
     |  make_VariableExpression(self, name)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.LogicParser:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  assertNextToken(self, expected)
     |
     |  assertToken(self, tok, expected)
     |
     |  attempt_ApplicationExpression(self, expression, context)
     |      Attempt to make an application expression.  The next tokens are
     |      a list of arguments in parens, then the argument expression is a
     |      function being applied to the arguments.  Otherwise, return the
     |      argument expression.
     |
     |  attempt_BooleanExpression(self, expression, context)
     |      Attempt to make a boolean expression.  If the next token is a boolean
     |      operator, then a BooleanExpression will be returned.  Otherwise, the
     |      parameter will be returned.
     |
     |  attempt_EqualityExpression(self, expression, context)
     |      Attempt to make an equality expression.  If the next token is an
     |      equality operator, then an EqualityExpression will be returned.
     |      Otherwise, the parameter will be returned.
     |
     |  attempt_adjuncts(self, expression, context)
     |
     |  get_QuantifiedExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different quantifiers
     |
     |  get_next_token_variable(self, description)
     |
     |  handle_lambda(self, tok, context)
     |
     |  handle_negation(self, tok, context)
     |
     |  handle_open(self, tok, context)
     |
     |  handle_quant(self, tok, context)
     |
     |  handle_variable(self, tok, context)
     |
     |  has_priority(self, operation, context)
     |
     |  inRange(self, location)
     |      Return TRUE if the given location is within the buffer
     |
     |  make_QuanifiedExpression(self, factory, variable, term)
     |
     |  parse(self, data, signature=None)
     |      Parse the expression.
     |
     |      :param data: str for the input to be parsed
     |      :param signature: ``dict<str, str>`` that maps variable names to type
     |          strings
     |      :returns: a parsed Expression
     |
     |  process(self, data)
     |      Split the data into tokens
     |
     |  process_next_expression(self, context)
     |      Parse the next complete expression from the stream and return it.
     |
     |  process_quoted_token(self, data_idx, data)
     |
     |  token(self, location=None)
     |      Get the next waiting token.  If a location is given, then
     |      return the token at currentIndex+location without advancing
     |      currentIndex; setting it gives lookahead/lookback capability.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.sem.logic.LogicParser:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.sem.logic.LogicParser:
     |
     |  MAX_PARSE_DEPTH = 200

    class DrtProposition(DrtExpression, nltk.sem.logic.Expression)
     |  DrtProposition(variable, drs)
     |
     |  Method resolution order:
     |      DrtProposition
     |      DrtExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from nltk.sem.logic.Expression
     |      Return hash(self).
     |
     |  __init__(self, variable, drs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  eliminate_equality(self)
     |
     |  fol(self)
     |
     |  get_refs(self, recursive=False)
     |      Return the set of discourse referents in this DRS.
     |      :param recursive: bool Also find discourse referents in subterms?
     |      :return: list of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  visit_structured(self, function, combinator)
     |      :see: Expression.visit_structured()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __add__(self, other)
     |
     |  __and__(self, other)
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DrtExpression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  findtype(self, variable)
     |      Find the type of the given variable as it is used in this expression.
     |      For example, finding the type of "P" in "P(x) & Q(x,y)" yields "<e,t>"
     |
     |      :param variable: Variable
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects

    class DrtTokens(nltk.sem.logic.Tokens)
     |  Method resolution order:
     |      DrtTokens
     |      nltk.sem.logic.Tokens
     |      builtins.object
     |
     |  Data and other attributes defined here:
     |
     |  CLOSE_BRACKET = ']'
     |
     |  COLON = ':'
     |
     |  DRS = 'DRS'
     |
     |  DRS_CONC = '+'
     |
     |  OPEN_BRACKET = '['
     |
     |  PRONOUN = 'PRO'
     |
     |  PUNCT = ['+', '[', ']', ':']
     |
     |  SYMBOLS = ['&', '^', '|', '->', '=>', '<->', '<=>', '=', '==', '!=', r...
     |
     |  TOKENS = ['and', '&', '^', 'or', '|', 'implies', '->', '=>', 'iff', '<...
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.sem.logic.Tokens:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.sem.logic.Tokens:
     |
     |  ALL = 'all'
     |
     |  ALL_LIST = ['all', 'forall']
     |
     |  AND = '&'
     |
     |  AND_LIST = ['and', '&', '^']
     |
     |  BINOPS = ['and', '&', '^', 'or', '|', 'implies', '->', '=>', 'iff', '<...
     |
     |  CLOSE = ')'
     |
     |  COMMA = ','
     |
     |  DOT = '.'
     |
     |  EQ = '='
     |
     |  EQ_LIST = ['=', '==']
     |
     |  EXISTS = 'exists'
     |
     |  EXISTS_LIST = ['some', 'exists', 'exist']
     |
     |  IFF = '<->'
     |
     |  IFF_LIST = ['iff', '<->', '<=>']
     |
     |  IMP = '->'
     |
     |  IMP_LIST = ['implies', '->', '=>']
     |
     |  IOTA = 'iota'
     |
     |  IOTA_LIST = ['iota']
     |
     |  LAMBDA = r'\'
     |
     |  LAMBDA_LIST = [r'\']
     |
     |  NEQ = '!='
     |
     |  NEQ_LIST = ['!=']
     |
     |  NOT = '-'
     |
     |  NOT_LIST = ['not', '-', '!']
     |
     |  OPEN = '('
     |
     |  OR = '|'
     |
     |  OR_LIST = ['or', '|']
     |
     |  QUANTS = ['some', 'exists', 'exist', 'all', 'forall', 'iota']

    class PossibleAntecedents(builtins.list, DrtExpression, nltk.sem.logic.Expression)
     |  PossibleAntecedents(iterable=(), /)
     |
     |  Method resolution order:
     |      PossibleAntecedents
     |      builtins.list
     |      DrtExpression
     |      nltk.sem.logic.Expression
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  free(self)
     |      Set of free variables.
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace all instances of variable v with expression E in self,
     |      where v is free in self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, index, /)
     |      Return self[index].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __iadd__(self, value, /)
     |      Implement self+=value.
     |
     |  __imul__(self, value, /)
     |      Implement self*=value.
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  append(self, object, /)
     |      Append object to the end of the list.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  copy(self, /)
     |      Return a shallow copy of the list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  extend(self, iterable, /)
     |      Extend list by appending elements from the iterable.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  insert(self, index, object, /)
     |      Insert object before index.
     |
     |  pop(self, index=-1, /)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, value, /)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self, /)
     |      Reverse *IN PLACE*.
     |
     |  sort(self, /, *, key=None, reverse=False)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.list:
     |
     |  __hash__ = None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DrtExpression:
     |
     |  __and__(self, other)
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  applyto(self, other)
     |
     |  draw(self)
     |
     |  eliminate_equality(self)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``DrtExpression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  get_refs(self, recursive=False)
     |      Return the set of discourse referents in this DRS.
     |      :param recursive: bool Also find discourse referents in subterms?
     |      :return: list of ``Variable`` objects
     |
     |  is_pronoun_function(self)
     |      Is self of the form "PRO(x)"?
     |
     |  make_EqualityExpression(self, first, second)
     |
     |  make_VariableExpression(self, variable)
     |
     |  pretty_format(self)
     |      Draw the DRS
     |      :return: the pretty print string
     |
     |  pretty_print(self)
     |
     |  resolve_anaphora(self)
     |
     |  typecheck(self, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from DrtExpression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from DrtExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.Expression:
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  findtype(self, variable)
     |      Find the type of the given variable as it is used in this expression.
     |      For example, finding the type of "P" in "P(x) & Q(x,y)" yields "<e,t>"
     |
     |      :param variable: Variable
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination

FUNCTIONS
    DrtVariableExpression(variable)
        This is a factory method that instantiates and returns a subtype of
        ``DrtAbstractVariableExpression`` appropriate for the given variable.

    demo()

    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

    resolve_anaphora(expression, trail=[], budget=None)

    test_draw()

DATA
    APP = 'APP'
    MAX_ANAPHORA_OPERATIONS = 1000000

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\sem\drt.py

nltk.earleychart
Python Library Documentation: module nltk.parse.earleychart in nltk.parse

NAME
    nltk.parse.earleychart

DESCRIPTION
    Data classes and parser implementations for *incremental* chart
    parsers, which use dynamic programming to efficiently parse a text.
    A "chart parser" derives parse trees for a text by iteratively adding
    "edges" to a "chart".  Each "edge" represents a hypothesis about the tree
    structure for a subsequence of the text.  The "chart" is a
    "blackboard" for composing and combining these hypotheses.

    A parser is "incremental", if it guarantees that for all i, j where i < j,
    all edges ending at i are built before any edges ending at j.
    This is appealing for, say, speech recognizer hypothesis filtering.

    The main parser class is ``EarleyChartParser``, which is a top-down
    algorithm, originally formulated by Jay Earley (1970).

CLASSES
    nltk.parse.chart.CachedTopDownPredictRule(nltk.parse.chart.TopDownPredictRule)
        PredictorRule
    nltk.parse.chart.Chart(builtins.object)
        IncrementalChart
            FeatureIncrementalChart(IncrementalChart, nltk.parse.featurechart.FeatureChart)
    nltk.parse.chart.ChartParser(nltk.parse.api.ParserI)
        IncrementalChartParser
            EarleyChartParser
            FeatureIncrementalChartParser(IncrementalChartParser, nltk.parse.featurechart.FeatureChartParser)
                FeatureEarleyChartParser
                FeatureIncrementalBottomUpChartParser
                FeatureIncrementalBottomUpLeftCornerChartParser
                FeatureIncrementalTopDownChartParser
            IncrementalBottomUpChartParser
            IncrementalBottomUpLeftCornerChartParser
            IncrementalLeftCornerChartParser
            IncrementalTopDownChartParser
    nltk.parse.chart.FilteredSingleEdgeFundamentalRule(nltk.parse.chart.SingleEdgeFundamentalRule)
        FilteredCompleteFundamentalRule
    nltk.parse.chart.SingleEdgeFundamentalRule(nltk.parse.chart.FundamentalRule)
        CompleteFundamentalRule
            CompleterRule
                FeatureCompleterRule
            ScannerRule
                FeatureScannerRule
    nltk.parse.featurechart.FeatureSingleEdgeFundamentalRule(nltk.parse.chart.SingleEdgeFundamentalRule)
        FeatureCompleteFundamentalRule
    nltk.parse.featurechart.FeatureTopDownPredictRule(nltk.parse.chart.CachedTopDownPredictRule)
        FeaturePredictorRule

    class CompleteFundamentalRule(nltk.parse.chart.SingleEdgeFundamentalRule)
     |  Method resolution order:
     |      CompleteFundamentalRule
     |      nltk.parse.chart.SingleEdgeFundamentalRule
     |      nltk.parse.chart.FundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class CompleterRule(CompleteFundamentalRule)
     |  Method resolution order:
     |      CompleterRule
     |      CompleteFundamentalRule
     |      nltk.parse.chart.SingleEdgeFundamentalRule
     |      nltk.parse.chart.FundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class EarleyChartParser(IncrementalChartParser)
     |  EarleyChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      EarleyChartParser
     |      IncrementalChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureCompleteFundamentalRule(nltk.parse.featurechart.FeatureSingleEdgeFundamentalRule)
     |  Method resolution order:
     |      FeatureCompleteFundamentalRule
     |      nltk.parse.featurechart.FeatureSingleEdgeFundamentalRule
     |      nltk.parse.chart.SingleEdgeFundamentalRule
     |      nltk.parse.chart.FundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureCompleterRule(CompleterRule)
     |  Method resolution order:
     |      FeatureCompleterRule
     |      CompleterRule
     |      CompleteFundamentalRule
     |      nltk.parse.chart.SingleEdgeFundamentalRule
     |      nltk.parse.chart.FundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods inherited from CompleterRule:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureEarleyChartParser(FeatureIncrementalChartParser)
     |  FeatureEarleyChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      FeatureEarleyChartParser
     |      FeatureIncrementalChartParser
     |      IncrementalChartParser
     |      nltk.parse.featurechart.FeatureChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureIncrementalBottomUpChartParser(FeatureIncrementalChartParser)
     |  FeatureIncrementalBottomUpChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      FeatureIncrementalBottomUpChartParser
     |      FeatureIncrementalChartParser
     |      IncrementalChartParser
     |      nltk.parse.featurechart.FeatureChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureIncrementalBottomUpLeftCornerChartParser(FeatureIncrementalChartParser)
     |  FeatureIncrementalBottomUpLeftCornerChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      FeatureIncrementalBottomUpLeftCornerChartParser
     |      FeatureIncrementalChartParser
     |      IncrementalChartParser
     |      nltk.parse.featurechart.FeatureChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureIncrementalChart(IncrementalChart, nltk.parse.featurechart.FeatureChart)
     |  FeatureIncrementalChart(tokens)
     |
     |  Method resolution order:
     |      FeatureIncrementalChart
     |      IncrementalChart
     |      nltk.parse.featurechart.FeatureChart
     |      nltk.parse.chart.Chart
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  select(self, end, **restrictions)
     |      Returns an iterator over the edges in this chart.
     |      See ``Chart.select`` for more information about the
     |      ``restrictions`` on the edges.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChart:
     |
     |  edges(self)
     |      Return a list of all edges in this chart.  New edges
     |      that are added to the chart after the call to edges()
     |      will *not* be contained in this list.
     |
     |      :rtype: list(EdgeI)
     |      :see: ``iteredges``, ``select``
     |
     |  initialize(self)
     |      Clear the chart.
     |
     |  iteredges(self)
     |      Return an iterator over the edges in this chart.  It is
     |      not guaranteed that new edges which are added to the
     |      chart before the iterator is exhausted will also be generated.
     |
     |      :rtype: iter(EdgeI)
     |      :see: ``edges``, ``select``
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.featurechart.FeatureChart:
     |
     |  parses(self, start, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      Return an iterator of the complete tree structures that span
     |      the entire chart, and whose root node is ``root``.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.Chart:
     |
     |  __init__(self, tokens)
     |      Construct a new chart. The chart is initialized with the
     |      leaf edges corresponding to the terminal leaves.
     |
     |      :type tokens: list
     |      :param tokens: The sentence that this chart will be used to parse.
     |
     |  __iter__ = iteredges(self)
     |      Return an iterator over the edges in this chart.  It is
     |      not guaranteed that new edges which are added to the
     |      chart before the iterator is exhausted will also be generated.
     |
     |      :rtype: iter(EdgeI)
     |      :see: ``edges``, ``select``
     |
     |  child_pointer_lists(self, edge)
     |      Return the set of child pointer lists for the given edge.
     |      Each child pointer list is a list of edges that have
     |      been used to form this edge.
     |
     |      :rtype: list(list(EdgeI))
     |
     |  dot_digraph(self)
     |
     |  insert(self, edge, *child_pointer_lists)
     |      Add a new edge to the chart, and return True if this operation
     |      modified the chart.  In particular, return true iff the chart
     |      did not already contain ``edge``, or if it did not already associate
     |      ``child_pointer_lists`` with ``edge``.
     |
     |      :type edge: EdgeI
     |      :param edge: The new edge
     |      :type child_pointer_lists: sequence of tuple(EdgeI)
     |      :param child_pointer_lists: A sequence of lists of the edges that
     |          were used to form this edge.  This list is used to reconstruct
     |          the trees (or partial trees) that are associated with ``edge``.
     |      :rtype: bool
     |
     |  insert_with_backpointer(self, new_edge, previous_edge, child_edge)
     |      Add a new edge to the chart, using a pointer to the previous edge.
     |
     |  leaf(self, index)
     |      Return the leaf value of the word at the given index.
     |
     |      :rtype: str
     |
     |  leaves(self)
     |      Return a list of the leaf values of each word in the
     |      chart's sentence.
     |
     |      :rtype: list(str)
     |
     |  num_edges(self)
     |      Return the number of edges contained in this chart.
     |
     |      :rtype: int
     |
     |  num_leaves(self)
     |      Return the number of words in this chart's sentence.
     |
     |      :rtype: int
     |
     |  pretty_format(self, width=None)
     |      Return a pretty-printed string representation of this chart.
     |
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |      :rtype: str
     |
     |  pretty_format_edge(self, edge, width=None)
     |      Return a pretty-printed string representation of a given edge
     |      in this chart.
     |
     |      :rtype: str
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |
     |  pretty_format_leaves(self, width=None)
     |      Return a pretty-printed string representation of this
     |      chart's leaves.  This string can be used as a header
     |      for calls to ``pretty_format_edge``.
     |
     |  trees(self, edge, tree_class=<class 'nltk.tree.tree.Tree'>, complete=False)
     |      Return an iterator of the tree structures that are associated
     |      with ``edge``.
     |
     |      If ``edge`` is incomplete, then the unexpanded children will be
     |      encoded as childless subtrees, whose node value is the
     |      corresponding terminal or nonterminal.
     |
     |      :rtype: list(Tree)
     |      :note: If two trees share a common subtree, then the same
     |          Tree may be used to encode that subtree in
     |          both trees.  If you need to eliminate this subtree
     |          sharing, then create a deep copy of each tree.
     |      :raise ValueError: if more than ``MAX_PARSE_TREES`` parse-tree nodes
     |          would be built, which a highly-ambiguous grammar reaches at an
     |          exponential rate (CWE-770).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.Chart:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureIncrementalChartParser(IncrementalChartParser, nltk.parse.featurechart.FeatureChartParser)
     |  FeatureIncrementalChartParser(grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2DC40>, <nltk.parse.featurechart.FeatureEmptyPredictRule object at 0x0000028F98C2DC70>, <nltk.parse.featurechart.FeatureBottomUpPredictCombineRule object at 0x0000028F98C2DCA0>, <nltk.parse.earleychart.FeatureCompleteFundamentalRule object at 0x0000028F98C2DCD0>], trace_chart_width=20, chart_class=<class 'nltk.parse.earleychart.FeatureIncrementalChart'>, **parser_args)
     |
     |  Method resolution order:
     |      FeatureIncrementalChartParser
     |      IncrementalChartParser
     |      nltk.parse.featurechart.FeatureChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2DC40>, <nltk.parse.featurechart.FeatureEmptyPredictRule object at 0x0000028F98C2DC70>, <nltk.parse.featurechart.FeatureBottomUpPredictCombineRule object at 0x0000028F98C2DCA0>, <nltk.parse.earleychart.FeatureCompleteFundamentalRule object at 0x0000028F98C2DCD0>], trace_chart_width=20, chart_class=<class 'nltk.parse.earleychart.FeatureIncrementalChart'>, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureIncrementalTopDownChartParser(FeatureIncrementalChartParser)
     |  FeatureIncrementalTopDownChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      FeatureIncrementalTopDownChartParser
     |      FeatureIncrementalChartParser
     |      IncrementalChartParser
     |      nltk.parse.featurechart.FeatureChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeaturePredictorRule(nltk.parse.featurechart.FeatureTopDownPredictRule)
     |  Method resolution order:
     |      FeaturePredictorRule
     |      nltk.parse.featurechart.FeatureTopDownPredictRule
     |      nltk.parse.chart.CachedTopDownPredictRule
     |      nltk.parse.chart.TopDownPredictRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods inherited from nltk.parse.featurechart.FeatureTopDownPredictRule:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.CachedTopDownPredictRule:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.TopDownPredictRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureScannerRule(ScannerRule)
     |  Method resolution order:
     |      FeatureScannerRule
     |      ScannerRule
     |      CompleteFundamentalRule
     |      nltk.parse.chart.SingleEdgeFundamentalRule
     |      nltk.parse.chart.FundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods inherited from ScannerRule:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FilteredCompleteFundamentalRule(nltk.parse.chart.FilteredSingleEdgeFundamentalRule)
     |  Method resolution order:
     |      FilteredCompleteFundamentalRule
     |      nltk.parse.chart.FilteredSingleEdgeFundamentalRule
     |      nltk.parse.chart.SingleEdgeFundamentalRule
     |      nltk.parse.chart.FundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IncrementalBottomUpChartParser(IncrementalChartParser)
     |  IncrementalBottomUpChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      IncrementalBottomUpChartParser
     |      IncrementalChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IncrementalBottomUpLeftCornerChartParser(IncrementalChartParser)
     |  IncrementalBottomUpLeftCornerChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      IncrementalBottomUpLeftCornerChartParser
     |      IncrementalChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IncrementalChart(nltk.parse.chart.Chart)
     |  IncrementalChart(tokens)
     |
     |  Method resolution order:
     |      IncrementalChart
     |      nltk.parse.chart.Chart
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  edges(self)
     |      Return a list of all edges in this chart.  New edges
     |      that are added to the chart after the call to edges()
     |      will *not* be contained in this list.
     |
     |      :rtype: list(EdgeI)
     |      :see: ``iteredges``, ``select``
     |
     |  initialize(self)
     |      Clear the chart.
     |
     |  iteredges(self)
     |      Return an iterator over the edges in this chart.  It is
     |      not guaranteed that new edges which are added to the
     |      chart before the iterator is exhausted will also be generated.
     |
     |      :rtype: iter(EdgeI)
     |      :see: ``edges``, ``select``
     |
     |  select(self, end, **restrictions)
     |      Return an iterator over the edges in this chart.  Any
     |      new edges that are added to the chart before the iterator
     |      is exahusted will also be generated.  ``restrictions``
     |      can be used to restrict the set of edges that will be
     |      generated.
     |
     |      :param span: Only generate edges ``e`` where ``e.span()==span``
     |      :param start: Only generate edges ``e`` where ``e.start()==start``
     |      :param end: Only generate edges ``e`` where ``e.end()==end``
     |      :param length: Only generate edges ``e`` where ``e.length()==length``
     |      :param lhs: Only generate edges ``e`` where ``e.lhs()==lhs``
     |      :param rhs: Only generate edges ``e`` where ``e.rhs()==rhs``
     |      :param nextsym: Only generate edges ``e`` where
     |          ``e.nextsym()==nextsym``
     |      :param dot: Only generate edges ``e`` where ``e.dot()==dot``
     |      :param is_complete: Only generate edges ``e`` where
     |          ``e.is_complete()==is_complete``
     |      :param is_incomplete: Only generate edges ``e`` where
     |          ``e.is_incomplete()==is_incomplete``
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.Chart:
     |
     |  __init__(self, tokens)
     |      Construct a new chart. The chart is initialized with the
     |      leaf edges corresponding to the terminal leaves.
     |
     |      :type tokens: list
     |      :param tokens: The sentence that this chart will be used to parse.
     |
     |  __iter__ = iteredges(self)
     |      Return an iterator over the edges in this chart.  It is
     |      not guaranteed that new edges which are added to the
     |      chart before the iterator is exhausted will also be generated.
     |
     |      :rtype: iter(EdgeI)
     |      :see: ``edges``, ``select``
     |
     |  child_pointer_lists(self, edge)
     |      Return the set of child pointer lists for the given edge.
     |      Each child pointer list is a list of edges that have
     |      been used to form this edge.
     |
     |      :rtype: list(list(EdgeI))
     |
     |  dot_digraph(self)
     |
     |  insert(self, edge, *child_pointer_lists)
     |      Add a new edge to the chart, and return True if this operation
     |      modified the chart.  In particular, return true iff the chart
     |      did not already contain ``edge``, or if it did not already associate
     |      ``child_pointer_lists`` with ``edge``.
     |
     |      :type edge: EdgeI
     |      :param edge: The new edge
     |      :type child_pointer_lists: sequence of tuple(EdgeI)
     |      :param child_pointer_lists: A sequence of lists of the edges that
     |          were used to form this edge.  This list is used to reconstruct
     |          the trees (or partial trees) that are associated with ``edge``.
     |      :rtype: bool
     |
     |  insert_with_backpointer(self, new_edge, previous_edge, child_edge)
     |      Add a new edge to the chart, using a pointer to the previous edge.
     |
     |  leaf(self, index)
     |      Return the leaf value of the word at the given index.
     |
     |      :rtype: str
     |
     |  leaves(self)
     |      Return a list of the leaf values of each word in the
     |      chart's sentence.
     |
     |      :rtype: list(str)
     |
     |  num_edges(self)
     |      Return the number of edges contained in this chart.
     |
     |      :rtype: int
     |
     |  num_leaves(self)
     |      Return the number of words in this chart's sentence.
     |
     |      :rtype: int
     |
     |  parses(self, root, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      Return an iterator of the complete tree structures that span
     |      the entire chart, and whose root node is ``root``.
     |
     |  pretty_format(self, width=None)
     |      Return a pretty-printed string representation of this chart.
     |
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |      :rtype: str
     |
     |  pretty_format_edge(self, edge, width=None)
     |      Return a pretty-printed string representation of a given edge
     |      in this chart.
     |
     |      :rtype: str
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |
     |  pretty_format_leaves(self, width=None)
     |      Return a pretty-printed string representation of this
     |      chart's leaves.  This string can be used as a header
     |      for calls to ``pretty_format_edge``.
     |
     |  trees(self, edge, tree_class=<class 'nltk.tree.tree.Tree'>, complete=False)
     |      Return an iterator of the tree structures that are associated
     |      with ``edge``.
     |
     |      If ``edge`` is incomplete, then the unexpanded children will be
     |      encoded as childless subtrees, whose node value is the
     |      corresponding terminal or nonterminal.
     |
     |      :rtype: list(Tree)
     |      :note: If two trees share a common subtree, then the same
     |          Tree may be used to encode that subtree in
     |          both trees.  If you need to eliminate this subtree
     |          sharing, then create a deep copy of each tree.
     |      :raise ValueError: if more than ``MAX_PARSE_TREES`` parse-tree nodes
     |          would be built, which a highly-ambiguous grammar reaches at an
     |          exponential rate (CWE-770).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.Chart:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IncrementalChartParser(nltk.parse.chart.ChartParser)
     |  IncrementalChartParser(grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2D730>, <nltk.parse.chart.EmptyPredictRule object at 0x0000028F98C2D760>, <nltk.parse.chart.BottomUpPredictCombineRule object at 0x0000028F98C2D790>, <nltk.parse.earleychart.CompleteFundamentalRule object at 0x0000028F98C2D7C0>], trace=0, trace_chart_width=50, chart_class=<class 'nltk.parse.earleychart.IncrementalChart'>)
     |
     |  An *incremental* chart parser implementing Jay Earley's
     |  parsing algorithm:
     |
     |  | For each index end in [0, 1, ..., N]:
     |  |   For each edge such that edge.end = end:
     |  |     If edge is incomplete and edge.next is not a part of speech:
     |  |       Apply PredictorRule to edge
     |  |     If edge is incomplete and edge.next is a part of speech:
     |  |       Apply ScannerRule to edge
     |  |     If edge is complete:
     |  |       Apply CompleterRule to edge
     |  | Return any complete parses in the chart
     |
     |  Method resolution order:
     |      IncrementalChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2D730>, <nltk.parse.chart.EmptyPredictRule object at 0x0000028F98C2D760>, <nltk.parse.chart.BottomUpPredictCombineRule object at 0x0000028F98C2D790>, <nltk.parse.earleychart.CompleteFundamentalRule object at 0x0000028F98C2D7C0>], trace=0, trace_chart_width=50, chart_class=<class 'nltk.parse.earleychart.IncrementalChart'>)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IncrementalLeftCornerChartParser(IncrementalChartParser)
     |  IncrementalLeftCornerChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      IncrementalLeftCornerChartParser
     |      IncrementalChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IncrementalTopDownChartParser(IncrementalChartParser)
     |  IncrementalTopDownChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      IncrementalTopDownChartParser
     |      IncrementalChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new Earley chart parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :param chart_class: The class that should be used to create
     |          the charts used by this parser.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IncrementalChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class PredictorRule(nltk.parse.chart.CachedTopDownPredictRule)
     |  Method resolution order:
     |      PredictorRule
     |      nltk.parse.chart.CachedTopDownPredictRule
     |      nltk.parse.chart.TopDownPredictRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods inherited from nltk.parse.chart.CachedTopDownPredictRule:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.TopDownPredictRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ScannerRule(CompleteFundamentalRule)
     |  Method resolution order:
     |      ScannerRule
     |      CompleteFundamentalRule
     |      nltk.parse.chart.SingleEdgeFundamentalRule
     |      nltk.parse.chart.FundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo(print_times=True, print_grammar=False, print_trees=True, trace=2, sent='I saw John with a dog with my cookie', numparses=5)
        A demonstration of the Earley parsers.

    perf_counter(...)
        perf_counter() -> float

        Performance counter for benchmarking.

DATA
    BU_INCREMENTAL_FEATURE_STRATEGY = [<nltk.parse.chart.LeafInitRule obje...
    BU_INCREMENTAL_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nl...
    BU_LC_INCREMENTAL_FEATURE_STRATEGY = [<nltk.parse.chart.LeafInitRule o...
    BU_LC_INCREMENTAL_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, ...
    EARLEY_FEATURE_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nl...
    EARLEY_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nltk.parse...
    LC_INCREMENTAL_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nl...
    TD_INCREMENTAL_FEATURE_STRATEGY = [<nltk.parse.chart.LeafInitRule obje...
    TD_INCREMENTAL_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nl...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\earleychart.py

nltk.edge_closure
Python Library Documentation: function edge_closure in module nltk.util

edge_closure(tree, children=<built-in function iter>, maxdepth=-1, verbose=False)
    :param tree: the tree root
    :param children: a function taking as argument a tree node
    :param maxdepth: to limit the search depth
    :param verbose: to print warnings when cycles are discarded

    Yield the edges of a graph in breadth-first order,
    discarding eventual cycles.
    The first argument should be the start node;
    children should be a function taking as argument a graph node
    and returning an iterator of the node's children.

    >>> from nltk.util import edge_closure
    >>> print(list(edge_closure('A', lambda node:{'A':['B','C'], 'B':'C', 'C':'B'}[node])))
    [('A', 'B'), ('A', 'C'), ('B', 'C'), ('C', 'B')]
nltk.edges2dot
Python Library Documentation: function edges2dot in module nltk.util

edges2dot(edges, shapes=None, attr=None)
    :param edges: the set (or list) of edges of a directed graph.
    :param shapes: dictionary of strings that trigger a specified shape.
    :param attr: dictionary with global graph attributes
    :return: a representation of 'edges' as a string in the DOT graph language.

    Returns dot_string: a representation of 'edges' as a string in the DOT
    graph language, which can be converted to an image by the 'dot' program
    from the Graphviz package, or nltk.parse.dependencygraph.dot2img(dot_string).

    >>> import nltk
    >>> from nltk.util import edges2dot
    >>> print(edges2dot([('A', 'B'), ('A', 'C'), ('B', 'C'), ('C', 'B')]))
    digraph G {
    "A" -> "B";
    "A" -> "C";
    "B" -> "C";
    "C" -> "B";
    }
    <BLANKLINE>
nltk.edit_distance
Python Library Documentation: function edit_distance in module nltk.metrics.distance

edit_distance(s1, s2, substitution_cost=1, transpositions=False)
    Calculate the Levenshtein edit-distance between two strings.
    The edit distance is the number of characters that need to be
    substituted, inserted, or deleted, to transform s1 into s2.  For
    example, transforming "rain" to "shine" requires three steps,
    consisting of two substitutions and one insertion:
    "rain" -> "sain" -> "shin" -> "shine".  These operations could have
    been done in other orders, but at least three steps are needed.

    Allows specifying the cost of substitution edits (e.g., "a" -> "b"),
    because sometimes it makes sense to assign greater penalties to
    substitutions.

    This also optionally allows transposition edits (e.g., "ab" -> "ba"),
    though this is disabled by default.

    :param s1, s2: The strings to be analysed
    :param transpositions: Whether to allow transposition edits
    :type s1: str
    :type s2: str
    :type substitution_cost: int
    :type transpositions: bool
    :rtype: int
nltk.edit_distance_align
Python Library Documentation: function edit_distance_align in module nltk.metrics.distance

edit_distance_align(s1, s2, substitution_cost=1)
    Calculate the minimum Levenshtein edit-distance based alignment
    mapping between two strings. The alignment finds the mapping
    from string s1 to s2 that minimizes the edit distance cost.
    For example, mapping "rain" to "shine" would involve 2
    substitutions, 2 matches and an insertion resulting in
    the following mapping:
    [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (4, 5)]
    NB: (0, 0) is the start state without any letters associated
    See more: https://web.stanford.edu/class/cs124/lec/med.pdf

    In case of multiple valid minimum-distance alignments, the
    backtrace has the following operation precedence:

    1. Substitute s1 and s2 characters
    2. Skip s1 character
    3. Skip s2 character

    The backtrace is carried out in reverse string order.

    This function does not support transposition.

    :param s1, s2: The strings to be aligned
    :type s1: str
    :type s2: str
    :type substitution_cost: int
    :rtype: List[Tuple(int, int)]
nltk.elementtree_indent
Python Library Documentation: function elementtree_indent in module nltk.util

elementtree_indent(elem, level=0)
    Recursive function to indent an ElementTree._ElementInterface
    used for pretty printing. Run indent on elem and then output
    in the normal way.

    :param elem: element to be indented. will be modified.
    :type elem: ElementTree._ElementInterface
    :param level: level of indentation for this element
    :type level: nonnegative integer
    :rtype:   ElementTree._ElementInterface
    :return:  Contents of elem indented to reflect its structure
nltk.entropy
Python Library Documentation: function entropy in module nltk.probability

entropy(pdist)
nltk.equality_preds
Python Library Documentation: function equality_preds in module nltk.sem.logic

equality_preds()
    Equality predicates
nltk.evaluate
Python Library Documentation: module nltk.sem.evaluate in nltk.sem

NAME
    nltk.sem.evaluate

DESCRIPTION
    This module provides data structures for representing first-order
    models.

CLASSES
    builtins.Exception(builtins.BaseException)
        Error
            Undefined
    builtins.dict(builtins.object)
        Assignment
        Valuation
    builtins.object
        Model

    class Assignment(builtins.dict)
     |  Assignment(domain, assign=None)
     |
     |  A dictionary which represents an assignment of values to variables.
     |
     |  An assignment can only assign values from its domain.
     |
     |  If an unknown expression *a* is passed to a model *M*\ 's
     |  interpretation function *i*, *i* will first check whether *M*\ 's
     |  valuation assigns an interpretation to *a* as a constant, and if
     |  this fails, *i* will delegate the interpretation of *a* to
     |  *g*. *g* only assigns values to individual variables (i.e.,
     |  members of the class ``IndividualVariableExpression`` in the ``logic``
     |  module. If a variable is not assigned a value by *g*, it will raise
     |  an ``Undefined`` exception.
     |
     |  A variable *Assignment* is a mapping from individual variables to
     |  entities in the domain. Individual variables are usually indicated
     |  with the letters ``'x'``, ``'y'``, ``'w'`` and ``'z'``, optionally
     |  followed by an integer (e.g., ``'x0'``, ``'y332'``).  Assignments are
     |  created using the ``Assignment`` constructor, which also takes the
     |  domain as a parameter.
     |
     |      >>> from nltk.sem.evaluate import Assignment
     |      >>> dom = set(['u1', 'u2', 'u3', 'u4'])
     |      >>> g3 = Assignment(dom, [('x', 'u1'), ('y', 'u2')])
     |      >>> g3 == {'x': 'u1', 'y': 'u2'}
     |      True
     |
     |  There is also a ``print`` format for assignments which uses a notation
     |  closer to that in logic textbooks:
     |
     |      >>> print(g3)
     |      g[u1/x][u2/y]
     |
     |  It is also possible to update an assignment using the ``add`` method:
     |
     |      >>> dom = set(['u1', 'u2', 'u3', 'u4'])
     |      >>> g4 = Assignment(dom)
     |      >>> g4.add('x', 'u1')
     |      {'x': 'u1'}
     |
     |  With no arguments, ``purge()`` is equivalent to ``clear()`` on a dictionary:
     |
     |      >>> g4.purge()
     |      >>> g4
     |      {}
     |
     |  :param domain: the domain of discourse
     |  :type domain: set
     |  :param assign: a list of (varname, value) associations
     |  :type assign: list
     |
     |  Method resolution order:
     |      Assignment
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __getitem__(self, key)
     |      Return self[key].
     |
     |  __init__(self, domain, assign=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Pretty printing for assignments. {'x', 'u'} appears as 'g[u/x]'
     |
     |  add(self, var, val)
     |      Add a new variable-value pair to the assignment, and update
     |      ``self.variant``.
     |
     |  copy(self)
     |      D.copy() -> a shallow copy of D
     |
     |  purge(self, var=None)
     |      Remove one or all keys (i.e. logic variables) from an
     |      assignment, and update ``self.variant``.
     |
     |      :param var: a Variable acting as a key for the assignment.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

    class Error(builtins.Exception)
     |  Method resolution order:
     |      Error
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class Model(builtins.object)
     |  Model(domain, valuation)
     |
     |  A first order model is a domain *D* of discourse and a valuation *V*.
     |
     |  A domain *D* is a set, and a valuation *V* is a map that associates
     |  expressions with values in the model.
     |  The domain of *V* should be a subset of *D*.
     |
     |  Construct a new ``Model``.
     |
     |  :type domain: set
     |  :param domain: A set of entities representing the domain of discourse of the model.
     |  :type valuation: Valuation
     |  :param valuation: the valuation of the model.
     |  :param prop: If this is set, then we are building a propositional    model and don't require the domain of *V* to be subset of *D*.
     |
     |  Methods defined here:
     |
     |  __init__(self, domain, valuation)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  evaluate(self, expr, g, trace=None)
     |      Read input expressions, and provide a handler for ``satisfy``
     |      that blocks further propagation of the ``Undefined`` error.
     |      :param expr: An ``Expression`` of ``logic``.
     |      :type g: Assignment
     |      :param g: an assignment to individual variables.
     |      :rtype: bool or 'Undefined'
     |
     |  i(self, parsed, g, trace=False)
     |      An interpretation function.
     |
     |      Assuming that ``parsed`` is atomic:
     |
     |      - if ``parsed`` is a non-logical constant, calls the valuation *V*
     |      - else if ``parsed`` is an individual variable, calls assignment *g*
     |      - else returns ``Undefined``.
     |
     |      :param parsed: an ``Expression`` of ``logic``.
     |      :type g: Assignment
     |      :param g: an assignment to individual variables.
     |      :return: a semantic value
     |
     |  satisfiers(self, parsed, varex, g, trace=None, nesting=0)
     |      Generate the entities from the model's domain that satisfy an open formula.
     |
     |      :param parsed: an open formula
     |      :type parsed: Expression
     |      :param varex: the relevant free individual variable in ``parsed``.
     |      :type varex: VariableExpression or str
     |      :param g: a variable assignment
     |      :type g:  Assignment
     |      :return: a set of the entities that satisfy ``parsed``.
     |
     |  satisfy(self, parsed, g, trace=None)
     |      Recursive interpretation function for a formula of first-order logic.
     |
     |      Raises an ``Undefined`` error when ``parsed`` is an atomic string
     |      but is not a symbol or an individual variable.
     |
     |      :return: Returns a truth value or ``Undefined`` if ``parsed`` is        complex, and calls the interpretation function ``i`` if ``parsed``        is atomic.
     |
     |      :param parsed: An expression of ``logic``.
     |      :type g: Assignment
     |      :param g: an assignment to individual variables.
     |      :raise Error: if ``parsed`` has a nested quantifier/lambda path whose        domain-value combinations (|domain| ** nesting depth) would exceed        ``MAX_SATISFY_OPERATIONS`` (CWE-770).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MAX_SATISFY_OPERATIONS = 1000000

    class Undefined(Error)
     |  Method resolution order:
     |      Undefined
     |      Error
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors inherited from Error:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class Valuation(builtins.dict)
     |  Valuation(xs)
     |
     |  A dictionary which represents a model-theoretic Valuation of non-logical constants.
     |  Keys are strings representing the constants to be interpreted, and values correspond
     |  to individuals (represented as strings) and n-ary relations (represented as sets of tuples
     |  of strings).
     |
     |  An instance of ``Valuation`` will raise a KeyError exception (i.e.,
     |  just behave like a standard  dictionary) if indexed with an expression that
     |  is not in its list of symbols.
     |
     |  Method resolution order:
     |      Valuation
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __getitem__(self, key)
     |      Return self[key].
     |
     |  __init__(self, xs)
     |      :param xs: a list of (symbol, value) pairs.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  domain
     |      Set-theoretic domain of the value-space of a Valuation.
     |
     |  symbols
     |      The non-logical constants which the Valuation recognizes.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  copy(...)
     |      D.copy() -> a shallow copy of D
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

FUNCTIONS
    arity(rel)
        Check the arity of a relation.
        :type rel: set of tuples
        :rtype: int of tuple of str

    demo(num=0, trace=None)
        Run exists demos.

         - num = 1: propositional logic demo
         - num = 2: first order model demo (only if trace is set)
         - num = 3: first order sentences demo
         - num = 4: satisfaction of open formulas demo
         - any other value: run all the demos

        :param trace: trace = 1, or trace = 2 for more verbose tracing

    foldemo(trace=None)
        Interpretation of closed expressions in a first-order model.

    folmodel(quiet=False, trace=None)
        Example of a first-order model.

    is_rel(s)
        Check whether a set represents a relation (of any arity).

        :param s: a set containing tuples of str elements
        :type s: set
        :rtype: bool

    propdemo(trace=None)
        Example of a propositional model.

    read_valuation(s, encoding=None)
        Convert a valuation string into a valuation.

        :param s: a valuation string
        :type s: str
        :param encoding: the encoding of the input string, if it is binary
        :type encoding: str
        :return: a ``nltk.sem`` valuation
        :rtype: Valuation

    satdemo(trace=None)
        Satisfiers of an open formula in a first order model.

    set2rel(s)
        Convert a set containing individuals (strings or numbers) into a set of
        unary tuples. Any tuples of strings already in the set are passed through
        unchanged.

        For example:
          - set(['a', 'b']) => set([('a',), ('b',)])
          - set([3, 27]) => set([('3',), ('27',)])

        :type s: set
        :rtype: set of tuple of str

    trace(f, *args, **kw)

DATA
    mult = 30

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\sem\evaluate.py

nltk.evaluate_sents
Python Library Documentation: function evaluate_sents in module nltk.sem.util

evaluate_sents(inputs, grammar, model, assignment, trace=0)
    Add the truth-in-a-model value to each semantic representation
    for each syntactic parse of each input sentences.

    :param inputs: a list of sentences
    :type inputs: list(str)
    :param grammar: ``FeatureGrammar`` or name of feature-based grammar
    :type grammar: nltk.grammar.FeatureGrammar
    :return: a mapping from sentences to lists of triples (parse-tree, semantic-representations, evaluation-in-model)
    :rtype: list(list(tuple(nltk.tree.Tree, nltk.sem.logic.ConstantExpression, bool or dict(str): bool)))
nltk.everygrams
Python Library Documentation: function everygrams in module nltk.util

everygrams(sequence, min_len=1, max_len=-1, pad_left=False, pad_right=False, **kwargs)
    Returns all possible ngrams generated from a sequence of items, as an iterator.

        >>> sent = 'a b c'.split()

    New version outputs for everygrams.
        >>> list(everygrams(sent))
        [('a',), ('a', 'b'), ('a', 'b', 'c'), ('b',), ('b', 'c'), ('c',)]

    Old version outputs for everygrams.
        >>> sorted(everygrams(sent), key=len)
        [('a',), ('b',), ('c',), ('a', 'b'), ('b', 'c'), ('a', 'b', 'c')]

        >>> list(everygrams(sent, max_len=2))
        [('a',), ('a', 'b'), ('b',), ('b', 'c'), ('c',)]

    :param sequence: the source data to be converted into ngrams. If max_len is
        not provided, this sequence will be loaded into memory
    :type sequence: sequence or iter
    :param min_len: minimum length of the ngrams, aka. n-gram order/degree of ngram
    :type  min_len: int
    :param max_len: maximum length of the ngrams (set to length of sequence by default)
    :type  max_len: int
    :param pad_left: whether the ngrams should be left-padded
    :type pad_left: bool
    :param pad_right: whether the ngrams should be right-padded
    :type pad_right: bool
    :rtype: iter(tuple)
    :raise ValueError: if ``max_len`` is left at its default and the sequence is
        longer than ``MAX_EVERYGRAMS_DEFAULT_LEN``, since enumerating every
        n-gram of every length would allocate O(n**3) elements and exhaust
        memory (CWE-770). Pass an explicit ``max_len`` to bound the n-gram order.
nltk.extract
Python Library Documentation: function extract in module nltk.translate.phrase_based

extract(f_start, f_end, e_start, e_end, alignment, f_aligned, srctext, trgtext, srclen, trglen, max_phrase_length)
    This function checks for alignment point consistency and extracts
    phrases using the chunk of consistent phrases.

    A phrase pair (e, f ) is consistent with an alignment A if and only if:

    (i) No English words in the phrase pair are aligned to words outside it.

           ∀e i ∈ e, (e i , f j ) ∈ A ⇒ f j ∈ f

    (ii) No Foreign words in the phrase pair are aligned to words outside it.

            ∀f j ∈ f , (e i , f j ) ∈ A ⇒ e i ∈ e

    (iii) The phrase pair contains at least one alignment point.

            ∃e i ∈ e  ̄ , f j ∈ f  ̄ s.t. (e i , f j ) ∈ A

    :type f_start: int
    :param f_start: Starting index of the possible foreign language phrases
    :type f_end: int
    :param f_end: End index of the possible foreign language phrases
    :type e_start: int
    :param e_start: Starting index of the possible source language phrases
    :type e_end: int
    :param e_end: End index of the possible source language phrases
    :type srctext: list
    :param srctext: The source language tokens, a list of string.
    :type trgtext: list
    :param trgtext: The target language tokens, a list of string.
    :type srclen: int
    :param srclen: The number of tokens in the source language tokens.
    :type trglen: int
    :param trglen: The number of tokens in the target language tokens.
nltk.extract_rels
Python Library Documentation: function extract_rels in module nltk.sem.relextract

extract_rels(subjclass, objclass, doc, corpus='ace', pattern=None, window=10)
    Filter the output of ``semi_rel2reldict`` according to specified NE classes and a filler pattern.

    The parameters ``subjclass`` and ``objclass`` can be used to restrict the
    Named Entities to particular types (any of 'LOCATION', 'ORGANIZATION',
    'PERSON', 'DURATION', 'DATE', 'CARDINAL', 'PERCENT', 'MONEY', 'MEASURE').

    :param subjclass: the class of the subject Named Entity.
    :type subjclass: str
    :param objclass: the class of the object Named Entity.
    :type objclass: str
    :param doc: input document
    :type doc: ieer document or a list of chunk trees
    :param corpus: name of the corpus to take as input; possible values are
        'ieer' and 'conll2002'
    :type corpus: str
    :param pattern: a regular expression for filtering the fillers of
        retrieved triples.
    :type pattern: SRE_Pattern
    :param window: filters out fillers which exceed this threshold
    :type window: int
    :return: see ``mk_reldicts``
    :rtype: list(defaultdict)
nltk.extract_test_sentences
Python Library Documentation: function extract_test_sentences in module nltk.parse.util

extract_test_sentences(string, comment_chars='#%;', encoding=None)
    Parses a string with one test sentence per line.
    Lines can optionally begin with:

    - a bool, saying if the sentence is grammatical or not, or
    - an int, giving the number of parse trees is should have,

    The result information is followed by a colon, and then the sentence.
    Empty lines and lines beginning with a comment char are ignored.

    :return: a list of tuple of sentences and expected results,
        where a sentence is a list of str,
        and a result is None, or bool, or int

    :param comment_chars: ``str`` of possible comment characters.
    :param encoding: the encoding of the string, if it is binary
nltk.f_measure
Python Library Documentation: function f_measure in module nltk.metrics.scores

f_measure(reference, test, alpha=0.5)
    Given a set of reference values and a set of test values, return
    the f-measure of the test values, when compared against the
    reference values.  The f-measure is the harmonic mean of the
    ``precision`` and ``recall``, weighted by ``alpha``.  In particular,
    given the precision *p* and recall *r* defined by:

    - *p* = card(``reference`` intersection ``test``)/card(``test``)
    - *r* = card(``reference`` intersection ``test``)/card(``reference``)

    The f-measure is:

    - *1/(alpha/p + (1-alpha)/r)*

    If either ``reference`` or ``test`` is empty, then ``f_measure``
    returns None.

    :type reference: set
    :param reference: A set of reference values.
    :type test: set
    :param test: A set of values to compare against the reference set.
    :rtype: float or None
nltk.featstruct
Python Library Documentation: module nltk.featstruct in nltk

NAME
    nltk.featstruct

DESCRIPTION
    Basic data classes for representing feature structures, and for
    performing basic operations on those feature structures.  A feature
    structure is a mapping from feature identifiers to feature values,
    where each feature value is either a basic value (such as a string or
    an integer), or a nested feature structure.  There are two types of
    feature structure, implemented by two subclasses of ``FeatStruct``:

        - feature dictionaries, implemented by ``FeatDict``, act like
          Python dictionaries.  Feature identifiers may be strings or
          instances of the ``Feature`` class.
        - feature lists, implemented by ``FeatList``, act like Python
          lists.  Feature identifiers are integers.

    Feature structures are typically used to represent partial information
    about objects.  A feature identifier that is not mapped to a value
    stands for a feature whose value is unknown (*not* a feature without
    a value).  Two feature structures that represent (potentially
    overlapping) information about the same object can be combined by
    unification.  When two inconsistent feature structures are unified,
    the unification fails and returns None.

    Features can be specified using "feature paths", or tuples of feature
    identifiers that specify path through the nested feature structures to
    a value.  Feature structures may contain reentrant feature values.  A
    "reentrant feature value" is a single feature value that can be
    accessed via multiple feature paths.  Unification preserves the
    reentrance relations imposed by both of the unified feature
    structures.  In the feature structure resulting from unification, any
    modifications to a reentrant feature value will be visible using any
    of its feature paths.

    Feature structure variables are encoded using the ``nltk.sem.Variable``
    class.  The variables' values are tracked using a bindings
    dictionary, which maps variables to their values.  When two feature
    structures are unified, a fresh bindings dictionary is created to
    track their values; and before unification completes, all bound
    variables are replaced by their values.  Thus, the bindings
    dictionaries are usually strictly internal to the unification process.
    However, it is possible to track the bindings of variables if you
    choose to, by supplying your own initial bindings dictionary to the
    ``unify()`` function.

    When unbound variables are unified with one another, they become
    aliased.  This is encoded by binding one variable to the other.

    Lightweight Feature Structures
    ==============================
    Many of the functions defined by ``nltk.featstruct`` can be applied
    directly to simple Python dictionaries and lists, rather than to
    full-fledged ``FeatDict`` and ``FeatList`` objects.  In other words,
    Python ``dicts`` and ``lists`` can be used as "light-weight" feature
    structures.

        >>> from nltk.featstruct import unify
        >>> unify(dict(x=1, y=dict()), dict(a='a', y=dict(b='b')))  # doctest: +SKIP
        {'y': {'b': 'b'}, 'x': 1, 'a': 'a'}

    However, you should keep in mind the following caveats:

      - Python dictionaries & lists ignore reentrance when checking for
        equality between values.  But two FeatStructs with different
        reentrances are considered nonequal, even if all their base
        values are equal.

      - FeatStructs can be easily frozen, allowing them to be used as
        keys in hash tables.  Python dictionaries and lists can not.

      - FeatStructs display reentrance in their string representations;
        Python dictionaries and lists do not.

      - FeatStructs may *not* be mixed with Python dictionaries and lists
        (e.g., when performing unification).

      - FeatStructs provide a number of useful methods, such as ``walk()``
        and ``cyclic()``, which are not available for Python dicts and lists.

    In general, if your feature structures will contain any reentrances,
    or if you plan to use them as dictionary keys, it is strongly
    recommended that you use full-fledged ``FeatStruct`` objects.

CLASSES
    builtins.object
        FeatStructReader
        Feature
            RangeFeature
            SlashFeature
    nltk.sem.logic.SubstituteBindingsI(builtins.object)
        FeatStruct
            FeatDict(FeatStruct, builtins.dict)
            FeatList(FeatStruct, builtins.list)

    class FeatDict(FeatStruct, builtins.dict)
     |  FeatDict(features=None, **morefeatures)
     |
     |  A feature structure that acts like a Python dictionary.  I.e., a
     |  mapping from feature identifiers to feature values, where a feature
     |  identifier can be a string or a ``Feature``; and where a feature value
     |  can be either a basic value (such as a string or an integer), or a nested
     |  feature structure.  A feature identifiers for a ``FeatDict`` is
     |  sometimes called a "feature name".
     |
     |  Two feature dicts are considered equal if they assign the same
     |  values to all features, and have the same reentrances.
     |
     |  :see: ``FeatStruct`` for information about feature paths, reentrance,
     |      cyclic feature structures, mutability, freezing, and hashing.
     |
     |  Method resolution order:
     |      FeatDict
     |      FeatStruct
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __contains__(self, name_or_path)
     |      Return true if a feature with the given name or path exists.
     |
     |  __deepcopy__(self, memo)
     |
     |  __delitem__(self, name_or_path)
     |      If the feature with the given name or path exists, delete
     |      its value; otherwise, raise ``KeyError``.
     |
     |  __getitem__(self, name_or_path)
     |      If the feature with the given name or path exists, return
     |      its value; otherwise, raise ``KeyError``.
     |
     |  __init__(self, features=None, **morefeatures)
     |      Create a new feature dictionary, with the specified features.
     |
     |      :param features: The initial value for this feature
     |          dictionary.  If ``features`` is a ``FeatStruct``, then its
     |          features are copied (shallow copy).  If ``features`` is a
     |          dict, then a feature is created for each item, mapping its
     |          key to its value.  If ``features`` is a string, then it is
     |          processed using ``FeatStructReader``.  If ``features`` is a list of
     |          tuples ``(name, val)``, then a feature is created for each tuple.
     |      :param morefeatures: Additional features for the new feature
     |          dictionary.  If a feature is listed under both ``features`` and
     |          ``morefeatures``, then the value from ``morefeatures`` will be
     |          used.
     |
     |  __setitem__(self, name_or_path, value)
     |      Set the value for the feature with the given name or path
     |      to ``value``.  If ``name_or_path`` is an invalid path, raise
     |      ``KeyError``.
     |
     |  __str__(self)
     |      Display a multi-line representation of this feature dictionary
     |      as an FVM (feature value matrix).
     |
     |  clear(self, *args, **kwargs) from _check_frozen.<locals>
     |      D.clear() -> None.  Remove all items from D.
     |      If self is frozen, raise ValueError.
     |
     |  get(self, name_or_path, default=None)
     |      If the feature with the given name or path exists, return its
     |      value; otherwise, return ``default``.
     |
     |  has_key(self, name_or_path)
     |      Return true if a feature with the given name or path exists.
     |
     |  pop(self, *args, **kwargs) from _check_frozen.<locals>
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |      If self is frozen, raise ValueError.
     |
     |  popitem(self, *args, **kwargs) from _check_frozen.<locals>
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |      If self is frozen, raise ValueError.
     |
     |  setdefault(self, *args, **kwargs) from _check_frozen.<locals>
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |      If self is frozen, raise ValueError.
     |
     |  update(self, features=None, **morefeatures)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from FeatStruct:
     |
     |  __eq__(self, other)
     |      Return true if ``self`` and ``other`` are both feature structures,
     |      assign the same values to all features, and contain the same
     |      reentrances.  I.e., return
     |      ``self.equal_values(other, check_reentrance=True)``.
     |
     |      :see: ``equal_values()``
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      If this feature structure is frozen, return its hash value;
     |      otherwise, raise ``TypeError``.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Display a single-line representation of this feature structure,
     |      suitable for embedding in other representations.
     |
     |  copy(self, deep=True)
     |      Return a new copy of ``self``.  The new copy will not be frozen.
     |
     |      :param deep: If true, create a deep copy; if false, create
     |          a shallow copy.
     |
     |  cyclic(self)
     |      Return True if this feature structure contains itself.
     |
     |  equal_values(self, other, check_reentrance=False)
     |      Return True if ``self`` and ``other`` assign the same value to
     |      to every feature.  In particular, return true if
     |      ``self[p]==other[p]`` for every feature path *p* such
     |      that ``self[p]`` or ``other[p]`` is a base value (i.e.,
     |      not a nested feature structure).
     |
     |      :param check_reentrance: If True, then also return False if
     |          there is any difference between the reentrances of ``self``
     |          and ``other``.
     |      :note: the ``==`` is equivalent to ``equal_values()`` with
     |          ``check_reentrance=True``.
     |
     |  freeze(self)
     |      Make this feature structure, and any feature structures it
     |      contains, immutable.  Note: this method does not attempt to
     |      'freeze' any feature value that is not a ``FeatStruct``; it
     |      is recommended that you use only immutable feature values.
     |
     |  frozen(self)
     |      Return True if this feature structure is immutable.  Feature
     |      structures can be made immutable with the ``freeze()`` method.
     |      Immutable feature structures may not be made mutable again,
     |      but new mutable copies can be produced with the ``copy()`` method.
     |
     |  remove_variables(self)
     |      Return the feature structure that is obtained by deleting
     |      any feature whose value is a ``Variable``.
     |
     |      :rtype: FeatStruct
     |
     |  rename_variables(self, vars=None, used_vars=(), new_vars=None)
     |      :see: ``nltk.featstruct.rename_variables()``
     |
     |  retract_bindings(self, bindings)
     |      :see: ``nltk.featstruct.retract_bindings()``
     |
     |  substitute_bindings(self, bindings)
     |      :see: ``nltk.featstruct.substitute_bindings()``
     |
     |  subsumes(self, other)
     |      Return True if ``self`` subsumes ``other``.  I.e., return true
     |      If unifying ``self`` with ``other`` would result in a feature
     |      structure equal to ``other``.
     |
     |  unify(self, other, bindings=None, trace=False, fail=None, rename_vars=True)
     |
     |  variables(self)
     |      :see: ``nltk.featstruct.find_variables()``
     |
     |  walk(self)
     |      Return an iterator that generates this feature structure, and
     |      each feature structure it contains.  Each feature structure will
     |      be generated exactly once.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from FeatStruct:
     |
     |  __new__(cls, features=None, **morefeatures)
     |      Construct and return a new feature structure.  If this
     |      constructor is called directly, then the returned feature
     |      structure will be an instance of either the ``FeatDict`` class
     |      or the ``FeatList`` class.
     |
     |      :param features: The initial feature values for this feature
     |          structure:
     |
     |          - FeatStruct(string) -> FeatStructReader().read(string)
     |          - FeatStruct(mapping) -> FeatDict(mapping)
     |          - FeatStruct(sequence) -> FeatList(sequence)
     |          - FeatStruct() -> FeatDict()
     |      :param morefeatures: If ``features`` is a mapping or None,
     |          then ``morefeatures`` provides additional features for the
     |          ``FeatDict`` constructor.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.

    class FeatList(FeatStruct, builtins.list)
     |  FeatList(features=())
     |
     |  A list of feature values, where each feature value is either a
     |  basic value (such as a string or an integer), or a nested feature
     |  structure.
     |
     |  Feature lists may contain reentrant feature values.  A "reentrant
     |  feature value" is a single feature value that can be accessed via
     |  multiple feature paths.  Feature lists may also be cyclic.
     |
     |  Two feature lists are considered equal if they assign the same
     |  values to all features, and have the same reentrances.
     |
     |  :see: ``FeatStruct`` for information about feature paths, reentrance,
     |      cyclic feature structures, mutability, freezing, and hashing.
     |
     |  Method resolution order:
     |      FeatList
     |      FeatStruct
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.list
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __deepcopy__(self, memo)
     |
     |  __delitem__(self, name_or_path)
     |      If the feature with the given name or path exists, delete
     |      its value; otherwise, raise ``KeyError``.
     |
     |  __getitem__(self, name_or_path)
     |      Return self[index].
     |
     |  __iadd__(self, *args, **kwargs) from _check_frozen.<locals>
     |      Implement self+=value.
     |      If self is frozen, raise ValueError.
     |
     |  __imul__(self, *args, **kwargs) from _check_frozen.<locals>
     |      Implement self*=value.
     |      If self is frozen, raise ValueError.
     |
     |  __init__(self, features=())
     |      Create a new feature list, with the specified features.
     |
     |      :param features: The initial list of features for this feature
     |          list.  If ``features`` is a string, then it is paresd using
     |          ``FeatStructReader``.  Otherwise, it should be a sequence
     |          of basic values and nested feature structures.
     |
     |  __setitem__(self, name_or_path, value)
     |      Set the value for the feature with the given name or path
     |      to ``value``.  If ``name_or_path`` is an invalid path, raise
     |      ``KeyError``.
     |
     |  append(self, *args, **kwargs) from _check_frozen.<locals>
     |      Append object to the end of the list.
     |      If self is frozen, raise ValueError.
     |
     |  extend(self, *args, **kwargs) from _check_frozen.<locals>
     |      Extend list by appending elements from the iterable.
     |      If self is frozen, raise ValueError.
     |
     |  insert(self, *args, **kwargs) from _check_frozen.<locals>
     |      Insert object before index.
     |      If self is frozen, raise ValueError.
     |
     |  pop(self, *args, **kwargs) from _check_frozen.<locals>
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |      If self is frozen, raise ValueError.
     |
     |  remove(self, *args, **kwargs) from _check_frozen.<locals>
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |      If self is frozen, raise ValueError.
     |
     |  reverse(self, *args, **kwargs) from _check_frozen.<locals>
     |      Reverse *IN PLACE*.
     |      If self is frozen, raise ValueError.
     |
     |  sort(self, *args, **kwargs) from _check_frozen.<locals>
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |      If self is frozen, raise ValueError.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from FeatStruct:
     |
     |  __eq__(self, other)
     |      Return true if ``self`` and ``other`` are both feature structures,
     |      assign the same values to all features, and contain the same
     |      reentrances.  I.e., return
     |      ``self.equal_values(other, check_reentrance=True)``.
     |
     |      :see: ``equal_values()``
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      If this feature structure is frozen, return its hash value;
     |      otherwise, raise ``TypeError``.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Display a single-line representation of this feature structure,
     |      suitable for embedding in other representations.
     |
     |  copy(self, deep=True)
     |      Return a new copy of ``self``.  The new copy will not be frozen.
     |
     |      :param deep: If true, create a deep copy; if false, create
     |          a shallow copy.
     |
     |  cyclic(self)
     |      Return True if this feature structure contains itself.
     |
     |  equal_values(self, other, check_reentrance=False)
     |      Return True if ``self`` and ``other`` assign the same value to
     |      to every feature.  In particular, return true if
     |      ``self[p]==other[p]`` for every feature path *p* such
     |      that ``self[p]`` or ``other[p]`` is a base value (i.e.,
     |      not a nested feature structure).
     |
     |      :param check_reentrance: If True, then also return False if
     |          there is any difference between the reentrances of ``self``
     |          and ``other``.
     |      :note: the ``==`` is equivalent to ``equal_values()`` with
     |          ``check_reentrance=True``.
     |
     |  freeze(self)
     |      Make this feature structure, and any feature structures it
     |      contains, immutable.  Note: this method does not attempt to
     |      'freeze' any feature value that is not a ``FeatStruct``; it
     |      is recommended that you use only immutable feature values.
     |
     |  frozen(self)
     |      Return True if this feature structure is immutable.  Feature
     |      structures can be made immutable with the ``freeze()`` method.
     |      Immutable feature structures may not be made mutable again,
     |      but new mutable copies can be produced with the ``copy()`` method.
     |
     |  remove_variables(self)
     |      Return the feature structure that is obtained by deleting
     |      any feature whose value is a ``Variable``.
     |
     |      :rtype: FeatStruct
     |
     |  rename_variables(self, vars=None, used_vars=(), new_vars=None)
     |      :see: ``nltk.featstruct.rename_variables()``
     |
     |  retract_bindings(self, bindings)
     |      :see: ``nltk.featstruct.retract_bindings()``
     |
     |  substitute_bindings(self, bindings)
     |      :see: ``nltk.featstruct.substitute_bindings()``
     |
     |  subsumes(self, other)
     |      Return True if ``self`` subsumes ``other``.  I.e., return true
     |      If unifying ``self`` with ``other`` would result in a feature
     |      structure equal to ``other``.
     |
     |  unify(self, other, bindings=None, trace=False, fail=None, rename_vars=True)
     |
     |  variables(self)
     |      :see: ``nltk.featstruct.find_variables()``
     |
     |  walk(self)
     |      Return an iterator that generates this feature structure, and
     |      each feature structure it contains.  Each feature structure will
     |      be generated exactly once.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from FeatStruct:
     |
     |  __new__(cls, features=None, **morefeatures)
     |      Construct and return a new feature structure.  If this
     |      constructor is called directly, then the returned feature
     |      structure will be an instance of either the ``FeatDict`` class
     |      or the ``FeatList`` class.
     |
     |      :param features: The initial feature values for this feature
     |          structure:
     |
     |          - FeatStruct(string) -> FeatStructReader().read(string)
     |          - FeatStruct(mapping) -> FeatDict(mapping)
     |          - FeatStruct(sequence) -> FeatList(sequence)
     |          - FeatStruct() -> FeatDict()
     |      :param morefeatures: If ``features`` is a mapping or None,
     |          then ``morefeatures`` provides additional features for the
     |          ``FeatDict`` constructor.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class FeatStruct(nltk.sem.logic.SubstituteBindingsI)
     |  FeatStruct(features=None, **morefeatures)
     |
     |  A mapping from feature identifiers to feature values, where each
     |  feature value is either a basic value (such as a string or an
     |  integer), or a nested feature structure.  There are two types of
     |  feature structure:
     |
     |    - feature dictionaries, implemented by ``FeatDict``, act like
     |      Python dictionaries.  Feature identifiers may be strings or
     |      instances of the ``Feature`` class.
     |    - feature lists, implemented by ``FeatList``, act like Python
     |      lists.  Feature identifiers are integers.
     |
     |  Feature structures may be indexed using either simple feature
     |  identifiers or 'feature paths.'  A feature path is a sequence
     |  of feature identifiers that stand for a corresponding sequence of
     |  indexing operations.  In particular, ``fstruct[(f1,f2,...,fn)]`` is
     |  equivalent to ``fstruct[f1][f2]...[fn]``.
     |
     |  Feature structures may contain reentrant feature structures.  A
     |  "reentrant feature structure" is a single feature structure
     |  object that can be accessed via multiple feature paths.  Feature
     |  structures may also be cyclic.  A feature structure is "cyclic"
     |  if there is any feature path from the feature structure to itself.
     |
     |  Two feature structures are considered equal if they assign the
     |  same values to all features, and have the same reentrancies.
     |
     |  By default, feature structures are mutable.  They may be made
     |  immutable with the ``freeze()`` method.  Once they have been
     |  frozen, they may be hashed, and thus used as dictionary keys.
     |
     |  Method resolution order:
     |      FeatStruct
     |      nltk.sem.logic.SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __deepcopy__(self, memo)
     |      # Subclasses should define __deepcopy__ to ensure that the new
     |      # copy will not be frozen.
     |
     |  __eq__(self, other)
     |      Return true if ``self`` and ``other`` are both feature structures,
     |      assign the same values to all features, and contain the same
     |      reentrances.  I.e., return
     |      ``self.equal_values(other, check_reentrance=True)``.
     |
     |      :see: ``equal_values()``
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      If this feature structure is frozen, return its hash value;
     |      otherwise, raise ``TypeError``.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Display a single-line representation of this feature structure,
     |      suitable for embedding in other representations.
     |
     |  copy(self, deep=True)
     |      Return a new copy of ``self``.  The new copy will not be frozen.
     |
     |      :param deep: If true, create a deep copy; if false, create
     |          a shallow copy.
     |
     |  cyclic(self)
     |      Return True if this feature structure contains itself.
     |
     |  equal_values(self, other, check_reentrance=False)
     |      Return True if ``self`` and ``other`` assign the same value to
     |      to every feature.  In particular, return true if
     |      ``self[p]==other[p]`` for every feature path *p* such
     |      that ``self[p]`` or ``other[p]`` is a base value (i.e.,
     |      not a nested feature structure).
     |
     |      :param check_reentrance: If True, then also return False if
     |          there is any difference between the reentrances of ``self``
     |          and ``other``.
     |      :note: the ``==`` is equivalent to ``equal_values()`` with
     |          ``check_reentrance=True``.
     |
     |  freeze(self)
     |      Make this feature structure, and any feature structures it
     |      contains, immutable.  Note: this method does not attempt to
     |      'freeze' any feature value that is not a ``FeatStruct``; it
     |      is recommended that you use only immutable feature values.
     |
     |  frozen(self)
     |      Return True if this feature structure is immutable.  Feature
     |      structures can be made immutable with the ``freeze()`` method.
     |      Immutable feature structures may not be made mutable again,
     |      but new mutable copies can be produced with the ``copy()`` method.
     |
     |  remove_variables(self)
     |      Return the feature structure that is obtained by deleting
     |      any feature whose value is a ``Variable``.
     |
     |      :rtype: FeatStruct
     |
     |  rename_variables(self, vars=None, used_vars=(), new_vars=None)
     |      :see: ``nltk.featstruct.rename_variables()``
     |
     |  retract_bindings(self, bindings)
     |      :see: ``nltk.featstruct.retract_bindings()``
     |
     |  substitute_bindings(self, bindings)
     |      :see: ``nltk.featstruct.substitute_bindings()``
     |
     |  subsumes(self, other)
     |      Return True if ``self`` subsumes ``other``.  I.e., return true
     |      If unifying ``self`` with ``other`` would result in a feature
     |      structure equal to ``other``.
     |
     |  unify(self, other, bindings=None, trace=False, fail=None, rename_vars=True)
     |
     |  variables(self)
     |      :see: ``nltk.featstruct.find_variables()``
     |
     |  walk(self)
     |      Return an iterator that generates this feature structure, and
     |      each feature structure it contains.  Each feature structure will
     |      be generated exactly once.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(cls, features=None, **morefeatures)
     |      Construct and return a new feature structure.  If this
     |      constructor is called directly, then the returned feature
     |      structure will be an instance of either the ``FeatDict`` class
     |      or the ``FeatList`` class.
     |
     |      :param features: The initial feature values for this feature
     |          structure:
     |
     |          - FeatStruct(string) -> FeatStructReader().read(string)
     |          - FeatStruct(mapping) -> FeatDict(mapping)
     |          - FeatStruct(sequence) -> FeatList(sequence)
     |          - FeatStruct() -> FeatDict()
     |      :param morefeatures: If ``features`` is a mapping or None,
     |          then ``morefeatures`` provides additional features for the
     |          ``FeatDict`` constructor.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.sem.logic.SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatStructReader(builtins.object)
     |  FeatStructReader(features=(*slash*, *type*), fdict_class=<class 'nltk.featstruct.FeatStruct'>, flist_class=<class 'nltk.featstruct.FeatList'>, logic_parser=None)
     |
     |  Methods defined here:
     |
     |  __init__(self, features=(*slash*, *type*), fdict_class=<class 'nltk.featstruct.FeatStruct'>, flist_class=<class 'nltk.featstruct.FeatList'>, logic_parser=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  fromstring(self, s, fstruct=None)
     |      Convert a string representation of a feature structure (as
     |      displayed by repr) into a ``FeatStruct``.  This process
     |      imposes the following restrictions on the string
     |      representation:
     |
     |      - Feature names cannot contain any of the following:
     |        whitespace, parentheses, quote marks, equals signs,
     |        dashes, commas, and square brackets.  Feature names may
     |        not begin with plus signs or minus signs.
     |      - Only the following basic feature value are supported:
     |        strings, integers, variables, None, and unquoted
     |        alphanumeric strings.
     |      - For reentrant values, the first mention must specify
     |        a reentrance identifier and a value; and any subsequent
     |        mentions must use arrows (``'->'``) to reference the
     |        reentrance identifier.
     |
     |  read_app_value(self, s, position, reentrances, match)
     |      Mainly included for backwards compat.
     |
     |  read_fstruct_value(self, s, position, reentrances, match)
     |
     |  read_int_value(self, s, position, reentrances, match)
     |
     |  read_logic_value(self, s, position, reentrances, match)
     |
     |  read_partial(self, s, position=0, reentrances=None, fstruct=None)
     |      Helper function that reads in a feature structure.
     |
     |      :param s: The string to read.
     |      :param position: The position in the string to start parsing.
     |      :param reentrances: A dictionary from reentrance ids to values.
     |          Defaults to an empty dictionary.
     |      :return: A tuple (val, pos) of the feature structure created by
     |          parsing and the position where the parsed feature structure ends.
     |      :rtype: bool
     |
     |  read_set_value(self, s, position, reentrances, match)
     |
     |  read_str_value(self, s, position, reentrances, match)
     |
     |  read_sym_value(self, s, position, reentrances, match)
     |
     |  read_tuple_value(self, s, position, reentrances, match)
     |
     |  read_value(self, s, position, reentrances)
     |
     |  read_var_value(self, s, position, reentrances, match)
     |      # Note: the '?' is included in the variable name.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  VALUE_HANDLERS = [('read_fstruct_value', re.compile('\\s*(?:\\((\\d+)\...

    class Feature(builtins.object)
     |  Feature(name, default=None, display=None)
     |
     |  A feature identifier that's specialized to put additional
     |  constraints, default values, etc.
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, name, default=None, display=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  read_value(self, s, position, reentrances, parser)
     |
     |  unify_base_values(self, fval1, fval2, bindings)
     |      If possible, return a single value..  If not, return
     |      the value ``UnificationFailure``.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  default
     |      Default value for this feature.
     |
     |  display
     |      Custom display location: can be prefix, or slash.
     |
     |  name
     |      The name of this feature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class RangeFeature(Feature)
     |  RangeFeature(name, default=None, display=None)
     |
     |  Method resolution order:
     |      RangeFeature
     |      Feature
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  read_value(self, s, position, reentrances, parser)
     |
     |  unify_base_values(self, fval1, fval2, bindings)
     |      If possible, return a single value..  If not, return
     |      the value ``UnificationFailure``.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  RANGE_RE = re.compile('(-?\\d+):(-?\\d+)')
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Feature:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, name, default=None, display=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from Feature:
     |
     |  default
     |      Default value for this feature.
     |
     |  display
     |      Custom display location: can be prefix, or slash.
     |
     |  name
     |      The name of this feature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Feature:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SlashFeature(Feature)
     |  SlashFeature(name, default=None, display=None)
     |
     |  Method resolution order:
     |      SlashFeature
     |      Feature
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  read_value(self, s, position, reentrances, parser)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Feature:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, name, default=None, display=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  unify_base_values(self, fval1, fval2, bindings)
     |      If possible, return a single value..  If not, return
     |      the value ``UnificationFailure``.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from Feature:
     |
     |  default
     |      Default value for this feature.
     |
     |  display
     |      Custom display location: can be prefix, or slash.
     |
     |  name
     |      The name of this feature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Feature:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    conflicts(fstruct1, fstruct2, trace=0)
        Return a list of the feature paths of all features which are
        assigned incompatible values by ``fstruct1`` and ``fstruct2``.

        :rtype: list(tuple)

    subsumes(fstruct1, fstruct2)
        Return True if ``fstruct1`` subsumes ``fstruct2``.  I.e., return
        true if unifying ``fstruct1`` with ``fstruct2`` would result in a
        feature structure equal to ``fstruct2.``

        :rtype: bool

    unify(fstruct1, fstruct2, bindings=None, trace=False, fail=None, rename_vars=True, fs_class='default')
        Unify ``fstruct1`` with ``fstruct2``, and return the resulting feature
        structure.  This unified feature structure is the minimal
        feature structure that contains all feature value assignments from both
        ``fstruct1`` and ``fstruct2``, and that preserves all reentrancies.

        If no such feature structure exists (because ``fstruct1`` and
        ``fstruct2`` specify incompatible values for some feature), then
        unification fails, and ``unify`` returns None.

        Bound variables are replaced by their values.  Aliased
        variables are replaced by their representative variable
        (if unbound) or the value of their representative variable
        (if bound).  I.e., if variable *v* is in ``bindings``,
        then *v* is replaced by ``bindings[v]``.  This will
        be repeated until the variable is replaced by an unbound
        variable or a non-variable value.

        Unbound variables are bound when they are unified with
        values; and aliased when they are unified with variables.
        I.e., if variable *v* is not in ``bindings``, and is
        unified with a variable or value *x*, then
        ``bindings[v]`` is set to *x*.

        If ``bindings`` is unspecified, then all variables are
        assumed to be unbound.  I.e., ``bindings`` defaults to an
        empty dict.

            >>> from nltk.featstruct import FeatStruct
            >>> FeatStruct('[a=?x]').unify(FeatStruct('[b=?x]'))
            [a=?x, b=?x2]

        :type bindings: dict(Variable -> any)
        :param bindings: A set of variable bindings to be used and
            updated during unification.
        :type trace: bool
        :param trace: If true, generate trace output.
        :type rename_vars: bool
        :param rename_vars: If True, then rename any variables in
            ``fstruct2`` that are also used in ``fstruct1``, in order to
            avoid collisions on variable names.

DATA
    SLASH = *slash*
    TYPE = *type*
    __all__ = ['FeatStruct', 'FeatDict', 'FeatList', 'unify', 'subsumes', ...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\featstruct.py

nltk.featurechart
Python Library Documentation: module nltk.parse.featurechart in nltk.parse

NAME
    nltk.parse.featurechart

DESCRIPTION
    Extension of chart parsing implementation to handle grammars with
    feature structures as nodes.

CLASSES
    nltk.parse.chart.BottomUpPredictCombineRule(nltk.parse.chart.BottomUpPredictRule)
        FeatureBottomUpPredictCombineRule
    nltk.parse.chart.BottomUpPredictRule(nltk.parse.chart.AbstractChartRule)
        FeatureBottomUpPredictRule
    nltk.parse.chart.CachedTopDownPredictRule(nltk.parse.chart.TopDownPredictRule)
        FeatureTopDownPredictRule
    nltk.parse.chart.Chart(builtins.object)
        FeatureChart
            InstantiateVarsChart
    nltk.parse.chart.ChartParser(nltk.parse.api.ParserI)
        FeatureChartParser
            FeatureBottomUpChartParser
            FeatureBottomUpLeftCornerChartParser
            FeatureTopDownChartParser
    nltk.parse.chart.EmptyPredictRule(nltk.parse.chart.AbstractChartRule)
        FeatureEmptyPredictRule
    nltk.parse.chart.FundamentalRule(nltk.parse.chart.AbstractChartRule)
        FeatureFundamentalRule
    nltk.parse.chart.SingleEdgeFundamentalRule(nltk.parse.chart.FundamentalRule)
        FeatureSingleEdgeFundamentalRule
    nltk.parse.chart.TopDownInitRule(nltk.parse.chart.AbstractChartRule)
        FeatureTopDownInitRule
    nltk.parse.chart.TreeEdge(nltk.parse.chart.EdgeI)
        FeatureTreeEdge

    class FeatureBottomUpChartParser(FeatureChartParser)
     |  FeatureBottomUpChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      FeatureBottomUpChartParser
     |      FeatureChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureBottomUpLeftCornerChartParser(FeatureChartParser)
     |  FeatureBottomUpLeftCornerChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      FeatureBottomUpLeftCornerChartParser
     |      FeatureChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureBottomUpPredictCombineRule(nltk.parse.chart.BottomUpPredictCombineRule)
     |  Method resolution order:
     |      FeatureBottomUpPredictCombineRule
     |      nltk.parse.chart.BottomUpPredictCombineRule
     |      nltk.parse.chart.BottomUpPredictRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.BottomUpPredictCombineRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureBottomUpPredictRule(nltk.parse.chart.BottomUpPredictRule)
     |  Method resolution order:
     |      FeatureBottomUpPredictRule
     |      nltk.parse.chart.BottomUpPredictRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.BottomUpPredictRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureChart(nltk.parse.chart.Chart)
     |  FeatureChart(tokens)
     |
     |  A Chart for feature grammars.
     |  :see: ``Chart`` for more information.
     |
     |  Method resolution order:
     |      FeatureChart
     |      nltk.parse.chart.Chart
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  parses(self, start, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      Return an iterator of the complete tree structures that span
     |      the entire chart, and whose root node is ``root``.
     |
     |  select(self, **restrictions)
     |      Returns an iterator over the edges in this chart.
     |      See ``Chart.select`` for more information about the
     |      ``restrictions`` on the edges.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.Chart:
     |
     |  __init__(self, tokens)
     |      Construct a new chart. The chart is initialized with the
     |      leaf edges corresponding to the terminal leaves.
     |
     |      :type tokens: list
     |      :param tokens: The sentence that this chart will be used to parse.
     |
     |  __iter__ = iteredges(self)
     |
     |  child_pointer_lists(self, edge)
     |      Return the set of child pointer lists for the given edge.
     |      Each child pointer list is a list of edges that have
     |      been used to form this edge.
     |
     |      :rtype: list(list(EdgeI))
     |
     |  dot_digraph(self)
     |
     |  edges(self)
     |      Return a list of all edges in this chart.  New edges
     |      that are added to the chart after the call to edges()
     |      will *not* be contained in this list.
     |
     |      :rtype: list(EdgeI)
     |      :see: ``iteredges``, ``select``
     |
     |  initialize(self)
     |      Clear the chart.
     |
     |  insert(self, edge, *child_pointer_lists)
     |      Add a new edge to the chart, and return True if this operation
     |      modified the chart.  In particular, return true iff the chart
     |      did not already contain ``edge``, or if it did not already associate
     |      ``child_pointer_lists`` with ``edge``.
     |
     |      :type edge: EdgeI
     |      :param edge: The new edge
     |      :type child_pointer_lists: sequence of tuple(EdgeI)
     |      :param child_pointer_lists: A sequence of lists of the edges that
     |          were used to form this edge.  This list is used to reconstruct
     |          the trees (or partial trees) that are associated with ``edge``.
     |      :rtype: bool
     |
     |  insert_with_backpointer(self, new_edge, previous_edge, child_edge)
     |      Add a new edge to the chart, using a pointer to the previous edge.
     |
     |  iteredges(self)
     |      Return an iterator over the edges in this chart.  It is
     |      not guaranteed that new edges which are added to the
     |      chart before the iterator is exhausted will also be generated.
     |
     |      :rtype: iter(EdgeI)
     |      :see: ``edges``, ``select``
     |
     |  leaf(self, index)
     |      Return the leaf value of the word at the given index.
     |
     |      :rtype: str
     |
     |  leaves(self)
     |      Return a list of the leaf values of each word in the
     |      chart's sentence.
     |
     |      :rtype: list(str)
     |
     |  num_edges(self)
     |      Return the number of edges contained in this chart.
     |
     |      :rtype: int
     |
     |  num_leaves(self)
     |      Return the number of words in this chart's sentence.
     |
     |      :rtype: int
     |
     |  pretty_format(self, width=None)
     |      Return a pretty-printed string representation of this chart.
     |
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |      :rtype: str
     |
     |  pretty_format_edge(self, edge, width=None)
     |      Return a pretty-printed string representation of a given edge
     |      in this chart.
     |
     |      :rtype: str
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |
     |  pretty_format_leaves(self, width=None)
     |      Return a pretty-printed string representation of this
     |      chart's leaves.  This string can be used as a header
     |      for calls to ``pretty_format_edge``.
     |
     |  trees(self, edge, tree_class=<class 'nltk.tree.tree.Tree'>, complete=False)
     |      Return an iterator of the tree structures that are associated
     |      with ``edge``.
     |
     |      If ``edge`` is incomplete, then the unexpanded children will be
     |      encoded as childless subtrees, whose node value is the
     |      corresponding terminal or nonterminal.
     |
     |      :rtype: list(Tree)
     |      :note: If two trees share a common subtree, then the same
     |          Tree may be used to encode that subtree in
     |          both trees.  If you need to eliminate this subtree
     |          sharing, then create a deep copy of each tree.
     |      :raise ValueError: if more than ``MAX_PARSE_TREES`` parse-tree nodes
     |          would be built, which a highly-ambiguous grammar reaches at an
     |          exponential rate (CWE-770).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.Chart:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureChartParser(nltk.parse.chart.ChartParser)
     |  FeatureChartParser(grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2D3A0>, <nltk.parse.featurechart.FeatureEmptyPredictRule object at 0x0000028F98C2D3D0>, <nltk.parse.featurechart.FeatureBottomUpPredictCombineRule object at 0x0000028F98C2D400>, <nltk.parse.featurechart.FeatureSingleEdgeFundamentalRule object at 0x0000028F98C2D430>], trace_chart_width=20, chart_class=<class 'nltk.parse.featurechart.FeatureChart'>, **parser_args)
     |
     |  Method resolution order:
     |      FeatureChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, strategy=[<nltk.parse.chart.LeafInitRule object at 0x0000028F98C2D3A0>, <nltk.parse.featurechart.FeatureEmptyPredictRule object at 0x0000028F98C2D3D0>, <nltk.parse.featurechart.FeatureBottomUpPredictCombineRule object at 0x0000028F98C2D400>, <nltk.parse.featurechart.FeatureSingleEdgeFundamentalRule object at 0x0000028F98C2D430>], trace_chart_width=20, chart_class=<class 'nltk.parse.featurechart.FeatureChart'>, **parser_args)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureEmptyPredictRule(nltk.parse.chart.EmptyPredictRule)
     |  Method resolution order:
     |      FeatureEmptyPredictRule
     |      nltk.parse.chart.EmptyPredictRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.EmptyPredictRule:
     |
     |  NUM_EDGES = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureFundamentalRule(nltk.parse.chart.FundamentalRule)
     |  A specialized version of the fundamental rule that operates on
     |  nonterminals whose symbols are ``FeatStructNonterminal``s.  Rather
     |  than simply comparing the nonterminals for equality, they are
     |  unified.  Variable bindings from these unifications are collected
     |  and stored in the chart using a ``FeatureTreeEdge``.  When a
     |  complete edge is generated, these bindings are applied to all
     |  nonterminals in the edge.
     |
     |  The fundamental rule states that:
     |
     |  - ``[A -> alpha \* B1 beta][i:j]``
     |  - ``[B2 -> gamma \*][j:k]``
     |
     |  licenses the edge:
     |
     |  - ``[A -> alpha B3 \* beta][i:j]``
     |
     |  assuming that B1 and B2 can be unified to generate B3.
     |
     |  Method resolution order:
     |      FeatureFundamentalRule
     |      nltk.parse.chart.FundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, left_edge, right_edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.FundamentalRule:
     |
     |  NUM_EDGES = 2
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureSingleEdgeFundamentalRule(nltk.parse.chart.SingleEdgeFundamentalRule)
     |  A specialized version of the completer / single edge fundamental rule
     |  that operates on nonterminals whose symbols are ``FeatStructNonterminal``.
     |  Rather than simply comparing the nonterminals for equality, they are
     |  unified.
     |
     |  Method resolution order:
     |      FeatureSingleEdgeFundamentalRule
     |      nltk.parse.chart.SingleEdgeFundamentalRule
     |      nltk.parse.chart.FundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.SingleEdgeFundamentalRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureTopDownChartParser(FeatureChartParser)
     |  FeatureTopDownChartParser(grammar, **parser_args)
     |
     |  Method resolution order:
     |      FeatureTopDownChartParser
     |      FeatureChartParser
     |      nltk.parse.chart.ChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, **parser_args)
     |      Create a new chart parser, that uses ``grammar`` to parse
     |      texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type strategy: list(ChartRuleI)
     |      :param strategy: A list of rules that should be used to decide
     |          what edges to add to the chart (top-down strategy by default).
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |      :type trace_chart_width: int
     |      :param trace_chart_width: The default total width reserved for
     |          the chart in trace output.  The remainder of each line will
     |          be used to display edges.
     |      :type use_agenda: bool
     |      :param use_agenda: Use an optimized agenda-based algorithm,
     |          if possible.
     |      :param chart_class: The class that should be used to create
     |          the parse charts.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.ChartParser:
     |
     |  chart_parse(self, tokens, trace=None)
     |      Return the final parse ``Chart`` from which all possible
     |      parse trees can be extracted.
     |
     |      :param tokens: The sentence to be parsed
     |      :type tokens: list(str)
     |      :rtype: Chart
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureTopDownInitRule(nltk.parse.chart.TopDownInitRule)
     |  Method resolution order:
     |      FeatureTopDownInitRule
     |      nltk.parse.chart.TopDownInitRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.TopDownInitRule:
     |
     |  NUM_EDGES = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureTopDownPredictRule(nltk.parse.chart.CachedTopDownPredictRule)
     |  A specialized version of the (cached) top down predict rule that operates
     |  on nonterminals whose symbols are ``FeatStructNonterminal``.  Rather
     |  than simply comparing the nonterminals for equality, they are
     |  unified.
     |
     |  The top down expand rule states that:
     |
     |  - ``[A -> alpha \* B1 beta][i:j]``
     |
     |  licenses the edge:
     |
     |  - ``[B2 -> \* gamma][j:j]``
     |
     |  for each grammar production ``B2 -> gamma``, assuming that B1
     |  and B2 can be unified.
     |
     |  Method resolution order:
     |      FeatureTopDownPredictRule
     |      nltk.parse.chart.CachedTopDownPredictRule
     |      nltk.parse.chart.TopDownPredictRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.CachedTopDownPredictRule:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.parse.chart.TopDownPredictRule:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FeatureTreeEdge(nltk.parse.chart.TreeEdge)
     |  FeatureTreeEdge(span, lhs, rhs, dot=0, bindings=None)
     |
     |  A specialized tree edge that allows shared variable bindings
     |  between nonterminals on the left-hand side and right-hand side.
     |
     |  Each ``FeatureTreeEdge`` contains a set of ``bindings``, i.e., a
     |  dictionary mapping from variables to values.  If the edge is not
     |  complete, then these bindings are simply stored.  However, if the
     |  edge is complete, then the constructor applies these bindings to
     |  every nonterminal in the edge whose symbol implements the
     |  interface ``SubstituteBindingsI``.
     |
     |  Method resolution order:
     |      FeatureTreeEdge
     |      nltk.parse.chart.TreeEdge
     |      nltk.parse.chart.EdgeI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, span, lhs, rhs, dot=0, bindings=None)
     |      Construct a new edge.  If the edge is incomplete (i.e., if
     |      ``dot<len(rhs)``), then store the bindings as-is.  If the edge
     |      is complete (i.e., if ``dot==len(rhs)``), then apply the
     |      bindings to all nonterminals in ``lhs`` and ``rhs``, and then
     |      clear the bindings.  See ``TreeEdge`` for a description of
     |      the other arguments.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  bindings(self)
     |      Return a copy of this edge's bindings dictionary.
     |
     |  move_dot_forward(self, new_end, bindings=None)
     |      :return: A new ``FeatureTreeEdge`` formed from this edge.
     |          The new edge's dot position is increased by ``1``,
     |          and its end index will be replaced by ``new_end``.
     |      :rtype: FeatureTreeEdge
     |      :param new_end: The new end index.
     |      :type new_end: int
     |      :param bindings: Bindings for the new edge.
     |      :type bindings: dict
     |
     |  next_with_bindings(self)
     |
     |  variables(self)
     |      :return: The set of variables used by this edge.
     |      :rtype: set(Variable)
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  from_production(production, index)
     |      :return: A new ``TreeEdge`` formed from the given production.
     |          The new edge's left-hand side and right-hand side will
     |          be taken from ``production``; its span will be
     |          ``(index,index)``; and its dot position will be ``0``.
     |      :rtype: TreeEdge
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.TreeEdge:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  dot(self)
     |      Return this edge's dot position, which indicates how much of
     |      the hypothesized structure is consistent with the
     |      sentence.  In particular, ``self.rhs[:dot]`` is consistent
     |      with ``tokens[self.start():self.end()]``.
     |
     |      :rtype: int
     |
     |  end(self)
     |      Return the end index of this edge's span.
     |
     |      :rtype: int
     |
     |  is_complete(self)
     |      Return True if this edge's structure is fully consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  is_incomplete(self)
     |      Return True if this edge's structure is partially consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  length(self)
     |      Return the length of this edge's span.
     |
     |      :rtype: int
     |
     |  lhs(self)
     |      Return this edge's left-hand side, which specifies what kind
     |      of structure is hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the left-hand side values for each edge type.
     |
     |  nextsym(self)
     |      Return the element of this edge's right-hand side that
     |      immediately follows its dot.
     |
     |      :rtype: Nonterminal or terminal or None
     |
     |  rhs(self)
     |      Return this edge's right-hand side, which specifies
     |      the content of the structure hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the right-hand side values for each edge type.
     |
     |  span(self)
     |      Return a tuple ``(s, e)``, where ``tokens[s:e]`` is the
     |      portion of the sentence that is consistent with this
     |      edge's structure.
     |
     |      :rtype: tuple(int, int)
     |
     |  start(self)
     |      Return the start index of this edge's span.
     |
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.EdgeI:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.EdgeI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class InstantiateVarsChart(FeatureChart)
     |  InstantiateVarsChart(tokens)
     |
     |  A specialized chart that 'instantiates' variables whose names
     |  start with '@', by replacing them with unique new variables.
     |  In particular, whenever a complete edge is added to the chart, any
     |  variables in the edge's ``lhs`` whose names start with '@' will be
     |  replaced by unique new ``Variable``.
     |
     |  Method resolution order:
     |      InstantiateVarsChart
     |      FeatureChart
     |      nltk.parse.chart.Chart
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, tokens)
     |      Construct a new chart. The chart is initialized with the
     |      leaf edges corresponding to the terminal leaves.
     |
     |      :type tokens: list
     |      :param tokens: The sentence that this chart will be used to parse.
     |
     |  initialize(self)
     |      Clear the chart.
     |
     |  insert(self, edge, child_pointer_list)
     |      Add a new edge to the chart, and return True if this operation
     |      modified the chart.  In particular, return true iff the chart
     |      did not already contain ``edge``, or if it did not already associate
     |      ``child_pointer_lists`` with ``edge``.
     |
     |      :type edge: EdgeI
     |      :param edge: The new edge
     |      :type child_pointer_lists: sequence of tuple(EdgeI)
     |      :param child_pointer_lists: A sequence of lists of the edges that
     |          were used to form this edge.  This list is used to reconstruct
     |          the trees (or partial trees) that are associated with ``edge``.
     |      :rtype: bool
     |
     |  inst_vars(self, edge)
     |
     |  instantiate_edge(self, edge)
     |      If the edge is a ``FeatureTreeEdge``, and it is complete,
     |      then instantiate all variables whose names start with '@',
     |      by replacing them with unique new variables.
     |
     |      Note that instantiation is done in-place, since the
     |      parsing algorithms might already hold a reference to
     |      the edge for future use.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from FeatureChart:
     |
     |  parses(self, start, tree_class=<class 'nltk.tree.tree.Tree'>)
     |      Return an iterator of the complete tree structures that span
     |      the entire chart, and whose root node is ``root``.
     |
     |  select(self, **restrictions)
     |      Returns an iterator over the edges in this chart.
     |      See ``Chart.select`` for more information about the
     |      ``restrictions`` on the edges.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.Chart:
     |
     |  __iter__ = iteredges(self)
     |
     |  child_pointer_lists(self, edge)
     |      Return the set of child pointer lists for the given edge.
     |      Each child pointer list is a list of edges that have
     |      been used to form this edge.
     |
     |      :rtype: list(list(EdgeI))
     |
     |  dot_digraph(self)
     |
     |  edges(self)
     |      Return a list of all edges in this chart.  New edges
     |      that are added to the chart after the call to edges()
     |      will *not* be contained in this list.
     |
     |      :rtype: list(EdgeI)
     |      :see: ``iteredges``, ``select``
     |
     |  insert_with_backpointer(self, new_edge, previous_edge, child_edge)
     |      Add a new edge to the chart, using a pointer to the previous edge.
     |
     |  iteredges(self)
     |      Return an iterator over the edges in this chart.  It is
     |      not guaranteed that new edges which are added to the
     |      chart before the iterator is exhausted will also be generated.
     |
     |      :rtype: iter(EdgeI)
     |      :see: ``edges``, ``select``
     |
     |  leaf(self, index)
     |      Return the leaf value of the word at the given index.
     |
     |      :rtype: str
     |
     |  leaves(self)
     |      Return a list of the leaf values of each word in the
     |      chart's sentence.
     |
     |      :rtype: list(str)
     |
     |  num_edges(self)
     |      Return the number of edges contained in this chart.
     |
     |      :rtype: int
     |
     |  num_leaves(self)
     |      Return the number of words in this chart's sentence.
     |
     |      :rtype: int
     |
     |  pretty_format(self, width=None)
     |      Return a pretty-printed string representation of this chart.
     |
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |      :rtype: str
     |
     |  pretty_format_edge(self, edge, width=None)
     |      Return a pretty-printed string representation of a given edge
     |      in this chart.
     |
     |      :rtype: str
     |      :param width: The number of characters allotted to each
     |          index in the sentence.
     |
     |  pretty_format_leaves(self, width=None)
     |      Return a pretty-printed string representation of this
     |      chart's leaves.  This string can be used as a header
     |      for calls to ``pretty_format_edge``.
     |
     |  trees(self, edge, tree_class=<class 'nltk.tree.tree.Tree'>, complete=False)
     |      Return an iterator of the tree structures that are associated
     |      with ``edge``.
     |
     |      If ``edge`` is incomplete, then the unexpanded children will be
     |      encoded as childless subtrees, whose node value is the
     |      corresponding terminal or nonterminal.
     |
     |      :rtype: list(Tree)
     |      :note: If two trees share a common subtree, then the same
     |          Tree may be used to encode that subtree in
     |          both trees.  If you need to eliminate this subtree
     |          sharing, then create a deep copy of each tree.
     |      :raise ValueError: if more than ``MAX_PARSE_TREES`` parse-tree nodes
     |          would be built, which a highly-ambiguous grammar reaches at an
     |          exponential rate (CWE-770).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.Chart:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo(print_times=True, print_grammar=True, print_trees=True, print_sentence=True, trace=1, parser=<class 'nltk.parse.featurechart.FeatureChartParser'>, sent='I saw John with a dog with my cookie')

    demo_grammar()

    perf_counter(...)
        perf_counter() -> float

        Performance counter for benchmarking.

    run_profile()

DATA
    BU_FEATURE_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nltk.p...
    BU_LC_FEATURE_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nlt...
    TD_FEATURE_STRATEGY = [<nltk.parse.chart.LeafInitRule object>, <nltk.p...
    TYPE = *type*

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\featurechart.py

nltk.filestring
Python Library Documentation: function filestring in module nltk.util

filestring(f, allowed_dir=None)
    Read a file path or file-like object into a string.

    Security:
    - Paths are resolved via ``Path.resolve()`` to prevent
      symlink and ``../`` traversal attacks.
    - If ``allowed_dir`` is provided, the resolved path must
      fall within that directory tree.
    - All file opens go through ``pathsec.open``, which
      validates paths against NLTK's allowed data roots.
    - File-like objects with a ``.read()`` method are passed
      through without path checks.

    :param f: a file path or file-like object with a ``.read()`` method
    :param allowed_dir: if provided, restricts file access to paths
        within this directory; raises ``PermissionError`` if the
        resolved path falls outside it
    :raises PermissionError: if ``allowed_dir`` is set and ``f``
        resolves outside it, or if pathsec blocks the path
    :rtype: str
nltk.find
Python Library Documentation: function find in module nltk.data

find(resource_name, paths=None)
    Find the given resource by searching through the directories and
    zip files in paths, where a None or empty string specifies an absolute path.
    Returns a corresponding path name.  If the given resource is not
    found, raise a ``LookupError``, whose message gives a pointer to
    the installation instructions for the NLTK downloader.

    Zip File Handling:

      - If ``resource_name`` contains a component with a ``.zip``
        extension, then it is assumed to be a zipfile; and the
        remaining path components are used to look inside the zipfile.

      - If any element of ``nltk.data.path`` has a ``.zip`` extension,
        then it is assumed to be a zipfile.

      - If a given resource name that does not contain any zipfile
        component is not found initially, then ``find()`` will make a
        second attempt to find that resource, by replacing each
        component *p* in the path with *p.zip/p*.  For example, this
        allows ``find()`` to map the resource name
        ``corpora/chat80/cities.pl`` to a zip file path pointer to
        ``corpora/chat80.zip/chat80/cities.pl``.

      - When using ``find()`` to locate a directory contained in a
        zipfile, the resource name must end with the forward slash
        character.  Otherwise, ``find()`` will not locate the
        directory.

    :type resource_name: str or unicode
    :param resource_name: The name of the resource to search for.
        Resource names are posix-style relative path names, such as
        ``corpora/brown``.  Directory names will be
        automatically converted to a platform-appropriate path separator.
    :rtype: str
nltk.flatten
Python Library Documentation: function flatten in module nltk.util

flatten(*args)
    Flatten a list.

        >>> from nltk.util import flatten
        >>> flatten(1, 2, ['b', 'a' , ['c', 'd']], 3)
        [1, 2, 'b', 'a', 'c', 'd', 3]

    :param args: items and lists to be combined into a single list
    :rtype: list
nltk.fractional_presence
Python Library Documentation: function fractional_presence in module nltk.metrics.distance

fractional_presence(label)
nltk.functools
Python Library Documentation: module functools

NAME
    functools - functools.py - Tools for working with functions and callable objects

MODULE REFERENCE
    https://docs.python.org/3.12/library/functools.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

CLASSES
    builtins.object
        cached_property
        partial
        partialmethod
        singledispatchmethod

    class cached_property(builtins.object)
     |  cached_property(func)
     |
     |  Methods defined here:
     |
     |  __get__(self, instance, owner=None)
     |
     |  __init__(self, func)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __set_name__(self, owner, name)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__ = GenericAlias(...)
     |      Represent a PEP 585 generic type
     |
     |      E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class partial(builtins.object)
     |  partial(func, *args, **keywords) - new function with partial application
     |  of the given arguments and keywords.
     |
     |  Methods defined here:
     |
     |  __call__(self, /, *args, **kwargs)
     |      Call self as a function.
     |
     |  __delattr__(self, name, /)
     |      Implement delattr(self, name).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setattr__(self, name, value, /)
     |      Implement setattr(self, name, value).
     |
     |  __setstate__(...)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |
     |  __vectorcalloffset__
     |
     |  args
     |      tuple of arguments to future partial calls
     |
     |  func
     |      function object to use in future partial calls
     |
     |  keywords
     |      dictionary of keyword arguments to future partial calls

    class partialmethod(builtins.object)
     |  partialmethod(func, /, *args, **keywords)
     |
     |  Method descriptor with partial application of the given arguments
     |  and keywords.
     |
     |  Supports wrapping existing descriptors and handles non-descriptor
     |  callables as instance methods.
     |
     |  Methods defined here:
     |
     |  __get__(self, obj, cls=None)
     |
     |  __init__(self, func, /, *args, **keywords)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__ = GenericAlias(...)
     |      Represent a PEP 585 generic type
     |
     |      E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  __isabstractmethod__
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class singledispatchmethod(builtins.object)
     |  singledispatchmethod(func)
     |
     |  Single-dispatch generic method descriptor.
     |
     |  Supports wrapping existing descriptors and handles non-descriptor
     |  callables as instance methods.
     |
     |  Methods defined here:
     |
     |  __get__(self, obj, cls=None)
     |
     |  __init__(self, func)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  register(self, cls, method=None)
     |      generic_method.register(cls, func) -> func
     |
     |      Registers a new implementation for the given *cls* on a *generic_method*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  __isabstractmethod__
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    cache(user_function, /)
        Simple lightweight unbounded cache.  Sometimes called "memoize".

    cmp_to_key(mycmp)
        Convert a cmp= function into a key= function.

        mycmp
          Function that compares two objects.

    lru_cache(maxsize=128, typed=False)
        Least-recently-used cache decorator.

        If *maxsize* is set to None, the LRU features are disabled and the cache
        can grow without bound.

        If *typed* is True, arguments of different types will be cached separately.
        For example, f(3.0) and f(3) will be treated as distinct calls with
        distinct results.

        Arguments to the cached function must be hashable.

        View the cache statistics named tuple (hits, misses, maxsize, currsize)
        with f.cache_info().  Clear the cache and statistics with f.cache_clear().
        Access the underlying function with f.__wrapped__.

        See:  https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)

    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

    singledispatch(func)
        Single-dispatch generic function decorator.

        Transforms a function into a generic function, which can have different
        behaviours depending upon the type of its first argument. The decorated
        function acts as the default implementation, and additional
        implementations can be registered using the register() attribute of the
        generic function.

    total_ordering(cls)
        Class decorator that fills in missing ordering methods

    update_wrapper(wrapper, wrapped, assigned=('__module__', '__name__', '__qualname__', '__doc__', '__annotations__', '__type_params__'), updated=('__dict__',))
        Update a wrapper function to look like the wrapped function

        wrapper is the function to be updated
        wrapped is the original function
        assigned is a tuple naming the attributes assigned directly
        from the wrapped function to the wrapper function (defaults to
        functools.WRAPPER_ASSIGNMENTS)
        updated is a tuple naming the attributes of the wrapper that
        are updated with the corresponding attribute from the wrapped
        function (defaults to functools.WRAPPER_UPDATES)

    wraps(wrapped, assigned=('__module__', '__name__', '__qualname__', '__doc__', '__annotations__', '__type_params__'), updated=('__dict__',))
        Decorator factory to apply update_wrapper() to a wrapper function

        Returns a decorator that invokes update_wrapper() with the decorated
        function as the wrapper argument and the arguments to wraps() as the
        remaining arguments. Default arguments are as for update_wrapper().
        This is a convenience function to simplify applying partial() to
        update_wrapper().

DATA
    WRAPPER_ASSIGNMENTS = ('__module__', '__name__', '__qualname__', '__do...
    WRAPPER_UPDATES = ('__dict__',)
    __all__ = ['update_wrapper', 'wraps', 'WRAPPER_ASSIGNMENTS', 'WRAPPER_...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\functools.py

nltk.gale_church
Python Library Documentation: module nltk.translate.gale_church in nltk.translate

NAME
    nltk.translate.gale_church - A port of the Gale-Church Aligner.

DESCRIPTION
    Gale & Church (1993), A Program for Aligning Sentences in Bilingual Corpora.
    https://aclweb.org/anthology/J93-1004.pdf

CLASSES
    builtins.object
        LanguageIndependent

    class LanguageIndependent(builtins.object)
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  AVERAGE_CHARACTERS = 1
     |
     |  PRIORS = {(0, 1): 0.0099, (1, 0): 0.0099, (1, 1): 0.89, (1, 2): 0.089,...
     |
     |  VARIANCE_CHARACTERS = 6.8

FUNCTIONS
    align_blocks(source_sents_lens, target_sents_lens, params=<class 'nltk.translate.gale_church.LanguageIndependent'>)
        Return the sentence alignment of two text blocks (usually paragraphs).

            >>> align_blocks([5,5,5], [7,7,7])
            [(0, 0), (1, 1), (2, 2)]
            >>> align_blocks([10,5,5], [12,20])
            [(0, 0), (1, 1), (2, 1)]
            >>> align_blocks([12,20], [10,5,5])
            [(0, 0), (1, 1), (1, 2)]
            >>> align_blocks([10,2,10,10,2,10], [12,3,20,3,12])
            [(0, 0), (1, 1), (2, 2), (3, 2), (4, 3), (5, 4)]

        @param source_sents_lens: The list of source sentence lengths.
        @param target_sents_lens: The list of target sentence lengths.
        @param params: the sentence alignment parameters.
        @return: The sentence alignments, a list of index pairs.

    align_log_prob(i, j, source_sents, target_sents, alignment, params)
        Returns the log probability of the two sentences C{source_sents[i]}, C{target_sents[j]}
        being aligned with a specific C{alignment}.

        @param i: The offset of the source sentence.
        @param j: The offset of the target sentence.
        @param source_sents: The list of source sentence lengths.
        @param target_sents: The list of target sentence lengths.
        @param alignment: The alignment type, a tuple of two integers.
        @param params: The sentence alignment parameters.

        @returns: The log probability of a specific alignment between the two sentences, given the parameters.

    align_texts(source_blocks, target_blocks, params=<class 'nltk.translate.gale_church.LanguageIndependent'>)
        Creates the sentence alignment of two texts.

        Texts can consist of several blocks. Block boundaries cannot be crossed by sentence
        alignment links.

        Each block consists of a list that contains the lengths (in characters) of the sentences
        in this block.

        @param source_blocks: The list of blocks in the source text.
        @param target_blocks: The list of blocks in the target text.
        @param params: the sentence alignment parameters.

        @returns: A list of sentence alignment lists

    erfcc(x)
        Complementary error function.

    norm_cdf(x)
        Return the area under the normal distribution from M{-∞..x}.

    norm_logsf(x)

    parse_token_stream(stream, soft_delimiter, hard_delimiter)
        Parses a stream of tokens and splits it into sentences (using C{soft_delimiter} tokens)
        and blocks (using C{hard_delimiter} tokens) for use with the L{align_texts} function.

    split_at(it, split_value)
        Splits an iterator C{it} at values of C{split_value}.

        Each instance of C{split_value} is swallowed. The iterator produces
        subiterators which need to be consumed fully before the next subiterator
        can be used.

    trace(backlinks, source_sents_lens, target_sents_lens)
        Traverse the alignment cost from the tracebacks and retrieves
        appropriate sentence pairs.

        :param backlinks: A dictionary where the key is the alignment points and value is the cost (referencing the LanguageIndependent.PRIORS)
        :type backlinks: dict
        :param source_sents_lens: A list of target sentences' lengths
        :type source_sents_lens: list(int)
        :param target_sents_lens: A list of target sentences' lengths
        :type target_sents_lens: list(int)

DATA
    LOG2 = 0.6931471805599453

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\gale_church.py

nltk.gdfa
Python Library Documentation: module nltk.translate.gdfa in nltk.translate

NAME
    nltk.translate.gdfa

DESCRIPTION
    # Natural Language Toolkit: GDFA word alignment symmetrization
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Authors: Liling Tan
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

FUNCTIONS
    grow_diag_final_and(srclen, trglen, e2f, f2e)
        This module symmetrisatizes the source-to-target and target-to-source
        word alignment output and produces, aka. GDFA algorithm (Koehn, 2005).

        Step 1: Find the intersection of the bidirectional alignment.

        Step 2: Search for additional neighbor alignment points to be added, given
                these criteria: (i) neighbor alignments points are not in the
                intersection and (ii) neighbor alignments are in the union.

        Step 3: Add all other alignment points that are not in the intersection, not in
                the neighboring alignments that met the criteria but in the original
                forward/backward alignment outputs.

            >>> forw = ('0-0 2-1 9-2 21-3 10-4 7-5 11-6 9-7 12-8 1-9 3-10 '
            ...         '4-11 17-12 17-13 25-14 13-15 24-16 11-17 28-18')
            >>> back = ('0-0 1-9 2-9 3-10 4-11 5-12 6-6 7-5 8-6 9-7 10-4 '
            ...         '11-6 12-8 13-12 15-12 17-13 18-13 19-12 20-13 '
            ...         '21-3 22-12 23-14 24-17 25-15 26-17 27-18 28-18')
            >>> srctext = ("この よう な ハロー 白色 わい 星 の L 関数 "
            ...            "は L と 共 に 不連続 に 増加 する こと が "
            ...            "期待 さ れる こと を 示し た 。")
            >>> trgtext = ("Therefore , we expect that the luminosity function "
            ...            "of such halo white dwarfs increases discontinuously "
            ...            "with the luminosity .")
            >>> srclen = len(srctext.split())
            >>> trglen = len(trgtext.split())
            >>>
            >>> gdfa = grow_diag_final_and(srclen, trglen, forw, back)
            >>> gdfa == sorted(set([(28, 18), (6, 6), (24, 17), (2, 1), (15, 12), (13, 12),
            ...         (2, 9), (3, 10), (26, 17), (25, 15), (8, 6), (9, 7), (20,
            ...         13), (18, 13), (0, 0), (10, 4), (13, 15), (23, 14), (7, 5),
            ...         (25, 14), (1, 9), (17, 13), (4, 11), (11, 17), (9, 2), (22,
            ...         12), (27, 18), (24, 16), (21, 3), (19, 12), (17, 12), (5,
            ...         12), (11, 6), (12, 8)]))
            True

        References:
        Koehn, P., A. Axelrod, A. Birch, C. Callison, M. Osborne, and D. Talbot.
        2005. Edinburgh System Description for the 2005 IWSLT Speech
        Translation Evaluation. In MT Eval Workshop.

        :type srclen: int
        :param srclen: the number of tokens in the source language
        :type trglen: int
        :param trglen: the number of tokens in the target language
        :type e2f: str
        :param e2f: the forward word alignment outputs from source-to-target
                    language (in pharaoh output format)
        :type f2e: str
        :param f2e: the backward word alignment outputs from target-to-source
                    language (in pharaoh output format)
        :rtype: set(tuple(int))
        :return: the symmetrized alignment points from the GDFA algorithm

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\gdfa.py

nltk.getproxies
Python Library Documentation: function getproxies in module urllib.request

getproxies()
    Return a dictionary of scheme -> proxy server URL mappings.

    Returns settings gathered from the environment, if specified,
    or the registry.
nltk.ghd
Python Library Documentation: function ghd in module nltk.metrics.segmentation

ghd(ref, hyp, ins_cost=2.0, del_cost=2.0, shift_cost_coeff=1.0, boundary='1')
    Compute the Generalized Hamming Distance for a reference and a hypothetical
    segmentation, corresponding to the cost related to the transformation
    of the hypothetical segmentation into the reference segmentation
    through boundary insertion, deletion and shift operations.

    A segmentation is any sequence over a vocabulary of two items
    (e.g. "0", "1"), where the specified boundary value is used to
    mark the edge of a segmentation.

    Recommended parameter values are a shift_cost_coeff of 2.
    Associated with a ins_cost, and del_cost equal to the mean segment
    length in the reference segmentation.

        >>> # Same examples as Kulyukin C++ implementation
        >>> ghd('1100100000', '1100010000', 1.0, 1.0, 0.5)
        0.5
        >>> ghd('1100100000', '1100000001', 1.0, 1.0, 0.5)
        2.0
        >>> ghd('011', '110', 1.0, 1.0, 0.5)
        1.0
        >>> ghd('1', '0', 1.0, 1.0, 0.5)
        1.0
        >>> ghd('111', '000', 1.0, 1.0, 0.5)
        3.0
        >>> ghd('000', '111', 1.0, 2.0, 0.5)
        6.0

    :param ref: the reference segmentation
    :type ref: str or list
    :param hyp: the hypothetical segmentation
    :type hyp: str or list
    :param ins_cost: insertion cost
    :type ins_cost: float
    :param del_cost: deletion cost
    :type del_cost: float
    :param shift_cost_coeff: constant used to compute the cost of a shift.
        ``shift cost = shift_cost_coeff * |i - j|`` where ``i`` and ``j``
        are the positions indicating the shift
    :type shift_cost_coeff: float
    :param boundary: boundary value
    :type boundary: str or int or bool
    :rtype: float
nltk.gleu
Python Library Documentation: function sentence_gleu in module nltk.translate.gleu_score

sentence_gleu(references, hypothesis, min_len=1, max_len=4)
    Calculates the sentence level GLEU (Google-BLEU) score described in

        Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi,
        Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey,
        Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser,
        Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens,
        George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith,
        Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes,
        Jeffrey Dean. (2016) Google’s Neural Machine Translation System:
        Bridging the Gap between Human and Machine Translation.
        eprint arXiv:1609.08144. https://arxiv.org/pdf/1609.08144v2.pdf
        Retrieved on 27 Oct 2016.

    From Wu et al. (2016):
        "The BLEU score has some undesirable properties when used for single
         sentences, as it was designed to be a corpus measure. We therefore
         use a slightly different score for our RL experiments which we call
         the 'GLEU score'. For the GLEU score, we record all sub-sequences of
         1, 2, 3 or 4 tokens in output and target sequence (n-grams). We then
         compute a recall, which is the ratio of the number of matching n-grams
         to the number of total n-grams in the target (ground truth) sequence,
         and a precision, which is the ratio of the number of matching n-grams
         to the number of total n-grams in the generated output sequence. Then
         GLEU score is simply the minimum of recall and precision. This GLEU
         score's range is always between 0 (no matches) and 1 (all match) and
         it is symmetrical when switching output and target. According to
         our experiments, GLEU score correlates quite well with the BLEU
         metric on a corpus level but does not have its drawbacks for our per
         sentence reward objective."

    Note: The initial implementation only allowed a single reference, but now
          a list of references is required (which is consistent with
          bleu_score.sentence_bleu()).

    The infamous "the the the ... " example

        >>> ref = 'the cat is on the mat'.split()
        >>> hyp = 'the the the the the the the'.split()
        >>> sentence_gleu([ref], hyp)  # doctest: +ELLIPSIS
        0.0909...

    An example to evaluate normal machine translation outputs

        >>> ref1 = str('It is a guide to action that ensures that the military '
        ...            'will forever heed Party commands').split()
        >>> hyp1 = str('It is a guide to action which ensures that the military '
        ...            'always obeys the commands of the party').split()
        >>> hyp2 = str('It is to insure the troops forever hearing the activity '
        ...            'guidebook that party direct').split()
        >>> sentence_gleu([ref1], hyp1) # doctest: +ELLIPSIS
        0.4393...
        >>> sentence_gleu([ref1], hyp2) # doctest: +ELLIPSIS
        0.1206...

    :param references: a list of reference sentences
    :type references: list(list(str))
    :param hypothesis: a hypothesis sentence
    :type hypothesis: list(str)
    :param min_len: The minimum order of n-gram this function should extract.
    :type min_len: int
    :param max_len: The maximum order of n-gram this function should extract.
    :type max_len: int
    :return: the sentence level GLEU score.
    :rtype: float
nltk.gleu_score
Python Library Documentation: module nltk.translate.gleu_score in nltk.translate

NAME
    nltk.translate.gleu_score - GLEU score implementation.

FUNCTIONS
    corpus_gleu(list_of_references, hypotheses, min_len=1, max_len=4)
        Calculate a single corpus-level GLEU score (aka. system-level GLEU) for all
        the hypotheses and their respective references.

        Instead of averaging the sentence level GLEU scores (i.e. macro-average
        precision), Wu et al. (2016) sum up the matching tokens and the max of
        hypothesis and reference tokens for each sentence, then compute using the
        aggregate values.

        From Mike Schuster (via email):
            "For the corpus, we just add up the two statistics n_match and
             n_all = max(n_all_output, n_all_target) for all sentences, then
             calculate gleu_score = n_match / n_all, so it is not just a mean of
             the sentence gleu scores (in our case, longer sentences count more,
             which I think makes sense as they are more difficult to translate)."

        >>> hyp1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which',
        ...         'ensures', 'that', 'the', 'military', 'always',
        ...         'obeys', 'the', 'commands', 'of', 'the', 'party']
        >>> ref1a = ['It', 'is', 'a', 'guide', 'to', 'action', 'that',
        ...          'ensures', 'that', 'the', 'military', 'will', 'forever',
        ...          'heed', 'Party', 'commands']
        >>> ref1b = ['It', 'is', 'the', 'guiding', 'principle', 'which',
        ...          'guarantees', 'the', 'military', 'forces', 'always',
        ...          'being', 'under', 'the', 'command', 'of', 'the', 'Party']
        >>> ref1c = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the',
        ...          'army', 'always', 'to', 'heed', 'the', 'directions',
        ...          'of', 'the', 'party']

        >>> hyp2 = ['he', 'read', 'the', 'book', 'because', 'he', 'was',
        ...         'interested', 'in', 'world', 'history']
        >>> ref2a = ['he', 'was', 'interested', 'in', 'world', 'history',
        ...          'because', 'he', 'read', 'the', 'book']

        >>> list_of_references = [[ref1a, ref1b, ref1c], [ref2a]]
        >>> hypotheses = [hyp1, hyp2]
        >>> corpus_gleu(list_of_references, hypotheses) # doctest: +ELLIPSIS
        0.5673...

        The example below show that corpus_gleu() is different from averaging
        sentence_gleu() for hypotheses

        >>> score1 = sentence_gleu([ref1a], hyp1)
        >>> score2 = sentence_gleu([ref2a], hyp2)
        >>> (score1 + score2) / 2 # doctest: +ELLIPSIS
        0.6144...

        :param list_of_references: a list of reference sentences, w.r.t. hypotheses
        :type list_of_references: list(list(list(str)))
        :param hypotheses: a list of hypothesis sentences
        :type hypotheses: list(list(str))
        :param min_len: The minimum order of n-gram this function should extract.
        :type min_len: int
        :param max_len: The maximum order of n-gram this function should extract.
        :type max_len: int
        :return: The corpus-level GLEU score.
        :rtype: float

    sentence_gleu(references, hypothesis, min_len=1, max_len=4)
        Calculates the sentence level GLEU (Google-BLEU) score described in

            Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi,
            Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey,
            Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser,
            Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens,
            George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith,
            Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes,
            Jeffrey Dean. (2016) Google’s Neural Machine Translation System:
            Bridging the Gap between Human and Machine Translation.
            eprint arXiv:1609.08144. https://arxiv.org/pdf/1609.08144v2.pdf
            Retrieved on 27 Oct 2016.

        From Wu et al. (2016):
            "The BLEU score has some undesirable properties when used for single
             sentences, as it was designed to be a corpus measure. We therefore
             use a slightly different score for our RL experiments which we call
             the 'GLEU score'. For the GLEU score, we record all sub-sequences of
             1, 2, 3 or 4 tokens in output and target sequence (n-grams). We then
             compute a recall, which is the ratio of the number of matching n-grams
             to the number of total n-grams in the target (ground truth) sequence,
             and a precision, which is the ratio of the number of matching n-grams
             to the number of total n-grams in the generated output sequence. Then
             GLEU score is simply the minimum of recall and precision. This GLEU
             score's range is always between 0 (no matches) and 1 (all match) and
             it is symmetrical when switching output and target. According to
             our experiments, GLEU score correlates quite well with the BLEU
             metric on a corpus level but does not have its drawbacks for our per
             sentence reward objective."

        Note: The initial implementation only allowed a single reference, but now
              a list of references is required (which is consistent with
              bleu_score.sentence_bleu()).

        The infamous "the the the ... " example

            >>> ref = 'the cat is on the mat'.split()
            >>> hyp = 'the the the the the the the'.split()
            >>> sentence_gleu([ref], hyp)  # doctest: +ELLIPSIS
            0.0909...

        An example to evaluate normal machine translation outputs

            >>> ref1 = str('It is a guide to action that ensures that the military '
            ...            'will forever heed Party commands').split()
            >>> hyp1 = str('It is a guide to action which ensures that the military '
            ...            'always obeys the commands of the party').split()
            >>> hyp2 = str('It is to insure the troops forever hearing the activity '
            ...            'guidebook that party direct').split()
            >>> sentence_gleu([ref1], hyp1) # doctest: +ELLIPSIS
            0.4393...
            >>> sentence_gleu([ref1], hyp2) # doctest: +ELLIPSIS
            0.1206...

        :param references: a list of reference sentences
        :type references: list(list(str))
        :param hypothesis: a hypothesis sentence
        :type hypothesis: list(str)
        :param min_len: The minimum order of n-gram this function should extract.
        :type min_len: int
        :param max_len: The maximum order of n-gram this function should extract.
        :type max_len: int
        :return: the sentence level GLEU score.
        :rtype: float

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\gleu_score.py

nltk.glue
Python Library Documentation: module nltk.sem.glue in nltk.sem

NAME
    nltk.sem.glue

DESCRIPTION
    # Natural Language Toolkit: Glue Semantics
    #
    # Author: Dan Garrette <dhgarrette@gmail.com>
    #
    # Copyright (C) 2001-2026 NLTK Project
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.dict(builtins.object)
        GlueDict
            DrtGlueDict
    builtins.object
        Glue
            DrtGlue
        GlueFormula
            DrtGlueFormula

    class DrtGlue(Glue)
     |  DrtGlue(semtype_file=None, remove_duplicates=False, depparser=None, verbose=False)
     |
     |  Method resolution order:
     |      DrtGlue
     |      Glue
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, semtype_file=None, remove_duplicates=False, depparser=None, verbose=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  get_glue_dict(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Glue:
     |
     |  dep_parse(self, sentence)
     |      Return a dependency graph for the sentence.
     |
     |      :param sentence: the sentence to be parsed
     |      :type sentence: list(str)
     |      :rtype: DependencyGraph
     |
     |  depgraph_to_glue(self, depgraph)
     |
     |  get_pos_tagger(self)
     |
     |  get_readings(self, agenda)
     |
     |  gfl_to_compiled(self, gfl)
     |
     |  parse_to_compiled(self, sentence)
     |
     |  parse_to_meaning(self, sentence)
     |
     |  train_depparser(self, depgraphs=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Glue:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DrtGlueDict(GlueDict)
     |  DrtGlueDict(filename, encoding=None)
     |
     |  Method resolution order:
     |      DrtGlueDict
     |      GlueDict
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  get_GlueFormula_factory(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from GlueDict:
     |
     |  __init__(self, filename, encoding=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  add_missing_dependencies(self, node, depgraph)
     |
     |  find_label_name(self, name, node, depgraph, unique_index)
     |
     |  get_glueformulas_from_semtype_entry(self, lookup, word, node, depgraph, counter)
     |
     |  get_label(self, node)
     |      Pick an alphabetic character as identifier for an entity in the model.
     |
     |      :param value: where to index into the list of characters
     |      :type value: int
     |
     |  get_meaning_formula(self, generic, word)
     |      :param generic: A meaning formula string containing the
     |          parameter "<word>"
     |      :param word: The actual word to be replace "<word>"
     |
     |  get_semtypes(self, node)
     |      Based on the node, return a list of plausible semtypes in order of
     |      plausibility.
     |
     |  initialize_labels(self, expr, node, depgraph, unique_index)
     |
     |  lookup(self, node, depgraph, counter)
     |
     |  lookup_unique(self, rel, node, depgraph)
     |      Lookup 'key'. There should be exactly one item in the associated relation.
     |
     |  read_file(self, empty_first=True)
     |
     |  to_glueformula_list(self, depgraph, node=None, counter=None, verbose=False)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from GlueDict:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  copy(...)
     |      D.copy() -> a shallow copy of D
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

    class DrtGlueFormula(GlueFormula)
     |  DrtGlueFormula(meaning, glue, indices=None)
     |
     |  Method resolution order:
     |      DrtGlueFormula
     |      GlueFormula
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, meaning, glue, indices=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  make_LambdaExpression(self, variable, term)
     |
     |  make_VariableExpression(self, name)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from GlueFormula:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  applyto(self, arg)
     |      self = (\x.(walk x), (subj -o f))
     |      arg  = (john        ,  subj)
     |      returns ((walk john),          f)
     |
     |  compile(self, counter=None)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |  lambda_abstract(self, other)
     |
     |  simplify(self)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from GlueFormula:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from GlueFormula:
     |
     |  __hash__ = None

    class Glue(builtins.object)
     |  Glue(semtype_file=None, remove_duplicates=False, depparser=None, verbose=False)
     |
     |  Methods defined here:
     |
     |  __init__(self, semtype_file=None, remove_duplicates=False, depparser=None, verbose=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  dep_parse(self, sentence)
     |      Return a dependency graph for the sentence.
     |
     |      :param sentence: the sentence to be parsed
     |      :type sentence: list(str)
     |      :rtype: DependencyGraph
     |
     |  depgraph_to_glue(self, depgraph)
     |
     |  get_glue_dict(self)
     |
     |  get_pos_tagger(self)
     |
     |  get_readings(self, agenda)
     |
     |  gfl_to_compiled(self, gfl)
     |
     |  parse_to_compiled(self, sentence)
     |
     |  parse_to_meaning(self, sentence)
     |
     |  train_depparser(self, depgraphs=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class GlueDict(builtins.dict)
     |  GlueDict(filename, encoding=None)
     |
     |  Method resolution order:
     |      GlueDict
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, filename, encoding=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  add_missing_dependencies(self, node, depgraph)
     |
     |  find_label_name(self, name, node, depgraph, unique_index)
     |
     |  get_GlueFormula_factory(self)
     |
     |  get_glueformulas_from_semtype_entry(self, lookup, word, node, depgraph, counter)
     |
     |  get_label(self, node)
     |      Pick an alphabetic character as identifier for an entity in the model.
     |
     |      :param value: where to index into the list of characters
     |      :type value: int
     |
     |  get_meaning_formula(self, generic, word)
     |      :param generic: A meaning formula string containing the
     |          parameter "<word>"
     |      :param word: The actual word to be replace "<word>"
     |
     |  get_semtypes(self, node)
     |      Based on the node, return a list of plausible semtypes in order of
     |      plausibility.
     |
     |  initialize_labels(self, expr, node, depgraph, unique_index)
     |
     |  lookup(self, node, depgraph, counter)
     |
     |  lookup_unique(self, rel, node, depgraph)
     |      Lookup 'key'. There should be exactly one item in the associated relation.
     |
     |  read_file(self, empty_first=True)
     |
     |  to_glueformula_list(self, depgraph, node=None, counter=None, verbose=False)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  copy(...)
     |      D.copy() -> a shallow copy of D
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

    class GlueFormula(builtins.object)
     |  GlueFormula(meaning, glue, indices=None)
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __init__(self, meaning, glue, indices=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  applyto(self, arg)
     |      self = (\x.(walk x), (subj -o f))
     |      arg  = (john        ,  subj)
     |      returns ((walk john),          f)
     |
     |  compile(self, counter=None)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |  lambda_abstract(self, other)
     |
     |  make_LambdaExpression(self, variable, term)
     |
     |  make_VariableExpression(self, name)
     |
     |  simplify(self)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None

FUNCTIONS
    demo(show_example=-1)

DATA
    OPTIONAL_RELATIONSHIPS = ['nmod', 'vmod', 'punct']
    SPEC_SEMTYPES = {'a': 'ex_quant', 'an': 'ex_quant', 'default': 'ex_qua...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\sem\glue.py

nltk.grammar
Python Library Documentation: module nltk.grammar in nltk

NAME
    nltk.grammar

DESCRIPTION
    Basic data classes for representing context free grammars.  A
    "grammar" specifies which trees can represent the structure of a
    given text.  Each of these trees is called a "parse tree" for the
    text (or simply a "parse").  In a "context free" grammar, the set of
    parse trees for any piece of a text can depend only on that piece, and
    not on the rest of the text (i.e., the piece's context).  Context free
    grammars are often used to find possible syntactic structures for
    sentences.  In this context, the leaves of a parse tree are word
    tokens; and the node values are phrasal categories, such as ``NP``
    and ``VP``.

    The ``CFG`` class is used to encode context free grammars.  Each
    ``CFG`` consists of a start symbol and a set of productions.
    The "start symbol" specifies the root node value for parse trees.  For example,
    the start symbol for syntactic parsing is usually ``S``.  Start
    symbols are encoded using the ``Nonterminal`` class, which is discussed
    below.

    A Grammar's "productions" specify what parent-child relationships a parse
    tree can contain.  Each production specifies that a particular
    node can be the parent of a particular set of children.  For example,
    the production ``<S> -> <NP> <VP>`` specifies that an ``S`` node can
    be the parent of an ``NP`` node and a ``VP`` node.

    Grammar productions are implemented by the ``Production`` class.
    Each ``Production`` consists of a left hand side and a right hand
    side.  The "left hand side" is a ``Nonterminal`` that specifies the
    node type for a potential parent; and the "right hand side" is a list
    that specifies allowable children for that parent.  This lists
    consists of ``Nonterminals`` and text types: each ``Nonterminal``
    indicates that the corresponding child may be a ``TreeToken`` with the
    specified node type; and each text type indicates that the
    corresponding child may be a ``Token`` with the with that type.

    The ``Nonterminal`` class is used to distinguish node values from leaf
    values.  This prevents the grammar from accidentally using a leaf
    value (such as the English word "A") as the node of a subtree.  Within
    a ``CFG``, all node values are wrapped in the ``Nonterminal``
    class. Note, however, that the trees that are specified by the grammar do
    *not* include these ``Nonterminal`` wrappers.

    Grammars can also be given a more procedural interpretation.  According to
    this interpretation, a Grammar specifies any tree structure *tree* that
    can be produced by the following procedure:

    | Set tree to the start symbol
    | Repeat until tree contains no more nonterminal leaves:
    |   Choose a production prod with whose left hand side
    |     lhs is a nonterminal leaf of tree.
    |   Replace the nonterminal leaf with a subtree, whose node
    |     value is the value wrapped by the nonterminal lhs, and
    |     whose children are the right hand side of prod.

    The operation of replacing the left hand side (*lhs*) of a production
    with the right hand side (*rhs*) in a tree (*tree*) is known as
    "expanding" *lhs* to *rhs* in *tree*.

CLASSES
    builtins.object
        CFG
            PCFG
        DependencyGrammar
        Nonterminal
        ProbabilisticDependencyGrammar
        Production
            DependencyProduction
            ProbabilisticProduction(Production, nltk.probability.ImmutableProbabilisticMixIn)

    class CFG(builtins.object)
     |  CFG(start, productions, calculate_leftcorners=True)
     |
     |  A context-free grammar.  A grammar consists of a start state and
     |  a set of productions.  The set of terminals and nonterminals is
     |  implicitly specified by the productions.
     |
     |  If you need efficient key-based access to productions, you
     |  can use a subclass to implement it.
     |
     |  Methods defined here:
     |
     |  __init__(self, start, productions, calculate_leftcorners=True)
     |      Create a new context-free grammar, from the given start state
     |      and set of ``Production`` instances.
     |
     |      :param start: The start symbol
     |      :type start: Nonterminal
     |      :param productions: The list of productions that defines the grammar
     |      :type productions: list(Production)
     |      :param calculate_leftcorners: False if we don't want to calculate the
     |          leftcorner relation. In that case, some optimized chart parsers won't work.
     |      :type calculate_leftcorners: bool
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  check_coverage(self, tokens)
     |      Check whether the grammar rules cover the given list of tokens.
     |      If not, then raise an exception.
     |
     |      :type tokens: list(str)
     |
     |  chomsky_normal_form(self, new_token_padding='@$@', flexible=False)
     |      Returns a new Grammar that is in chomsky normal
     |
     |      :param: new_token_padding
     |          Customise new rule formation during binarisation
     |
     |  is_binarised(self)
     |      Return True if all productions are at most binary.
     |      Note that there can still be empty and unary productions.
     |
     |  is_chomsky_normal_form(self)
     |      Return True if the grammar is of Chomsky Normal Form, i.e. all productions
     |      are of the form A -> B C, or A -> "s".
     |
     |  is_flexible_chomsky_normal_form(self)
     |      Return True if all productions are of the forms
     |      A -> B C, A -> B, or A -> "s".
     |
     |  is_leftcorner(self, cat, left)
     |      True if left is a leftcorner of cat, where left can be a
     |      terminal or a nonterminal.
     |
     |      :param cat: the parent of the leftcorner
     |      :type cat: Nonterminal
     |      :param left: the suggested leftcorner
     |      :type left: Terminal or Nonterminal
     |      :rtype: bool
     |
     |  is_lexical(self)
     |      Return True if all productions are lexicalised.
     |
     |  is_nonempty(self)
     |      Return True if there are no empty productions.
     |
     |  is_nonlexical(self)
     |      Return True if all lexical rules are "preterminals", that is,
     |      unary rules which can be separated in a preprocessing step.
     |
     |      This means that all productions are of the forms
     |      A -> B1 ... Bn (n>=0), or A -> "s".
     |
     |      Note: is_lexical() and is_nonlexical() are not opposites.
     |      There are grammars which are neither, and grammars which are both.
     |
     |  leftcorner_parents(self, cat)
     |      Return the set of all nonterminals for which the given category
     |      is a left corner. This is the inverse of the leftcorner relation.
     |
     |      :param cat: the suggested leftcorner
     |      :type cat: Nonterminal
     |      :return: the set of all parents to the leftcorner
     |      :rtype: set(Nonterminal)
     |
     |  leftcorners(self, cat)
     |      Return the set of all nonterminals that the given nonterminal
     |      can start with, including itself.
     |
     |      This is the reflexive, transitive closure of the immediate
     |      leftcorner relation:  (A > B)  iff  (A -> B beta)
     |
     |      :param cat: the parent of the leftcorners
     |      :type cat: Nonterminal
     |      :return: the set of all leftcorners
     |      :rtype: set(Nonterminal)
     |
     |  max_len(self)
     |      Return the right-hand side length of the longest grammar production.
     |
     |  min_len(self)
     |      Return the right-hand side length of the shortest grammar production.
     |
     |  productions(self, lhs=None, rhs=None, empty=False)
     |      Return the grammar productions, filtered by the left-hand side
     |      or the first item in the right-hand side.
     |
     |      :param lhs: Only return productions with the given left-hand side.
     |      :param rhs: Only return productions with the given first item
     |          in the right-hand side.
     |      :param empty: Only return productions with an empty right-hand side.
     |      :return: A list of productions matching the given constraints.
     |      :rtype: list(Production)
     |
     |  start(self)
     |      Return the start symbol of the grammar
     |
     |      :rtype: Nonterminal
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  binarize(grammar, padding='@$@')
     |      Convert all non-binary rules into binary by introducing
     |      new tokens.
     |      Example::
     |
     |          Original:
     |              A => B C D
     |          After Conversion:
     |              A => B A@$@B
     |              A@$@B => C D
     |
     |  eliminate_start(grammar)
     |      Eliminate start rule in case it appears on RHS
     |      Example: S -> S0 S1 and S0 -> S1 S
     |      Then another rule S0_Sigma -> S is added
     |
     |  fromstring(input, encoding=None)
     |      Return the grammar instance corresponding to the input string(s).
     |
     |      :param input: a grammar, either in the form of a string or as a list of strings.
     |
     |  remove_mixed_rules(grammar, padding='@$@')
     |      Convert all mixed rules containing terminals and non-terminals
     |      into dummy non-terminals.
     |      Example::
     |
     |          Original:
     |              A => term B
     |          After Conversion:
     |              A => TERM@$@TERM B
     |              TERM@$@TERM => term
     |
     |  remove_unitary_rules(grammar)
     |      Remove nonlexical unitary rules and convert them to
     |      lexical
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DependencyGrammar(builtins.object)
     |  DependencyGrammar(productions)
     |
     |  A dependency grammar.  A DependencyGrammar consists of a set of
     |  productions.  Each production specifies a head/modifier relationship
     |  between a pair of words.
     |
     |  Methods defined here:
     |
     |  __contains__(self, head_mod)
     |      Return True if this ``DependencyGrammar`` contains a
     |      ``DependencyProduction`` mapping 'head' to 'mod'.
     |
     |      :param head_mod: A tuple of a head word and a mod word,
     |          to test as a modifier of 'head'.
     |      :type head: Tuple[str, str]
     |      :rtype: bool
     |
     |  __init__(self, productions)
     |      Create a new dependency grammar, from the set of ``Productions``.
     |
     |      :param productions: The list of productions that defines the grammar
     |      :type productions: list(Production)
     |
     |  __repr__(self)
     |      Return a concise string representation of the ``DependencyGrammar``
     |
     |  __str__(self)
     |      Return a verbose string representation of the ``DependencyGrammar``
     |
     |      :rtype: str
     |
     |  contains(self, head, mod)
     |      :param head: A head word.
     |      :type head: str
     |      :param mod: A mod word, to test as a modifier of 'head'.
     |      :type mod: str
     |
     |      :return: true if this ``DependencyGrammar`` contains a
     |          ``DependencyProduction`` mapping 'head' to 'mod'.
     |      :rtype: bool
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  fromstring(input)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DependencyProduction(Production)
     |  DependencyProduction(lhs, rhs)
     |
     |  A dependency grammar production.  Each production maps a single
     |  head word to an unordered list of one or more modifier words.
     |
     |  Method resolution order:
     |      DependencyProduction
     |      Production
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __str__(self)
     |      Return a verbose string representation of the ``DependencyProduction``.
     |
     |      :rtype: str
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Production:
     |
     |  __eq__(self, other)
     |      Return True if this ``Production`` is equal to ``other``.
     |
     |      :rtype: bool
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return a hash value for the ``Production``.
     |
     |      :rtype: int
     |
     |  __init__(self, lhs, rhs)
     |      Construct a new ``Production``.
     |
     |      :param lhs: The left-hand side of the new ``Production``.
     |      :type lhs: Nonterminal
     |      :param rhs: The right-hand side of the new ``Production``.
     |      :type rhs: sequence(Nonterminal and terminal)
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __len__(self)
     |      Return the length of the right-hand side.
     |
     |      :rtype: int
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return a concise string representation of the ``Production``.
     |
     |      :rtype: str
     |
     |  is_lexical(self)
     |      Return True if the right-hand contain at least one terminal token.
     |
     |      :rtype: bool
     |
     |  is_nonlexical(self)
     |      Return True if the right-hand side only contains ``Nonterminals``
     |
     |      :rtype: bool
     |
     |  lhs(self)
     |      Return the left-hand side of this ``Production``.
     |
     |      :rtype: Nonterminal
     |
     |  rhs(self)
     |      Return the right-hand side of this ``Production``.
     |
     |      :rtype: sequence(Nonterminal and terminal)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Production:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Nonterminal(builtins.object)
     |  Nonterminal(symbol)
     |
     |  A non-terminal symbol for a context free grammar.  ``Nonterminal``
     |  is a wrapper class for node values; it is used by ``Production``
     |  objects to distinguish node values from leaf values.
     |  The node value that is wrapped by a ``Nonterminal`` is known as its
     |  "symbol".  Symbols are typically strings representing phrasal
     |  categories (such as ``"NP"`` or ``"VP"``).  However, more complex
     |  symbol types are sometimes used (e.g., for lexicalized grammars).
     |  Since symbols are node values, they must be immutable and
     |  hashable.  Two ``Nonterminals`` are considered equal if their
     |  symbols are equal.
     |
     |  :see: ``CFG``, ``Production``
     |  :type _symbol: any
     |  :ivar _symbol: The node value corresponding to this
     |      ``Nonterminal``.  This value must be immutable and hashable.
     |
     |  Methods defined here:
     |
     |  __div__(self, rhs)
     |      Return a new nonterminal whose symbol is ``A/B``, where ``A`` is
     |      the symbol for this nonterminal, and ``B`` is the symbol for rhs.
     |
     |      :param rhs: The nonterminal used to form the right hand side
     |          of the new nonterminal.
     |      :type rhs: Nonterminal
     |      :rtype: Nonterminal
     |
     |  __eq__(self, other)
     |      Return True if this non-terminal is equal to ``other``.  In
     |      particular, return True if ``other`` is a ``Nonterminal``
     |      and this non-terminal's symbol is equal to ``other`` 's symbol.
     |
     |      :rtype: bool
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, symbol)
     |      Construct a new non-terminal from the given symbol.
     |
     |      :type symbol: any
     |      :param symbol: The node value corresponding to this
     |          ``Nonterminal``.  This value must be immutable and
     |          hashable.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return a string representation for this ``Nonterminal``.
     |
     |      :rtype: str
     |
     |  __str__(self)
     |      Return a string representation for this ``Nonterminal``.
     |
     |      :rtype: str
     |
     |  __truediv__(self, rhs)
     |      Return a new nonterminal whose symbol is ``A/B``, where ``A`` is
     |      the symbol for this nonterminal, and ``B`` is the symbol for rhs.
     |      This function allows use of the slash ``/`` operator with
     |      the future import of division.
     |
     |      :param rhs: The nonterminal used to form the right hand side
     |          of the new nonterminal.
     |      :type rhs: Nonterminal
     |      :rtype: Nonterminal
     |
     |  symbol(self)
     |      Return the node value corresponding to this ``Nonterminal``.
     |
     |      :rtype: (any)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class PCFG(CFG)
     |  PCFG(start, productions, calculate_leftcorners=True)
     |
     |  A probabilistic context-free grammar.  A PCFG consists of a
     |  start state and a set of productions with probabilities.  The set of
     |  terminals and nonterminals is implicitly specified by the productions.
     |
     |  PCFG productions use the ``ProbabilisticProduction`` class.
     |  ``PCFGs`` impose the constraint that the set of productions with
     |  any given left-hand-side must have probabilities that sum to 1
     |  (allowing for a small margin of error).
     |
     |  If you need efficient key-based access to productions, you can use
     |  a subclass to implement it.
     |
     |  :type EPSILON: float
     |  :cvar EPSILON: The acceptable margin of error for checking that
     |      productions with a given left-hand side have probabilities
     |      that sum to 1.
     |
     |  Method resolution order:
     |      PCFG
     |      CFG
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, start, productions, calculate_leftcorners=True)
     |      Create a new context-free grammar, from the given start state
     |      and set of ``ProbabilisticProductions``.
     |
     |      :param start: The start symbol
     |      :type start: Nonterminal
     |      :param productions: The list of productions that defines the grammar
     |      :type productions: list(Production)
     |      :raise ValueError: if the set of productions with any left-hand-side
     |          do not have probabilities that sum to a value within
     |          EPSILON of 1.
     |      :param calculate_leftcorners: False if we don't want to calculate the
     |          leftcorner relation. In that case, some optimized chart parsers won't work.
     |      :type calculate_leftcorners: bool
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  fromstring(input, encoding=None)
     |      Return a probabilistic context-free grammar corresponding to the
     |      input string(s).
     |
     |      :param input: a grammar, either in the form of a string or else
     |           as a list of strings.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  EPSILON = 0.01
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from CFG:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  check_coverage(self, tokens)
     |      Check whether the grammar rules cover the given list of tokens.
     |      If not, then raise an exception.
     |
     |      :type tokens: list(str)
     |
     |  chomsky_normal_form(self, new_token_padding='@$@', flexible=False)
     |      Returns a new Grammar that is in chomsky normal
     |
     |      :param: new_token_padding
     |          Customise new rule formation during binarisation
     |
     |  is_binarised(self)
     |      Return True if all productions are at most binary.
     |      Note that there can still be empty and unary productions.
     |
     |  is_chomsky_normal_form(self)
     |      Return True if the grammar is of Chomsky Normal Form, i.e. all productions
     |      are of the form A -> B C, or A -> "s".
     |
     |  is_flexible_chomsky_normal_form(self)
     |      Return True if all productions are of the forms
     |      A -> B C, A -> B, or A -> "s".
     |
     |  is_leftcorner(self, cat, left)
     |      True if left is a leftcorner of cat, where left can be a
     |      terminal or a nonterminal.
     |
     |      :param cat: the parent of the leftcorner
     |      :type cat: Nonterminal
     |      :param left: the suggested leftcorner
     |      :type left: Terminal or Nonterminal
     |      :rtype: bool
     |
     |  is_lexical(self)
     |      Return True if all productions are lexicalised.
     |
     |  is_nonempty(self)
     |      Return True if there are no empty productions.
     |
     |  is_nonlexical(self)
     |      Return True if all lexical rules are "preterminals", that is,
     |      unary rules which can be separated in a preprocessing step.
     |
     |      This means that all productions are of the forms
     |      A -> B1 ... Bn (n>=0), or A -> "s".
     |
     |      Note: is_lexical() and is_nonlexical() are not opposites.
     |      There are grammars which are neither, and grammars which are both.
     |
     |  leftcorner_parents(self, cat)
     |      Return the set of all nonterminals for which the given category
     |      is a left corner. This is the inverse of the leftcorner relation.
     |
     |      :param cat: the suggested leftcorner
     |      :type cat: Nonterminal
     |      :return: the set of all parents to the leftcorner
     |      :rtype: set(Nonterminal)
     |
     |  leftcorners(self, cat)
     |      Return the set of all nonterminals that the given nonterminal
     |      can start with, including itself.
     |
     |      This is the reflexive, transitive closure of the immediate
     |      leftcorner relation:  (A > B)  iff  (A -> B beta)
     |
     |      :param cat: the parent of the leftcorners
     |      :type cat: Nonterminal
     |      :return: the set of all leftcorners
     |      :rtype: set(Nonterminal)
     |
     |  max_len(self)
     |      Return the right-hand side length of the longest grammar production.
     |
     |  min_len(self)
     |      Return the right-hand side length of the shortest grammar production.
     |
     |  productions(self, lhs=None, rhs=None, empty=False)
     |      Return the grammar productions, filtered by the left-hand side
     |      or the first item in the right-hand side.
     |
     |      :param lhs: Only return productions with the given left-hand side.
     |      :param rhs: Only return productions with the given first item
     |          in the right-hand side.
     |      :param empty: Only return productions with an empty right-hand side.
     |      :return: A list of productions matching the given constraints.
     |      :rtype: list(Production)
     |
     |  start(self)
     |      Return the start symbol of the grammar
     |
     |      :rtype: Nonterminal
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from CFG:
     |
     |  binarize(grammar, padding='@$@')
     |      Convert all non-binary rules into binary by introducing
     |      new tokens.
     |      Example::
     |
     |          Original:
     |              A => B C D
     |          After Conversion:
     |              A => B A@$@B
     |              A@$@B => C D
     |
     |  eliminate_start(grammar)
     |      Eliminate start rule in case it appears on RHS
     |      Example: S -> S0 S1 and S0 -> S1 S
     |      Then another rule S0_Sigma -> S is added
     |
     |  remove_mixed_rules(grammar, padding='@$@')
     |      Convert all mixed rules containing terminals and non-terminals
     |      into dummy non-terminals.
     |      Example::
     |
     |          Original:
     |              A => term B
     |          After Conversion:
     |              A => TERM@$@TERM B
     |              TERM@$@TERM => term
     |
     |  remove_unitary_rules(grammar)
     |      Remove nonlexical unitary rules and convert them to
     |      lexical
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from CFG:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProbabilisticDependencyGrammar(builtins.object)
     |  ProbabilisticDependencyGrammar(productions, events, tags)
     |
     |  Methods defined here:
     |
     |  __init__(self, productions, events, tags)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return a concise string representation of the ``ProbabilisticDependencyGrammar``
     |
     |  __str__(self)
     |      Return a verbose string representation of the ``ProbabilisticDependencyGrammar``
     |
     |      :rtype: str
     |
     |  contains(self, head, mod)
     |      Return True if this ``DependencyGrammar`` contains a
     |      ``DependencyProduction`` mapping 'head' to 'mod'.
     |
     |      :param head: A head word.
     |      :type head: str
     |      :param mod: A mod word, to test as a modifier of 'head'.
     |      :type mod: str
     |      :rtype: bool
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProbabilisticProduction(Production, nltk.probability.ImmutableProbabilisticMixIn)
     |  ProbabilisticProduction(lhs, rhs, **prob)
     |
     |  A probabilistic context free grammar production.
     |  A PCFG ``ProbabilisticProduction`` is essentially just a ``Production`` that
     |  has an associated probability, which represents how likely it is that
     |  this production will be used.  In particular, the probability of a
     |  ``ProbabilisticProduction`` records the likelihood that its right-hand side is
     |  the correct instantiation for any given occurrence of its left-hand side.
     |
     |  :see: ``Production``
     |
     |  Method resolution order:
     |      ProbabilisticProduction
     |      Production
     |      nltk.probability.ImmutableProbabilisticMixIn
     |      nltk.probability.ProbabilisticMixIn
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return True if this ``Production`` is equal to ``other``.
     |
     |      :rtype: bool
     |
     |  __hash__(self)
     |      Return a hash value for the ``Production``.
     |
     |      :rtype: int
     |
     |  __init__(self, lhs, rhs, **prob)
     |      Construct a new ``ProbabilisticProduction``.
     |
     |      :param lhs: The left-hand side of the new ``ProbabilisticProduction``.
     |      :type lhs: Nonterminal
     |      :param rhs: The right-hand side of the new ``ProbabilisticProduction``.
     |      :type rhs: sequence(Nonterminal and terminal)
     |      :param prob: Probability parameters of the new ``ProbabilisticProduction``.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __str__(self)
     |      Return a verbose string representation of the ``Production``.
     |
     |      :rtype: str
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Production:
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __len__(self)
     |      Return the length of the right-hand side.
     |
     |      :rtype: int
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return a concise string representation of the ``Production``.
     |
     |      :rtype: str
     |
     |  is_lexical(self)
     |      Return True if the right-hand contain at least one terminal token.
     |
     |      :rtype: bool
     |
     |  is_nonlexical(self)
     |      Return True if the right-hand side only contains ``Nonterminals``
     |
     |      :rtype: bool
     |
     |  lhs(self)
     |      Return the left-hand side of this ``Production``.
     |
     |      :rtype: Nonterminal
     |
     |  rhs(self)
     |      Return the right-hand side of this ``Production``.
     |
     |      :rtype: sequence(Nonterminal and terminal)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Production:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.probability.ImmutableProbabilisticMixIn:
     |
     |  set_logprob(self, prob)
     |      Set the log probability associated with this object to
     |      ``logprob``.  I.e., set the probability associated with this
     |      object to ``2**(logprob)``.
     |
     |      :param logprob: The new log probability
     |      :type logprob: float
     |
     |  set_prob(self, prob)
     |      Set the probability associated with this object to ``prob``.
     |
     |      :param prob: The new probability
     |      :type prob: float
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.probability.ProbabilisticMixIn:
     |
     |  logprob(self)
     |      Return ``log(p)``, where ``p`` is the probability associated
     |      with this object.
     |
     |      :rtype: float
     |
     |  prob(self)
     |      Return the probability associated with this object.
     |
     |      :rtype: float

    class Production(builtins.object)
     |  Production(lhs, rhs)
     |
     |  A grammar production.  Each production maps a single symbol
     |  on the "left-hand side" to a sequence of symbols on the
     |  "right-hand side".  (In the case of context-free productions,
     |  the left-hand side must be a ``Nonterminal``, and the right-hand
     |  side is a sequence of terminals and ``Nonterminals``.)
     |  "terminals" can be any immutable hashable object that is
     |  not a ``Nonterminal``.  Typically, terminals are strings
     |  representing words, such as ``"dog"`` or ``"under"``.
     |
     |  :see: ``CFG``
     |  :see: ``DependencyGrammar``
     |  :see: ``Nonterminal``
     |  :type _lhs: Nonterminal
     |  :ivar _lhs: The left-hand side of the production.
     |  :type _rhs: tuple(Nonterminal, terminal)
     |  :ivar _rhs: The right-hand side of the production.
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return True if this ``Production`` is equal to ``other``.
     |
     |      :rtype: bool
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return a hash value for the ``Production``.
     |
     |      :rtype: int
     |
     |  __init__(self, lhs, rhs)
     |      Construct a new ``Production``.
     |
     |      :param lhs: The left-hand side of the new ``Production``.
     |      :type lhs: Nonterminal
     |      :param rhs: The right-hand side of the new ``Production``.
     |      :type rhs: sequence(Nonterminal and terminal)
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __len__(self)
     |      Return the length of the right-hand side.
     |
     |      :rtype: int
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return a concise string representation of the ``Production``.
     |
     |      :rtype: str
     |
     |  __str__(self)
     |      Return a verbose string representation of the ``Production``.
     |
     |      :rtype: str
     |
     |  is_lexical(self)
     |      Return True if the right-hand contain at least one terminal token.
     |
     |      :rtype: bool
     |
     |  is_nonlexical(self)
     |      Return True if the right-hand side only contains ``Nonterminals``
     |
     |      :rtype: bool
     |
     |  lhs(self)
     |      Return the left-hand side of this ``Production``.
     |
     |      :rtype: Nonterminal
     |
     |  rhs(self)
     |      Return the right-hand side of this ``Production``.
     |
     |      :rtype: sequence(Nonterminal and terminal)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    induce_pcfg(start, productions)
        Induce a PCFG grammar from a list of productions.

        The probability of a production A -> B C in a PCFG is:

        |                count(A -> B C)
        |  P(B, C | A) = ---------------       where \* is any right hand side
        |                 count(A -> \*)

        :param start: The start symbol
        :type start: Nonterminal
        :param productions: The list of productions that defines the grammar
        :type productions: list(Production)

    nonterminals(symbols)
        Given a string containing a list of symbol names, return a list of
        ``Nonterminals`` constructed from those symbols.

        :param symbols: The symbol name string.  This string can be
            delimited by either spaces or commas.
        :type symbols: str
        :return: A list of ``Nonterminals`` constructed from the symbol
            names given in ``symbols``.  The ``Nonterminals`` are sorted
            in the same order as the symbols names.
        :rtype: list(Nonterminal)

    read_grammar(input, nonterm_parser, probabilistic=False, encoding=None)
        Return a pair consisting of a starting category and a list of
        ``Productions``.

        :param input: a grammar, either in the form of a string or else
            as a list of strings.
        :param nonterm_parser: a function for parsing nonterminals.
            It should take a ``(string, position)`` as argument and
            return a ``(nonterminal, position)`` as result.
        :param probabilistic: are the grammar rules probabilistic?
        :type probabilistic: bool
        :param encoding: the encoding of the grammar, if it is a binary string
        :type encoding: str

DATA
    __all__ = ['Nonterminal', 'nonterminals', 'CFG', 'Production', 'PCFG',...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\grammar.py

nltk.grow_diag_final_and
Python Library Documentation: function grow_diag_final_and in module nltk.translate.gdfa

grow_diag_final_and(srclen, trglen, e2f, f2e)
    This module symmetrisatizes the source-to-target and target-to-source
    word alignment output and produces, aka. GDFA algorithm (Koehn, 2005).

    Step 1: Find the intersection of the bidirectional alignment.

    Step 2: Search for additional neighbor alignment points to be added, given
            these criteria: (i) neighbor alignments points are not in the
            intersection and (ii) neighbor alignments are in the union.

    Step 3: Add all other alignment points that are not in the intersection, not in
            the neighboring alignments that met the criteria but in the original
            forward/backward alignment outputs.

        >>> forw = ('0-0 2-1 9-2 21-3 10-4 7-5 11-6 9-7 12-8 1-9 3-10 '
        ...         '4-11 17-12 17-13 25-14 13-15 24-16 11-17 28-18')
        >>> back = ('0-0 1-9 2-9 3-10 4-11 5-12 6-6 7-5 8-6 9-7 10-4 '
        ...         '11-6 12-8 13-12 15-12 17-13 18-13 19-12 20-13 '
        ...         '21-3 22-12 23-14 24-17 25-15 26-17 27-18 28-18')
        >>> srctext = ("この よう な ハロー 白色 わい 星 の L 関数 "
        ...            "は L と 共 に 不連続 に 増加 する こと が "
        ...            "期待 さ れる こと を 示し た 。")
        >>> trgtext = ("Therefore , we expect that the luminosity function "
        ...            "of such halo white dwarfs increases discontinuously "
        ...            "with the luminosity .")
        >>> srclen = len(srctext.split())
        >>> trglen = len(trgtext.split())
        >>>
        >>> gdfa = grow_diag_final_and(srclen, trglen, forw, back)
        >>> gdfa == sorted(set([(28, 18), (6, 6), (24, 17), (2, 1), (15, 12), (13, 12),
        ...         (2, 9), (3, 10), (26, 17), (25, 15), (8, 6), (9, 7), (20,
        ...         13), (18, 13), (0, 0), (10, 4), (13, 15), (23, 14), (7, 5),
        ...         (25, 14), (1, 9), (17, 13), (4, 11), (11, 17), (9, 2), (22,
        ...         12), (27, 18), (24, 16), (21, 3), (19, 12), (17, 12), (5,
        ...         12), (11, 6), (12, 8)]))
        True

    References:
    Koehn, P., A. Axelrod, A. Birch, C. Callison, M. Osborne, and D. Talbot.
    2005. Edinburgh System Description for the 2005 IWSLT Speech
    Translation Evaluation. In MT Eval Workshop.

    :type srclen: int
    :param srclen: the number of tokens in the source language
    :type trglen: int
    :param trglen: the number of tokens in the target language
    :type e2f: str
    :param e2f: the forward word alignment outputs from source-to-target
                language (in pharaoh output format)
    :type f2e: str
    :param f2e: the backward word alignment outputs from target-to-source
                language (in pharaoh output format)
    :rtype: set(tuple(int))
    :return: the symmetrized alignment points from the GDFA algorithm
nltk.guess_encoding
Python Library Documentation: function guess_encoding in module nltk.util

guess_encoding(data)
    Given a byte string, attempt to decode it.
    Tries the standard 'UTF8' and 'latin-1' encodings,
    Plus several gathered from locale information.

    The calling program *must* first call::

        locale.setlocale(locale.LC_ALL, '')

    If successful it returns ``(decoded_unicode, successful_encoding)``.
    If unsuccessful it raises a ``UnicodeError``.
nltk.help
Python Library Documentation: module nltk.help in nltk

NAME
    nltk.help - Provide structured access to documentation.

FUNCTIONS
    brown_tagset(tagpattern=None)

    claws5_tagset(tagpattern=None)

    upenn_tagset(tagpattern=None)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\help.py

nltk.hmm
Python Library Documentation: module nltk.tag.hmm in nltk.tag

NAME
    nltk.tag.hmm

DESCRIPTION
    Hidden Markov Models (HMMs) largely used to assign the correct label sequence
    to sequential data or assess the probability of a given label and data
    sequence. These models are finite state machines characterised by a number of
    states, transitions between these states, and output symbols emitted while in
    each state. The HMM is an extension to the Markov chain, where each state
    corresponds deterministically to a given event. In the HMM the observation is
    a probabilistic function of the state. HMMs share the Markov chain's
    assumption, being that the probability of transition from one state to another
    only depends on the current state - i.e. the series of states that led to the
    current state are not used. They are also time invariant.

    The HMM is a directed graph, with probability weighted edges (representing the
    probability of a transition between the source and sink states) where each
    vertex emits an output symbol when entered. The symbol (or observation) is
    non-deterministically generated. For this reason, knowing that a sequence of
    output observations was generated by a given HMM does not mean that the
    corresponding sequence of states (and what the current state is) is known.
    This is the 'hidden' in the hidden markov model.

    Formally, a HMM can be characterised by:

    - the output observation alphabet. This is the set of symbols which may be
      observed as output of the system.
    - the set of states.
    - the transition probabilities *a_{ij} = P(s_t = j | s_{t-1} = i)*. These
      represent the probability of transition to each state from a given state.
    - the output probability matrix *b_i(k) = P(X_t = o_k | s_t = i)*. These
      represent the probability of observing each symbol in a given state.
    - the initial state distribution. This gives the probability of starting
      in each state.

    To ground this discussion, take a common NLP application, part-of-speech (POS)
    tagging. An HMM is desirable for this task as the highest probability tag
    sequence can be calculated for a given sequence of word forms. This differs
    from other tagging techniques which often tag each word individually, seeking
    to optimise each individual tagging greedily without regard to the optimal
    combination of tags for a larger unit, such as a sentence. The HMM does this
    with the Viterbi algorithm, which efficiently computes the optimal path
    through the graph given the sequence of words forms.

    In POS tagging the states usually have a 1:1 correspondence with the tag
    alphabet - i.e. each state represents a single tag. The output observation
    alphabet is the set of word forms (the lexicon), and the remaining three
    parameters are derived by a training regime. With this information the
    probability of a given sentence can be easily derived, by simply summing the
    probability of each distinct path through the model. Similarly, the highest
    probability tagging sequence can be derived with the Viterbi algorithm,
    yielding a state sequence which can be mapped into a tag sequence.

    This discussion assumes that the HMM has been trained. This is probably the
    most difficult task with the model, and requires either MLE estimates of the
    parameters or unsupervised learning using the Baum-Welch algorithm, a variant
    of EM.

    For more information, please consult the source code for this module,
    which includes extensive demonstration code.

CLASSES
    builtins.object
        HiddenMarkovModelTrainer
    nltk.tag.api.TaggerI(builtins.object)
        HiddenMarkovModelTagger

    class HiddenMarkovModelTagger(nltk.tag.api.TaggerI)
     |  HiddenMarkovModelTagger(symbols, states, transitions, outputs, priors, transform=<function _identity at 0x0000028F98B92480>)
     |
     |  Hidden Markov model class, a generative model for labelling sequence data.
     |  These models define the joint probability of a sequence of symbols and
     |  their labels (state transitions) as the product of the starting state
     |  probability, the probability of each state transition, and the probability
     |  of each observation being generated from each state. This is described in
     |  more detail in the module documentation.
     |
     |  This implementation is based on the HMM description in Chapter 8, Huang,
     |  Acero and Hon, Spoken Language Processing and includes an extension for
     |  training shallow HMM parsers or specialized HMMs as in Molina et.
     |  al, 2002.  A specialized HMM modifies training data by applying a
     |  specialization function to create a new training set that is more
     |  appropriate for sequential tagging with an HMM.  A typical use case is
     |  chunking.
     |
     |  :param symbols: the set of output symbols (alphabet)
     |  :type symbols: seq of any
     |  :param states: a set of states representing state space
     |  :type states: seq of any
     |  :param transitions: transition probabilities; Pr(s_i | s_j) is the
     |      probability of transition from state i given the model is in
     |      state_j
     |  :type transitions: ConditionalProbDistI
     |  :param outputs: output probabilities; Pr(o_k | s_i) is the probability
     |      of emitting symbol k when entering state i
     |  :type outputs: ConditionalProbDistI
     |  :param priors: initial state distribution; Pr(s_i) is the probability
     |      of starting in state i
     |  :type priors: ProbDistI
     |  :param transform: an optional function for transforming training
     |      instances, defaults to the identity function.
     |  :type transform: callable
     |
     |  Method resolution order:
     |      HiddenMarkovModelTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, symbols, states, transitions, outputs, priors, transform=<function _identity at 0x0000028F98B92480>)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  best_path(self, unlabeled_sequence)
     |      Returns the state sequence of the optimal (most probable) path through
     |      the HMM. Uses the Viterbi algorithm to calculate this part by dynamic
     |      programming.
     |
     |      :return: the state sequence
     |      :rtype: sequence of any
     |      :param unlabeled_sequence: the sequence of unlabeled symbols
     |      :type unlabeled_sequence: list
     |
     |  best_path_simple(self, unlabeled_sequence)
     |      Returns the state sequence of the optimal (most probable) path through
     |      the HMM. Uses the Viterbi algorithm to calculate this part by dynamic
     |      programming.  This uses a simple, direct method, and is included for
     |      teaching purposes.
     |
     |      :return: the state sequence
     |      :rtype: sequence of any
     |      :param unlabeled_sequence: the sequence of unlabeled symbols
     |      :type unlabeled_sequence: list
     |
     |  entropy(self, unlabeled_sequence)
     |      Returns the entropy over labellings of the given sequence. This is
     |      given by::
     |
     |          H(O) = - sum_S Pr(S | O) log Pr(S | O)
     |
     |      where the summation ranges over all state sequences, S. Let
     |      *Z = Pr(O) = sum_S Pr(S, O)}* where the summation ranges over all state
     |      sequences and O is the observation sequence. As such the entropy can
     |      be re-expressed as::
     |
     |          H = - sum_S Pr(S | O) log [ Pr(S, O) / Z ]
     |          = log Z - sum_S Pr(S | O) log Pr(S, 0)
     |          = log Z - sum_S Pr(S | O) [ log Pr(S_0) + sum_t Pr(S_t | S_{t-1}) + sum_t Pr(O_t | S_t) ]
     |
     |      The order of summation for the log terms can be flipped, allowing
     |      dynamic programming to be used to calculate the entropy. Specifically,
     |      we use the forward and backward probabilities (alpha, beta) giving::
     |
     |          H = log Z - sum_s0 alpha_0(s0) beta_0(s0) / Z * log Pr(s0)
     |          + sum_t,si,sj alpha_t(si) Pr(sj | si) Pr(O_t+1 | sj) beta_t(sj) / Z * log Pr(sj | si)
     |          + sum_t,st alpha_t(st) beta_t(st) / Z * log Pr(O_t | st)
     |
     |      This simply uses alpha and beta to find the probabilities of partial
     |      sequences, constrained to include the given state(s) at some point in
     |      time.
     |
     |  log_probability(self, sequence)
     |      Returns the log-probability of the given symbol sequence. If the
     |      sequence is labelled, then returns the joint log-probability of the
     |      symbol, state sequence. Otherwise, uses the forward algorithm to find
     |      the log-probability over all label sequences.
     |
     |      :return: the log-probability of the sequence
     |      :rtype: float
     |      :param sequence: the sequence of symbols which must contain the TEXT
     |          property, and optionally the TAG property
     |      :type sequence:  Token
     |
     |  point_entropy(self, unlabeled_sequence)
     |      Returns the pointwise entropy over the possible states at each
     |      position in the chain, given the observation sequence.
     |
     |  probability(self, sequence)
     |      Returns the probability of the given symbol sequence. If the sequence
     |      is labelled, then returns the joint probability of the symbol, state
     |      sequence. Otherwise, uses the forward algorithm to find the
     |      probability over all label sequences.
     |
     |      :return: the probability of the sequence
     |      :rtype: float
     |      :param sequence: the sequence of symbols which must contain the TEXT
     |          property, and optionally the TAG property
     |      :type sequence:  Token
     |
     |  random_sample(self, rng, length)
     |      Randomly sample the HMM to generate a sentence of a given length. This
     |      samples the prior distribution then the observation distribution and
     |      transition distribution for each subsequent observation and state.
     |      This will mostly generate unintelligible garbage, but can provide some
     |      amusement.
     |
     |      :return:        the randomly created state/observation sequence,
     |                      generated according to the HMM's probability
     |                      distributions. The SUBTOKENS have TEXT and TAG
     |                      properties containing the observation and state
     |                      respectively.
     |      :rtype:         list
     |      :param rng:     random number generator
     |      :type rng:      Random (or any object with a random() method)
     |      :param length:  desired output length
     |      :type length:   int
     |
     |  reset_cache(self)
     |
     |  tag(self, unlabeled_sequence)
     |      Tags the sequence with the highest probability state sequence. This
     |      uses the best_path method to find the Viterbi path.
     |
     |      :return: a labelled sequence of symbols
     |      :rtype: list
     |      :param unlabeled_sequence: the sequence of unlabeled symbols
     |      :type unlabeled_sequence: list
     |
     |  test(self, test_sequence, verbose=False, **kwargs)
     |      Tests the HiddenMarkovModelTagger instance.
     |
     |      :param test_sequence: a sequence of labeled test instances
     |      :type test_sequence: list(list)
     |      :param verbose: boolean flag indicating whether training should be
     |          verbose or include printed output
     |      :type verbose: bool
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  train(labeled_sequence, test_sequence=None, unlabeled_sequence=None, **kwargs)
     |      Train a new HiddenMarkovModelTagger using the given labeled and
     |      unlabeled training instances. Testing will be performed if test
     |      instances are provided.
     |
     |      :return: a hidden markov model tagger
     |      :rtype: HiddenMarkovModelTagger
     |      :param labeled_sequence: a sequence of labeled training instances,
     |          i.e. a list of sentences represented as tuples
     |      :type labeled_sequence: list(list)
     |      :param test_sequence: a sequence of labeled test instances
     |      :type test_sequence: list(list)
     |      :param unlabeled_sequence: a sequence of unlabeled training instances,
     |          i.e. a list of sentences represented as words
     |      :type unlabeled_sequence: list(list)
     |      :param transform: an optional function for transforming training
     |          instances, defaults to the identity function, see ``transform()``
     |      :type transform: function
     |      :param estimator: an optional function or class that maps a
     |          condition's frequency distribution to its probability
     |          distribution, defaults to a Lidstone distribution with gamma = 0.1
     |      :type estimator: class or function
     |      :param verbose: boolean flag indicating whether training should be
     |          verbose or include printed output
     |      :type verbose: bool
     |      :param max_iterations: number of Baum-Welch iterations to perform
     |      :type max_iterations: int
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class HiddenMarkovModelTrainer(builtins.object)
     |  HiddenMarkovModelTrainer(states=None, symbols=None)
     |
     |  Algorithms for learning HMM parameters from training data. These include
     |  both supervised learning (MLE) and unsupervised learning (Baum-Welch).
     |
     |  Creates an HMM trainer to induce an HMM with the given states and
     |  output symbol alphabet. A supervised and unsupervised training
     |  method may be used. If either of the states or symbols are not given,
     |  these may be derived from supervised training.
     |
     |  :param states:  the set of state labels
     |  :type states:   sequence of any
     |  :param symbols: the set of observation symbols
     |  :type symbols:  sequence of any
     |
     |  Methods defined here:
     |
     |  __init__(self, states=None, symbols=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  train(self, labeled_sequences=None, unlabeled_sequences=None, **kwargs)
     |      Trains the HMM using both (or either of) supervised and unsupervised
     |      techniques.
     |
     |      :return: the trained model
     |      :rtype: HiddenMarkovModelTagger
     |      :param labelled_sequences: the supervised training data, a set of
     |          labelled sequences of observations
     |          ex: [ (word_1, tag_1),...,(word_n,tag_n) ]
     |      :type labelled_sequences: list
     |      :param unlabeled_sequences: the unsupervised training data, a set of
     |          sequences of observations
     |          ex: [ word_1, ..., word_n ]
     |      :type unlabeled_sequences: list
     |      :param kwargs: additional arguments to pass to the training methods
     |
     |  train_supervised(self, labelled_sequences, estimator=None)
     |      Supervised training maximising the joint probability of the symbol and
     |      state sequences. This is done via collecting frequencies of
     |      transitions between states, symbol observations while within each
     |      state and which states start a sentence. These frequency distributions
     |      are then normalised into probability estimates, which can be
     |      smoothed if desired.
     |
     |      :return: the trained model
     |      :rtype: HiddenMarkovModelTagger
     |      :param labelled_sequences: the training data, a set of
     |          labelled sequences of observations
     |      :type labelled_sequences: list
     |      :param estimator: a function taking
     |          a FreqDist and a number of bins and returning a CProbDistI;
     |          otherwise a MLE estimate is used
     |
     |  train_unsupervised(self, unlabeled_sequences, update_outputs=True, **kwargs)
     |      Trains the HMM using the Baum-Welch algorithm to maximise the
     |      probability of the data sequence. This is a variant of the EM
     |      algorithm, and is unsupervised in that it doesn't need the state
     |      sequences for the symbols. The code is based on 'A Tutorial on Hidden
     |      Markov Models and Selected Applications in Speech Recognition',
     |      Lawrence Rabiner, IEEE, 1989.
     |
     |      :return: the trained model
     |      :rtype: HiddenMarkovModelTagger
     |      :param unlabeled_sequences: the training data, a set of
     |          sequences of observations
     |      :type unlabeled_sequences: list
     |
     |      kwargs may include following parameters:
     |
     |      :param model: a HiddenMarkovModelTagger instance used to begin
     |          the Baum-Welch algorithm
     |      :param max_iterations: the maximum number of EM iterations
     |      :param convergence_logprob: the maximum change in log probability to
     |          allow convergence
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()

    demo_bw()

    demo_pos()

    demo_pos_bw(test=10, supervised=20, unsupervised=10, verbose=True, max_iterations=5)

    load_pos(num_sents)

    logsumexp2(arr)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\hmm.py

nltk.hunpos
Python Library Documentation: module nltk.tag.hunpos in nltk.tag

NAME
    nltk.tag.hunpos - A module for interfacing with the HunPos open-source POS-tagger.

CLASSES
    nltk.tag.api.TaggerI(builtins.object)
        HunposTagger

    class HunposTagger(nltk.tag.api.TaggerI)
     |  HunposTagger(path_to_model, path_to_bin=None, encoding='ISO-8859-1', verbose=False)
     |
     |  A class for pos tagging with HunPos. The input is the paths to:
     |   - a model trained on training data
     |   - (optionally) the path to the hunpos-tag binary
     |   - (optionally) the encoding of the training data (default: ISO-8859-1)
     |
     |  Check whether the required "hunpos-tag" binary is available:
     |
     |      >>> from nltk.test.setup_fixt import check_binary
     |      >>> check_binary('hunpos-tag')
     |
     |  Example:
     |      >>> from nltk.tag import HunposTagger
     |      >>> ht = HunposTagger('en_wsj.model')
     |      >>> ht.tag('What is the airspeed of an unladen swallow ?'.split())
     |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'), ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'), ('unladen', 'NN'), ('swallow', 'VB'), ('?', '.')]
     |      >>> ht.close()
     |
     |  This class communicates with the hunpos-tag binary via pipes. When the
     |  tagger object is no longer needed, the close() method should be called to
     |  free system resources. The class supports the context manager interface; if
     |  used in a with statement, the close() method is invoked automatically:
     |
     |      >>> with HunposTagger('en_wsj.model') as ht:
     |      ...     ht.tag('What is the airspeed of an unladen swallow ?'.split())
     |      ...
     |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'), ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'), ('unladen', 'NN'), ('swallow', 'VB'), ('?', '.')]
     |
     |  Method resolution order:
     |      HunposTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __del__(self)
     |
     |  __enter__(self)
     |
     |  __exit__(self, exc_type, exc_value, traceback)
     |
     |  __init__(self, path_to_model, path_to_bin=None, encoding='ISO-8859-1', verbose=False)
     |      Starts the hunpos-tag executable and establishes a connection with it.
     |
     |      :param path_to_model: The model file.
     |      :param path_to_bin: The hunpos-tag binary.
     |      :param encoding: The encoding used by the model. Unicode tokens
     |          passed to the tag() and tag_sents() methods are converted to
     |          this charset when they are sent to hunpos-tag.
     |          The default is ISO-8859-1 (Latin-1).
     |
     |          This parameter is ignored for str tokens, which are sent as-is.
     |          The caller must ensure that tokens are encoded in the right charset.
     |
     |  close(self)
     |      Closes the pipe to the hunpos executable.
     |
     |  tag(self, tokens)
     |      Tags a single sentence: a list of words.
     |      The tokens should not contain any newline characters.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    PIPE = -1

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\hunpos.py

nltk.ibm1
Python Library Documentation: module nltk.translate.ibm1 in nltk.translate

NAME
    nltk.translate.ibm1 - Lexical translation model that ignores word order.

DESCRIPTION
    In IBM Model 1, word order is ignored for simplicity. As long as the
    word alignments are equivalent, it doesn't matter where the word occurs
    in the source or target sentence. Thus, the following three alignments
    are equally likely::

        Source: je mange du jambon
        Target: i eat some ham
        Alignment: (0,0) (1,1) (2,2) (3,3)

        Source: je mange du jambon
        Target: some ham eat i
        Alignment: (0,2) (1,3) (2,1) (3,1)

        Source: du jambon je mange
        Target: eat i some ham
        Alignment: (0,3) (1,2) (2,0) (3,1)

    Note that an alignment is represented here as
    (word_index_in_target, word_index_in_source).

    The EM algorithm used in Model 1 is:

    :E step: In the training data, count how many times a source language
             word is translated into a target language word, weighted by
             the prior probability of the translation.

    :M step: Estimate the new probability of translation based on the
             counts from the Expectation step.

    Notations
    ---------

    :i: Position in the source sentence
         Valid values are 0 (for NULL), 1, 2, ..., length of source sentence
    :j: Position in the target sentence
         Valid values are 1, 2, ..., length of target sentence
    :s: A word in the source language
    :t: A word in the target language

    References
    ----------

    Philipp Koehn. 2010. Statistical Machine Translation.
    Cambridge University Press, New York.

    Peter E Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and
    Robert L. Mercer. 1993. The Mathematics of Statistical Machine
    Translation: Parameter Estimation. Computational Linguistics, 19 (2),
    263-311.

CLASSES
    nltk.translate.ibm_model.IBMModel(builtins.object)
        IBMModel1

    class IBMModel1(nltk.translate.ibm_model.IBMModel)
     |  IBMModel1(sentence_aligned_corpus, iterations, probability_tables=None)
     |
     |  Lexical translation model that ignores word order
     |
     |  >>> bitext = []
     |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus', 'ist', 'ja', 'groß'], ['the', 'house', 'is', 'big']))
     |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
     |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
     |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
     |
     |  >>> ibm1 = IBMModel1(bitext, 5)
     |
     |  >>> print(round(ibm1.translation_table['buch']['book'], 3))
     |  0.889
     |  >>> print(round(ibm1.translation_table['das']['book'], 3))
     |  0.062
     |  >>> print(round(ibm1.translation_table['buch'][None], 3))
     |  0.113
     |  >>> print(round(ibm1.translation_table['ja'][None], 3))
     |  0.073
     |
     |  >>> test_sentence = bitext[2]
     |  >>> test_sentence.words
     |  ['das', 'buch', 'ist', 'ja', 'klein']
     |  >>> test_sentence.mots
     |  ['the', 'book', 'is', 'small']
     |  >>> test_sentence.alignment
     |  Alignment([(0, 0), (1, 1), (2, 2), (3, 2), (4, 3)])
     |
     |  Method resolution order:
     |      IBMModel1
     |      nltk.translate.ibm_model.IBMModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, sentence_aligned_corpus, iterations, probability_tables=None)
     |      Train on ``sentence_aligned_corpus`` and create a lexical
     |      translation model.
     |
     |      Translation direction is from ``AlignedSent.mots`` to
     |      ``AlignedSent.words``.
     |
     |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
     |      :type sentence_aligned_corpus: list(AlignedSent)
     |
     |      :param iterations: Number of iterations to run training algorithm
     |      :type iterations: int
     |
     |      :param probability_tables: Optional. Use this to pass in custom
     |          probability values. If not specified, probabilities will be
     |          set to a uniform distribution, or some other sensible value.
     |          If specified, the following entry must be present:
     |          ``translation_table``.
     |          See ``IBMModel`` for the type and purpose of this table.
     |      :type probability_tables: dict[str]: object
     |
     |  align(self, sentence_pair)
     |      Determines the best word alignment for one sentence pair from
     |      the corpus that the model was trained on.
     |
     |      The best alignment will be set in ``sentence_pair`` when the
     |      method returns. In contrast with the internal implementation of
     |      IBM models, the word indices in the ``Alignment`` are zero-
     |      indexed, not one-indexed.
     |
     |      :param sentence_pair: A sentence in the source language and its
     |          counterpart sentence in the target language
     |      :type sentence_pair: AlignedSent
     |
     |  align_all(self, parallel_corpus)
     |
     |  prob_alignment_point(self, s, t)
     |      Probability that word ``t`` in the target sentence is aligned to
     |      word ``s`` in the source sentence
     |
     |  prob_all_alignments(self, src_sentence, trg_sentence)
     |      Computes the probability of all possible word alignments,
     |      expressed as a marginal distribution over target words t
     |
     |      Each entry in the return value represents the contribution to
     |      the total alignment probability by the target word t.
     |
     |      To obtain probability(alignment | src_sentence, trg_sentence),
     |      simply sum the entries in the return value.
     |
     |      :return: Probability of t for all s in ``src_sentence``
     |      :rtype: dict(str): float
     |
     |  prob_t_a_given_s(self, alignment_info)
     |      Probability of target sentence and an alignment given the
     |      source sentence
     |
     |  set_uniform_probabilities(self, sentence_aligned_corpus)
     |      Initialize probability tables to a uniform distribution
     |
     |      Derived classes should implement this accordingly.
     |
     |  train(self, parallel_corpus)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
     |      Finds the best alignment according to IBM Model 2
     |
     |      Used as a starting point for hill climbing in Models 3 and
     |      above, because it is easier to compute than the best alignments
     |      in higher models
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to be word-aligned
     |      :type sentence_pair: AlignedSent
     |
     |      :param j_pegged: If specified, the alignment point of j_pegged
     |          will be fixed to i_pegged
     |      :type j_pegged: int
     |
     |      :param i_pegged: Alignment point to j_pegged
     |      :type i_pegged: int
     |
     |  hillclimb(self, alignment_info, j_pegged=None)
     |      Starting from the alignment in ``alignment_info``, look at
     |      neighboring alignments iteratively for the best one
     |
     |      There is no guarantee that the best alignment in the alignment
     |      space will be found, because the algorithm might be stuck in a
     |      local maximum.
     |
     |      :param j_pegged: If specified, the search will be constrained to
     |          alignments where ``j_pegged`` remains unchanged
     |      :type j_pegged: int
     |
     |      :return: The best alignment found from hill climbing
     |      :rtype: AlignmentInfo
     |
     |  init_vocab(self, sentence_aligned_corpus)
     |
     |  maximize_fertility_probabilities(self, counts)
     |
     |  maximize_lexical_translation_probabilities(self, counts)
     |
     |  maximize_null_generation_probabilities(self, counts)
     |
     |  neighboring(self, alignment_info, j_pegged=None)
     |      Determine the neighbors of ``alignment_info``, obtained by
     |      moving or swapping one alignment point
     |
     |      :param j_pegged: If specified, neighbors that have a different
     |          alignment point from j_pegged will not be considered
     |      :type j_pegged: int
     |
     |      :return: A set neighboring alignments represented by their
     |          ``AlignmentInfo``
     |      :rtype: set(AlignmentInfo)
     |
     |  prob_of_alignments(self, alignments)
     |
     |  reset_probabilities(self)
     |
     |  sample(self, sentence_pair)
     |      Sample the most probable alignments from the entire alignment
     |      space
     |
     |      First, determine the best alignment according to IBM Model 2.
     |      With this initial alignment, use hill climbing to determine the
     |      best alignment according to a higher IBM Model. Add this
     |      alignment and its neighbors to the sample set. Repeat this
     |      process with other initial alignments obtained by pegging an
     |      alignment point.
     |
     |      Hill climbing may be stuck in a local maxima, hence the pegging
     |      and trying out of different alignments.
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to generate a sample of alignments from
     |      :type sentence_pair: AlignedSent
     |
     |      :return: A set of best alignments represented by their ``AlignmentInfo``
     |          and the best alignment of the set for convenience
     |      :rtype: set(AlignmentInfo), AlignmentInfo
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  MIN_PROB = 1e-12

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\ibm1.py

nltk.ibm2
Python Library Documentation: module nltk.translate.ibm2 in nltk.translate

NAME
    nltk.translate.ibm2 - Lexical translation model that considers word order.

DESCRIPTION
    IBM Model 2 improves on Model 1 by accounting for word order.
    An alignment probability is introduced, a(i | j,l,m), which predicts
    a source word position, given its aligned target word's position.

    The EM algorithm used in Model 2 is:

    :E step: In the training data, collect counts, weighted by prior
             probabilities.

             - (a) count how many times a source language word is translated
                   into a target language word
             - (b) count how many times a particular position in the source
                   sentence is aligned to a particular position in the target
                   sentence

    :M step: Estimate new probabilities based on the counts from the E step

    Notations
    ---------

    :i: Position in the source sentence
         Valid values are 0 (for NULL), 1, 2, ..., length of source sentence
    :j: Position in the target sentence
         Valid values are 1, 2, ..., length of target sentence
    :l: Number of words in the source sentence, excluding NULL
    :m: Number of words in the target sentence
    :s: A word in the source language
    :t: A word in the target language

    References
    ----------

    Philipp Koehn. 2010. Statistical Machine Translation.
    Cambridge University Press, New York.

    Peter E Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and
    Robert L. Mercer. 1993. The Mathematics of Statistical Machine
    Translation: Parameter Estimation. Computational Linguistics, 19 (2),
    263-311.

CLASSES
    nltk.translate.ibm_model.Counts(builtins.object)
        Model2Counts
    nltk.translate.ibm_model.IBMModel(builtins.object)
        IBMModel2

    class IBMModel2(nltk.translate.ibm_model.IBMModel)
     |  IBMModel2(sentence_aligned_corpus, iterations, probability_tables=None)
     |
     |  Lexical translation model that considers word order
     |
     |  >>> bitext = []
     |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus', 'ist', 'ja', 'groß'], ['the', 'house', 'is', 'big']))
     |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
     |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
     |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
     |
     |  >>> ibm2 = IBMModel2(bitext, 5)
     |
     |  >>> print(round(ibm2.translation_table['buch']['book'], 3))
     |  1.0
     |  >>> print(round(ibm2.translation_table['das']['book'], 3))
     |  0.0
     |  >>> print(round(ibm2.translation_table['buch'][None], 3))
     |  0.0
     |  >>> print(round(ibm2.translation_table['ja'][None], 3))
     |  0.0
     |
     |  >>> print(round(ibm2.alignment_table[1][1][2][2], 3))
     |  0.939
     |  >>> print(round(ibm2.alignment_table[1][2][2][2], 3))
     |  0.0
     |  >>> print(round(ibm2.alignment_table[2][2][4][5], 3))
     |  1.0
     |
     |  >>> test_sentence = bitext[2]
     |  >>> test_sentence.words
     |  ['das', 'buch', 'ist', 'ja', 'klein']
     |  >>> test_sentence.mots
     |  ['the', 'book', 'is', 'small']
     |  >>> test_sentence.alignment
     |  Alignment([(0, 0), (1, 1), (2, 2), (3, 2), (4, 3)])
     |
     |  Method resolution order:
     |      IBMModel2
     |      nltk.translate.ibm_model.IBMModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, sentence_aligned_corpus, iterations, probability_tables=None)
     |      Train on ``sentence_aligned_corpus`` and create a lexical
     |      translation model and an alignment model.
     |
     |      Translation direction is from ``AlignedSent.mots`` to
     |      ``AlignedSent.words``.
     |
     |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
     |      :type sentence_aligned_corpus: list(AlignedSent)
     |
     |      :param iterations: Number of iterations to run training algorithm
     |      :type iterations: int
     |
     |      :param probability_tables: Optional. Use this to pass in custom
     |          probability values. If not specified, probabilities will be
     |          set to a uniform distribution, or some other sensible value.
     |          If specified, all the following entries must be present:
     |          ``translation_table``, ``alignment_table``.
     |          See ``IBMModel`` for the type and purpose of these tables.
     |      :type probability_tables: dict[str]: object
     |
     |  align(self, sentence_pair)
     |      Determines the best word alignment for one sentence pair from
     |      the corpus that the model was trained on.
     |
     |      The best alignment will be set in ``sentence_pair`` when the
     |      method returns. In contrast with the internal implementation of
     |      IBM models, the word indices in the ``Alignment`` are zero-
     |      indexed, not one-indexed.
     |
     |      :param sentence_pair: A sentence in the source language and its
     |          counterpart sentence in the target language
     |      :type sentence_pair: AlignedSent
     |
     |  align_all(self, parallel_corpus)
     |
     |  maximize_alignment_probabilities(self, counts)
     |
     |  prob_alignment_point(self, i, j, src_sentence, trg_sentence)
     |      Probability that position j in ``trg_sentence`` is aligned to
     |      position i in the ``src_sentence``
     |
     |  prob_all_alignments(self, src_sentence, trg_sentence)
     |      Computes the probability of all possible word alignments,
     |      expressed as a marginal distribution over target words t
     |
     |      Each entry in the return value represents the contribution to
     |      the total alignment probability by the target word t.
     |
     |      To obtain probability(alignment | src_sentence, trg_sentence),
     |      simply sum the entries in the return value.
     |
     |      :return: Probability of t for all s in ``src_sentence``
     |      :rtype: dict(str): float
     |
     |  prob_t_a_given_s(self, alignment_info)
     |      Probability of target sentence and an alignment given the
     |      source sentence
     |
     |  set_uniform_probabilities(self, sentence_aligned_corpus)
     |      Initialize probability tables to a uniform distribution
     |
     |      Derived classes should implement this accordingly.
     |
     |  train(self, parallel_corpus)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
     |      Finds the best alignment according to IBM Model 2
     |
     |      Used as a starting point for hill climbing in Models 3 and
     |      above, because it is easier to compute than the best alignments
     |      in higher models
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to be word-aligned
     |      :type sentence_pair: AlignedSent
     |
     |      :param j_pegged: If specified, the alignment point of j_pegged
     |          will be fixed to i_pegged
     |      :type j_pegged: int
     |
     |      :param i_pegged: Alignment point to j_pegged
     |      :type i_pegged: int
     |
     |  hillclimb(self, alignment_info, j_pegged=None)
     |      Starting from the alignment in ``alignment_info``, look at
     |      neighboring alignments iteratively for the best one
     |
     |      There is no guarantee that the best alignment in the alignment
     |      space will be found, because the algorithm might be stuck in a
     |      local maximum.
     |
     |      :param j_pegged: If specified, the search will be constrained to
     |          alignments where ``j_pegged`` remains unchanged
     |      :type j_pegged: int
     |
     |      :return: The best alignment found from hill climbing
     |      :rtype: AlignmentInfo
     |
     |  init_vocab(self, sentence_aligned_corpus)
     |
     |  maximize_fertility_probabilities(self, counts)
     |
     |  maximize_lexical_translation_probabilities(self, counts)
     |
     |  maximize_null_generation_probabilities(self, counts)
     |
     |  neighboring(self, alignment_info, j_pegged=None)
     |      Determine the neighbors of ``alignment_info``, obtained by
     |      moving or swapping one alignment point
     |
     |      :param j_pegged: If specified, neighbors that have a different
     |          alignment point from j_pegged will not be considered
     |      :type j_pegged: int
     |
     |      :return: A set neighboring alignments represented by their
     |          ``AlignmentInfo``
     |      :rtype: set(AlignmentInfo)
     |
     |  prob_of_alignments(self, alignments)
     |
     |  reset_probabilities(self)
     |
     |  sample(self, sentence_pair)
     |      Sample the most probable alignments from the entire alignment
     |      space
     |
     |      First, determine the best alignment according to IBM Model 2.
     |      With this initial alignment, use hill climbing to determine the
     |      best alignment according to a higher IBM Model. Add this
     |      alignment and its neighbors to the sample set. Repeat this
     |      process with other initial alignments obtained by pegging an
     |      alignment point.
     |
     |      Hill climbing may be stuck in a local maxima, hence the pegging
     |      and trying out of different alignments.
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to generate a sample of alignments from
     |      :type sentence_pair: AlignedSent
     |
     |      :return: A set of best alignments represented by their ``AlignmentInfo``
     |          and the best alignment of the set for convenience
     |      :rtype: set(AlignmentInfo), AlignmentInfo
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  MIN_PROB = 1e-12

    class Model2Counts(nltk.translate.ibm_model.Counts)
     |  Data object to store counts of various parameters during training.
     |  Includes counts for alignment.
     |
     |  Method resolution order:
     |      Model2Counts
     |      nltk.translate.ibm_model.Counts
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  update_alignment(self, count, i, j, l, m)
     |
     |  update_lexical_translation(self, count, s, t)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.translate.ibm_model.Counts:
     |
     |  update_fertility(self, count, alignment_info)
     |
     |  update_null_generation(self, count, alignment_info)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.translate.ibm_model.Counts:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\ibm2.py

nltk.ibm3
Python Library Documentation: module nltk.translate.ibm3 in nltk.translate

NAME
    nltk.translate.ibm3

DESCRIPTION
    Translation model that considers how a word can be aligned to
    multiple words in another language.

    IBM Model 3 improves on Model 2 by directly modeling the phenomenon
    where a word in one language may be translated into zero or more words
    in another. This is expressed by the fertility probability,
    n(phi | source word).

    If a source word translates into more than one word, it is possible to
    generate sentences that have the same alignment in multiple ways. This
    is modeled by a distortion step. The distortion probability, d(j|i,l,m),
    predicts a target word position, given its aligned source word's
    position. The distortion probability replaces the alignment probability
    of Model 2.

    The fertility probability is not applicable for NULL. Target words that
    align to NULL are assumed to be distributed uniformly in the target
    sentence. The existence of these words is modeled by p1, the probability
    that a target word produced by a real source word requires another
    target word that is produced by NULL.

    The EM algorithm used in Model 3 is:

    :E step: In the training data, collect counts, weighted by prior
             probabilities.

             - (a) count how many times a source language word is translated
                   into a target language word
             - (b) count how many times a particular position in the target
                   sentence is aligned to a particular position in the source
                   sentence
             - (c) count how many times a source word is aligned to phi number
                   of target words
             - (d) count how many times NULL is aligned to a target word

    :M step: Estimate new probabilities based on the counts from the E step

    Because there are too many possible alignments, only the most probable
    ones are considered. First, the best alignment is determined using prior
    probabilities. Then, a hill climbing approach is used to find other good
    candidates.

    Notations
    ---------

    :i: Position in the source sentence
         Valid values are 0 (for NULL), 1, 2, ..., length of source sentence
    :j: Position in the target sentence
         Valid values are 1, 2, ..., length of target sentence
    :l: Number of words in the source sentence, excluding NULL
    :m: Number of words in the target sentence
    :s: A word in the source language
    :t: A word in the target language
    :phi: Fertility, the number of target words produced by a source word
    :p1: Probability that a target word produced by a source word is
         accompanied by another target word that is aligned to NULL
    :p0: 1 - p1

    References
    ----------

    Philipp Koehn. 2010. Statistical Machine Translation.
    Cambridge University Press, New York.

    Peter E Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and
    Robert L. Mercer. 1993. The Mathematics of Statistical Machine
    Translation: Parameter Estimation. Computational Linguistics, 19 (2),
    263-311.

CLASSES
    nltk.translate.ibm_model.Counts(builtins.object)
        Model3Counts
    nltk.translate.ibm_model.IBMModel(builtins.object)
        IBMModel3

    class IBMModel3(nltk.translate.ibm_model.IBMModel)
     |  IBMModel3(sentence_aligned_corpus, iterations, probability_tables=None)
     |
     |  Translation model that considers how a word can be aligned to
     |  multiple words in another language
     |
     |  >>> bitext = []
     |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus', 'war', 'ja', 'groß'], ['the', 'house', 'was', 'big']))
     |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['ein', 'haus', 'ist', 'klein'], ['a', 'house', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
     |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
     |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
     |  >>> bitext.append(AlignedSent(['ich', 'fasse', 'das', 'buch', 'zusammen'], ['i', 'summarize', 'the', 'book']))
     |  >>> bitext.append(AlignedSent(['fasse', 'zusammen'], ['summarize']))
     |
     |  >>> ibm3 = IBMModel3(bitext, 5)
     |
     |  >>> print(round(ibm3.translation_table['buch']['book'], 3))
     |  1.0
     |  >>> print(round(ibm3.translation_table['das']['book'], 3))
     |  0.0
     |  >>> print(round(ibm3.translation_table['ja'][None], 3))
     |  1.0
     |
     |  >>> print(round(ibm3.distortion_table[1][1][2][2], 3))
     |  1.0
     |  >>> print(round(ibm3.distortion_table[1][2][2][2], 3))
     |  0.0
     |  >>> print(round(ibm3.distortion_table[2][2][4][5], 3))
     |  0.75
     |
     |  >>> print(round(ibm3.fertility_table[2]['summarize'], 3))
     |  1.0
     |  >>> print(round(ibm3.fertility_table[1]['book'], 3))
     |  1.0
     |
     |  >>> print(round(ibm3.p1, 3))
     |  0.054
     |
     |  >>> test_sentence = bitext[2]
     |  >>> test_sentence.words
     |  ['das', 'buch', 'ist', 'ja', 'klein']
     |  >>> test_sentence.mots
     |  ['the', 'book', 'is', 'small']
     |  >>> test_sentence.alignment
     |  Alignment([(0, 0), (1, 1), (2, 2), (3, None), (4, 3)])
     |
     |  Method resolution order:
     |      IBMModel3
     |      nltk.translate.ibm_model.IBMModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, sentence_aligned_corpus, iterations, probability_tables=None)
     |      Train on ``sentence_aligned_corpus`` and create a lexical
     |      translation model, a distortion model, a fertility model, and a
     |      model for generating NULL-aligned words.
     |
     |      Translation direction is from ``AlignedSent.mots`` to
     |      ``AlignedSent.words``.
     |
     |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
     |      :type sentence_aligned_corpus: list(AlignedSent)
     |
     |      :param iterations: Number of iterations to run training algorithm
     |      :type iterations: int
     |
     |      :param probability_tables: Optional. Use this to pass in custom
     |          probability values. If not specified, probabilities will be
     |          set to a uniform distribution, or some other sensible value.
     |          If specified, all the following entries must be present:
     |          ``translation_table``, ``alignment_table``,
     |          ``fertility_table``, ``p1``, ``distortion_table``.
     |          See ``IBMModel`` for the type and purpose of these tables.
     |      :type probability_tables: dict[str]: object
     |
     |  maximize_distortion_probabilities(self, counts)
     |
     |  prob_t_a_given_s(self, alignment_info)
     |      Probability of target sentence and an alignment given the
     |      source sentence
     |
     |  reset_probabilities(self)
     |
     |  set_uniform_probabilities(self, sentence_aligned_corpus)
     |      Initialize probability tables to a uniform distribution
     |
     |      Derived classes should implement this accordingly.
     |
     |  train(self, parallel_corpus)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
     |      Finds the best alignment according to IBM Model 2
     |
     |      Used as a starting point for hill climbing in Models 3 and
     |      above, because it is easier to compute than the best alignments
     |      in higher models
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to be word-aligned
     |      :type sentence_pair: AlignedSent
     |
     |      :param j_pegged: If specified, the alignment point of j_pegged
     |          will be fixed to i_pegged
     |      :type j_pegged: int
     |
     |      :param i_pegged: Alignment point to j_pegged
     |      :type i_pegged: int
     |
     |  hillclimb(self, alignment_info, j_pegged=None)
     |      Starting from the alignment in ``alignment_info``, look at
     |      neighboring alignments iteratively for the best one
     |
     |      There is no guarantee that the best alignment in the alignment
     |      space will be found, because the algorithm might be stuck in a
     |      local maximum.
     |
     |      :param j_pegged: If specified, the search will be constrained to
     |          alignments where ``j_pegged`` remains unchanged
     |      :type j_pegged: int
     |
     |      :return: The best alignment found from hill climbing
     |      :rtype: AlignmentInfo
     |
     |  init_vocab(self, sentence_aligned_corpus)
     |
     |  maximize_fertility_probabilities(self, counts)
     |
     |  maximize_lexical_translation_probabilities(self, counts)
     |
     |  maximize_null_generation_probabilities(self, counts)
     |
     |  neighboring(self, alignment_info, j_pegged=None)
     |      Determine the neighbors of ``alignment_info``, obtained by
     |      moving or swapping one alignment point
     |
     |      :param j_pegged: If specified, neighbors that have a different
     |          alignment point from j_pegged will not be considered
     |      :type j_pegged: int
     |
     |      :return: A set neighboring alignments represented by their
     |          ``AlignmentInfo``
     |      :rtype: set(AlignmentInfo)
     |
     |  prob_of_alignments(self, alignments)
     |
     |  sample(self, sentence_pair)
     |      Sample the most probable alignments from the entire alignment
     |      space
     |
     |      First, determine the best alignment according to IBM Model 2.
     |      With this initial alignment, use hill climbing to determine the
     |      best alignment according to a higher IBM Model. Add this
     |      alignment and its neighbors to the sample set. Repeat this
     |      process with other initial alignments obtained by pegging an
     |      alignment point.
     |
     |      Hill climbing may be stuck in a local maxima, hence the pegging
     |      and trying out of different alignments.
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to generate a sample of alignments from
     |      :type sentence_pair: AlignedSent
     |
     |      :return: A set of best alignments represented by their ``AlignmentInfo``
     |          and the best alignment of the set for convenience
     |      :rtype: set(AlignmentInfo), AlignmentInfo
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  MIN_PROB = 1e-12

    class Model3Counts(nltk.translate.ibm_model.Counts)
     |  Data object to store counts of various parameters during training.
     |  Includes counts for distortion.
     |
     |  Method resolution order:
     |      Model3Counts
     |      nltk.translate.ibm_model.Counts
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  update_distortion(self, count, alignment_info, j, l, m)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.translate.ibm_model.Counts:
     |
     |  update_fertility(self, count, alignment_info)
     |
     |  update_lexical_translation(self, count, alignment_info, j)
     |
     |  update_null_generation(self, count, alignment_info)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.translate.ibm_model.Counts:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    factorial(n, /)
        Find n!.

        Raise a ValueError if x is negative or non-integral.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\ibm3.py

nltk.ibm4
Python Library Documentation: module nltk.translate.ibm4 in nltk.translate

NAME
    nltk.translate.ibm4

DESCRIPTION
    Translation model that reorders output words based on their type and
    distance from other related words in the output sentence.

    IBM Model 4 improves the distortion model of Model 3, motivated by the
    observation that certain words tend to be re-ordered in a predictable
    way relative to one another. For example, <adjective><noun> in English
    usually has its order flipped as <noun><adjective> in French.

    Model 4 requires words in the source and target vocabularies to be
    categorized into classes. This can be linguistically driven, like parts
    of speech (adjective, nouns, prepositions, etc). Word classes can also
    be obtained by statistical methods. The original IBM Model 4 uses an
    information theoretic approach to group words into 50 classes for each
    vocabulary.

    Terminology
    -----------

    :Cept:
        A source word with non-zero fertility i.e. aligned to one or more
        target words.
    :Tablet:
        The set of target word(s) aligned to a cept.
    :Head of cept:
        The first word of the tablet of that cept.
    :Center of cept:
        The average position of the words in that cept's tablet. If the
        value is not an integer, the ceiling is taken.
        For example, for a tablet with words in positions 2, 5, 6 in the
        target sentence, the center of the corresponding cept is
        ceil((2 + 5 + 6) / 3) = 5
    :Displacement:
        For a head word, defined as (position of head word - position of
        previous cept's center). Can be positive or negative.
        For a non-head word, defined as (position of non-head word -
        position of previous word in the same tablet). Always positive,
        because successive words in a tablet are assumed to appear to the
        right of the previous word.

    In contrast to Model 3 which reorders words in a tablet independently of
    other words, Model 4 distinguishes between three cases.

    1. Words generated by NULL are distributed uniformly.
    2. For a head word t, its position is modeled by the probability
       d_head(displacement | word_class_s(s),word_class_t(t)),
       where s is the previous cept, and word_class_s and word_class_t maps
       s and t to a source and target language word class respectively.
    3. For a non-head word t, its position is modeled by the probability
       d_non_head(displacement | word_class_t(t))

    The EM algorithm used in Model 4 is:

    :E step: In the training data, collect counts, weighted by prior
             probabilities.

             - (a) count how many times a source language word is translated
                   into a target language word
             - (b) for a particular word class, count how many times a head
                   word is located at a particular displacement from the
                   previous cept's center
             - (c) for a particular word class, count how many times a
                   non-head word is located at a particular displacement from
                   the previous target word
             - (d) count how many times a source word is aligned to phi number
                   of target words
             - (e) count how many times NULL is aligned to a target word

    :M step: Estimate new probabilities based on the counts from the E step

    Like Model 3, there are too many possible alignments to consider. Thus,
    a hill climbing approach is used to sample good candidates.

    Notations
    ---------

    :i: Position in the source sentence
         Valid values are 0 (for NULL), 1, 2, ..., length of source sentence
    :j: Position in the target sentence
         Valid values are 1, 2, ..., length of target sentence
    :l: Number of words in the source sentence, excluding NULL
    :m: Number of words in the target sentence
    :s: A word in the source language
    :t: A word in the target language
    :phi: Fertility, the number of target words produced by a source word
    :p1: Probability that a target word produced by a source word is
         accompanied by another target word that is aligned to NULL
    :p0: 1 - p1
    :dj: Displacement, Δj

    References
    ----------

    Philipp Koehn. 2010. Statistical Machine Translation.
    Cambridge University Press, New York.

    Peter E Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and
    Robert L. Mercer. 1993. The Mathematics of Statistical Machine
    Translation: Parameter Estimation. Computational Linguistics, 19 (2),
    263-311.

CLASSES
    nltk.translate.ibm_model.Counts(builtins.object)
        Model4Counts
    nltk.translate.ibm_model.IBMModel(builtins.object)
        IBMModel4

    class IBMModel4(nltk.translate.ibm_model.IBMModel)
     |  IBMModel4(sentence_aligned_corpus, iterations, source_word_classes, target_word_classes, probability_tables=None)
     |
     |  Translation model that reorders output words based on their type and
     |  their distance from other related words in the output sentence
     |
     |  >>> bitext = []
     |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus', 'war', 'ja', 'groß'], ['the', 'house', 'was', 'big']))
     |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['ein', 'haus', 'ist', 'klein'], ['a', 'house', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
     |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
     |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
     |  >>> bitext.append(AlignedSent(['ich', 'fasse', 'das', 'buch', 'zusammen'], ['i', 'summarize', 'the', 'book']))
     |  >>> bitext.append(AlignedSent(['fasse', 'zusammen'], ['summarize']))
     |  >>> src_classes = {'the': 0, 'a': 0, 'small': 1, 'big': 1, 'house': 2, 'book': 2, 'is': 3, 'was': 3, 'i': 4, 'summarize': 5 }
     |  >>> trg_classes = {'das': 0, 'ein': 0, 'haus': 1, 'buch': 1, 'klein': 2, 'groß': 2, 'ist': 3, 'war': 3, 'ja': 4, 'ich': 5, 'fasse': 6, 'zusammen': 6 }
     |
     |  >>> ibm4 = IBMModel4(bitext, 5, src_classes, trg_classes)
     |
     |  >>> print(round(ibm4.translation_table['buch']['book'], 3))
     |  1.0
     |  >>> print(round(ibm4.translation_table['das']['book'], 3))
     |  0.0
     |  >>> print(round(ibm4.translation_table['ja'][None], 3))
     |  1.0
     |
     |  >>> print(round(ibm4.head_distortion_table[1][0][1], 3))
     |  1.0
     |  >>> print(round(ibm4.head_distortion_table[2][0][1], 3))
     |  0.0
     |  >>> print(round(ibm4.non_head_distortion_table[3][6], 3))
     |  0.5
     |
     |  >>> print(round(ibm4.fertility_table[2]['summarize'], 3))
     |  1.0
     |  >>> print(round(ibm4.fertility_table[1]['book'], 3))
     |  1.0
     |
     |  >>> print(round(ibm4.p1, 3))
     |  0.033
     |
     |  >>> test_sentence = bitext[2]
     |  >>> test_sentence.words
     |  ['das', 'buch', 'ist', 'ja', 'klein']
     |  >>> test_sentence.mots
     |  ['the', 'book', 'is', 'small']
     |  >>> test_sentence.alignment
     |  Alignment([(0, 0), (1, 1), (2, 2), (3, None), (4, 3)])
     |
     |  Method resolution order:
     |      IBMModel4
     |      nltk.translate.ibm_model.IBMModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, sentence_aligned_corpus, iterations, source_word_classes, target_word_classes, probability_tables=None)
     |      Train on ``sentence_aligned_corpus`` and create a lexical
     |      translation model, distortion models, a fertility model, and a
     |      model for generating NULL-aligned words.
     |
     |      Translation direction is from ``AlignedSent.mots`` to
     |      ``AlignedSent.words``.
     |
     |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
     |      :type sentence_aligned_corpus: list(AlignedSent)
     |
     |      :param iterations: Number of iterations to run training algorithm
     |      :type iterations: int
     |
     |      :param source_word_classes: Lookup table that maps a source word
     |          to its word class, the latter represented by an integer id
     |      :type source_word_classes: dict[str]: int
     |
     |      :param target_word_classes: Lookup table that maps a target word
     |          to its word class, the latter represented by an integer id
     |      :type target_word_classes: dict[str]: int
     |
     |      :param probability_tables: Optional. Use this to pass in custom
     |          probability values. If not specified, probabilities will be
     |          set to a uniform distribution, or some other sensible value.
     |          If specified, all the following entries must be present:
     |          ``translation_table``, ``alignment_table``,
     |          ``fertility_table``, ``p1``, ``head_distortion_table``,
     |          ``non_head_distortion_table``. See ``IBMModel`` and
     |          ``IBMModel4`` for the type and purpose of these tables.
     |      :type probability_tables: dict[str]: object
     |
     |  maximize_distortion_probabilities(self, counts)
     |
     |  prob_t_a_given_s(self, alignment_info)
     |      Probability of target sentence and an alignment given the
     |      source sentence
     |
     |  reset_probabilities(self)
     |
     |  set_uniform_probabilities(self, sentence_aligned_corpus)
     |      Set distortion probabilities uniformly to
     |      1 / cardinality of displacement values
     |
     |  train(self, parallel_corpus)
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  model4_prob_t_a_given_s(alignment_info, ibm_model)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
     |      Finds the best alignment according to IBM Model 2
     |
     |      Used as a starting point for hill climbing in Models 3 and
     |      above, because it is easier to compute than the best alignments
     |      in higher models
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to be word-aligned
     |      :type sentence_pair: AlignedSent
     |
     |      :param j_pegged: If specified, the alignment point of j_pegged
     |          will be fixed to i_pegged
     |      :type j_pegged: int
     |
     |      :param i_pegged: Alignment point to j_pegged
     |      :type i_pegged: int
     |
     |  hillclimb(self, alignment_info, j_pegged=None)
     |      Starting from the alignment in ``alignment_info``, look at
     |      neighboring alignments iteratively for the best one
     |
     |      There is no guarantee that the best alignment in the alignment
     |      space will be found, because the algorithm might be stuck in a
     |      local maximum.
     |
     |      :param j_pegged: If specified, the search will be constrained to
     |          alignments where ``j_pegged`` remains unchanged
     |      :type j_pegged: int
     |
     |      :return: The best alignment found from hill climbing
     |      :rtype: AlignmentInfo
     |
     |  init_vocab(self, sentence_aligned_corpus)
     |
     |  maximize_fertility_probabilities(self, counts)
     |
     |  maximize_lexical_translation_probabilities(self, counts)
     |
     |  maximize_null_generation_probabilities(self, counts)
     |
     |  neighboring(self, alignment_info, j_pegged=None)
     |      Determine the neighbors of ``alignment_info``, obtained by
     |      moving or swapping one alignment point
     |
     |      :param j_pegged: If specified, neighbors that have a different
     |          alignment point from j_pegged will not be considered
     |      :type j_pegged: int
     |
     |      :return: A set neighboring alignments represented by their
     |          ``AlignmentInfo``
     |      :rtype: set(AlignmentInfo)
     |
     |  prob_of_alignments(self, alignments)
     |
     |  sample(self, sentence_pair)
     |      Sample the most probable alignments from the entire alignment
     |      space
     |
     |      First, determine the best alignment according to IBM Model 2.
     |      With this initial alignment, use hill climbing to determine the
     |      best alignment according to a higher IBM Model. Add this
     |      alignment and its neighbors to the sample set. Repeat this
     |      process with other initial alignments obtained by pegging an
     |      alignment point.
     |
     |      Hill climbing may be stuck in a local maxima, hence the pegging
     |      and trying out of different alignments.
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to generate a sample of alignments from
     |      :type sentence_pair: AlignedSent
     |
     |      :return: A set of best alignments represented by their ``AlignmentInfo``
     |          and the best alignment of the set for convenience
     |      :rtype: set(AlignmentInfo), AlignmentInfo
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  MIN_PROB = 1e-12

    class Model4Counts(nltk.translate.ibm_model.Counts)
     |  Data object to store counts of various parameters during training.
     |  Includes counts for distortion.
     |
     |  Method resolution order:
     |      Model4Counts
     |      nltk.translate.ibm_model.Counts
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  update_distortion(self, count, alignment_info, j, src_classes, trg_classes)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.translate.ibm_model.Counts:
     |
     |  update_fertility(self, count, alignment_info)
     |
     |  update_lexical_translation(self, count, alignment_info, j)
     |
     |  update_null_generation(self, count, alignment_info)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.translate.ibm_model.Counts:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    factorial(n, /)
        Find n!.

        Raise a ValueError if x is negative or non-integral.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\ibm4.py

nltk.ibm5
Python Library Documentation: module nltk.translate.ibm5 in nltk.translate

NAME
    nltk.translate.ibm5

DESCRIPTION
    Translation model that keeps track of vacant positions in the target
    sentence to decide where to place translated words.

    Translation can be viewed as a process where each word in the source
    sentence is stepped through sequentially, generating translated words
    for each source word. The target sentence can be viewed as being made
    up of ``m`` empty slots initially, which gradually fill up as generated
    words are placed in them.

    Models 3 and 4 use distortion probabilities to decide how to place
    translated words. For simplicity, these models ignore the history of
    which slots have already been occupied with translated words.
    Consider the placement of the last translated word: there is only one
    empty slot left in the target sentence, so the distortion probability
    should be 1.0 for that position and 0.0 everywhere else. However, the
    distortion probabilities for Models 3 and 4 are set up such that all
    positions are under consideration.

    IBM Model 5 fixes this deficiency by accounting for occupied slots
    during translation. It introduces the vacancy function v(j), the number
    of vacancies up to, and including, position j in the target sentence.

    Terminology
    -----------

    :Maximum vacancy:
        The number of valid slots that a word can be placed in.
        This is not necessarily the same as the number of vacant slots.
        For example, if a tablet contains more than one word, the head word
        cannot be placed at the last vacant slot because there will be no
        space for the other words in the tablet. The number of valid slots
        has to take into account the length of the tablet.
        Non-head words cannot be placed before the head word, so vacancies
        to the left of the head word are ignored.
    :Vacancy difference:
        For a head word: (v(j) - v(center of previous cept))
        Can be positive or negative.
        For a non-head word: (v(j) - v(position of previously placed word))
        Always positive, because successive words in a tablet are assumed to
        appear to the right of the previous word.

    Positioning of target words fall under three cases:

    1. Words generated by NULL are distributed uniformly
    2. For a head word t, its position is modeled by the probability
       v_head(dv | max_v,word_class_t(t))
    3. For a non-head word t, its position is modeled by the probability
       v_non_head(dv | max_v,word_class_t(t))

    dv and max_v are defined differently for head and non-head words.

    The EM algorithm used in Model 5 is:

    :E step: In the training data, collect counts, weighted by prior
             probabilities.

             - (a) count how many times a source language word is translated
                   into a target language word
             - (b) for a particular word class and maximum vacancy, count how
                   many times a head word and the previous cept's center have
                   a particular difference in number of vacancies
             - (b) for a particular word class and maximum vacancy, count how
                   many times a non-head word and the previous target word
                   have a particular difference in number of vacancies
             - (d) count how many times a source word is aligned to phi number
                   of target words
             - (e) count how many times NULL is aligned to a target word

    :M step: Estimate new probabilities based on the counts from the E step

    Like Model 4, there are too many possible alignments to consider. Thus,
    a hill climbing approach is used to sample good candidates. In addition,
    pruning is used to weed out unlikely alignments based on Model 4 scores.

    Notations
    ---------

    :i: Position in the source sentence
         Valid values are 0 (for NULL), 1, 2, ..., length of source sentence
    :j: Position in the target sentence
         Valid values are 1, 2, ..., length of target sentence
    :l: Number of words in the source sentence, excluding NULL
    :m: Number of words in the target sentence
    :s: A word in the source language
    :t: A word in the target language
    :phi: Fertility, the number of target words produced by a source word
    :p1: Probability that a target word produced by a source word is
         accompanied by another target word that is aligned to NULL
    :p0: 1 - p1
    :max_v: Maximum vacancy
    :dv: Vacancy difference, Δv

    The definition of v_head here differs from GIZA++, section 4.7 of
    [Brown et al., 1993], and [Koehn, 2010]. In the latter cases, v_head is
    v_head(v(j) | v(center of previous cept),max_v,word_class(t)).

    Here, we follow appendix B of [Brown et al., 1993] and combine v(j) with
    v(center of previous cept) to obtain dv:
    v_head(v(j) - v(center of previous cept) | max_v,word_class(t)).

    References
    ----------

    Philipp Koehn. 2010. Statistical Machine Translation.
    Cambridge University Press, New York.

    Peter E Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and
    Robert L. Mercer. 1993. The Mathematics of Statistical Machine
    Translation: Parameter Estimation. Computational Linguistics, 19 (2),
    263-311.

CLASSES
    builtins.object
        Slots
    nltk.translate.ibm_model.Counts(builtins.object)
        Model5Counts
    nltk.translate.ibm_model.IBMModel(builtins.object)
        IBMModel5

    class IBMModel5(nltk.translate.ibm_model.IBMModel)
     |  IBMModel5(sentence_aligned_corpus, iterations, source_word_classes, target_word_classes, probability_tables=None)
     |
     |  Translation model that keeps track of vacant positions in the target
     |  sentence to decide where to place translated words
     |
     |  >>> bitext = []
     |  >>> bitext.append(AlignedSent(['klein', 'ist', 'das', 'haus'], ['the', 'house', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus', 'war', 'ja', 'groß'], ['the', 'house', 'was', 'big']))
     |  >>> bitext.append(AlignedSent(['das', 'buch', 'ist', 'ja', 'klein'], ['the', 'book', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['ein', 'haus', 'ist', 'klein'], ['a', 'house', 'is', 'small']))
     |  >>> bitext.append(AlignedSent(['das', 'haus'], ['the', 'house']))
     |  >>> bitext.append(AlignedSent(['das', 'buch'], ['the', 'book']))
     |  >>> bitext.append(AlignedSent(['ein', 'buch'], ['a', 'book']))
     |  >>> bitext.append(AlignedSent(['ich', 'fasse', 'das', 'buch', 'zusammen'], ['i', 'summarize', 'the', 'book']))
     |  >>> bitext.append(AlignedSent(['fasse', 'zusammen'], ['summarize']))
     |  >>> src_classes = {'the': 0, 'a': 0, 'small': 1, 'big': 1, 'house': 2, 'book': 2, 'is': 3, 'was': 3, 'i': 4, 'summarize': 5 }
     |  >>> trg_classes = {'das': 0, 'ein': 0, 'haus': 1, 'buch': 1, 'klein': 2, 'groß': 2, 'ist': 3, 'war': 3, 'ja': 4, 'ich': 5, 'fasse': 6, 'zusammen': 6 }
     |
     |  >>> ibm5 = IBMModel5(bitext, 5, src_classes, trg_classes)
     |
     |  >>> print(round(ibm5.head_vacancy_table[1][1][1], 3))
     |  1.0
     |  >>> print(round(ibm5.head_vacancy_table[2][1][1], 3))
     |  0.0
     |  >>> print(round(ibm5.non_head_vacancy_table[3][3][6], 3))
     |  1.0
     |
     |  >>> print(round(ibm5.fertility_table[2]['summarize'], 3))
     |  1.0
     |  >>> print(round(ibm5.fertility_table[1]['book'], 3))
     |  1.0
     |
     |  >>> print(round(ibm5.p1, 3))
     |  0.033
     |
     |  >>> test_sentence = bitext[2]
     |  >>> test_sentence.words
     |  ['das', 'buch', 'ist', 'ja', 'klein']
     |  >>> test_sentence.mots
     |  ['the', 'book', 'is', 'small']
     |  >>> test_sentence.alignment
     |  Alignment([(0, 0), (1, 1), (2, 2), (3, None), (4, 3)])
     |
     |  Method resolution order:
     |      IBMModel5
     |      nltk.translate.ibm_model.IBMModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, sentence_aligned_corpus, iterations, source_word_classes, target_word_classes, probability_tables=None)
     |      Train on ``sentence_aligned_corpus`` and create a lexical
     |      translation model, vacancy models, a fertility model, and a
     |      model for generating NULL-aligned words.
     |
     |      Translation direction is from ``AlignedSent.mots`` to
     |      ``AlignedSent.words``.
     |
     |      :param sentence_aligned_corpus: Sentence-aligned parallel corpus
     |      :type sentence_aligned_corpus: list(AlignedSent)
     |
     |      :param iterations: Number of iterations to run training algorithm
     |      :type iterations: int
     |
     |      :param source_word_classes: Lookup table that maps a source word
     |          to its word class, the latter represented by an integer id
     |      :type source_word_classes: dict[str]: int
     |
     |      :param target_word_classes: Lookup table that maps a target word
     |          to its word class, the latter represented by an integer id
     |      :type target_word_classes: dict[str]: int
     |
     |      :param probability_tables: Optional. Use this to pass in custom
     |          probability values. If not specified, probabilities will be
     |          set to a uniform distribution, or some other sensible value.
     |          If specified, all the following entries must be present:
     |          ``translation_table``, ``alignment_table``,
     |          ``fertility_table``, ``p1``, ``head_distortion_table``,
     |          ``non_head_distortion_table``, ``head_vacancy_table``,
     |          ``non_head_vacancy_table``. See ``IBMModel``, ``IBMModel4``,
     |          and ``IBMModel5`` for the type and purpose of these tables.
     |      :type probability_tables: dict[str]: object
     |
     |  hillclimb(self, alignment_info, j_pegged=None)
     |      Starting from the alignment in ``alignment_info``, look at
     |      neighboring alignments iteratively for the best one, according
     |      to Model 4
     |
     |      Note that Model 4 scoring is used instead of Model 5 because the
     |      latter is too expensive to compute.
     |
     |      There is no guarantee that the best alignment in the alignment
     |      space will be found, because the algorithm might be stuck in a
     |      local maximum.
     |
     |      :param j_pegged: If specified, the search will be constrained to
     |          alignments where ``j_pegged`` remains unchanged
     |      :type j_pegged: int
     |
     |      :return: The best alignment found from hill climbing
     |      :rtype: AlignmentInfo
     |
     |  maximize_vacancy_probabilities(self, counts)
     |
     |  prob_t_a_given_s(self, alignment_info)
     |      Probability of target sentence and an alignment given the
     |      source sentence
     |
     |  prune(self, alignment_infos)
     |      Removes alignments from ``alignment_infos`` that have
     |      substantially lower Model 4 scores than the best alignment
     |
     |      :return: Pruned alignments
     |      :rtype: set(AlignmentInfo)
     |
     |  reset_probabilities(self)
     |
     |  sample(self, sentence_pair)
     |      Sample the most probable alignments from the entire alignment
     |      space according to Model 4
     |
     |      Note that Model 4 scoring is used instead of Model 5 because the
     |      latter is too expensive to compute.
     |
     |      First, determine the best alignment according to IBM Model 2.
     |      With this initial alignment, use hill climbing to determine the
     |      best alignment according to a IBM Model 4. Add this
     |      alignment and its neighbors to the sample set. Repeat this
     |      process with other initial alignments obtained by pegging an
     |      alignment point. Finally, prune alignments that have
     |      substantially lower Model 4 scores than the best alignment.
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to generate a sample of alignments from
     |      :type sentence_pair: AlignedSent
     |
     |      :return: A set of best alignments represented by their ``AlignmentInfo``
     |          and the best alignment of the set for convenience
     |      :rtype: set(AlignmentInfo), AlignmentInfo
     |
     |  set_uniform_probabilities(self, sentence_aligned_corpus)
     |      Set vacancy probabilities uniformly to
     |      1 / cardinality of vacancy difference values
     |
     |  train(self, parallel_corpus)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MIN_SCORE_FACTOR = 0.2
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
     |      Finds the best alignment according to IBM Model 2
     |
     |      Used as a starting point for hill climbing in Models 3 and
     |      above, because it is easier to compute than the best alignments
     |      in higher models
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to be word-aligned
     |      :type sentence_pair: AlignedSent
     |
     |      :param j_pegged: If specified, the alignment point of j_pegged
     |          will be fixed to i_pegged
     |      :type j_pegged: int
     |
     |      :param i_pegged: Alignment point to j_pegged
     |      :type i_pegged: int
     |
     |  init_vocab(self, sentence_aligned_corpus)
     |
     |  maximize_fertility_probabilities(self, counts)
     |
     |  maximize_lexical_translation_probabilities(self, counts)
     |
     |  maximize_null_generation_probabilities(self, counts)
     |
     |  neighboring(self, alignment_info, j_pegged=None)
     |      Determine the neighbors of ``alignment_info``, obtained by
     |      moving or swapping one alignment point
     |
     |      :param j_pegged: If specified, neighbors that have a different
     |          alignment point from j_pegged will not be considered
     |      :type j_pegged: int
     |
     |      :return: A set neighboring alignments represented by their
     |          ``AlignmentInfo``
     |      :rtype: set(AlignmentInfo)
     |
     |  prob_of_alignments(self, alignments)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.translate.ibm_model.IBMModel:
     |
     |  MIN_PROB = 1e-12

    class Model5Counts(nltk.translate.ibm_model.Counts)
     |  Data object to store counts of various parameters during training.
     |  Includes counts for vacancies.
     |
     |  Method resolution order:
     |      Model5Counts
     |      nltk.translate.ibm_model.Counts
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  update_vacancy(self, count, alignment_info, i, trg_classes, slots)
     |      :param count: Value to add to the vacancy counts
     |      :param alignment_info: Alignment under consideration
     |      :param i: Source word position under consideration
     |      :param trg_classes: Target word classes
     |      :param slots: Vacancy states of the slots in the target sentence.
     |          Output parameter that will be modified as new words are placed
     |          in the target sentence.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.translate.ibm_model.Counts:
     |
     |  update_fertility(self, count, alignment_info)
     |
     |  update_lexical_translation(self, count, alignment_info, j)
     |
     |  update_null_generation(self, count, alignment_info)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.translate.ibm_model.Counts:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Slots(builtins.object)
     |  Slots(target_sentence_length)
     |
     |  Represents positions in a target sentence. Used to keep track of
     |  which slot (position) is occupied.
     |
     |  Methods defined here:
     |
     |  __init__(self, target_sentence_length)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __len__(self)
     |
     |  occupy(self, position)
     |      :return: Mark slot at ``position`` as occupied
     |
     |  vacancies_at(self, position)
     |      :return: Number of vacant slots up to, and including, ``position``
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    factorial(n, /)
        Find n!.

        Raise a ValueError if x is negative or non-integral.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\ibm5.py

nltk.ibm_model
Python Library Documentation: module nltk.translate.ibm_model in nltk.translate

NAME
    nltk.translate.ibm_model

DESCRIPTION
    Common methods and classes for all IBM models. See ``IBMModel1``,
    ``IBMModel2``, ``IBMModel3``, ``IBMModel4``, and ``IBMModel5``
    for specific implementations.

    The IBM models are a series of generative models that learn lexical
    translation probabilities, p(target language word|source language word),
    given a sentence-aligned parallel corpus.

    The models increase in sophistication from model 1 to 5. Typically, the
    output of lower models is used to seed the higher models. All models
    use the Expectation-Maximization (EM) algorithm to learn various
    probability tables.

    Words in a sentence are one-indexed. The first word of a sentence has
    position 1, not 0. Index 0 is reserved in the source sentence for the
    NULL token. The concept of position does not apply to NULL, but it is
    indexed at 0 by convention.

    Each target word is aligned to exactly one source word or the NULL
    token.

    References:
    Philipp Koehn. 2010. Statistical Machine Translation.
    Cambridge University Press, New York.

    Peter E Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and
    Robert L. Mercer. 1993. The Mathematics of Statistical Machine
    Translation: Parameter Estimation. Computational Linguistics, 19 (2),
    263-311.

CLASSES
    builtins.object
        AlignmentInfo
        Counts
        IBMModel

    class AlignmentInfo(builtins.object)
     |  AlignmentInfo(alignment, src_sentence, trg_sentence, cepts)
     |
     |  Helper data object for training IBM Models 3 and up
     |
     |  Read-only. For a source sentence and its counterpart in the target
     |  language, this class holds information about the sentence pair's
     |  alignment, cepts, and fertility.
     |
     |  Warning: Alignments are one-indexed here, in contrast to
     |  nltk.translate.Alignment and AlignedSent, which are zero-indexed
     |  This class is not meant to be used outside of IBM models.
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, alignment, src_sentence, trg_sentence, cepts)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  center_of_cept(self, i)
     |      :return: The ceiling of the average positions of the words in
     |          the tablet of cept ``i``, or 0 if ``i`` is None
     |
     |  fertility_of_i(self, i)
     |      Fertility of word in position ``i`` of the source sentence
     |
     |  is_head_word(self, j)
     |      :return: Whether the word in position ``j`` of the target
     |          sentence is a head word
     |
     |  previous_cept(self, j)
     |      :return: The previous cept of ``j``, or None if ``j`` belongs to
     |          the first cept
     |
     |  previous_in_tablet(self, j)
     |      :return: The position of the previous word that is in the same
     |          tablet as ``j``, or None if ``j`` is the first word of the
     |          tablet
     |
     |  zero_indexed_alignment(self)
     |      :return: Zero-indexed alignment, suitable for use in external
     |          ``nltk.translate`` modules like ``nltk.translate.Alignment``
     |      :rtype: list(tuple)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Counts(builtins.object)
     |  Data object to store counts of various parameters during training
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  update_fertility(self, count, alignment_info)
     |
     |  update_lexical_translation(self, count, alignment_info, j)
     |
     |  update_null_generation(self, count, alignment_info)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IBMModel(builtins.object)
     |  IBMModel(sentence_aligned_corpus)
     |
     |  Abstract base class for all IBM models
     |
     |  Methods defined here:
     |
     |  __init__(self, sentence_aligned_corpus)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  best_model2_alignment(self, sentence_pair, j_pegged=None, i_pegged=0)
     |      Finds the best alignment according to IBM Model 2
     |
     |      Used as a starting point for hill climbing in Models 3 and
     |      above, because it is easier to compute than the best alignments
     |      in higher models
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to be word-aligned
     |      :type sentence_pair: AlignedSent
     |
     |      :param j_pegged: If specified, the alignment point of j_pegged
     |          will be fixed to i_pegged
     |      :type j_pegged: int
     |
     |      :param i_pegged: Alignment point to j_pegged
     |      :type i_pegged: int
     |
     |  hillclimb(self, alignment_info, j_pegged=None)
     |      Starting from the alignment in ``alignment_info``, look at
     |      neighboring alignments iteratively for the best one
     |
     |      There is no guarantee that the best alignment in the alignment
     |      space will be found, because the algorithm might be stuck in a
     |      local maximum.
     |
     |      :param j_pegged: If specified, the search will be constrained to
     |          alignments where ``j_pegged`` remains unchanged
     |      :type j_pegged: int
     |
     |      :return: The best alignment found from hill climbing
     |      :rtype: AlignmentInfo
     |
     |  init_vocab(self, sentence_aligned_corpus)
     |
     |  maximize_fertility_probabilities(self, counts)
     |
     |  maximize_lexical_translation_probabilities(self, counts)
     |
     |  maximize_null_generation_probabilities(self, counts)
     |
     |  neighboring(self, alignment_info, j_pegged=None)
     |      Determine the neighbors of ``alignment_info``, obtained by
     |      moving or swapping one alignment point
     |
     |      :param j_pegged: If specified, neighbors that have a different
     |          alignment point from j_pegged will not be considered
     |      :type j_pegged: int
     |
     |      :return: A set neighboring alignments represented by their
     |          ``AlignmentInfo``
     |      :rtype: set(AlignmentInfo)
     |
     |  prob_of_alignments(self, alignments)
     |
     |  prob_t_a_given_s(self, alignment_info)
     |      Probability of target sentence and an alignment given the
     |      source sentence
     |
     |      All required information is assumed to be in ``alignment_info``
     |      and self.
     |
     |      Derived classes should override this method
     |
     |  reset_probabilities(self)
     |
     |  sample(self, sentence_pair)
     |      Sample the most probable alignments from the entire alignment
     |      space
     |
     |      First, determine the best alignment according to IBM Model 2.
     |      With this initial alignment, use hill climbing to determine the
     |      best alignment according to a higher IBM Model. Add this
     |      alignment and its neighbors to the sample set. Repeat this
     |      process with other initial alignments obtained by pegging an
     |      alignment point.
     |
     |      Hill climbing may be stuck in a local maxima, hence the pegging
     |      and trying out of different alignments.
     |
     |      :param sentence_pair: Source and target language sentence pair
     |          to generate a sample of alignments from
     |      :type sentence_pair: AlignedSent
     |
     |      :return: A set of best alignments represented by their ``AlignmentInfo``
     |          and the best alignment of the set for convenience
     |      :rtype: set(AlignmentInfo), AlignmentInfo
     |
     |  set_uniform_probabilities(self, sentence_aligned_corpus)
     |      Initialize probability tables to a uniform distribution
     |
     |      Derived classes should implement this accordingly.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MIN_PROB = 1e-12

FUNCTIONS
    ceil(x, /)
        Return the ceiling of x as an Integral.

        This is the smallest integer >= x.

    insort_left(a, x, lo=0, hi=None, *, key=None)
        Insert item x in list a, and keep it sorted assuming a is sorted.

        If x is already in a, insert it to the left of the leftmost x.

        Optional args lo (default 0) and hi (default len(a)) bound the
        slice of a to be searched.

        A custom key function can be supplied to customize the sort order.

    longest_target_sentence_length(sentence_aligned_corpus)
        :param sentence_aligned_corpus: Parallel corpus under consideration
        :type sentence_aligned_corpus: list(AlignedSent)
        :return: Number of words in the longest target language sentence
            of ``sentence_aligned_corpus``

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\ibm_model.py

nltk.ieerstr2tree
Python Library Documentation: function ieerstr2tree in module nltk.chunk.util

ieerstr2tree(s, chunk_types=['LOCATION', 'ORGANIZATION', 'PERSON', 'DURATION', 'DATE', 'CARDINAL', 'PERCENT', 'MONEY', 'MEASURE'], root_label='S')
    Return a chunk structure containing the chunked tagged text that is
    encoded in the given IEER style string.
    Convert a string of chunked tagged text in the IEER named
    entity format into a chunk structure.  Chunks are of several
    types, LOCATION, ORGANIZATION, PERSON, DURATION, DATE, CARDINAL,
    PERCENT, MONEY, and MEASURE.

    :rtype: Tree
nltk.importlib
Python Library Documentation: package importlib

NAME
    importlib - A pure Python implementation of import.

MODULE REFERENCE
    https://docs.python.org/3.12/library/importlib.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

PACKAGE CONTENTS
    _abc
    _bootstrap
    _bootstrap_external
    abc
    machinery
    metadata (package)
    readers
    resources (package)
    simple
    util

FUNCTIONS
    __import__(name, globals=None, locals=None, fromlist=(), level=0)
        Import a module.

        The 'globals' argument is used to infer where the import is occurring from
        to handle relative imports. The 'locals' argument is ignored. The
        'fromlist' argument specifies what should exist as attributes on the module
        being imported (e.g. ``from module import <fromlist>``).  The 'level'
        argument represents the package location to import from in a relative
        import (e.g. ``from ..pkg import mod`` would have a 'level' of 2).

    import_module(name, package=None)
        Import a module.

        The 'package' argument is required when performing a relative import. It
        specifies the package to use as the anchor point from which to resolve the
        relative import to an absolute import.

    invalidate_caches()
        Call the invalidate_caches() method on all meta path finders stored in
        sys.meta_path (where implemented).

    reload(module)
        Reload the module and return it.

        The module must have been successfully imported before.

DATA
    __all__ = ['__import__', 'import_module', 'invalidate_caches', 'reload...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\importlib\__init__.py

nltk.in_idle
Python Library Documentation: function in_idle in module nltk.util

in_idle()
    Return True if this function is run within idle.  Tkinter
    programs that are run in idle should never call ``Tk.mainloop``; so
    this function should be used to gate all calls to ``Tk.mainloop``.

    :warning: This function works by checking ``sys.stdin``.  If the
        user has modified ``sys.stdin``, then it may return incorrect
        results.
    :rtype: bool
nltk.induce_pcfg
Python Library Documentation: function induce_pcfg in module nltk.grammar

induce_pcfg(start, productions)
    Induce a PCFG grammar from a list of productions.

    The probability of a production A -> B C in a PCFG is:

    |                count(A -> B C)
    |  P(B, C | A) = ---------------       where \* is any right hand side
    |                 count(A -> \*)

    :param start: The start symbol
    :type start: Nonterminal
    :param productions: The list of productions that defines the grammar
    :type productions: list(Production)
nltk.inference
Python Library Documentation: package nltk.inference in nltk

NAME
    nltk.inference - Classes and interfaces for theorem proving and model building.

PACKAGE CONTENTS
    api
    discourse
    mace
    nonmonotonic
    prover9
    resolution
    tableau

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\inference\__init__.py

nltk.infile
Python Library Documentation: TextIOWrapper in module _io object

class TextIOWrapper(_TextIOBase)
 |  TextIOWrapper(buffer, encoding=None, errors=None, newline=None, line_buffering=False, write_through=False)
 |
 |  Character and line based layer over a BufferedIOBase object, buffer.
 |
 |  encoding gives the name of the encoding that the stream will be
 |  decoded or encoded with. It defaults to locale.getencoding().
 |
 |  errors determines the strictness of encoding and decoding (see
 |  help(codecs.Codec) or the documentation for codecs.register) and
 |  defaults to "strict".
 |
 |  newline controls how line endings are handled. It can be None, '',
 |  '\n', '\r', and '\r\n'.  It works as follows:
 |
 |  * On input, if newline is None, universal newlines mode is
 |    enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
 |    these are translated into '\n' before being returned to the
 |    caller. If it is '', universal newline mode is enabled, but line
 |    endings are returned to the caller untranslated. If it has any of
 |    the other legal values, input lines are only terminated by the given
 |    string, and the line ending is returned to the caller untranslated.
 |
 |  * On output, if newline is None, any '\n' characters written are
 |    translated to the system default line separator, os.linesep. If
 |    newline is '' or '\n', no translation takes place. If newline is any
 |    of the other legal values, any '\n' characters written are translated
 |    to the given string.
 |
 |  If line_buffering is True, a call to flush is implied when a call to
 |  write contains a newline character.
 |
 |  Method resolution order:
 |      TextIOWrapper
 |      _TextIOBase
 |      _IOBase
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __init__(self, /, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __next__(self, /)
 |      Implement next(self).
 |
 |  __reduce__(...)
 |      Helper for pickle.
 |
 |  __reduce_ex__(...)
 |      Helper for pickle.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  close(self, /)
 |      Flush and close the IO object.
 |
 |      This method has no effect if the file is already closed.
 |
 |  detach(self, /)
 |      Separate the underlying buffer from the TextIOBase and return it.
 |
 |      After the underlying buffer has been detached, the TextIO is in an unusable state.
 |
 |  fileno(self, /)
 |      Return underlying file descriptor if one exists.
 |
 |      Raise OSError if the IO object does not use a file descriptor.
 |
 |  flush(self, /)
 |      Flush write buffers, if applicable.
 |
 |      This is not implemented for read-only and non-blocking streams.
 |
 |  isatty(self, /)
 |      Return whether this is an 'interactive' stream.
 |
 |      Return False if it can't be determined.
 |
 |  read(self, size=-1, /)
 |      Read at most size characters from stream.
 |
 |      Read from underlying buffer until we have size characters or we hit EOF.
 |      If size is negative or omitted, read until EOF.
 |
 |  readable(self, /)
 |      Return whether object was opened for reading.
 |
 |      If False, read() will raise OSError.
 |
 |  readline(self, size=-1, /)
 |      Read until newline or EOF.
 |
 |      Return an empty string if EOF is hit immediately.
 |      If size is specified, at most size characters will be read.
 |
 |  reconfigure(self, /, *, encoding=None, errors=None, newline=None, line_buffering=None, write_through=None)
 |      Reconfigure the text stream with new parameters.
 |
 |      This also does an implicit stream flush.
 |
 |  seek(self, cookie, whence=0, /)
 |      Set the stream position, and return the new stream position.
 |
 |        cookie
 |          Zero or an opaque number returned by tell().
 |        whence
 |          The relative position to seek from.
 |
 |      Four operations are supported, given by the following argument
 |      combinations:
 |
 |      - seek(0, SEEK_SET): Rewind to the start of the stream.
 |      - seek(cookie, SEEK_SET): Restore a previous position;
 |        'cookie' must be a number returned by tell().
 |      - seek(0, SEEK_END): Fast-forward to the end of the stream.
 |      - seek(0, SEEK_CUR): Leave the current stream position unchanged.
 |
 |      Any other argument combinations are invalid,
 |      and may raise exceptions.
 |
 |  seekable(self, /)
 |      Return whether object supports random access.
 |
 |      If False, seek(), tell() and truncate() will raise OSError.
 |      This method may need to do a test seek().
 |
 |  tell(self, /)
 |      Return the stream position as an opaque number.
 |
 |      The return value of tell() can be given as input to seek(), to restore a
 |      previous stream position.
 |
 |  truncate(self, pos=None, /)
 |      Truncate file to size bytes.
 |
 |      File pointer is left unchanged. Size defaults to the current IO position
 |      as reported by tell(). Return the new size.
 |
 |  writable(self, /)
 |      Return whether object was opened for writing.
 |
 |      If False, write() will raise OSError.
 |
 |  write(self, text, /)
 |      Write string s to stream.
 |
 |      Return the number of characters written
 |      (which is always equal to the length of the string).
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  buffer
 |
 |  closed
 |
 |  encoding
 |      Encoding of the text stream.
 |
 |      Subclasses should override.
 |
 |  errors
 |      The error setting of the decoder or encoder.
 |
 |      Subclasses should override.
 |
 |  line_buffering
 |
 |  name
 |
 |  newlines
 |      Line endings translated so far.
 |
 |      Only line endings translated during reading are considered.
 |
 |      Subclasses should override.
 |
 |  write_through
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from _IOBase:
 |
 |  __del__(...)
 |
 |  __enter__(...)
 |
 |  __exit__(...)
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  readlines(self, hint=-1, /)
 |      Return a list of lines from the stream.
 |
 |      hint can be specified to control the number of lines read: no more
 |      lines will be read if the total size (in bytes/characters) of all
 |      lines so far exceeds hint.
 |
 |  writelines(self, lines, /)
 |      Write a list of lines to stream.
 |
 |      Line separators are not added, so it is usual for each of the
 |      lines provided to have a line separator at the end.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from _IOBase:
 |
 |  __dict__
nltk.inspect
Python Library Documentation: module inspect

NAME
    inspect - Get useful information from live Python objects.

MODULE REFERENCE
    https://docs.python.org/3.12/library/inspect.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION
    This module encapsulates the interface provided by the internal special
    attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
    It also provides some help for examining source code and class layout.

    Here are some of the useful functions provided by this module:

        ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
            isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
            isroutine() - check object types
        getmembers() - get members of an object that satisfy a given condition

        getfile(), getsourcefile(), getsource() - find an object's source code
        getdoc(), getcomments() - get documentation on an object
        getmodule() - determine the module that an object came from
        getclasstree() - arrange classes so as to represent their hierarchy

        getargvalues(), getcallargs() - get info about function arguments
        getfullargspec() - same, with support for Python 3 features
        formatargvalues() - format an argument spec
        getouterframes(), getinnerframes() - get info about frames
        currentframe() - get the current stack frame
        stack(), trace() - get info about frames on the stack or in a traceback

        signature() - get a Signature object for the callable

        get_annotations() - safely compute an object's annotations

CLASSES
    builtins.Exception(builtins.BaseException)
        ClassFoundException
        EndOfBlock
    builtins.object
        BlockFinder
        BoundArguments
        Parameter
        Signature
    builtins.tuple(builtins.object)
        ArgInfo
        Arguments
        Attribute
        ClosureVars
        FullArgSpec
    enum.IntFlag(builtins.int, enum.ReprEnum, enum.Flag)
        BufferFlags
    _FrameInfo(builtins.tuple)
        FrameInfo
    _Traceback(builtins.tuple)
        Traceback

    class ArgInfo(builtins.tuple)
     |  ArgInfo(args, varargs, keywords, locals)
     |
     |  ArgInfo(args, varargs, keywords, locals)
     |
     |  Method resolution order:
     |      ArgInfo
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __getnewargs__(self) from collections.ArgInfo
     |      Return self as a plain tuple.  Used by copy and pickle.
     |
     |  __repr__(self) from collections.ArgInfo
     |      Return a nicely formatted representation string
     |
     |  _asdict(self) from collections.ArgInfo
     |      Return a new dict which maps field names to their values.
     |
     |  _replace(self, /, **kwds) from collections.ArgInfo
     |      Return a new ArgInfo object replacing specified fields with new values
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  _make(iterable) from collections.ArgInfo
     |      Make a new ArgInfo object from a sequence or iterable
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(_cls, args, varargs, keywords, locals) from namedtuple_ArgInfo.ArgInfo
     |      Create new instance of ArgInfo(args, varargs, keywords, locals)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  args
     |      Alias for field number 0
     |
     |  varargs
     |      Alias for field number 1
     |
     |  keywords
     |      Alias for field number 2
     |
     |  locals
     |      Alias for field number 3
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('args', 'varargs', 'keywords', 'locals')
     |
     |  _field_defaults = {}
     |
     |  _fields = ('args', 'varargs', 'keywords', 'locals')
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class Arguments(builtins.tuple)
     |  Arguments(args, varargs, varkw)
     |
     |  Arguments(args, varargs, varkw)
     |
     |  Method resolution order:
     |      Arguments
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __getnewargs__(self) from collections.Arguments
     |      Return self as a plain tuple.  Used by copy and pickle.
     |
     |  __repr__(self) from collections.Arguments
     |      Return a nicely formatted representation string
     |
     |  _asdict(self) from collections.Arguments
     |      Return a new dict which maps field names to their values.
     |
     |  _replace(self, /, **kwds) from collections.Arguments
     |      Return a new Arguments object replacing specified fields with new values
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  _make(iterable) from collections.Arguments
     |      Make a new Arguments object from a sequence or iterable
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(_cls, args, varargs, varkw) from namedtuple_Arguments.Arguments
     |      Create new instance of Arguments(args, varargs, varkw)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  args
     |      Alias for field number 0
     |
     |  varargs
     |      Alias for field number 1
     |
     |  varkw
     |      Alias for field number 2
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('args', 'varargs', 'varkw')
     |
     |  _field_defaults = {}
     |
     |  _fields = ('args', 'varargs', 'varkw')
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class Attribute(builtins.tuple)
     |  Attribute(name, kind, defining_class, object)
     |
     |  Attribute(name, kind, defining_class, object)
     |
     |  Method resolution order:
     |      Attribute
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __getnewargs__(self) from collections.Attribute
     |      Return self as a plain tuple.  Used by copy and pickle.
     |
     |  __repr__(self) from collections.Attribute
     |      Return a nicely formatted representation string
     |
     |  _asdict(self) from collections.Attribute
     |      Return a new dict which maps field names to their values.
     |
     |  _replace(self, /, **kwds) from collections.Attribute
     |      Return a new Attribute object replacing specified fields with new values
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  _make(iterable) from collections.Attribute
     |      Make a new Attribute object from a sequence or iterable
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(_cls, name, kind, defining_class, object) from namedtuple_Attribute.Attribute
     |      Create new instance of Attribute(name, kind, defining_class, object)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  name
     |      Alias for field number 0
     |
     |  kind
     |      Alias for field number 1
     |
     |  defining_class
     |      Alias for field number 2
     |
     |  object
     |      Alias for field number 3
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('name', 'kind', 'defining_class', 'object')
     |
     |  _field_defaults = {}
     |
     |  _fields = ('name', 'kind', 'defining_class', 'object')
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class BlockFinder(builtins.object)
     |  Provide a tokeneater() method to detect the end of a code block.
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  tokeneater(self, type, token, srowcol, erowcol, line)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BoundArguments(builtins.object)
     |  BoundArguments(signature, arguments)
     |
     |  Result of `Signature.bind` call.  Holds the mapping of arguments
     |  to the function's parameters.
     |
     |  Has the following public attributes:
     |
     |  * arguments : dict
     |      An ordered mutable mapping of parameters' names to arguments' values.
     |      Does not contain arguments' default values.
     |  * signature : Signature
     |      The Signature object that created this instance.
     |  * args : tuple
     |      Tuple of positional arguments values.
     |  * kwargs : dict
     |      Dict of keyword arguments values.
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __getstate__(self)
     |      Helper for pickle.
     |
     |  __init__(self, signature, arguments)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __setstate__(self, state)
     |
     |  apply_defaults(self)
     |      Set default values for missing arguments.
     |
     |      For variable-positional arguments (*args) the default is an
     |      empty tuple.
     |
     |      For variable-keyword arguments (**kwargs) the default is an
     |      empty dict.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  args
     |
     |  kwargs
     |
     |  signature
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  arguments
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None

    class BufferFlags(enum.IntFlag)
     |  BufferFlags(*values)
     |
     |  Method resolution order:
     |      BufferFlags
     |      enum.IntFlag
     |      builtins.int
     |      enum.ReprEnum
     |      enum.Flag
     |      enum.Enum
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __and__(self, other) from enum.Flag
     |
     |  __format__(self, format_spec, /) from builtins.int
     |      Convert to a string according to format_spec.
     |
     |  __invert__(self) from enum.Flag
     |
     |  __new__(cls, value) from enum.Enum
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  __or__(self, other) from enum.Flag
     |      Return self|value.
     |
     |  __rand__ = __and__(self, other)
     |
     |  __ror__ = __or__(self, other)
     |
     |  __rxor__ = __xor__(self, other)
     |
     |  __xor__(self, other) from enum.Flag
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  FORMAT = <BufferFlags.FORMAT: 4>
     |
     |  ND = <BufferFlags.ND: 8>
     |
     |  READ = <BufferFlags.READ: 256>
     |
     |  WRITABLE = <BufferFlags.WRITABLE: 1>
     |
     |  WRITE = <BufferFlags.WRITE: 512>
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from enum.IntFlag:
     |
     |  __repr__(self) from enum.Flag
     |      Return repr(self).
     |
     |  __str__ = __repr__(self, /) from builtins.int
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.int:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __ceil__(...)
     |      Ceiling of an Integral returns itself.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floor__(...)
     |      Flooring an Integral returns itself.
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getnewargs__(self, /)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __round__(...)
     |      Rounding an Integral returns itself.
     |
     |      Rounding with an ndigits argument also returns an integer.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __sizeof__(self, /)
     |      Returns size in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __trunc__(...)
     |      Truncating an Integral returns itself.
     |
     |  as_integer_ratio(self, /)
     |      Return a pair of integers, whose ratio is equal to the original int.
     |
     |      The ratio is in lowest terms and has a positive denominator.
     |
     |      >>> (10).as_integer_ratio()
     |      (10, 1)
     |      >>> (-10).as_integer_ratio()
     |      (-10, 1)
     |      >>> (0).as_integer_ratio()
     |      (0, 1)
     |
     |  bit_count(self, /)
     |      Number of ones in the binary representation of the absolute value of self.
     |
     |      Also known as the population count.
     |
     |      >>> bin(13)
     |      '0b1101'
     |      >>> (13).bit_count()
     |      3
     |
     |  bit_length(self, /)
     |      Number of bits necessary to represent self in binary.
     |
     |      >>> bin(37)
     |      '0b100101'
     |      >>> (37).bit_length()
     |      6
     |
     |  conjugate(...)
     |      Returns self, the complex conjugate of any int.
     |
     |  is_integer(self, /)
     |      Returns True. Exists for duck type compatibility with float.is_integer.
     |
     |  to_bytes(self, /, length=1, byteorder='big', *, signed=False)
     |      Return an array of bytes representing an integer.
     |
     |      length
     |        Length of bytes object to use.  An OverflowError is raised if the
     |        integer is not representable with the given number of bytes.  Default
     |        is length 1.
     |      byteorder
     |        The byte order used to represent the integer.  If byteorder is 'big',
     |        the most significant byte is at the beginning of the byte array.  If
     |        byteorder is 'little', the most significant byte is at the end of the
     |        byte array.  To request the native byte order of the host system, use
     |        `sys.byteorder' as the byte order value.  Default is to use 'big'.
     |      signed
     |        Determines whether two's complement is used to represent the integer.
     |        If signed is False and a negative integer is given, an OverflowError
     |        is raised.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.int:
     |
     |  from_bytes(bytes, byteorder='big', *, signed=False)
     |      Return the integer represented by the given array of bytes.
     |
     |      bytes
     |        Holds the array of bytes to convert.  The argument must either
     |        support the buffer protocol or be an iterable object producing bytes.
     |        Bytes and bytearray are examples of built-in objects that support the
     |        buffer protocol.
     |      byteorder
     |        The byte order used to represent the integer.  If byteorder is 'big',
     |        the most significant byte is at the beginning of the byte array.  If
     |        byteorder is 'little', the most significant byte is at the end of the
     |        byte array.  To request the native byte order of the host system, use
     |        `sys.byteorder' as the byte order value.  Default is to use 'big'.
     |      signed
     |        Indicates whether two's complement is used to represent the integer.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.int:
     |
     |  denominator
     |      the denominator of a rational number in lowest terms
     |
     |  imag
     |      the imaginary part of a complex number
     |
     |  numerator
     |      the numerator of a rational number in lowest terms
     |
     |  real
     |      the real part of a complex number
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from enum.Flag:
     |
     |  __contains__(self, other)
     |      Returns True if self has at least the same flags set as other.
     |
     |  __iter__(self)
     |      Returns flags in definition order.
     |
     |  __len__(self)
     |      Return the number of members (no aliases)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from enum.Enum:
     |
     |  __dir__(self)
     |      Returns public methods and other interesting attributes.
     |
     |  __init__(self, *args, **kwds)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __reduce_ex__(self, proto)
     |      Helper for pickle.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from enum.Enum:
     |
     |  name
     |      The name of the Enum member.
     |
     |  value
     |      The value of the Enum member.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from enum.EnumType:
     |
     |  __getitem__(name)
     |      Return the member matching `name`.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from enum.EnumType:
     |
     |  __members__
     |      Returns a mapping of member name->value.
     |
     |      This mapping lists all enum members, including aliases. Note that this
     |      is a read-only view of the internal mapping.

    class ClassFoundException(builtins.Exception)
     |  Method resolution order:
     |      ClassFoundException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class ClosureVars(builtins.tuple)
     |  ClosureVars(nonlocals, globals, builtins, unbound)
     |
     |  ClosureVars(nonlocals, globals, builtins, unbound)
     |
     |  Method resolution order:
     |      ClosureVars
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __getnewargs__(self) from collections.ClosureVars
     |      Return self as a plain tuple.  Used by copy and pickle.
     |
     |  __repr__(self) from collections.ClosureVars
     |      Return a nicely formatted representation string
     |
     |  _asdict(self) from collections.ClosureVars
     |      Return a new dict which maps field names to their values.
     |
     |  _replace(self, /, **kwds) from collections.ClosureVars
     |      Return a new ClosureVars object replacing specified fields with new values
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  _make(iterable) from collections.ClosureVars
     |      Make a new ClosureVars object from a sequence or iterable
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(_cls, nonlocals, globals, builtins, unbound) from namedtuple_ClosureVars.ClosureVars
     |      Create new instance of ClosureVars(nonlocals, globals, builtins, unbound)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  nonlocals
     |      Alias for field number 0
     |
     |  globals
     |      Alias for field number 1
     |
     |  builtins
     |      Alias for field number 2
     |
     |  unbound
     |      Alias for field number 3
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('nonlocals', 'globals', 'builtins', 'unbound')
     |
     |  _field_defaults = {}
     |
     |  _fields = ('nonlocals', 'globals', 'builtins', 'unbound')
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class EndOfBlock(builtins.Exception)
     |  Method resolution order:
     |      EndOfBlock
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class FrameInfo(_FrameInfo)
     |  FrameInfo(frame, filename, lineno, function, code_context, index, *, positions=None)
     |
     |  Method resolution order:
     |      FrameInfo
     |      _FrameInfo
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __repr__(self)
     |      Return a nicely formatted representation string
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(cls, frame, filename, lineno, function, code_context, index, *, positions=None)
     |      Create new instance of _FrameInfo(frame, filename, lineno, function, code_context, index)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _FrameInfo:
     |
     |  __getnewargs__(self) from collections._FrameInfo
     |      Return self as a plain tuple.  Used by copy and pickle.
     |
     |  _asdict(self) from collections._FrameInfo
     |      Return a new dict which maps field names to their values.
     |
     |  _replace(self, /, **kwds) from collections._FrameInfo
     |      Return a new _FrameInfo object replacing specified fields with new values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from _FrameInfo:
     |
     |  _make(iterable) from collections._FrameInfo
     |      Make a new _FrameInfo object from a sequence or iterable
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from _FrameInfo:
     |
     |  frame
     |      Alias for field number 0
     |
     |  filename
     |      Alias for field number 1
     |
     |  lineno
     |      Alias for field number 2
     |
     |  function
     |      Alias for field number 3
     |
     |  code_context
     |      Alias for field number 4
     |
     |  index
     |      Alias for field number 5
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from _FrameInfo:
     |
     |  __match_args__ = ('frame', 'filename', 'lineno', 'function', 'code_con...
     |
     |  _field_defaults = {}
     |
     |  _fields = ('frame', 'filename', 'lineno', 'function', 'code_context', ...
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class FullArgSpec(builtins.tuple)
     |  FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)
     |
     |  FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)
     |
     |  Method resolution order:
     |      FullArgSpec
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __getnewargs__(self) from collections.FullArgSpec
     |      Return self as a plain tuple.  Used by copy and pickle.
     |
     |  __repr__(self) from collections.FullArgSpec
     |      Return a nicely formatted representation string
     |
     |  _asdict(self) from collections.FullArgSpec
     |      Return a new dict which maps field names to their values.
     |
     |  _replace(self, /, **kwds) from collections.FullArgSpec
     |      Return a new FullArgSpec object replacing specified fields with new values
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  _make(iterable) from collections.FullArgSpec
     |      Make a new FullArgSpec object from a sequence or iterable
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(_cls, args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations) from namedtuple_FullArgSpec.FullArgSpec
     |      Create new instance of FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  args
     |      Alias for field number 0
     |
     |  varargs
     |      Alias for field number 1
     |
     |  varkw
     |      Alias for field number 2
     |
     |  defaults
     |      Alias for field number 3
     |
     |  kwonlyargs
     |      Alias for field number 4
     |
     |  kwonlydefaults
     |      Alias for field number 5
     |
     |  annotations
     |      Alias for field number 6
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('args', 'varargs', 'varkw', 'defaults', 'kwonlyargs'...
     |
     |  _field_defaults = {}
     |
     |  _fields = ('args', 'varargs', 'varkw', 'defaults', 'kwonlyargs', 'kwon...
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class Parameter(builtins.object)
     |  Parameter(name, kind, *, default, annotation)
     |
     |  Represents a parameter in a function signature.
     |
     |  Has the following public attributes:
     |
     |  * name : str
     |      The name of the parameter as a string.
     |  * default : object
     |      The default value for the parameter if specified.  If the
     |      parameter has no default value, this attribute is set to
     |      `Parameter.empty`.
     |  * annotation
     |      The annotation for the parameter if specified.  If the
     |      parameter has no annotation, this attribute is set to
     |      `Parameter.empty`.
     |  * kind : str
     |      Describes how argument values are bound to the parameter.
     |      Possible values: `Parameter.POSITIONAL_ONLY`,
     |      `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`,
     |      `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, name, kind, *, default, annotation)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __reduce__(self)
     |      Helper for pickle.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __setstate__(self, state)
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  replace(self, *, name=<class 'inspect._void'>, kind=<class 'inspect._void'>, annotation=<class 'inspect._void'>, default=<class 'inspect._void'>)
     |      Creates a customized copy of the Parameter.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  annotation
     |
     |  default
     |
     |  kind
     |
     |  name
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  KEYWORD_ONLY = <_ParameterKind.KEYWORD_ONLY: 3>
     |
     |  POSITIONAL_ONLY = <_ParameterKind.POSITIONAL_ONLY: 0>
     |
     |  POSITIONAL_OR_KEYWORD = <_ParameterKind.POSITIONAL_OR_KEYWORD: 1>
     |
     |  VAR_KEYWORD = <_ParameterKind.VAR_KEYWORD: 4>
     |
     |  VAR_POSITIONAL = <_ParameterKind.VAR_POSITIONAL: 2>
     |
     |  empty = <class 'inspect._empty'>
     |      Marker object for Signature.empty and Parameter.empty.

    class Signature(builtins.object)
     |  Signature(parameters=None, *, return_annotation, __validate_parameters__=True)
     |
     |  A Signature object represents the overall signature of a function.
     |  It stores a Parameter object for each parameter accepted by the
     |  function, as well as information specific to the function itself.
     |
     |  A Signature object has the following public attributes and methods:
     |
     |  * parameters : OrderedDict
     |      An ordered mapping of parameters' names to the corresponding
     |      Parameter objects (keyword-only arguments are in the same order
     |      as listed in `code.co_varnames`).
     |  * return_annotation : object
     |      The annotation for the return type of the function if specified.
     |      If the function has no annotation for its return type, this
     |      attribute is set to `Signature.empty`.
     |  * bind(*args, **kwargs) -> BoundArguments
     |      Creates a mapping from positional and keyword arguments to
     |      parameters.
     |  * bind_partial(*args, **kwargs) -> BoundArguments
     |      Creates a partial mapping from positional and keyword arguments
     |      to parameters (simulating 'functools.partial' behavior.)
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, parameters=None, *, return_annotation, __validate_parameters__=True)
     |      Constructs Signature from the given list of Parameter
     |      objects and 'return_annotation'.  All arguments are optional.
     |
     |  __reduce__(self)
     |      Helper for pickle.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __setstate__(self, state)
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  bind(self, /, *args, **kwargs)
     |      Get a BoundArguments object, that maps the passed `args`
     |      and `kwargs` to the function's signature.  Raises `TypeError`
     |      if the passed arguments can not be bound.
     |
     |  bind_partial(self, /, *args, **kwargs)
     |      Get a BoundArguments object, that partially maps the
     |      passed `args` and `kwargs` to the function's signature.
     |      Raises `TypeError` if the passed arguments can not be bound.
     |
     |  replace(self, *, parameters=<class 'inspect._void'>, return_annotation=<class 'inspect._void'>)
     |      Creates a customized copy of the Signature.
     |      Pass 'parameters' and/or 'return_annotation' arguments
     |      to override them in the new copy.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  from_callable(obj, *, follow_wrapped=True, globals=None, locals=None, eval_str=False)
     |      Constructs Signature for the given callable object.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  parameters
     |
     |  return_annotation
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  empty = <class 'inspect._empty'>
     |      Marker object for Signature.empty and Parameter.empty.

    class Traceback(_Traceback)
     |  Traceback(filename, lineno, function, code_context, index, *, positions=None)
     |
     |  Method resolution order:
     |      Traceback
     |      _Traceback
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __repr__(self)
     |      Return a nicely formatted representation string
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(cls, filename, lineno, function, code_context, index, *, positions=None)
     |      Create new instance of _Traceback(filename, lineno, function, code_context, index)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _Traceback:
     |
     |  __getnewargs__(self) from collections._Traceback
     |      Return self as a plain tuple.  Used by copy and pickle.
     |
     |  _asdict(self) from collections._Traceback
     |      Return a new dict which maps field names to their values.
     |
     |  _replace(self, /, **kwds) from collections._Traceback
     |      Return a new _Traceback object replacing specified fields with new values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from _Traceback:
     |
     |  _make(iterable) from collections._Traceback
     |      Make a new _Traceback object from a sequence or iterable
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from _Traceback:
     |
     |  filename
     |      Alias for field number 0
     |
     |  lineno
     |      Alias for field number 1
     |
     |  function
     |      Alias for field number 2
     |
     |  code_context
     |      Alias for field number 3
     |
     |  index
     |      Alias for field number 4
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from _Traceback:
     |
     |  __match_args__ = ('filename', 'lineno', 'function', 'code_context', 'i...
     |
     |  _field_defaults = {}
     |
     |  _fields = ('filename', 'lineno', 'function', 'code_context', 'index')
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

FUNCTIONS
    classify_class_attrs(cls)
        Return list of attribute-descriptor tuples.

        For each name in dir(cls), the return list contains a 4-tuple
        with these elements:

            0. The name (a string).

            1. The kind of attribute this is, one of these strings:
                   'class method'    created via classmethod()
                   'static method'   created via staticmethod()
                   'property'        created via property()
                   'method'          any other flavor of method or descriptor
                   'data'            not a method

            2. The class which defined this attribute (a class).

            3. The object as obtained by calling getattr; if this fails, or if the
               resulting object does not live anywhere in the class' mro (including
               metaclasses) then the object is looked up in the defining class's
               dict (found by walking the mro).

        If one of the items in dir(cls) is stored in the metaclass it will now
        be discovered and not have None be listed as the class in which it was
        defined.  Any items whose home class cannot be discovered are skipped.

    cleandoc(doc)
        Clean up indentation from docstrings.

        Any whitespace that can be uniformly removed from the second line
        onwards is removed.

    currentframe()
        Return the frame of the caller or None if this is not possible.

    findsource(object)
        Return the entire source file and starting line number for an object.

        The argument may be a module, class, method, function, traceback, frame,
        or code object.  The source code is returned as a list of all the lines
        in the file and the line number indexes a line in that list.  An OSError
        is raised if the source code cannot be retrieved.

    formatannotation(annotation, base_module=None)

    formatannotationrelativeto(object)

    formatargvalues(args, varargs, varkw, locals, formatarg=<class 'str'>, formatvarargs=<function <lambda> at 0x0000028F8362C9A0>, formatvarkw=<function <lambda> at 0x0000028F8362CA40>, formatvalue=<function <lambda> at 0x0000028F8362CAE0>)
        Format an argument spec from the 4 values returned by getargvalues.

        The first four arguments are (args, varargs, varkw, locals).  The
        next four arguments are the corresponding optional formatting functions
        that are called to turn names and values into strings.  The ninth
        argument is an optional function to format the sequence of arguments.

    get_annotations(obj, *, globals=None, locals=None, eval_str=False)
        Compute the annotations dict for an object.

        obj may be a callable, class, or module.
        Passing in an object of any other type raises TypeError.

        Returns a dict.  get_annotations() returns a new dict every time
        it's called; calling it twice on the same object will return two
        different but equivalent dicts.

        This function handles several details for you:

          * If eval_str is true, values of type str will
            be un-stringized using eval().  This is intended
            for use with stringized annotations
            ("from __future__ import annotations").
          * If obj doesn't have an annotations dict, returns an
            empty dict.  (Functions and methods always have an
            annotations dict; classes, modules, and other types of
            callables may not.)
          * Ignores inherited annotations on classes.  If a class
            doesn't have its own annotations dict, returns an empty dict.
          * All accesses to object members and dict values are done
            using getattr() and dict.get() for safety.
          * Always, always, always returns a freshly-created dict.

        eval_str controls whether or not values of type str are replaced
        with the result of calling eval() on those values:

          * If eval_str is true, eval() is called on values of type str.
          * If eval_str is false (the default), values of type str are unchanged.

        globals and locals are passed in to eval(); see the documentation
        for eval() for more information.  If either globals or locals is
        None, this function may replace that value with a context-specific
        default, contingent on type(obj):

          * If obj is a module, globals defaults to obj.__dict__.
          * If obj is a class, globals defaults to
            sys.modules[obj.__module__].__dict__ and locals
            defaults to the obj class namespace.
          * If obj is a callable, globals defaults to obj.__globals__,
            although if obj is a wrapped function (using
            functools.update_wrapper()) it is first unwrapped.

    getabsfile(object, _filename=None)
        Return an absolute path to the source or compiled file for an object.

        The idea is for each object to have a unique origin, so this routine
        normalizes the result as much as possible.

    getargs(co)
        Get information about the arguments accepted by a code object.

        Three things are returned: (args, varargs, varkw), where
        'args' is the list of argument names. Keyword-only arguments are
        appended. 'varargs' and 'varkw' are the names of the * and **
        arguments or None.

    getargvalues(frame)
        Get information about arguments passed into a particular frame.

        A tuple of four things is returned: (args, varargs, varkw, locals).
        'args' is a list of the argument names.
        'varargs' and 'varkw' are the names of the * and ** arguments or None.
        'locals' is the locals dictionary of the given frame.

    getasyncgenlocals(agen)
        Get the mapping of asynchronous generator local variables to their current
        values.

        A dict is returned, with the keys the local variable names and values the
        bound values.

    getasyncgenstate(agen)
        Get current state of an asynchronous generator object.

        Possible states are:
          AGEN_CREATED: Waiting to start execution.
          AGEN_RUNNING: Currently being executed by the interpreter.
          AGEN_SUSPENDED: Currently suspended at a yield expression.
          AGEN_CLOSED: Execution has completed.

    getattr_static(obj, attr, default=<object object at 0x0000028F82DC87B0>)
        Retrieve attributes without triggering dynamic lookup via the
        descriptor protocol,  __getattr__ or __getattribute__.

        Note: this function may not be able to retrieve all attributes
        that getattr can fetch (like dynamically created attributes)
        and may find attributes that getattr can't (like descriptors
        that raise AttributeError). It can also return descriptor objects
        instead of instance members in some cases. See the
        documentation for details.

    getblock(lines)
        Extract the block of code at the top of the given list of lines.

    getcallargs(func, /, *positional, **named)
        Get the mapping of arguments to values.

        A dict is returned, with keys the function argument names (including the
        names of the * and ** arguments, if any), and values the respective bound
        values from 'positional' and 'named'.

    getclasstree(classes, unique=False)
        Arrange the given list of classes into a hierarchy of nested lists.

        Where a nested list appears, it contains classes derived from the class
        whose entry immediately precedes the list.  Each entry is a 2-tuple
        containing a class and a tuple of its base classes.  If the 'unique'
        argument is true, exactly one entry appears in the returned structure
        for each class in the given list.  Otherwise, classes using multiple
        inheritance and their descendants will appear multiple times.

    getclosurevars(func)
        Get the mapping of free variables to their current values.

        Returns a named tuple of dicts mapping the current nonlocal, global
        and builtin references as seen by the body of the function. A final
        set of unbound names that could not be resolved is also provided.

    getcomments(object)
        Get lines of comments immediately preceding an object's source code.

        Returns None when source can't be found.

    getcoroutinelocals(coroutine)
        Get the mapping of coroutine local variables to their current values.

        A dict is returned, with the keys the local variable names and values the
        bound values.

    getcoroutinestate(coroutine)
        Get current state of a coroutine object.

        Possible states are:
          CORO_CREATED: Waiting to start execution.
          CORO_RUNNING: Currently being executed by the interpreter.
          CORO_SUSPENDED: Currently suspended at an await expression.
          CORO_CLOSED: Execution has completed.

    getdoc(object)
        Get the documentation string for an object.

        All tabs are expanded to spaces.  To clean up docstrings that are
        indented to line up with blocks of code, any whitespace than can be
        uniformly removed from the second line onwards is removed.

    getfile(object)
        Work out which source or compiled file an object was defined in.

    getframeinfo(frame, context=1)
        Get information about a frame or traceback object.

        A tuple of five things is returned: the filename, the line number of
        the current line, the function name, a list of lines of context from
        the source code, and the index of the current line within that list.
        The optional second argument specifies the number of lines of context
        to return, which are centered around the current line.

    getfullargspec(func)
        Get the names and default values of a callable object's parameters.

        A tuple of seven things is returned:
        (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations).
        'args' is a list of the parameter names.
        'varargs' and 'varkw' are the names of the * and ** parameters or None.
        'defaults' is an n-tuple of the default values of the last n parameters.
        'kwonlyargs' is a list of keyword-only parameter names.
        'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults.
        'annotations' is a dictionary mapping parameter names to annotations.

        Notable differences from inspect.signature():
          - the "self" parameter is always reported, even for bound methods
          - wrapper chains defined by __wrapped__ *not* unwrapped automatically

    getgeneratorlocals(generator)
        Get the mapping of generator local variables to their current values.

        A dict is returned, with the keys the local variable names and values the
        bound values.

    getgeneratorstate(generator)
        Get current state of a generator-iterator.

        Possible states are:
          GEN_CREATED: Waiting to start execution.
          GEN_RUNNING: Currently being executed by the interpreter.
          GEN_SUSPENDED: Currently suspended at a yield expression.
          GEN_CLOSED: Execution has completed.

    getinnerframes(tb, context=1)
        Get a list of records for a traceback's frame and all lower frames.

        Each record contains a frame object, filename, line number, function
        name, a list of lines of context, and index within the context.

    getlineno(frame)
        Get the line number from a frame object, allowing for optimization.

    getmembers(object, predicate=None)
        Return all members of an object as (name, value) pairs sorted by name.
        Optionally, only return members that satisfy a given predicate.

    getmembers_static(object, predicate=None)
        Return all members of an object as (name, value) pairs sorted by name
        without triggering dynamic lookup via the descriptor protocol,
        __getattr__ or __getattribute__. Optionally, only return members that
        satisfy a given predicate.

        Note: this function may not be able to retrieve all members
           that getmembers can fetch (like dynamically created attributes)
           and may find members that getmembers can't (like descriptors
           that raise AttributeError). It can also return descriptor objects
           instead of instance members in some cases.

    getmodule(object, _filename=None)
        Return the module an object was defined in, or None if not found.

    getmodulename(path)
        Return the module name for a given file, or None.

    getmro(cls)
        Return tuple of base classes (including cls) in method resolution order.

    getouterframes(frame, context=1)
        Get a list of records for a frame and all higher (calling) frames.

        Each record contains a frame object, filename, line number, function
        name, a list of lines of context, and index within the context.

    getsource(object)
        Return the text of the source code for an object.

        The argument may be a module, class, method, function, traceback, frame,
        or code object.  The source code is returned as a single string.  An
        OSError is raised if the source code cannot be retrieved.

    getsourcefile(object)
        Return the filename that can be used to locate an object's source.
        Return None if no way can be identified to get the source.

    getsourcelines(object)
        Return a list of source lines and starting line number for an object.

        The argument may be a module, class, method, function, traceback, frame,
        or code object.  The source code is returned as a list of the lines
        corresponding to the object and the line number indicates where in the
        original source file the first line of code was found.  An OSError is
        raised if the source code cannot be retrieved.

    indentsize(line)
        Return the indent size, in spaces, at the start of a line of text.

    isabstract(object)
        Return true if the object is an abstract base class (ABC).

    isasyncgen(object)
        Return true if the object is an asynchronous generator.

    isasyncgenfunction(obj)
        Return true if the object is an asynchronous generator function.

        Asynchronous generator functions are defined with "async def"
        syntax and have "yield" expressions in their body.

    isawaitable(object)
        Return true if object can be passed to an ``await`` expression.

    isbuiltin(object)
        Return true if the object is a built-in function or method.

        Built-in functions and methods provide these attributes:
            __doc__         documentation string
            __name__        original name of this function or method
            __self__        instance to which a method is bound, or None

    isclass(object)
        Return true if the object is a class.

    iscode(object)
        Return true if the object is a code object.

        Code objects provide these attributes:
            co_argcount         number of arguments (not including *, ** args
                                or keyword only arguments)
            co_code             string of raw compiled bytecode
            co_cellvars         tuple of names of cell variables
            co_consts           tuple of constants used in the bytecode
            co_filename         name of file in which this code object was created
            co_firstlineno      number of first line in Python source code
            co_flags            bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
                                | 16=nested | 32=generator | 64=nofree | 128=coroutine
                                | 256=iterable_coroutine | 512=async_generator
            co_freevars         tuple of names of free variables
            co_posonlyargcount  number of positional only arguments
            co_kwonlyargcount   number of keyword only arguments (not including ** arg)
            co_lnotab           encoded mapping of line numbers to bytecode indices
            co_name             name with which this code object was defined
            co_names            tuple of names other than arguments and function locals
            co_nlocals          number of local variables
            co_stacksize        virtual machine stack space required
            co_varnames         tuple of names of arguments and local variables

    iscoroutine(object)
        Return true if the object is a coroutine.

    iscoroutinefunction(obj)
        Return true if the object is a coroutine function.

        Coroutine functions are normally defined with "async def" syntax, but may
        be marked via markcoroutinefunction.

    isdatadescriptor(object)
        Return true if the object is a data descriptor.

        Data descriptors have a __set__ or a __delete__ attribute.  Examples are
        properties (defined in Python) and getsets and members (defined in C).
        Typically, data descriptors will also have __name__ and __doc__ attributes
        (properties, getsets, and members have both of these attributes), but this
        is not guaranteed.

    isframe(object)
        Return true if the object is a frame object.

        Frame objects provide these attributes:
            f_back          next outer frame object (this frame's caller)
            f_builtins      built-in namespace seen by this frame
            f_code          code object being executed in this frame
            f_globals       global namespace seen by this frame
            f_lasti         index of last attempted instruction in bytecode
            f_lineno        current line number in Python source code
            f_locals        local namespace seen by this frame
            f_trace         tracing function for this frame, or None

    isfunction(object)
        Return true if the object is a user-defined function.

        Function objects provide these attributes:
            __doc__         documentation string
            __name__        name with which this function was defined
            __code__        code object containing compiled function bytecode
            __defaults__    tuple of any default values for arguments
            __globals__     global namespace in which this function was defined
            __annotations__ dict of parameter annotations
            __kwdefaults__  dict of keyword only parameters with defaults

    isgenerator(object)
        Return true if the object is a generator.

        Generator objects provide these attributes:
            __iter__        defined to support iteration over container
            close           raises a new GeneratorExit exception inside the
                            generator to terminate the iteration
            gi_code         code object
            gi_frame        frame object or possibly None once the generator has
                            been exhausted
            gi_running      set to 1 when generator is executing, 0 otherwise
            next            return the next item from the container
            send            resumes the generator and "sends" a value that becomes
                            the result of the current yield-expression
            throw           used to raise an exception inside the generator

    isgeneratorfunction(obj)
        Return true if the object is a user-defined generator function.

        Generator function objects provide the same attributes as functions.
        See help(isfunction) for a list of attributes.

    isgetsetdescriptor(object)
        Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules.

    ismemberdescriptor(object)
        Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules.

    ismethod(object)
        Return true if the object is an instance method.

    ismethoddescriptor(object)
        Return true if the object is a method descriptor.

        But not if ismethod() or isclass() or isfunction() are true.

        This is new in Python 2.2, and, for example, is true of int.__add__.
        An object passing this test has a __get__ attribute but not a __set__
        attribute, but beyond that the set of attributes varies.  __name__ is
        usually sensible, and __doc__ often is.

        Methods implemented via descriptors that also pass one of the other
        tests return false from the ismethoddescriptor() test, simply because
        the other tests promise more -- you can, e.g., count on having the
        __func__ attribute (etc) when an object passes ismethod().

    ismethodwrapper(object)
        Return true if the object is a method wrapper.

    ismodule(object)
        Return true if the object is a module.

    isroutine(object)
        Return true if the object is any kind of function or method.

    istraceback(object)
        Return true if the object is a traceback.

        Traceback objects provide these attributes:
            tb_frame        frame object at this level
            tb_lasti        index of last attempted instruction in bytecode
            tb_lineno       current line number in Python source code
            tb_next         next inner traceback object (called by this level)

    markcoroutinefunction(func)
        Decorator to ensure callable is recognised as a coroutine function.

    signature(obj, *, follow_wrapped=True, globals=None, locals=None, eval_str=False)
        Get a signature object for the passed callable.

    stack(context=1)
        Return a list of records for the stack above the caller's frame.

    trace(context=1)
        Return a list of records for the stack below the current exception.

    unwrap(func, *, stop=None)
        Get the object wrapped by *func*.

        Follows the chain of :attr:`__wrapped__` attributes returning the last
        object in the chain.

        *stop* is an optional callback accepting an object in the wrapper chain
        as its sole argument that allows the unwrapping to be terminated early if
        the callback returns a true value. If the callback never returns a true
        value, the last object in the chain is returned as usual. For example,
        :func:`signature` uses this to stop unwrapping if any object in the
        chain has a ``__signature__`` attribute defined.

        :exc:`ValueError` is raised if a cycle is encountered.

    walktree(classes, children, parent)
        Recursive helper function for getclasstree().

DATA
    AGEN_CLOSED = 'AGEN_CLOSED'
    AGEN_CREATED = 'AGEN_CREATED'
    AGEN_RUNNING = 'AGEN_RUNNING'
    AGEN_SUSPENDED = 'AGEN_SUSPENDED'
    CORO_CLOSED = 'CORO_CLOSED'
    CORO_CREATED = 'CORO_CREATED'
    CORO_RUNNING = 'CORO_RUNNING'
    CORO_SUSPENDED = 'CORO_SUSPENDED'
    CO_ASYNC_GENERATOR = 512
    CO_COROUTINE = 128
    CO_GENERATOR = 32
    CO_ITERABLE_COROUTINE = 256
    CO_NESTED = 16
    CO_NEWLOCALS = 2
    CO_NOFREE = 64
    CO_OPTIMIZED = 1
    CO_VARARGS = 4
    CO_VARKEYWORDS = 8
    GEN_CLOSED = 'GEN_CLOSED'
    GEN_CREATED = 'GEN_CREATED'
    GEN_RUNNING = 'GEN_RUNNING'
    GEN_SUSPENDED = 'GEN_SUSPENDED'
    TPFLAGS_IS_ABSTRACT = 1048576
    __all__ = ['AGEN_CLOSED', 'AGEN_CREATED', 'AGEN_RUNNING', 'AGEN_SUSPEN...

AUTHOR
    ('Ka-Ping Yee <ping@lfw.org>', 'Yury Selivanov <yselivanov@sprymix.com>')

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\inspect.py

nltk.install_opener
Python Library Documentation: function install_opener in module urllib.request

install_opener(opener)
nltk.internals
Python Library Documentation: module nltk.internals in nltk

NAME
    nltk.internals

DESCRIPTION
    # Natural Language Toolkit: Internal utility functions
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Steven Bird <stevenbird1@gmail.com>
    #         Edward Loper <edloper@gmail.com>
    #         Nitin Madnani <nmadnani@ets.org>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.ValueError(builtins.Exception)
        ReadError
    builtins.object
        Counter
        Deprecated
        ElementWrapper

    class Counter(builtins.object)
     |  Counter(initial_value=0)
     |
     |  A counter that auto-increments each time its value is read.
     |
     |  Methods defined here:
     |
     |  __init__(self, initial_value=0)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  get(self)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Deprecated(builtins.object)
     |  Deprecated(*args, **kwargs)
     |
     |  A base class used to mark deprecated classes.  A typical usage is to
     |  alert users that the name of a class has changed:
     |
     |      >>> from nltk.internals import Deprecated
     |      >>> class NewClassName:
     |      ...     pass # All logic goes here.
     |      ...
     |      >>> class OldClassName(Deprecated, NewClassName):
     |      ...     "Use NewClassName instead."
     |
     |  The docstring of the deprecated class will be used in the
     |  deprecation warning message.
     |
     |  Static methods defined here:
     |
     |  __new__(cls, *args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ElementWrapper(builtins.object)
     |  ElementWrapper(etree)
     |
     |  A wrapper around ElementTree Element objects whose main purpose is
     |  to provide nicer __repr__ and __str__ methods.  In addition, any
     |  of the wrapped Element's methods that return other Element objects
     |  are overridden to wrap those values before returning them.
     |
     |  This makes Elements more convenient to work with in
     |  interactive sessions and doctests, at the expense of some
     |  efficiency.
     |
     |  Methods defined here:
     |
     |  __delattr__(self, attr)
     |      Implement delattr(self, name).
     |
     |  __delitem__(self, index)
     |
     |  __delslice__(self, start, stop)
     |
     |  __getattr__(self, attrib)
     |
     |  __getitem__(self, index)
     |
     |  __getslice__(self, start, stop)
     |
     |  __init__(self, etree)
     |      Initialize a new Element wrapper for ``etree``.
     |
     |      If ``etree`` is a string, then it will be converted to an
     |      Element object using ``ElementTree.fromstring()`` first:
     |
     |          >>> ElementWrapper("<test></test>")
     |          <Element "<?xml version='1.0' encoding='utf8'?>\n<test />">
     |
     |  __len__(self)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __setattr__(self, attr, value)
     |      Implement setattr(self, name, value).
     |
     |  __setitem__(self, index, element)
     |
     |  __setslice__(self, start, stop, elements)
     |
     |  __str__(self)
     |      :return: the result of applying ``ElementTree.tostring()`` to
     |      the wrapped Element object.
     |
     |  find(self, path)
     |
     |  findall(self, path)
     |
     |  getchildren(self)
     |
     |  getiterator(self, tag=None)
     |
     |  makeelement(self, tag, attrib)
     |
     |  unwrap(self)
     |      Return the Element object wrapped by this wrapper.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(cls, etree)
     |      Create and return a wrapper around a given Element object.
     |      If ``etree`` is an ``ElementWrapper``, then ``etree`` is
     |      returned as-is.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ReadError(builtins.ValueError)
     |  ReadError(expected, position)
     |
     |  Exception raised by read_* functions when they fail.
     |  :param position: The index in the input string where an error occurred.
     |  :param expected: What was expected when an error occurred.
     |
     |  Method resolution order:
     |      ReadError
     |      builtins.ValueError
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, expected, position)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.ValueError:
     |
     |  __new__(*args, **kwargs) class method of builtins.ValueError
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

FUNCTIONS
    config_java(bin=None, options=None, verbose=False)
        Configure nltk's java interface, by letting nltk know where it can
        find the Java binary, and what extra options (if any) should be
        passed to Java when it is run.

        :param bin: The full path to the Java binary.  If not specified,
            then nltk will search the system for a Java binary; and if
            one is not found, it will raise a ``LookupError`` exception.
        :type bin: str
        :param options: A list of options that should be passed to the
            Java binary when it is called.  A common value is
            ``'-Xmx512m'``, which tells Java binary to increase
            the maximum heap size to 512 megabytes.  If no options are
            specified, then do not modify the options list.
        :type options: list(str)

    deprecated(message)
        A decorator used to mark functions as deprecated.  This will cause
        a warning to be printed the when the function is used.  Usage:

            >>> from nltk.internals import deprecated
            >>> @deprecated('Use foo() instead')
            ... def bar(x):
            ...     print(x/10)

    find_binary(name, path_to_bin=None, env_vars=(), searchpath=(), binary_names=None, url=None, verbose=False)

    find_binary_iter(name, path_to_bin=None, env_vars=(), searchpath=(), binary_names=None, url=None, verbose=False)
        Search for a file to be used by nltk.

        :param name: The name or path of the file.
        :param path_to_bin: The user-supplied binary location (deprecated)
        :param env_vars: A list of environment variable names to check.
        :param file_names: A list of alternative file names to check.
        :param searchpath: List of directories to search.
        :param url: URL presented to user for download help.
        :param verbose: Whether or not to print path when a file is found.

    find_dir(filename, env_vars=(), searchpath=(), file_names=None, url=None, verbose=False)

    find_file(filename, env_vars=(), searchpath=(), file_names=None, url=None, verbose=False)

    find_file_iter(filename, env_vars=(), searchpath=(), file_names=None, url=None, verbose=False, finding_dir=False)
        Search for a file to be used by nltk.

        :param filename: The name or path of the file.
        :param env_vars: A list of environment variable names to check.
        :param file_names: A list of alternative file names to check.
        :param searchpath: List of directories to search.
        :param url: URL presented to user for download help.
        :param verbose: Whether or not to print path when a file is found.

    find_jar(name_pattern, path_to_jar=None, env_vars=(), searchpath=(), url=None, verbose=False, is_regex=False)

    find_jar_iter(name_pattern, path_to_jar=None, env_vars=(), searchpath=(), url=None, verbose=False, is_regex=False)
        Search for a jar that is used by nltk.

        :param name_pattern: The name of the jar file
        :param path_to_jar: The user-supplied jar location, or None.
        :param env_vars: A list of environment variable names to check
                         in addition to the CLASSPATH variable which is
                         checked by default.
        :param searchpath: List of directories to search.
        :param is_regex: Whether name is a regular expression.

    find_jars_within_path(path_to_jars)

    import_from_stdlib(module)
        When python is run from within the nltk/ directory tree, the
        current directory is included at the beginning of the search path.
        Unfortunately, that means that modules within nltk can sometimes
        shadow standard library modules.  As an example, the stdlib
        'inspect' module will attempt to import the stdlib 'tokenize'
        module, but will instead end up importing NLTK's 'tokenize' module
        instead (causing the import to fail).

    is_writable(path)

    java(cmd, classpath=None, stdin=None, stdout=None, stderr=None, blocking=True, *, options=None)
        Execute the given java command, by opening a subprocess that calls
        Java.  If java has not yet been configured, it will be configured
        by calling ``config_java()`` with no arguments.

        :param cmd: The java command that should be called, formatted as
            a list of strings.  Typically, the first string will be the name
            of the java class; and the remaining strings will be arguments
            for that java class.
        :type cmd: list(str)

        :param classpath: A ``':'`` separated list of directories, JAR
            archives, and ZIP archives to search for class files.
        :type classpath: str

        :param stdin: Specify the executed program's
            standard input file handles, respectively.  Valid values are ``subprocess.PIPE``,
            an existing file descriptor (a positive integer), an existing
            file object, 'pipe', 'stdout', 'devnull' and None.  ``subprocess.PIPE`` indicates that a
            new pipe to the child should be created.  With None, no
            redirection will occur; the child's file handles will be
            inherited from the parent.  Additionally, stderr can be
            ``subprocess.STDOUT``, which indicates that the stderr data
            from the applications should be captured into the same file
            handle as for stdout.

        :param stdout: Specify the executed program's standard output file
            handle. See ``stdin`` for valid values.

        :param stderr: Specify the executed program's standard error file
            handle. See ``stdin`` for valid values.


        :param blocking: If ``false``, then return immediately after
            spawning the subprocess.  In this case, the return value is
            the ``Popen`` object, and not a ``(stdout, stderr)`` tuple.
        :param options: Java options to use for this subprocess call. If not
            specified, use the global options configured by ``config_java()``.

        :return: If ``blocking=True``, then return a tuple ``(stdout,
            stderr)``, containing the stdout and stderr outputs generated
            by the java command if the ``stdout`` and ``stderr`` parameters
            were set to ``subprocess.PIPE``; or None otherwise.  If
            ``blocking=False``, then return a ``subprocess.Popen`` object.

        :raise OSError: If the java command returns a nonzero return code.

    overridden(method)
        :return: True if ``method`` overrides some method with the same
            name in a base class.  This is typically used when defining
            abstract base classes or interfaces, to allow subclasses to define
            either of two related methods:

            >>> class EaterI:
            ...     '''Subclass must define eat() or batch_eat().'''
            ...     def eat(self, food):
            ...         if overridden(self.batch_eat):
            ...             return self.batch_eat([food])[0]
            ...         else:
            ...             raise NotImplementedError()
            ...     def batch_eat(self, foods):
            ...         return [self.eat(food) for food in foods]

        :type method: instance method

    raise_unorderable_types(ordering, a, b)

    read_int(s, start_position)
        If an integer begins at the specified position in the given
        string, then return a tuple ``(val, end_position)`` containing the
        value of the integer and the position where it ends.  Otherwise,
        raise a ``ReadError``.

        :param s: A string that will be checked to see if within which a
            Python integer exists.
        :type s: str

        :param start_position: The specified beginning position of the string ``s``
            to begin regex matching.
        :type start_position: int

        :return: A tuple containing the matched integer casted to an int,
            and the end position of the int in ``s``.
        :rtype: tuple(int, int)

        :raise ReadError: If the ``_READ_INT_RE`` regex doesn't return a
            match in ``s`` at ``start_position``.

        :Example:

        >>> from nltk.internals import read_int
        >>> read_int('42 is the answer', 0)
        (42, 2)

    read_number(s, start_position)
        If an integer or float begins at the specified position in the
        given string, then return a tuple ``(val, end_position)``
        containing the value of the number and the position where it ends.
        Otherwise, raise a ``ReadError``.

        :param s: A string that will be checked to see if within which a
            Python number exists.
        :type s: str

        :param start_position: The specified beginning position of the string ``s``
            to begin regex matching.
        :type start_position: int

        :return: A tuple containing the matched number casted to a ``float``,
            and the end position of the number in ``s``.
        :rtype: tuple(float, int)

        :raise ReadError: If the ``_READ_NUMBER_VALUE`` regex doesn't return a
            match in ``s`` at ``start_position``.

        :Example:

        >>> from nltk.internals import read_number
        >>> read_number('Pi is 3.14159', 6)
        (3.14159, 13)

    read_str(s, start_position)
        If a Python string literal begins at the specified position in the
        given string, then return a tuple ``(val, end_position)``
        containing the value of the string literal and the position where
        it ends.  Otherwise, raise a ``ReadError``.

        :param s: A string that will be checked to see if within which a
            Python string literal exists.
        :type s: str

        :param start_position: The specified beginning position of the string ``s``
            to begin regex matching.
        :type start_position: int

        :return: A tuple containing the matched string literal evaluated as a
            string and the end position of the string literal.
        :rtype: tuple(str, int)

        :raise ReadError: If the ``_STRING_START_RE`` regex doesn't return a
            match in ``s`` at ``start_position``, i.e., open quote. If the
            ``_STRING_END_RE`` regex doesn't return a match in ``s`` at the
            end of the first match, i.e., close quote.
        :raise ValueError: If an invalid string (i.e., contains an invalid
            escape sequence) is passed into the ``eval``.

        :Example:

        >>> from nltk.internals import read_str
        >>> read_str('"Hello", World!', 0)
        ('Hello', 7)

    slice_bounds(sequence, slice_obj, allow_step=False)
        Given a slice, return the corresponding (start, stop) bounds,
        taking into account None indices and negative indices.  The
        following guarantees are made for the returned start and stop values:

          - 0 <= start <= len(sequence)
          - 0 <= stop <= len(sequence)
          - start <= stop

        :raise ValueError: If ``slice_obj.step`` is not None.
        :param allow_step: If true, then the slice object may have a
            non-None step.  If it does, then return a tuple
            (start, stop, step).

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\internals.py

nltk.interpret_sents
Python Library Documentation: function interpret_sents in module nltk.sem.util

interpret_sents(inputs, grammar, semkey='SEM', trace=0)
    Add the semantic representation to each syntactic parse tree
    of each input sentence.

    :param inputs: a list of sentences
    :type inputs: list(str)
    :param grammar: ``FeatureGrammar`` or name of feature-based grammar
    :type grammar: nltk.grammar.FeatureGrammar
    :return: a mapping from sentences to lists of pairs (parse-tree, semantic-representations)
    :rtype: list(list(tuple(nltk.tree.Tree, nltk.sem.logic.ConstantExpression)))
nltk.interval_distance
Python Library Documentation: function interval_distance in module nltk.metrics.distance

interval_distance(label1, label2)
    Krippendorff's interval distance metric

    >>> from nltk.metrics import interval_distance
    >>> interval_distance(1,10)
    81

    Krippendorff 1980, Content Analysis: An Introduction to its Methodology
nltk.invert_dict
Python Library Documentation: function invert_dict in module nltk.util

invert_dict(d)
nltk.invert_graph
Python Library Documentation: function invert_graph in module nltk.util

invert_graph(graph)
    Inverts a directed graph.

    :param graph: the graph, represented as a dictionary of sets
    :type graph: dict(set)
    :return: the inverted graph
    :rtype: dict(set)
nltk.is_rel
Python Library Documentation: function is_rel in module nltk.sem.evaluate

is_rel(s)
    Check whether a set represents a relation (of any arity).

    :param s: a set containing tuples of str elements
    :type s: set
    :rtype: bool
nltk.islice
Python Library Documentation: class islice in module itertools

class islice(builtins.object)
 |  islice(iterable, stop) --> islice object
 |  islice(iterable, start, stop[, step]) --> islice object
 |
 |  Return an iterator whose next() method returns selected values from an
 |  iterable.  If start is specified, will skip all preceding elements;
 |  otherwise, start defaults to zero.  Step defaults to one.  If
 |  specified as another value, step determines how many values are
 |  skipped between successive calls.  Works like a slice() on a list
 |  but returns an iterator.
 |
 |  Methods defined here:
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __next__(self, /)
 |      Implement next(self).
 |
 |  __reduce__(...)
 |      Return state information for pickling.
 |
 |  __setstate__(...)
 |      Set state information for unpickling.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
nltk.isri
Python Library Documentation: module nltk.stem.isri in nltk.stem

NAME
    nltk.stem.isri - ISRI Arabic Stemmer

DESCRIPTION
    The algorithm for this stemmer is described in:

    Taghva, K., Elkoury, R., and Coombs, J. 2005. Arabic Stemming without a root dictionary.
    Information Science Research Institute. University of Nevada, Las Vegas, USA.

    The Information Science Research Institute’s (ISRI) Arabic stemmer shares many features
    with the Khoja stemmer. However, the main difference is that ISRI stemmer does not use root
    dictionary. Also, if a root is not found, ISRI stemmer returned normalized form, rather than
    returning the original unmodified word.

    Additional adjustments were made to improve the algorithm:

    1- Adding 60 stop words.
    2- Adding the pattern (تفاعيل) to ISRI pattern set.
    3- The step 2 in the original algorithm was normalizing all hamza. This step is discarded because it
    increases the word ambiguities and changes the original root.

CLASSES
    nltk.stem.api.StemmerI(builtins.object)
        ISRIStemmer

    class ISRIStemmer(nltk.stem.api.StemmerI)
     |  ISRI Arabic stemmer based on algorithm: Arabic Stemming without a root dictionary.
     |  Information Science Research Institute. University of Nevada, Las Vegas, USA.
     |
     |  A few minor modifications have been made to ISRI basic algorithm.
     |  See the source code of this module for more information.
     |
     |  isri.stem(token) returns Arabic root for the given token.
     |
     |  The ISRI Stemmer requires that all tokens have Unicode string types.
     |  If you use Python IDLE on Arabic Windows you have to decode text first
     |  using Arabic '1256' coding.
     |
     |  Method resolution order:
     |      ISRIStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  end_w5(self, word)
     |      ending step (word of length five)
     |
     |  end_w6(self, word)
     |      ending step (word of length six)
     |
     |  norm(self, word, num=3)
     |      normalization:
     |      num=1  normalize diacritics
     |      num=2  normalize initial hamza
     |      num=3  both 1&2
     |
     |  pre1(self, word)
     |      normalize short prefix
     |
     |  pre32(self, word)
     |      remove length three and length two prefixes in this order
     |
     |  pro_w4(self, word)
     |      process length four patterns and extract length three roots
     |
     |  pro_w53(self, word)
     |      process length five patterns and extract length three roots
     |
     |  pro_w54(self, word)
     |      process length five patterns and extract length four roots
     |
     |  pro_w6(self, word)
     |      process length six patterns and extract length three roots
     |
     |  pro_w64(self, word)
     |      process length six patterns and extract length four roots
     |
     |  stem(self, token)
     |      Stemming a word token using the ISRI stemmer.
     |
     |  suf1(self, word)
     |      normalize short sufix
     |
     |  suf32(self, word)
     |      remove length three and length two suffixes in this order
     |
     |  waw(self, word)
     |      remove connective ‘و’ if it precedes a word beginning with ‘و’
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\isri.py

nltk.jaccard_distance
Python Library Documentation: function jaccard_distance in module nltk.metrics.distance

jaccard_distance(label1, label2)
    Distance metric comparing set-similarity.
nltk.json_tags
Python Library Documentation: dict object

class dict(object)
 |  dict() -> new empty dictionary
 |  dict(mapping) -> new dictionary initialized from a mapping object's
 |      (key, value) pairs
 |  dict(iterable) -> new dictionary initialized as if via:
 |      d = {}
 |      for k, v in iterable:
 |          d[k] = v
 |  dict(**kwargs) -> new dictionary initialized with the name=value pairs
 |      in the keyword argument list.  For example:  dict(one=1, two=2)
 |
 |  Built-in subclasses:
 |      StgDict
 |
 |  Methods defined here:
 |
 |  __contains__(self, key, /)
 |      True if the dictionary has the specified key, else False.
 |
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __getitem__(self, key, /)
 |      Return self[key].
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __init__(self, /, *args, **kwargs)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  __ior__(self, value, /)
 |      Return self|=value.
 |
 |  __iter__(self, /)
 |      Implement iter(self).
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __len__(self, /)
 |      Return len(self).
 |
 |  __lt__(self, value, /)
 |      Return self<value.
 |
 |  __ne__(self, value, /)
 |      Return self!=value.
 |
 |  __or__(self, value, /)
 |      Return self|value.
 |
 |  __repr__(self, /)
 |      Return repr(self).
 |
 |  __reversed__(self, /)
 |      Return a reverse iterator over the dict keys.
 |
 |  __ror__(self, value, /)
 |      Return value|self.
 |
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |
 |  __sizeof__(...)
 |      D.__sizeof__() -> size of D in memory, in bytes
 |
 |  clear(...)
 |      D.clear() -> None.  Remove all items from D.
 |
 |  copy(...)
 |      D.copy() -> a shallow copy of D
 |
 |  get(self, key, default=None, /)
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  items(...)
 |      D.items() -> a set-like object providing a view on D's items
 |
 |  keys(...)
 |      D.keys() -> a set-like object providing a view on D's keys
 |
 |  pop(...)
 |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 |
 |      If the key is not found, return the default if given; otherwise,
 |      raise a KeyError.
 |
 |  popitem(self, /)
 |      Remove and return a (key, value) pair as a 2-tuple.
 |
 |      Pairs are returned in LIFO (last-in, first-out) order.
 |      Raises KeyError if the dict is empty.
 |
 |  setdefault(self, key, default=None, /)
 |      Insert key with a value of default if key is not in the dictionary.
 |
 |      Return the value for key if key is in the dictionary, else default.
 |
 |  update(...)
 |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
 |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
 |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
 |      In either case, this is followed by: for k in F:  D[k] = F[k]
 |
 |  values(...)
 |      D.values() -> an object providing a view on D's values
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  __class_getitem__(...)
 |      See PEP 585
 |
 |  fromkeys(iterable, value=None, /)
 |      Create a new dictionary with keys from iterable and values set to value.
 |
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |
 |  __new__(*args, **kwargs)
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __hash__ = None
nltk.jsontags
Python Library Documentation: module nltk.jsontags in nltk

NAME
    nltk.jsontags - Register JSON tags, so the nltk data loader knows what module and class to look for.

DESCRIPTION
    NLTK uses simple '!' tags to mark the types of objects, but the fully-qualified
    "tag:nltk.org,2011:" prefix is also accepted in case anyone ends up
    using it.

CLASSES
    json.decoder.JSONDecoder(builtins.object)
        JSONTaggedDecoder
    json.encoder.JSONEncoder(builtins.object)
        JSONTaggedEncoder

    class JSONTaggedDecoder(json.decoder.JSONDecoder)
     |  JSONTaggedDecoder(*, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
     |
     |  Method resolution order:
     |      JSONTaggedDecoder
     |      json.decoder.JSONDecoder
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  decode(self, s)
     |      Return the Python representation of ``s`` (a ``str`` instance
     |      containing a JSON document).
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  decode_obj(obj, _depth=0)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MAX_DECODE_DEPTH = 200
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from json.decoder.JSONDecoder:
     |
     |  __init__(self, *, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
     |      ``object_hook``, if specified, will be called with the result
     |      of every JSON object decoded and its return value will be used in
     |      place of the given ``dict``.  This can be used to provide custom
     |      deserializations (e.g. to support JSON-RPC class hinting).
     |
     |      ``object_pairs_hook``, if specified will be called with the result of
     |      every JSON object decoded with an ordered list of pairs.  The return
     |      value of ``object_pairs_hook`` will be used instead of the ``dict``.
     |      This feature can be used to implement custom decoders.
     |      If ``object_hook`` is also defined, the ``object_pairs_hook`` takes
     |      priority.
     |
     |      ``parse_float``, if specified, will be called with the string
     |      of every JSON float to be decoded. By default this is equivalent to
     |      float(num_str). This can be used to use another datatype or parser
     |      for JSON floats (e.g. decimal.Decimal).
     |
     |      ``parse_int``, if specified, will be called with the string
     |      of every JSON int to be decoded. By default this is equivalent to
     |      int(num_str). This can be used to use another datatype or parser
     |      for JSON integers (e.g. float).
     |
     |      ``parse_constant``, if specified, will be called with one of the
     |      following strings: -Infinity, Infinity, NaN.
     |      This can be used to raise an exception if invalid JSON numbers
     |      are encountered.
     |
     |      If ``strict`` is false (true is the default), then control
     |      characters will be allowed inside strings.  Control characters in
     |      this context are those with character codes in the 0-31 range,
     |      including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``.
     |
     |  raw_decode(self, s, idx=0)
     |      Decode a JSON document from ``s`` (a ``str`` beginning with
     |      a JSON document) and return a 2-tuple of the Python
     |      representation and the index in ``s`` where the document ended.
     |
     |      This can be used to decode a JSON document from a string that may
     |      have extraneous data at the end.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from json.decoder.JSONDecoder:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class JSONTaggedEncoder(json.encoder.JSONEncoder)
     |  JSONTaggedEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
     |
     |  Method resolution order:
     |      JSONTaggedEncoder
     |      json.encoder.JSONEncoder
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  default(self, obj)
     |      Implement this method in a subclass such that it returns
     |      a serializable object for ``o``, or calls the base implementation
     |      (to raise a ``TypeError``).
     |
     |      For example, to support arbitrary iterators, you could
     |      implement default like this::
     |
     |          def default(self, o):
     |              try:
     |                  iterable = iter(o)
     |              except TypeError:
     |                  pass
     |              else:
     |                  return list(iterable)
     |              # Let the base class default method raise the TypeError
     |              return super().default(o)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from json.encoder.JSONEncoder:
     |
     |  __init__(self, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
     |      Constructor for JSONEncoder, with sensible defaults.
     |
     |      If skipkeys is false, then it is a TypeError to attempt
     |      encoding of keys that are not str, int, float or None.  If
     |      skipkeys is True, such items are simply skipped.
     |
     |      If ensure_ascii is true, the output is guaranteed to be str
     |      objects with all incoming non-ASCII characters escaped.  If
     |      ensure_ascii is false, the output can contain non-ASCII characters.
     |
     |      If check_circular is true, then lists, dicts, and custom encoded
     |      objects will be checked for circular references during encoding to
     |      prevent an infinite recursion (which would cause an RecursionError).
     |      Otherwise, no such check takes place.
     |
     |      If allow_nan is true, then NaN, Infinity, and -Infinity will be
     |      encoded as such.  This behavior is not JSON specification compliant,
     |      but is consistent with most JavaScript based encoders and decoders.
     |      Otherwise, it will be a ValueError to encode such floats.
     |
     |      If sort_keys is true, then the output of dictionaries will be
     |      sorted by key; this is useful for regression tests to ensure
     |      that JSON serializations can be compared on a day-to-day basis.
     |
     |      If indent is a non-negative integer, then JSON array
     |      elements and object members will be pretty-printed with that
     |      indent level.  An indent level of 0 will only insert newlines.
     |      None is the most compact representation.
     |
     |      If specified, separators should be an (item_separator, key_separator)
     |      tuple.  The default is (', ', ': ') if *indent* is ``None`` and
     |      (',', ': ') otherwise.  To get the most compact JSON representation,
     |      you should specify (',', ':') to eliminate whitespace.
     |
     |      If specified, default is a function that gets called for objects
     |      that can't otherwise be serialized.  It should return a JSON encodable
     |      version of the object or raise a ``TypeError``.
     |
     |  encode(self, o)
     |      Return a JSON string representation of a Python data structure.
     |
     |      >>> from json.encoder import JSONEncoder
     |      >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
     |      '{"foo": ["bar", "baz"]}'
     |
     |  iterencode(self, o, _one_shot=False)
     |      Encode the given object and yield each string
     |      representation as available.
     |
     |      For example::
     |
     |          for chunk in JSONEncoder().iterencode(bigobject):
     |              mysocket.write(chunk)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from json.encoder.JSONEncoder:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from json.encoder.JSONEncoder:
     |
     |  item_separator = ', '
     |
     |  key_separator = ': '

FUNCTIONS
    register_tag(cls)
        Decorates a class to register it's json tag.

DATA
    __all__ = ['register_tag', 'json_tags', 'JSONTaggedEncoder', 'JSONTagg...
    json_tags = {'!nltk.tag.BrillTagger': <class 'nltk.tag.brill.BrillTagg...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\jsontags.py

nltk.lancaster
Python Library Documentation: module nltk.stem.lancaster in nltk.stem

NAME
    nltk.stem.lancaster

DESCRIPTION
    A word stemmer based on the Lancaster (Paice/Husk) stemming algorithm.
    Paice, Chris D. "Another Stemmer." ACM SIGIR Forum 24.3 (1990): 56-61.

CLASSES
    nltk.stem.api.StemmerI(builtins.object)
        LancasterStemmer

    class LancasterStemmer(nltk.stem.api.StemmerI)
     |  LancasterStemmer(rule_tuple=None, strip_prefix_flag=False)
     |
     |  Lancaster Stemmer
     |
     |      >>> from nltk.stem.lancaster import LancasterStemmer
     |      >>> st = LancasterStemmer()
     |      >>> st.stem('maximum')     # Remove "-um" when word is intact
     |      'maxim'
     |      >>> st.stem('presumably')  # Don't remove "-um" when word is not intact
     |      'presum'
     |      >>> st.stem('multiply')    # No action taken if word ends with "-ply"
     |      'multiply'
     |      >>> st.stem('provision')   # Replace "-sion" with "-j" to trigger "j" set of rules
     |      'provid'
     |      >>> st.stem('owed')        # Word starting with vowel must contain at least 2 letters
     |      'ow'
     |      >>> st.stem('ear')         # ditto
     |      'ear'
     |      >>> st.stem('saying')      # Words starting with consonant must contain at least 3
     |      'say'
     |      >>> st.stem('crying')      #     letters and one of those letters must be a vowel
     |      'cry'
     |      >>> st.stem('string')      # ditto
     |      'string'
     |      >>> st.stem('meant')       # ditto
     |      'meant'
     |      >>> st.stem('cement')      # ditto
     |      'cem'
     |      >>> st_pre = LancasterStemmer(strip_prefix_flag=True)
     |      >>> st_pre.stem('kilometer') # Test Prefix
     |      'met'
     |      >>> st_custom = LancasterStemmer(rule_tuple=("ssen4>", "s1t."))
     |      >>> st_custom.stem("ness") # Change s to t
     |      'nest'
     |
     |  Method resolution order:
     |      LancasterStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, rule_tuple=None, strip_prefix_flag=False)
     |      Create an instance of the Lancaster stemmer.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  parseRules(self, rule_tuple=None)
     |      Validate the set of rules used in this stemmer.
     |
     |      If this function is called as an individual method, without using stem
     |      method, rule_tuple argument will be compiled into self.rule_dictionary.
     |      If this function is called within stem, self._rule_tuple will be used.
     |
     |  stem(self, word)
     |      Stem a word using the Lancaster stemmer.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  default_rule_tuple = ('ai*2.', 'a*1.', 'bb1.', 'city3s.', 'ci2>', 'cn1...
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\lancaster.py

nltk.lazyimport
Python Library Documentation: module nltk.lazyimport in nltk

NAME
    nltk.lazyimport - Helper to enable simple lazy module import.

DESCRIPTION
    'Lazy' means the actual import is deferred until an attribute is
    requested from the module's namespace. This has the advantage of
    allowing all imports to be done at the top of a script (in a
    prominent and visible place) without having a great impact
    on startup time.

    Copyright (c) 1999-2005, Marc-Andre Lemburg; mailto:mal@lemburg.com
    See the documentation for further information on copyrights,
    or contact the author. All Rights Reserved.

CLASSES
    builtins.object
        LazyModule

    class LazyModule(builtins.object)
     |  LazyModule(name, locals, globals=None)
     |
     |  Lazy module class.
     |
     |  Lazy modules are imported into the given namespaces whenever a
     |  non-special attribute (there are some attributes like __doc__
     |  that class instances handle without calling __getattr__) is
     |  requested. The module is then registered under the given name
     |  in locals usually replacing the import wrapper instance. The
     |  import itself is done using globals as global namespace.
     |
     |  Example of creating a lazy load module:
     |
     |  ISO = LazyModule('ISO',locals(),globals())
     |
     |  Later, requesting an attribute from ISO will load the module
     |  automatically into the locals() namespace, overriding the
     |  LazyModule instance:
     |
     |  t = ISO.Week(1998,1,1)
     |
     |  Methods defined here:
     |
     |  __getattr__(self, name)
     |      Import the module on demand and get the attribute.
     |
     |  __init__(self, name, locals, globals=None)
     |      Create a LazyModule instance wrapping module name.
     |
     |      The module will later on be registered in locals under the
     |      given module name.
     |
     |      globals is optional and defaults to locals.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __setattr__(self, name, value)
     |      Import the module on demand and set the attribute.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\lazyimport.py

nltk.legality_principle
Python Library Documentation: module nltk.tokenize.legality_principle in nltk.tokenize

NAME
    nltk.tokenize.legality_principle

DESCRIPTION
    The Legality Principle is a language agnostic principle maintaining that syllable
    onsets and codas (the beginning and ends of syllables not including the vowel)
    are only legal if they are found as word onsets or codas in the language. The English
    word ''admit'' must then be syllabified as ''ad-mit'' since ''dm'' is not found
    word-initially in the English language (Bartlett et al.). This principle was first proposed
    in Daniel Kahn's 1976 dissertation, ''Syllable-based generalizations in English phonology''.

    Kahn further argues that there is a ''strong tendency to syllabify in such a way that
    initial clusters are of maximal length, consistent with the general constraints on
    word-initial consonant clusters.'' Consequently, in addition to being legal onsets,
    the longest legal onset is preferable---''Onset Maximization''.

    The default implementation assumes an English vowel set, but the `vowels` attribute
    can be set to IPA or any other alphabet's vowel set for the use-case.
    Both a valid set of vowels as well as a text corpus of words in the language
    are necessary to determine legal onsets and subsequently syllabify words.

    The legality principle with onset maximization is a universal syllabification algorithm,
    but that does not mean it performs equally across languages. Bartlett et al. (2009)
    is a good benchmark for English accuracy if utilizing IPA (pg. 311).

    References:

    - Otto Jespersen. 1904. Lehrbuch der Phonetik.
      Leipzig, Teubner. Chapter 13, Silbe, pp. 185-203.
    - Theo Vennemann, ''On the Theory of Syllabic Phonology,'' 1972, p. 11.
    - Daniel Kahn, ''Syllable-based generalizations in English phonology'', (PhD diss., MIT, 1976).
    - Elisabeth Selkirk. 1984. On the major class features and syllable theory.
      In Aronoff & Oehrle (eds.) Language Sound Structure: Studies in Phonology.
      Cambridge, MIT Press. pp. 107-136.
    - Jeremy Goslin and Ulrich Frauenfelder. 2001. A comparison of theoretical and human syllabification. Language and Speech, 44:409–436.
    - Susan Bartlett, et al. 2009. On the Syllabification of Phonemes.
      In HLT-NAACL. pp. 308-316.
    - Christopher Hench. 2017. Resonances in Middle High German: New Methodologies in Prosody. UC Berkeley.

CLASSES
    nltk.tokenize.api.TokenizerI(abc.ABC)
        LegalitySyllableTokenizer

    class LegalitySyllableTokenizer(nltk.tokenize.api.TokenizerI)
     |  LegalitySyllableTokenizer(tokenized_source_text, vowels='aeiouy', legal_frequency_threshold=0.001)
     |
     |  Syllabifies words based on the Legality Principle and Onset Maximization.
     |
     |      >>> from nltk.tokenize import LegalitySyllableTokenizer
     |      >>> from nltk import word_tokenize
     |      >>> from nltk.corpus import words
     |      >>> text = "This is a wonderful sentence."
     |      >>> text_words = word_tokenize(text)
     |      >>> LP = LegalitySyllableTokenizer(words.words())
     |      >>> [LP.tokenize(word) for word in text_words]
     |      [['This'], ['is'], ['a'], ['won', 'der', 'ful'], ['sen', 'ten', 'ce'], ['.']]
     |
     |  Method resolution order:
     |      LegalitySyllableTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, tokenized_source_text, vowels='aeiouy', legal_frequency_threshold=0.001)
     |      :param tokenized_source_text: List of valid tokens in the language
     |      :type tokenized_source_text: list(str)
     |      :param vowels: Valid vowels in language or IPA representation
     |      :type vowels: str
     |      :param legal_frequency_threshold: Lowest frequency of all onsets to be considered a legal onset
     |      :type legal_frequency_threshold: float
     |
     |  find_legal_onsets(self, words)
     |      Gathers all onsets and then return only those above the frequency threshold
     |
     |      :param words: List of words in a language
     |      :type words: list(str)
     |      :return: Set of legal onsets
     |      :rtype: set(str)
     |
     |  onset(self, word)
     |      Returns consonant cluster of word, i.e. all characters until the first vowel.
     |
     |      :param word: Single word or token
     |      :type word: str
     |      :return: String of characters of onset
     |      :rtype: str
     |
     |  tokenize(self, token)
     |      Apply the Legality Principle in combination with
     |      Onset Maximization to return a list of syllables.
     |
     |      :param token: Single word or token
     |      :type token: str
     |      :return syllable_list: Single word or token broken up into syllables.
     |      :rtype: list(str)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\legality_principle.py

nltk.lepor
Python Library Documentation: function sentence_lepor in module nltk.translate.lepor

sentence_lepor(references: list[str], hypothesis: str, alpha: float = 1.0, beta: float = 1.0, tokenizer: collections.abc.Callable[[str], list[str]] = None) -> list[float]
    Calculate LEPOR score a sentence from Han, A. L.-F. (2017).
    LEPOR: An Augmented Machine Translation Evaluation Metric. https://arxiv.org/abs/1703.08748v2

    >>> hypothesis = 'a bird is on a stone.'

    >>> reference1 = 'a bird behind the stone.'
    >>> reference2 = 'a bird is on the rock.'

    >>> sentence_lepor([reference1, reference2], hypothesis)
    [0.7824248013113159, 0.7739937377760259]

    :param references: Reference sentences
    :type references: list(str)
    :param hypothesis: Hypothesis sentence
    :type hypothesis: str
    :param alpha: A parameter to set weight fot recall.
    :type alpha: float
    :param beta: A parameter to set weight fot precision.
    :type beta: float
    :param tokenizer: A callable tokenizer that will accept a string and returns a list of tokens.
    :type tokenizer: Callable[[str], List[str]]

    :return: The list of Lepor scores for a hypothesis with all references.
    :rtype: list(float)
nltk.lfg
Python Library Documentation: module nltk.sem.lfg in nltk.sem

NAME
    nltk.sem.lfg

DESCRIPTION
    # Natural Language Toolkit: Lexical Functional Grammar
    #
    # Author: Dan Garrette <dhgarrette@gmail.com>
    #
    # Copyright (C) 2001-2026 NLTK Project
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.dict(builtins.object)
        FStructure

    class FStructure(builtins.dict)
     |  Method resolution order:
     |      FStructure
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __contains__(self, key)
     |      True if the dictionary has the specified key, else False.
     |
     |  __getitem__(self, key)
     |      Return self[key].
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __setitem__(self, key, value)
     |      Set self[key] to value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  pretty_format(self, indent=3)
     |
     |  safeappend(self, key, item)
     |      Append 'item' to the list at 'key'.  If no list exists for 'key', then
     |      construct one.
     |
     |  to_depgraph(self, rel=None)
     |
     |  to_glueformula_list(self, glue_dict)
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  read_depgraph(depgraph)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  copy(...)
     |      D.copy() -> a shallow copy of D
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

FUNCTIONS
    demo_read_depgraph()

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\sem\lfg.py

nltk.line_tokenize
Python Library Documentation: function line_tokenize in module nltk.tokenize.simple

line_tokenize(text, blanklines='discard')
nltk.linearlogic
Python Library Documentation: module nltk.sem.linearlogic in nltk.sem

NAME
    nltk.sem.linearlogic

DESCRIPTION
    # Natural Language Toolkit: Linear Logic
    #
    # Author: Dan Garrette <dhgarrette@gmail.com>
    #
    # Copyright (C) 2001-2026 NLTK Project
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.Exception(builtins.BaseException)
        LinearLogicApplicationException
        UnificationException
        VariableBindingException
    builtins.object
        BindingDict
        Expression
            ApplicationExpression
            AtomicExpression
                ConstantExpression
                VariableExpression
            ImpExpression
        Tokens
    nltk.sem.logic.LogicParser(builtins.object)
        LinearLogicParser

    class ApplicationExpression(Expression)
     |  ApplicationExpression(function, argument, argument_indices=None)
     |
     |  Method resolution order:
     |      ApplicationExpression
     |      Expression
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, function, argument, argument_indices=None)
     |      :param function: ``Expression`` for the function
     |      :param argument: ``Expression`` for the argument
     |      :param argument_indices: set for the indices of the glue formula from which the argument came
     |      :raise LinearLogicApplicationException: If 'function' cannot be applied to 'argument' given 'argument_indices'.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  simplify(self, bindings=None)
     |      Since function is an implication, return its consequent.  There should be
     |      no need to check that the application is valid since the checking is done
     |      by the constructor.
     |
     |      :param bindings: ``BindingDict`` A dictionary of bindings used to simplify
     |      :return: ``Expression``
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __call__(self, other)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other, other_indices=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Expression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class AtomicExpression(Expression)
     |  AtomicExpression(name, dependencies=None)
     |
     |  Method resolution order:
     |      AtomicExpression
     |      Expression
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, name, dependencies=None)
     |      :param name: str for the constant name
     |      :param dependencies: list of int for the indices on which this atom is dependent
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  compile_neg(self, index_counter, glueFormulaFactory)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |      :param index_counter: ``Counter`` for unique indices
     |      :param glueFormulaFactory: ``GlueFormula`` for creating new glue formulas
     |      :return: (``Expression``,set) for the compiled linear logic and any newly created glue formulas
     |
     |  compile_pos(self, index_counter, glueFormulaFactory)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |      :param index_counter: ``Counter`` for unique indices
     |      :param glueFormulaFactory: ``GlueFormula`` for creating new glue formulas
     |      :return: (``Expression``,set) for the compiled linear logic and any newly created glue formulas
     |
     |  initialize_labels(self, fstruct)
     |
     |  simplify(self, bindings=None)
     |      If 'self' is bound by 'bindings', return the atomic to which it is bound.
     |      Otherwise, return self.
     |
     |      :param bindings: ``BindingDict`` A dictionary of bindings used to simplify
     |      :return: ``AtomicExpression``
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __call__(self, other)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other, other_indices=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Expression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BindingDict(builtins.object)
     |  BindingDict(bindings=None)
     |
     |  Methods defined here:
     |
     |  __add__(self, other)
     |      :param other: ``BindingDict`` The dict with which to combine self
     |      :return: ``BindingDict`` A new dict containing all the elements of both parameters
     |      :raise VariableBindingException: If the parameter dictionaries are not consistent with each other
     |
     |  __contains__(self, item)
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __getitem__(self, variable)
     |      Return the expression to which 'variable' is bound
     |
     |  __init__(self, bindings=None)
     |      :param bindings:
     |          list [(``VariableExpression``, ``AtomicExpression``)] to initialize the dictionary
     |          dict {``VariableExpression``: ``AtomicExpression``} to initialize the dictionary
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __setitem__(self, variable, binding)
     |      A binding is consistent with the dict if its variable is not already bound, OR if its
     |      variable is already bound to its argument.
     |
     |      :param variable: ``VariableExpression`` The variable bind
     |      :param binding: ``Expression`` The expression to which 'variable' should be bound
     |      :raise VariableBindingException: If the variable cannot be bound in this dictionary
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None

    class ConstantExpression(AtomicExpression)
     |  ConstantExpression(name, dependencies=None)
     |
     |  Method resolution order:
     |      ConstantExpression
     |      AtomicExpression
     |      Expression
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  unify(self, other, bindings)
     |      If 'other' is a constant, then it must be equal to 'self'.  If 'other' is a variable,
     |      then it must not be bound to anything other than 'self'.
     |
     |      :param other: ``Expression``
     |      :param bindings: ``BindingDict`` A dictionary of all current bindings
     |      :return: ``BindingDict`` A new combined dictionary of of 'bindings' and any new binding
     |      :raise UnificationException: If 'self' and 'other' cannot be unified in the context of 'bindings'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AtomicExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, name, dependencies=None)
     |      :param name: str for the constant name
     |      :param dependencies: list of int for the indices on which this atom is dependent
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  compile_neg(self, index_counter, glueFormulaFactory)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |      :param index_counter: ``Counter`` for unique indices
     |      :param glueFormulaFactory: ``GlueFormula`` for creating new glue formulas
     |      :return: (``Expression``,set) for the compiled linear logic and any newly created glue formulas
     |
     |  compile_pos(self, index_counter, glueFormulaFactory)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |      :param index_counter: ``Counter`` for unique indices
     |      :param glueFormulaFactory: ``GlueFormula`` for creating new glue formulas
     |      :return: (``Expression``,set) for the compiled linear logic and any newly created glue formulas
     |
     |  initialize_labels(self, fstruct)
     |
     |  simplify(self, bindings=None)
     |      If 'self' is bound by 'bindings', return the atomic to which it is bound.
     |      Otherwise, return self.
     |
     |      :param bindings: ``BindingDict`` A dictionary of bindings used to simplify
     |      :return: ``AtomicExpression``
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __call__(self, other)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other, other_indices=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Expression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Expression(builtins.object)
     |  Methods defined here:
     |
     |  __call__(self, other)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other, other_indices=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ImpExpression(Expression)
     |  ImpExpression(antecedent, consequent)
     |
     |  Method resolution order:
     |      ImpExpression
     |      Expression
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, antecedent, consequent)
     |      :param antecedent: ``Expression`` for the antecedent
     |      :param consequent: ``Expression`` for the consequent
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  compile_neg(self, index_counter, glueFormulaFactory)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |      :param index_counter: ``Counter`` for unique indices
     |      :param glueFormulaFactory: ``GlueFormula`` for creating new glue formulas
     |      :return: (``Expression``,list of ``GlueFormula``) for the compiled linear logic and any newly created glue formulas
     |
     |  compile_pos(self, index_counter, glueFormulaFactory)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |      :param index_counter: ``Counter`` for unique indices
     |      :param glueFormulaFactory: ``GlueFormula`` for creating new glue formulas
     |      :return: (``Expression``,set) for the compiled linear logic and any newly created glue formulas
     |
     |  initialize_labels(self, fstruct)
     |
     |  simplify(self, bindings=None)
     |
     |  unify(self, other, bindings)
     |      Both the antecedent and consequent of 'self' and 'other' must unify.
     |
     |      :param other: ``ImpExpression``
     |      :param bindings: ``BindingDict`` A dictionary of all current bindings
     |      :return: ``BindingDict`` A new combined dictionary of of 'bindings' and any new bindings
     |      :raise UnificationException: If 'self' and 'other' cannot be unified in the context of 'bindings'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __call__(self, other)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other, other_indices=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Expression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LinearLogicApplicationException(builtins.Exception)
     |  Method resolution order:
     |      LinearLogicApplicationException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class LinearLogicParser(nltk.sem.logic.LogicParser)
     |  A linear logic expression parser.
     |
     |  Method resolution order:
     |      LinearLogicParser
     |      nltk.sem.logic.LogicParser
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      :param type_check: should type checking be performed
     |          to their types?
     |      :type type_check: bool
     |
     |  attempt_ApplicationExpression(self, expression, context)
     |      Attempt to make an application expression.  If the next tokens
     |      are an argument in parens, then the argument expression is a
     |      function being applied to the arguments.  Otherwise, return the
     |      argument expression.
     |
     |  get_BooleanExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different boolean operators
     |
     |  get_all_symbols(self)
     |      This method exists to be overridden
     |
     |  handle(self, tok, context)
     |      This method is intended to be overridden for logics that
     |      use different operators or expressions
     |
     |  make_BooleanExpression(self, factory, first, second)
     |
     |  make_VariableExpression(self, name)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.sem.logic.LogicParser:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  assertNextToken(self, expected)
     |
     |  assertToken(self, tok, expected)
     |
     |  attempt_BooleanExpression(self, expression, context)
     |      Attempt to make a boolean expression.  If the next token is a boolean
     |      operator, then a BooleanExpression will be returned.  Otherwise, the
     |      parameter will be returned.
     |
     |  attempt_EqualityExpression(self, expression, context)
     |      Attempt to make an equality expression.  If the next token is an
     |      equality operator, then an EqualityExpression will be returned.
     |      Otherwise, the parameter will be returned.
     |
     |  attempt_adjuncts(self, expression, context)
     |
     |  get_QuantifiedExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different quantifiers
     |
     |  get_next_token_variable(self, description)
     |
     |  handle_lambda(self, tok, context)
     |
     |  handle_negation(self, tok, context)
     |
     |  handle_open(self, tok, context)
     |
     |  handle_quant(self, tok, context)
     |
     |  handle_variable(self, tok, context)
     |
     |  has_priority(self, operation, context)
     |
     |  inRange(self, location)
     |      Return TRUE if the given location is within the buffer
     |
     |  isvariable(self, tok)
     |
     |  make_ApplicationExpression(self, function, argument)
     |
     |  make_EqualityExpression(self, first, second)
     |      This method serves as a hook for other logic parsers that
     |      have different equality expression classes
     |
     |  make_LambdaExpression(self, variable, term)
     |
     |  make_NegatedExpression(self, expression)
     |
     |  make_QuanifiedExpression(self, factory, variable, term)
     |
     |  parse(self, data, signature=None)
     |      Parse the expression.
     |
     |      :param data: str for the input to be parsed
     |      :param signature: ``dict<str, str>`` that maps variable names to type
     |          strings
     |      :returns: a parsed Expression
     |
     |  process(self, data)
     |      Split the data into tokens
     |
     |  process_next_expression(self, context)
     |      Parse the next complete expression from the stream and return it.
     |
     |  process_quoted_token(self, data_idx, data)
     |
     |  token(self, location=None)
     |      Get the next waiting token.  If a location is given, then
     |      return the token at currentIndex+location without advancing
     |      currentIndex; setting it gives lookahead/lookback capability.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.sem.logic.LogicParser:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.sem.logic.LogicParser:
     |
     |  MAX_PARSE_DEPTH = 200

    class Tokens(builtins.object)
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  CLOSE = ')'
     |
     |  IMP = '-o'
     |
     |  OPEN = '('
     |
     |  PUNCT = ['(', ')']
     |
     |  TOKENS = ['(', ')', '-o']

    class UnificationException(builtins.Exception)
     |  UnificationException(a, b, bindings)
     |
     |  Method resolution order:
     |      UnificationException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, a, b, bindings)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class VariableBindingException(builtins.Exception)
     |  Method resolution order:
     |      VariableBindingException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class VariableExpression(AtomicExpression)
     |  VariableExpression(name, dependencies=None)
     |
     |  Method resolution order:
     |      VariableExpression
     |      AtomicExpression
     |      Expression
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  unify(self, other, bindings)
     |      'self' must not be bound to anything other than 'other'.
     |
     |      :param other: ``Expression``
     |      :param bindings: ``BindingDict`` A dictionary of all current bindings
     |      :return: ``BindingDict`` A new combined dictionary of of 'bindings' and the new binding
     |      :raise UnificationException: If 'self' and 'other' cannot be unified in the context of 'bindings'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AtomicExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, name, dependencies=None)
     |      :param name: str for the constant name
     |      :param dependencies: list of int for the indices on which this atom is dependent
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  compile_neg(self, index_counter, glueFormulaFactory)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |      :param index_counter: ``Counter`` for unique indices
     |      :param glueFormulaFactory: ``GlueFormula`` for creating new glue formulas
     |      :return: (``Expression``,set) for the compiled linear logic and any newly created glue formulas
     |
     |  compile_pos(self, index_counter, glueFormulaFactory)
     |      From Iddo Lev's PhD Dissertation p108-109
     |
     |      :param index_counter: ``Counter`` for unique indices
     |      :param glueFormulaFactory: ``GlueFormula`` for creating new glue formulas
     |      :return: (``Expression``,set) for the compiled linear logic and any newly created glue formulas
     |
     |  initialize_labels(self, fstruct)
     |
     |  simplify(self, bindings=None)
     |      If 'self' is bound by 'bindings', return the atomic to which it is bound.
     |      Otherwise, return self.
     |
     |      :param bindings: ``BindingDict`` A dictionary of bindings used to simplify
     |      :return: ``AtomicExpression``
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __call__(self, other)
     |      Call self as a function.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other, other_indices=None)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Expression:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()

DATA
    APP = 'APP'

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\sem\linearlogic.py

nltk.lm
Python Library Documentation: package nltk.lm in nltk

NAME
    nltk.lm

DESCRIPTION
    NLTK Language Modeling Module.
    ------------------------------

    Currently this module covers only ngram language models, but it should be easy
    to extend to neural models.


    Preparing Data
    ==============

    Before we train our ngram models it is necessary to make sure the data we put in
    them is in the right format.
    Let's say we have a text that is a list of sentences, where each sentence is
    a list of strings. For simplicity we just consider a text consisting of
    characters instead of words.

        >>> text = [['a', 'b', 'c'], ['a', 'c', 'd', 'c', 'e', 'f']]

    If we want to train a bigram model, we need to turn this text into bigrams.
    Here's what the first sentence of our text would look like if we use a function
    from NLTK for this.

        >>> from nltk.util import bigrams
        >>> list(bigrams(text[0]))
        [('a', 'b'), ('b', 'c')]

    Notice how "b" occurs both as the first and second member of different bigrams
    but "a" and "c" don't? Wouldn't it be nice to somehow indicate how often sentences
    start with "a" and end with "c"?
    A standard way to deal with this is to add special "padding" symbols to the
    sentence before splitting it into ngrams.
    Fortunately, NLTK also has a function for that, let's see what it does to the
    first sentence.

        >>> from nltk.util import pad_sequence
        >>> list(pad_sequence(text[0],
        ... pad_left=True,
        ... left_pad_symbol="<s>",
        ... pad_right=True,
        ... right_pad_symbol="</s>",
        ... n=2))
        ['<s>', 'a', 'b', 'c', '</s>']

    Note the `n` argument, that tells the function we need padding for bigrams.
    Now, passing all these parameters every time is tedious and in most cases they
    can be safely assumed as defaults anyway.
    Thus our module provides a convenience function that has all these arguments
    already set while the other arguments remain the same as for `pad_sequence`.

        >>> from nltk.lm.preprocessing import pad_both_ends
        >>> list(pad_both_ends(text[0], n=2))
        ['<s>', 'a', 'b', 'c', '</s>']

    Combining the two parts discussed so far we get the following preparation steps
    for one sentence.

        >>> list(bigrams(pad_both_ends(text[0], n=2)))
        [('<s>', 'a'), ('a', 'b'), ('b', 'c'), ('c', '</s>')]

    To make our model more robust we could also train it on unigrams (single words)
    as well as bigrams, its main source of information.
    NLTK once again helpfully provides a function called `everygrams`.
    While not the most efficient, it is conceptually simple.


        >>> from nltk.util import everygrams
        >>> padded_bigrams = list(pad_both_ends(text[0], n=2))
        >>> list(everygrams(padded_bigrams, max_len=2))
        [('<s>',), ('<s>', 'a'), ('a',), ('a', 'b'), ('b',), ('b', 'c'), ('c',), ('c', '</s>'), ('</s>',)]

    We are almost ready to start counting ngrams, just one more step left.
    During training and evaluation our model will rely on a vocabulary that
    defines which words are "known" to the model.
    To create this vocabulary we need to pad our sentences (just like for counting
    ngrams) and then combine the sentences into one flat stream of words.

        >>> from nltk.lm.preprocessing import flatten
        >>> list(flatten(pad_both_ends(sent, n=2) for sent in text))
        ['<s>', 'a', 'b', 'c', '</s>', '<s>', 'a', 'c', 'd', 'c', 'e', 'f', '</s>']

    In most cases we want to use the same text as the source for both vocabulary
    and ngram counts.
    Now that we understand what this means for our preprocessing, we can simply import
    a function that does everything for us.

        >>> from nltk.lm.preprocessing import padded_everygram_pipeline
        >>> train, vocab = padded_everygram_pipeline(2, text)

    So as to avoid re-creating the text in memory, both `train` and `vocab` are lazy
    iterators. They are evaluated on demand at training time.


    Training
    ========
    Having prepared our data we are ready to start training a model.
    As a simple example, let us train a Maximum Likelihood Estimator (MLE).
    We only need to specify the highest ngram order to instantiate it.

        >>> from nltk.lm import MLE
        >>> lm = MLE(2)

    This automatically creates an empty vocabulary...

        >>> len(lm.vocab)
        0

    ... which gets filled as we fit the model.

        >>> lm.fit(train, vocab)
        >>> print(lm.vocab)
        <Vocabulary with cutoff=1 unk_label='<UNK>' and 9 items>
        >>> len(lm.vocab)
        9

    The vocabulary helps us handle words that have not occurred during training.

        >>> lm.vocab.lookup(text[0])
        ('a', 'b', 'c')
        >>> lm.vocab.lookup(["aliens", "from", "Mars"])
        ('<UNK>', '<UNK>', '<UNK>')

    Moreover, in some cases we want to ignore words that we did see during training
    but that didn't occur frequently enough, to provide us useful information.
    You can tell the vocabulary to ignore such words.
    To find out how that works, check out the docs for the `Vocabulary` class.


    Using a Trained Model
    =====================
    When it comes to ngram models the training boils down to counting up the ngrams
    from the training corpus.

        >>> print(lm.counts)
        <NgramCounter with 2 ngram orders and 24 ngrams>

    This provides a convenient interface to access counts for unigrams...

        >>> lm.counts['a']
        2

    ...and bigrams (in this case "a b")

        >>> lm.counts[['a']]['b']
        1

    And so on. However, the real purpose of training a language model is to have it
    score how probable words are in certain contexts.
    This being MLE, the model returns the item's relative frequency as its score.

        >>> lm.score("a")
        0.15384615384615385

    Items that are not seen during training are mapped to the vocabulary's
    "unknown label" token. This is "<UNK>" by default.

        >>> lm.score("<UNK>") == lm.score("aliens")
        True

    Here's how you get the score for a word given some preceding context.
    For example we want to know what is the chance that "b" is preceded by "a".

        >>> lm.score("b", ["a"])
        0.5

    To avoid underflow when working with many small score values it makes sense to
    take their logarithm.
    For convenience this can be done with the `logscore` method.

        >>> lm.logscore("a")
        -2.700439718141092

    Building on this method, we can also evaluate our model's cross-entropy and
    perplexity with respect to sequences of ngrams.

        >>> test = [('a', 'b'), ('c', 'd')]
        >>> lm.entropy(test)
        1.292481250360578
        >>> lm.perplexity(test)
        2.449489742783178

    It is advisable to preprocess your test text exactly the same way as you did
    the training text.

    One cool feature of ngram models is that they can be used to generate text.

        >>> lm.generate(1, random_seed=3)
        '<s>'
        >>> lm.generate(5, random_seed=3)
        ['<s>', 'a', 'b', 'c', 'd']

    Provide `random_seed` if you want to consistently reproduce the same text all
    other things being equal. Here we are using it to test the examples.

    You can also condition your generation on some preceding text with the `context`
    argument.

        >>> lm.generate(5, text_seed=['c'], random_seed=3)
        ['</s>', 'c', 'd', 'c', 'd']

    Note that an ngram model is restricted in how much preceding context it can
    take into account. For example, a trigram model can only condition its output
    on 2 preceding words. If you pass in a 4-word context, the first two words
    will be ignored.

PACKAGE CONTENTS
    api
    counter
    models
    preprocessing
    smoothing
    util
    vocabulary

CLASSES
    builtins.object
        nltk.lm.counter.NgramCounter
        nltk.lm.vocabulary.Vocabulary
    nltk.lm.api.LanguageModel(builtins.object)
        nltk.lm.models.Lidstone
            nltk.lm.models.Laplace
        nltk.lm.models.MLE
        nltk.lm.models.StupidBackoff
    nltk.lm.models.InterpolatedLanguageModel(nltk.lm.api.LanguageModel)
        nltk.lm.models.AbsoluteDiscountingInterpolated
        nltk.lm.models.KneserNeyInterpolated
        nltk.lm.models.WittenBellInterpolated

    class AbsoluteDiscountingInterpolated(InterpolatedLanguageModel)
     |  AbsoluteDiscountingInterpolated(order, discount=0.75, **kwargs)
     |
     |  Interpolated version of smoothing with absolute discount.
     |
     |  Method resolution order:
     |      AbsoluteDiscountingInterpolated
     |      InterpolatedLanguageModel
     |      nltk.lm.api.LanguageModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, order, discount=0.75, **kwargs)
     |      Creates new LanguageModel.
     |
     |      :param vocabulary: If provided, this vocabulary will be used instead
     |          of creating a new one when training.
     |      :type vocabulary: `nltk.lm.Vocabulary` or None
     |      :param counter: If provided, use this object to count ngrams.
     |      :type counter: `nltk.lm.NgramCounter` or None
     |      :param ngrams_fn: If given, defines how sentences in training text are turned to ngram
     |          sequences.
     |      :type ngrams_fn: function or None
     |      :param pad_fn: If given, defines how sentences in training text are padded.
     |      :type pad_fn: function or None
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from InterpolatedLanguageModel:
     |
     |  unmasked_score(self, word, context=None)
     |      Score a word given some optional context.
     |
     |      Concrete models are expected to provide an implementation.
     |      Note that this method does not mask its arguments with the OOV label.
     |      Use the `score` method for that.
     |
     |      :param str word: Word for which we want the score
     |      :param tuple(str) context: Context the word is in.
     |          If `None`, compute unigram score.
     |      :param context: tuple(str) or None
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.lm.api.LanguageModel:
     |
     |  context_counts(self, context)
     |      Helper method for retrieving counts for a given context.
     |
     |      Assumes context has been checked and oov words in it masked.
     |      :type context: tuple(str) or None
     |
     |  entropy(self, text_ngrams)
     |      Calculate cross-entropy of model for given evaluation text.
     |
     |      This implementation is based on the Shannon-McMillan-Breiman theorem,
     |      as used and referenced by Dan Jurafsky and Jordan Boyd-Graber.
     |
     |      :param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
     |      :rtype: float
     |
     |  fit(self, text, vocabulary_text=None)
     |      Trains the model on a text.
     |
     |      :param text: Training text as a sequence of sentences.
     |
     |  generate(self, num_words=1, text_seed=None, random_seed=None)
     |      Generate words from the model.
     |
     |      :param int num_words: How many words to generate. By default 1.
     |      :param text_seed: Generation can be conditioned on preceding context.
     |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
     |          makes the random sampling part of generation reproducible.
     |      :return: One (str) word or a list of words generated from model.
     |
     |      Examples:
     |
     |      >>> from nltk.lm import MLE
     |      >>> lm = MLE(2)
     |      >>> lm.fit([[("a", "b"), ("b", "c")]], vocabulary_text=['a', 'b', 'c'])
     |      >>> lm.fit([[("a",), ("b",), ("c",)]])
     |      >>> lm.generate(random_seed=3)
     |      'a'
     |      >>> lm.generate(text_seed=['a'])
     |      'b'
     |
     |  logscore(self, word, context=None)
     |      Evaluate the log score of this word in this context.
     |
     |      The arguments are the same as for `score` and `unmasked_score`.
     |
     |  perplexity(self, text_ngrams)
     |      Calculates the perplexity of the given text.
     |
     |      This is simply 2 ** cross-entropy for the text, so the arguments are the same.
     |
     |  score(self, word, context=None)
     |      Masks out of vocab (OOV) words and computes their model score.
     |
     |      For model-specific logic of calculating scores, see the `unmasked_score`
     |      method.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.lm.api.LanguageModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class KneserNeyInterpolated(InterpolatedLanguageModel)
     |  KneserNeyInterpolated(order, discount=0.1, **kwargs)
     |
     |  Interpolated version of Kneser-Ney smoothing.
     |
     |  Method resolution order:
     |      KneserNeyInterpolated
     |      InterpolatedLanguageModel
     |      nltk.lm.api.LanguageModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, order, discount=0.1, **kwargs)
     |      Creates new LanguageModel.
     |
     |      :param vocabulary: If provided, this vocabulary will be used instead
     |          of creating a new one when training.
     |      :type vocabulary: `nltk.lm.Vocabulary` or None
     |      :param counter: If provided, use this object to count ngrams.
     |      :type counter: `nltk.lm.NgramCounter` or None
     |      :param ngrams_fn: If given, defines how sentences in training text are turned to ngram
     |          sequences.
     |      :type ngrams_fn: function or None
     |      :param pad_fn: If given, defines how sentences in training text are padded.
     |      :type pad_fn: function or None
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from InterpolatedLanguageModel:
     |
     |  unmasked_score(self, word, context=None)
     |      Score a word given some optional context.
     |
     |      Concrete models are expected to provide an implementation.
     |      Note that this method does not mask its arguments with the OOV label.
     |      Use the `score` method for that.
     |
     |      :param str word: Word for which we want the score
     |      :param tuple(str) context: Context the word is in.
     |          If `None`, compute unigram score.
     |      :param context: tuple(str) or None
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.lm.api.LanguageModel:
     |
     |  context_counts(self, context)
     |      Helper method for retrieving counts for a given context.
     |
     |      Assumes context has been checked and oov words in it masked.
     |      :type context: tuple(str) or None
     |
     |  entropy(self, text_ngrams)
     |      Calculate cross-entropy of model for given evaluation text.
     |
     |      This implementation is based on the Shannon-McMillan-Breiman theorem,
     |      as used and referenced by Dan Jurafsky and Jordan Boyd-Graber.
     |
     |      :param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
     |      :rtype: float
     |
     |  fit(self, text, vocabulary_text=None)
     |      Trains the model on a text.
     |
     |      :param text: Training text as a sequence of sentences.
     |
     |  generate(self, num_words=1, text_seed=None, random_seed=None)
     |      Generate words from the model.
     |
     |      :param int num_words: How many words to generate. By default 1.
     |      :param text_seed: Generation can be conditioned on preceding context.
     |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
     |          makes the random sampling part of generation reproducible.
     |      :return: One (str) word or a list of words generated from model.
     |
     |      Examples:
     |
     |      >>> from nltk.lm import MLE
     |      >>> lm = MLE(2)
     |      >>> lm.fit([[("a", "b"), ("b", "c")]], vocabulary_text=['a', 'b', 'c'])
     |      >>> lm.fit([[("a",), ("b",), ("c",)]])
     |      >>> lm.generate(random_seed=3)
     |      'a'
     |      >>> lm.generate(text_seed=['a'])
     |      'b'
     |
     |  logscore(self, word, context=None)
     |      Evaluate the log score of this word in this context.
     |
     |      The arguments are the same as for `score` and `unmasked_score`.
     |
     |  perplexity(self, text_ngrams)
     |      Calculates the perplexity of the given text.
     |
     |      This is simply 2 ** cross-entropy for the text, so the arguments are the same.
     |
     |  score(self, word, context=None)
     |      Masks out of vocab (OOV) words and computes their model score.
     |
     |      For model-specific logic of calculating scores, see the `unmasked_score`
     |      method.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.lm.api.LanguageModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Laplace(Lidstone)
     |  Laplace(*args, **kwargs)
     |
     |  Implements Laplace (add one) smoothing.
     |
     |  Initialization identical to BaseNgramModel because gamma is always 1.
     |
     |  Method resolution order:
     |      Laplace
     |      Lidstone
     |      nltk.lm.api.LanguageModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, *args, **kwargs)
     |      Creates new LanguageModel.
     |
     |      :param vocabulary: If provided, this vocabulary will be used instead
     |          of creating a new one when training.
     |      :type vocabulary: `nltk.lm.Vocabulary` or None
     |      :param counter: If provided, use this object to count ngrams.
     |      :type counter: `nltk.lm.NgramCounter` or None
     |      :param ngrams_fn: If given, defines how sentences in training text are turned to ngram
     |          sequences.
     |      :type ngrams_fn: function or None
     |      :param pad_fn: If given, defines how sentences in training text are padded.
     |      :type pad_fn: function or None
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Lidstone:
     |
     |  unmasked_score(self, word, context=None)
     |      Add-one smoothing: Lidstone or Laplace.
     |
     |      To see what kind, look at `gamma` attribute on the class.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.lm.api.LanguageModel:
     |
     |  context_counts(self, context)
     |      Helper method for retrieving counts for a given context.
     |
     |      Assumes context has been checked and oov words in it masked.
     |      :type context: tuple(str) or None
     |
     |  entropy(self, text_ngrams)
     |      Calculate cross-entropy of model for given evaluation text.
     |
     |      This implementation is based on the Shannon-McMillan-Breiman theorem,
     |      as used and referenced by Dan Jurafsky and Jordan Boyd-Graber.
     |
     |      :param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
     |      :rtype: float
     |
     |  fit(self, text, vocabulary_text=None)
     |      Trains the model on a text.
     |
     |      :param text: Training text as a sequence of sentences.
     |
     |  generate(self, num_words=1, text_seed=None, random_seed=None)
     |      Generate words from the model.
     |
     |      :param int num_words: How many words to generate. By default 1.
     |      :param text_seed: Generation can be conditioned on preceding context.
     |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
     |          makes the random sampling part of generation reproducible.
     |      :return: One (str) word or a list of words generated from model.
     |
     |      Examples:
     |
     |      >>> from nltk.lm import MLE
     |      >>> lm = MLE(2)
     |      >>> lm.fit([[("a", "b"), ("b", "c")]], vocabulary_text=['a', 'b', 'c'])
     |      >>> lm.fit([[("a",), ("b",), ("c",)]])
     |      >>> lm.generate(random_seed=3)
     |      'a'
     |      >>> lm.generate(text_seed=['a'])
     |      'b'
     |
     |  logscore(self, word, context=None)
     |      Evaluate the log score of this word in this context.
     |
     |      The arguments are the same as for `score` and `unmasked_score`.
     |
     |  perplexity(self, text_ngrams)
     |      Calculates the perplexity of the given text.
     |
     |      This is simply 2 ** cross-entropy for the text, so the arguments are the same.
     |
     |  score(self, word, context=None)
     |      Masks out of vocab (OOV) words and computes their model score.
     |
     |      For model-specific logic of calculating scores, see the `unmasked_score`
     |      method.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.lm.api.LanguageModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Lidstone(nltk.lm.api.LanguageModel)
     |  Lidstone(gamma, *args, **kwargs)
     |
     |  Provides Lidstone-smoothed scores.
     |
     |  In addition to initialization arguments from BaseNgramModel also requires
     |  a number by which to increase the counts, gamma.
     |
     |  Method resolution order:
     |      Lidstone
     |      nltk.lm.api.LanguageModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, gamma, *args, **kwargs)
     |      Creates new LanguageModel.
     |
     |      :param vocabulary: If provided, this vocabulary will be used instead
     |          of creating a new one when training.
     |      :type vocabulary: `nltk.lm.Vocabulary` or None
     |      :param counter: If provided, use this object to count ngrams.
     |      :type counter: `nltk.lm.NgramCounter` or None
     |      :param ngrams_fn: If given, defines how sentences in training text are turned to ngram
     |          sequences.
     |      :type ngrams_fn: function or None
     |      :param pad_fn: If given, defines how sentences in training text are padded.
     |      :type pad_fn: function or None
     |
     |  unmasked_score(self, word, context=None)
     |      Add-one smoothing: Lidstone or Laplace.
     |
     |      To see what kind, look at `gamma` attribute on the class.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.lm.api.LanguageModel:
     |
     |  context_counts(self, context)
     |      Helper method for retrieving counts for a given context.
     |
     |      Assumes context has been checked and oov words in it masked.
     |      :type context: tuple(str) or None
     |
     |  entropy(self, text_ngrams)
     |      Calculate cross-entropy of model for given evaluation text.
     |
     |      This implementation is based on the Shannon-McMillan-Breiman theorem,
     |      as used and referenced by Dan Jurafsky and Jordan Boyd-Graber.
     |
     |      :param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
     |      :rtype: float
     |
     |  fit(self, text, vocabulary_text=None)
     |      Trains the model on a text.
     |
     |      :param text: Training text as a sequence of sentences.
     |
     |  generate(self, num_words=1, text_seed=None, random_seed=None)
     |      Generate words from the model.
     |
     |      :param int num_words: How many words to generate. By default 1.
     |      :param text_seed: Generation can be conditioned on preceding context.
     |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
     |          makes the random sampling part of generation reproducible.
     |      :return: One (str) word or a list of words generated from model.
     |
     |      Examples:
     |
     |      >>> from nltk.lm import MLE
     |      >>> lm = MLE(2)
     |      >>> lm.fit([[("a", "b"), ("b", "c")]], vocabulary_text=['a', 'b', 'c'])
     |      >>> lm.fit([[("a",), ("b",), ("c",)]])
     |      >>> lm.generate(random_seed=3)
     |      'a'
     |      >>> lm.generate(text_seed=['a'])
     |      'b'
     |
     |  logscore(self, word, context=None)
     |      Evaluate the log score of this word in this context.
     |
     |      The arguments are the same as for `score` and `unmasked_score`.
     |
     |  perplexity(self, text_ngrams)
     |      Calculates the perplexity of the given text.
     |
     |      This is simply 2 ** cross-entropy for the text, so the arguments are the same.
     |
     |  score(self, word, context=None)
     |      Masks out of vocab (OOV) words and computes their model score.
     |
     |      For model-specific logic of calculating scores, see the `unmasked_score`
     |      method.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.lm.api.LanguageModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class MLE(nltk.lm.api.LanguageModel)
     |  MLE(order, vocabulary=None, counter=None)
     |
     |  Class for providing MLE ngram model scores.
     |
     |  Inherits initialization from BaseNgramModel.
     |
     |  Method resolution order:
     |      MLE
     |      nltk.lm.api.LanguageModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  unmasked_score(self, word, context=None)
     |      Returns the MLE score for a word given a context.
     |
     |      Args:
     |      - word is expected to be a string
     |      - context is expected to be something reasonably convertible to a tuple
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.lm.api.LanguageModel:
     |
     |  __init__(self, order, vocabulary=None, counter=None)
     |      Creates new LanguageModel.
     |
     |      :param vocabulary: If provided, this vocabulary will be used instead
     |          of creating a new one when training.
     |      :type vocabulary: `nltk.lm.Vocabulary` or None
     |      :param counter: If provided, use this object to count ngrams.
     |      :type counter: `nltk.lm.NgramCounter` or None
     |      :param ngrams_fn: If given, defines how sentences in training text are turned to ngram
     |          sequences.
     |      :type ngrams_fn: function or None
     |      :param pad_fn: If given, defines how sentences in training text are padded.
     |      :type pad_fn: function or None
     |
     |  context_counts(self, context)
     |      Helper method for retrieving counts for a given context.
     |
     |      Assumes context has been checked and oov words in it masked.
     |      :type context: tuple(str) or None
     |
     |  entropy(self, text_ngrams)
     |      Calculate cross-entropy of model for given evaluation text.
     |
     |      This implementation is based on the Shannon-McMillan-Breiman theorem,
     |      as used and referenced by Dan Jurafsky and Jordan Boyd-Graber.
     |
     |      :param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
     |      :rtype: float
     |
     |  fit(self, text, vocabulary_text=None)
     |      Trains the model on a text.
     |
     |      :param text: Training text as a sequence of sentences.
     |
     |  generate(self, num_words=1, text_seed=None, random_seed=None)
     |      Generate words from the model.
     |
     |      :param int num_words: How many words to generate. By default 1.
     |      :param text_seed: Generation can be conditioned on preceding context.
     |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
     |          makes the random sampling part of generation reproducible.
     |      :return: One (str) word or a list of words generated from model.
     |
     |      Examples:
     |
     |      >>> from nltk.lm import MLE
     |      >>> lm = MLE(2)
     |      >>> lm.fit([[("a", "b"), ("b", "c")]], vocabulary_text=['a', 'b', 'c'])
     |      >>> lm.fit([[("a",), ("b",), ("c",)]])
     |      >>> lm.generate(random_seed=3)
     |      'a'
     |      >>> lm.generate(text_seed=['a'])
     |      'b'
     |
     |  logscore(self, word, context=None)
     |      Evaluate the log score of this word in this context.
     |
     |      The arguments are the same as for `score` and `unmasked_score`.
     |
     |  perplexity(self, text_ngrams)
     |      Calculates the perplexity of the given text.
     |
     |      This is simply 2 ** cross-entropy for the text, so the arguments are the same.
     |
     |  score(self, word, context=None)
     |      Masks out of vocab (OOV) words and computes their model score.
     |
     |      For model-specific logic of calculating scores, see the `unmasked_score`
     |      method.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.lm.api.LanguageModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class NgramCounter(builtins.object)
     |  NgramCounter(ngram_text=None)
     |
     |  Class for counting ngrams.
     |
     |  Will count any ngram sequence you give it ;)
     |
     |  First we need to make sure we are feeding the counter sentences of ngrams.
     |
     |  >>> text = [["a", "b", "c", "d"], ["a", "c", "d", "c"]]
     |  >>> from nltk.util import ngrams
     |  >>> text_bigrams = [ngrams(sent, 2) for sent in text]
     |  >>> text_unigrams = [ngrams(sent, 1) for sent in text]
     |
     |  The counting itself is very simple.
     |
     |  >>> from nltk.lm import NgramCounter
     |  >>> ngram_counts = NgramCounter(text_bigrams + text_unigrams)
     |
     |  You can conveniently access ngram counts using standard python dictionary notation.
     |  String keys will give you unigram counts.
     |
     |  >>> ngram_counts['a']
     |  2
     |  >>> ngram_counts['aliens']
     |  0
     |
     |  If you want to access counts for higher order ngrams, use a list or a tuple.
     |  These are treated as "context" keys, so what you get is a frequency distribution
     |  over all continuations after the given context.
     |
     |  >>> sorted(ngram_counts[['a']].items())
     |  [('b', 1), ('c', 1)]
     |  >>> sorted(ngram_counts[('a',)].items())
     |  [('b', 1), ('c', 1)]
     |
     |  This is equivalent to specifying explicitly the order of the ngram (in this case
     |  2 for bigram) and indexing on the context.
     |
     |  >>> ngram_counts[2][('a',)] is ngram_counts[['a']]
     |  True
     |
     |  Note that the keys in `ConditionalFreqDist` cannot be lists, only tuples!
     |  It is generally advisable to use the less verbose and more flexible square
     |  bracket notation.
     |
     |  To get the count of the full ngram "a b", do this:
     |
     |  >>> ngram_counts[['a']]['b']
     |  1
     |
     |  Specifying the ngram order as a number can be useful for accessing all ngrams
     |  in that order.
     |
     |  >>> ngram_counts[2]
     |  <ConditionalFreqDist with 4 conditions>
     |
     |  The keys of this `ConditionalFreqDist` are the contexts we discussed earlier.
     |  Unigrams can also be accessed with a human-friendly alias.
     |
     |  >>> ngram_counts.unigrams is ngram_counts[1]
     |  True
     |
     |  Similarly to `collections.Counter`, you can update counts after initialization.
     |
     |  >>> ngram_counts['e']
     |  0
     |  >>> ngram_counts.update([ngrams(["d", "e", "f"], 1)])
     |  >>> ngram_counts['e']
     |  1
     |
     |  Methods defined here:
     |
     |  N(self)
     |      Returns grand total number of ngrams stored.
     |
     |      This includes ngrams from all orders, so some duplication is expected.
     |      :rtype: int
     |
     |      >>> from nltk.lm import NgramCounter
     |      >>> counts = NgramCounter([[("a", "b"), ("c",), ("d", "e")]])
     |      >>> counts.N()
     |      3
     |
     |  __contains__(self, item)
     |
     |  __getitem__(self, item)
     |      User-friendly access to ngram counts.
     |
     |  __init__(self, ngram_text=None)
     |      Creates a new NgramCounter.
     |
     |      If `ngram_text` is specified, counts ngrams from it, otherwise waits for
     |      `update` method to be called explicitly.
     |
     |      :param ngram_text: Optional text containing sentences of ngrams, as for `update` method.
     |      :type ngram_text: Iterable(Iterable(tuple(str))) or None
     |
     |  __len__(self)
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  update(self, ngram_text)
     |      Updates ngram counts from `ngram_text`.
     |
     |      Expects `ngram_text` to be a sequence of sentences (sequences).
     |      Each sentence consists of ngrams as tuples of strings.
     |
     |      :param Iterable(Iterable(tuple(str))) ngram_text: Text containing sentences of ngrams.
     |      :raises TypeError: if the ngrams are not tuples.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StupidBackoff(nltk.lm.api.LanguageModel)
     |  StupidBackoff(alpha=0.4, *args, **kwargs)
     |
     |  Provides StupidBackoff scores.
     |
     |  In addition to initialization arguments from BaseNgramModel also requires
     |  a parameter alpha with which we scale the lower order probabilities.
     |  Note that this is not a true probability distribution as scores for ngrams
     |  of the same order do not sum up to unity.
     |
     |  Method resolution order:
     |      StupidBackoff
     |      nltk.lm.api.LanguageModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, alpha=0.4, *args, **kwargs)
     |      Creates new LanguageModel.
     |
     |      :param vocabulary: If provided, this vocabulary will be used instead
     |          of creating a new one when training.
     |      :type vocabulary: `nltk.lm.Vocabulary` or None
     |      :param counter: If provided, use this object to count ngrams.
     |      :type counter: `nltk.lm.NgramCounter` or None
     |      :param ngrams_fn: If given, defines how sentences in training text are turned to ngram
     |          sequences.
     |      :type ngrams_fn: function or None
     |      :param pad_fn: If given, defines how sentences in training text are padded.
     |      :type pad_fn: function or None
     |
     |  unmasked_score(self, word, context=None)
     |      Score a word given some optional context.
     |
     |      Concrete models are expected to provide an implementation.
     |      Note that this method does not mask its arguments with the OOV label.
     |      Use the `score` method for that.
     |
     |      :param str word: Word for which we want the score
     |      :param tuple(str) context: Context the word is in.
     |          If `None`, compute unigram score.
     |      :param context: tuple(str) or None
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.lm.api.LanguageModel:
     |
     |  context_counts(self, context)
     |      Helper method for retrieving counts for a given context.
     |
     |      Assumes context has been checked and oov words in it masked.
     |      :type context: tuple(str) or None
     |
     |  entropy(self, text_ngrams)
     |      Calculate cross-entropy of model for given evaluation text.
     |
     |      This implementation is based on the Shannon-McMillan-Breiman theorem,
     |      as used and referenced by Dan Jurafsky and Jordan Boyd-Graber.
     |
     |      :param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
     |      :rtype: float
     |
     |  fit(self, text, vocabulary_text=None)
     |      Trains the model on a text.
     |
     |      :param text: Training text as a sequence of sentences.
     |
     |  generate(self, num_words=1, text_seed=None, random_seed=None)
     |      Generate words from the model.
     |
     |      :param int num_words: How many words to generate. By default 1.
     |      :param text_seed: Generation can be conditioned on preceding context.
     |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
     |          makes the random sampling part of generation reproducible.
     |      :return: One (str) word or a list of words generated from model.
     |
     |      Examples:
     |
     |      >>> from nltk.lm import MLE
     |      >>> lm = MLE(2)
     |      >>> lm.fit([[("a", "b"), ("b", "c")]], vocabulary_text=['a', 'b', 'c'])
     |      >>> lm.fit([[("a",), ("b",), ("c",)]])
     |      >>> lm.generate(random_seed=3)
     |      'a'
     |      >>> lm.generate(text_seed=['a'])
     |      'b'
     |
     |  logscore(self, word, context=None)
     |      Evaluate the log score of this word in this context.
     |
     |      The arguments are the same as for `score` and `unmasked_score`.
     |
     |  perplexity(self, text_ngrams)
     |      Calculates the perplexity of the given text.
     |
     |      This is simply 2 ** cross-entropy for the text, so the arguments are the same.
     |
     |  score(self, word, context=None)
     |      Masks out of vocab (OOV) words and computes their model score.
     |
     |      For model-specific logic of calculating scores, see the `unmasked_score`
     |      method.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.lm.api.LanguageModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Vocabulary(builtins.object)
     |  Vocabulary(counts=None, unk_cutoff=1, unk_label='<UNK>')
     |
     |  Stores language model vocabulary.
     |
     |  Satisfies two common language modeling requirements for a vocabulary:
     |
     |  - When checking membership and calculating its size, filters items
     |    by comparing their counts to a cutoff value.
     |  - Adds a special "unknown" token which unseen words are mapped to.
     |
     |  >>> words = ['a', 'c', '-', 'd', 'c', 'a', 'b', 'r', 'a', 'c', 'd']
     |  >>> from nltk.lm import Vocabulary
     |  >>> vocab = Vocabulary(words, unk_cutoff=2)
     |
     |  Tokens with counts greater than or equal to the cutoff value will
     |  be considered part of the vocabulary.
     |
     |  >>> vocab['c']
     |  3
     |  >>> 'c' in vocab
     |  True
     |  >>> vocab['d']
     |  2
     |  >>> 'd' in vocab
     |  True
     |
     |  Tokens with frequency counts less than the cutoff value will be considered not
     |  part of the vocabulary even though their entries in the count dictionary are
     |  preserved.
     |
     |  >>> vocab['b']
     |  1
     |  >>> 'b' in vocab
     |  False
     |  >>> vocab['aliens']
     |  0
     |  >>> 'aliens' in vocab
     |  False
     |
     |  Keeping the count entries for seen words allows us to change the cutoff value
     |  without having to recalculate the counts.
     |
     |  >>> vocab2 = Vocabulary(vocab.counts, unk_cutoff=1)
     |  >>> "b" in vocab2
     |  True
     |
     |  The cutoff value influences not only membership checking but also the result of
     |  getting the size of the vocabulary using the built-in `len`.
     |  Note that while the number of keys in the vocabulary's counter stays the same,
     |  the items in the vocabulary differ depending on the cutoff.
     |  We use `sorted` to demonstrate because it keeps the order consistent.
     |
     |  >>> sorted(vocab2.counts)
     |  ['-', 'a', 'b', 'c', 'd', 'r']
     |  >>> sorted(vocab2)
     |  ['-', '<UNK>', 'a', 'b', 'c', 'd', 'r']
     |  >>> sorted(vocab.counts)
     |  ['-', 'a', 'b', 'c', 'd', 'r']
     |  >>> sorted(vocab)
     |  ['<UNK>', 'a', 'c', 'd']
     |
     |  In addition to items it gets populated with, the vocabulary stores a special
     |  token that stands in for so-called "unknown" items. By default it's "<UNK>".
     |
     |  >>> "<UNK>" in vocab
     |  True
     |
     |  We can look up words in a vocabulary using its `lookup` method.
     |  "Unseen" words (with counts less than cutoff) are looked up as the unknown label.
     |  If given one word (a string) as an input, this method will return a string.
     |
     |  >>> vocab.lookup("a")
     |  'a'
     |  >>> vocab.lookup("aliens")
     |  '<UNK>'
     |
     |  If given a sequence, it will return an tuple of the looked up words.
     |
     |  >>> vocab.lookup(["p", 'a', 'r', 'd', 'b', 'c'])
     |  ('<UNK>', 'a', '<UNK>', 'd', '<UNK>', 'c')
     |
     |  It's possible to update the counts after the vocabulary has been created.
     |  In general, the interface is the same as that of `collections.Counter`.
     |
     |  >>> vocab['b']
     |  1
     |  >>> vocab.update(["b", "b", "c"])
     |  >>> vocab['b']
     |  3
     |
     |  Methods defined here:
     |
     |  __contains__(self, item)
     |      Only consider items with counts GE to cutoff as being in the
     |      vocabulary.
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __getitem__(self, item)
     |
     |  __init__(self, counts=None, unk_cutoff=1, unk_label='<UNK>')
     |      Create a new Vocabulary.
     |
     |      :param counts: Optional iterable or `collections.Counter` instance to
     |                     pre-seed the Vocabulary. In case it is iterable, counts
     |                     are calculated.
     |      :param int unk_cutoff: Words that occur less frequently than this value
     |                             are not considered part of the vocabulary.
     |      :param unk_label: Label for marking words not part of vocabulary.
     |
     |  __iter__(self)
     |      Building on membership check define how to iterate over
     |      vocabulary.
     |
     |  __len__(self)
     |      Computing size of vocabulary reflects the cutoff.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  lookup(self, words)
     |      Look up one or more words in the vocabulary.
     |
     |      If passed one word as a string will return that word or `self.unk_label`.
     |      Otherwise will assume it was passed a sequence of words, will try to look
     |      each of them up and return an iterator over the looked up words.
     |
     |      :param words: Word(s) to look up.
     |      :type words: Iterable(str) or str
     |      :rtype: generator(str) or str
     |      :raises: TypeError for types other than strings or iterables
     |
     |      >>> from nltk.lm import Vocabulary
     |      >>> vocab = Vocabulary(["a", "b", "c", "a", "b"], unk_cutoff=2)
     |      >>> vocab.lookup("a")
     |      'a'
     |      >>> vocab.lookup("aliens")
     |      '<UNK>'
     |      >>> vocab.lookup(["a", "b", "c", ["x", "b"]])
     |      ('a', 'b', '<UNK>', ('<UNK>', 'b'))
     |
     |  update(self, *counter_args, **counter_kwargs)
     |      Update vocabulary counts.
     |
     |      Wraps `collections.Counter.update` method.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  cutoff
     |      Cutoff value.
     |
     |      Items with count below this value are not considered part of vocabulary.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None

    class WittenBellInterpolated(InterpolatedLanguageModel)
     |  WittenBellInterpolated(order, **kwargs)
     |
     |  Interpolated version of Witten-Bell smoothing.
     |
     |  Method resolution order:
     |      WittenBellInterpolated
     |      InterpolatedLanguageModel
     |      nltk.lm.api.LanguageModel
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, order, **kwargs)
     |      Creates new LanguageModel.
     |
     |      :param vocabulary: If provided, this vocabulary will be used instead
     |          of creating a new one when training.
     |      :type vocabulary: `nltk.lm.Vocabulary` or None
     |      :param counter: If provided, use this object to count ngrams.
     |      :type counter: `nltk.lm.NgramCounter` or None
     |      :param ngrams_fn: If given, defines how sentences in training text are turned to ngram
     |          sequences.
     |      :type ngrams_fn: function or None
     |      :param pad_fn: If given, defines how sentences in training text are padded.
     |      :type pad_fn: function or None
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from InterpolatedLanguageModel:
     |
     |  unmasked_score(self, word, context=None)
     |      Score a word given some optional context.
     |
     |      Concrete models are expected to provide an implementation.
     |      Note that this method does not mask its arguments with the OOV label.
     |      Use the `score` method for that.
     |
     |      :param str word: Word for which we want the score
     |      :param tuple(str) context: Context the word is in.
     |          If `None`, compute unigram score.
     |      :param context: tuple(str) or None
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.lm.api.LanguageModel:
     |
     |  context_counts(self, context)
     |      Helper method for retrieving counts for a given context.
     |
     |      Assumes context has been checked and oov words in it masked.
     |      :type context: tuple(str) or None
     |
     |  entropy(self, text_ngrams)
     |      Calculate cross-entropy of model for given evaluation text.
     |
     |      This implementation is based on the Shannon-McMillan-Breiman theorem,
     |      as used and referenced by Dan Jurafsky and Jordan Boyd-Graber.
     |
     |      :param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
     |      :rtype: float
     |
     |  fit(self, text, vocabulary_text=None)
     |      Trains the model on a text.
     |
     |      :param text: Training text as a sequence of sentences.
     |
     |  generate(self, num_words=1, text_seed=None, random_seed=None)
     |      Generate words from the model.
     |
     |      :param int num_words: How many words to generate. By default 1.
     |      :param text_seed: Generation can be conditioned on preceding context.
     |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
     |          makes the random sampling part of generation reproducible.
     |      :return: One (str) word or a list of words generated from model.
     |
     |      Examples:
     |
     |      >>> from nltk.lm import MLE
     |      >>> lm = MLE(2)
     |      >>> lm.fit([[("a", "b"), ("b", "c")]], vocabulary_text=['a', 'b', 'c'])
     |      >>> lm.fit([[("a",), ("b",), ("c",)]])
     |      >>> lm.generate(random_seed=3)
     |      'a'
     |      >>> lm.generate(text_seed=['a'])
     |      'b'
     |
     |  logscore(self, word, context=None)
     |      Evaluate the log score of this word in this context.
     |
     |      The arguments are the same as for `score` and `unmasked_score`.
     |
     |  perplexity(self, text_ngrams)
     |      Calculates the perplexity of the given text.
     |
     |      This is simply 2 ** cross-entropy for the text, so the arguments are the same.
     |
     |  score(self, word, context=None)
     |      Masks out of vocab (OOV) words and computes their model score.
     |
     |      For model-specific logic of calculating scores, see the `unmasked_score`
     |      method.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.lm.api.LanguageModel:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    __all__ = ['Vocabulary', 'NgramCounter', 'MLE', 'Lidstone', 'Laplace',...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\lm\__init__.py

nltk.load
Python Library Documentation: function load in module nltk.data

load(resource_url, format='auto', cache=True, verbose=False, logic_parser=None, fstruct_reader=None, encoding=None)
    Load a given resource from the NLTK data package.  The following
    resource formats are currently supported:

      - ``pickle``
      - ``json``
      - ``yaml``
      - ``cfg`` (context free grammars)
      - ``pcfg`` (probabilistic CFGs)
      - ``fcfg`` (feature-based CFGs)
      - ``fol`` (formulas of First Order Logic)
      - ``logic`` (Logical formulas to be parsed by the given logic_parser)
      - ``val`` (valuation of First Order Logic model)
      - ``text`` (the file contents as a unicode string)
      - ``raw`` (the raw file contents as a byte string)

    If no format is specified, ``load()`` will attempt to determine a
    format based on the resource name's file extension.  If that
    fails, ``load()`` will raise a ``ValueError`` exception.

    For all text formats (everything except ``pickle``, ``json``, ``yaml`` and ``raw``),
    it tries to decode the raw contents using UTF-8, and if that doesn't
    work, it tries with ISO-8859-1 (Latin-1), unless the ``encoding``
    is specified.

    :type resource_url: str
    :param resource_url: A URL specifying where the resource should be
        loaded from.  The default protocol is "nltk:", which searches
        for the file in the the NLTK data package.
    :type cache: bool
    :param cache: If true, add this resource to a cache.  If load()
        finds a resource in its cache, then it will return it from the
        cache rather than loading it.
    :type verbose: bool
    :param verbose: If true, print a message when loading a resource.
        Messages are not displayed when a resource is retrieved from
        the cache.
    :type logic_parser: LogicParser
    :param logic_parser: The parser that will be used to parse logical
        expressions.
    :type fstruct_reader: FeatStructReader
    :param fstruct_reader: The parser that will be used to parse the
        feature structure of an fcfg.
    :type encoding: str
    :param encoding: the encoding of the input; only used for text formats.
nltk.load_parser
Python Library Documentation: function load_parser in module nltk.parse.util

load_parser(grammar_url, trace=0, parser=None, chart_class=None, beam_size=0, **load_args)
    Load a grammar from a file, and build a parser based on that grammar.
    The parser depends on the grammar format, and might also depend
    on properties of the grammar itself.

    The following grammar formats are currently supported:
      - ``'cfg'``  (CFGs: ``CFG``)
      - ``'pcfg'`` (probabilistic CFGs: ``PCFG``)
      - ``'fcfg'`` (feature-based CFGs: ``FeatureGrammar``)

    :type grammar_url: str
    :param grammar_url: A URL specifying where the grammar is located.
        The default protocol is ``"nltk:"``, which searches for the file
        in the the NLTK data package.
    :type trace: int
    :param trace: The level of tracing that should be used when
        parsing a text.  ``0`` will generate no tracing output;
        and higher numbers will produce more verbose tracing output.
    :param parser: The class used for parsing; should be ``ChartParser``
        or a subclass.
        If None, the class depends on the grammar format.
    :param chart_class: The class used for storing the chart;
        should be ``Chart`` or a subclass.
        Only used for CFGs and feature CFGs.
        If None, the chart class depends on the grammar format.
    :type beam_size: int
    :param beam_size: The maximum length for the parser's edge queue.
        Only used for probabilistic CFGs.
    :param load_args: Keyword parameters used when loading the grammar.
        See ``data.load`` for more information.
nltk.locale
Python Library Documentation: module locale

NAME
    locale - Locale support module.

MODULE REFERENCE
    https://docs.python.org/3.12/library/locale.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION
    The module provides low-level access to the C lib's locale APIs and adds high
    level number formatting APIs as well as a locale aliasing engine to complement
    these.

    The aliasing engine includes support for many commonly used locale names and
    maps them to values suitable for passing to the C lib's setlocale() function. It
    also includes default encodings for all supported locale names.

CLASSES
    builtins.Exception(builtins.BaseException)
        Error

    class Error(builtins.Exception)
     |  Method resolution order:
     |      Error
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

FUNCTIONS
    atof(string, func=<class 'float'>)
        Parses a string as a float according to the locale settings.

    atoi(string)
        Converts a string to an integer according to the locale settings.

    currency(val, symbol=True, grouping=False, international=False)
        Formats val according to the currency settings
        in the current locale.

    format_string(f, val, grouping=False, monetary=False)
        Formats a string in the same way that the % formatting would use,
        but takes the current locale into account.

        Grouping is applied if the third parameter is true.
        Conversion uses monetary thousands separator and grouping strings if
        forth parameter monetary is true.

    getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE'))
        Tries to determine the default locale settings and returns
        them as tuple (language code, encoding).

        According to POSIX, a program which has not called
        setlocale(LC_ALL, "") runs using the portable 'C' locale.
        Calling setlocale(LC_ALL, "") lets it use the default locale as
        defined by the LANG variable. Since we don't want to interfere
        with the current locale setting we thus emulate the behavior
        in the way described above.

        To maintain compatibility with other platforms, not only the
        LANG variable is tested, but a list of variables given as
        envvars parameter. The first found to be defined will be
        used. envvars defaults to the search path used in GNU gettext;
        it must always contain the variable name 'LANG'.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    getencoding()
        Get the current locale encoding.

    getlocale(category=2)
        Returns the current setting for the given locale category as
        tuple (language code, encoding).

        category may be one of the LC_* value except LC_ALL. It
        defaults to LC_CTYPE.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    getpreferredencoding(do_setlocale=True)
        Return the charset that the user is likely using.

    localeconv()
        Returns numeric and monetary locale-specific parameters.

    normalize(localename)
        Returns a normalized locale code for the given locale
        name.

        The returned locale code is formatted for use with
        setlocale().

        If normalization fails, the original name is returned
        unchanged.

        If the given encoding is not known, the function defaults to
        the default encoding for the locale code just like setlocale()
        does.

    resetlocale(category=0)
        Sets the locale for category to the default setting.

        The default setting is determined by calling
        getdefaultlocale(). category defaults to LC_ALL.

    setlocale(category, locale=None)
        Set the locale for the given category.  The locale can be
        a string, an iterable of two strings (language code and encoding),
        or None.

        Iterables are converted to strings using the locale aliasing
        engine.  Locale strings are passed directly to the C lib.

        category may be given as one of the LC_* values.

    str(val)
        Convert float to string, taking the locale into account.

    strcoll(os1, os2, /)
        Compares two strings according to the locale.

    strxfrm(string, /)
        Return a string that can be used as a key for locale-aware comparisons.

DATA
    CHAR_MAX = 127
    LC_ALL = 0
    LC_COLLATE = 1
    LC_CTYPE = 2
    LC_MONETARY = 3
    LC_NUMERIC = 4
    LC_TIME = 5
    __all__ = ['getlocale', 'getdefaultlocale', 'getpreferredencoding', 'E...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\locale.py

nltk.log_likelihood
Python Library Documentation: function log_likelihood in module nltk.metrics.scores

log_likelihood(reference, test)
    Given a list of reference values and a corresponding list of test
    probability distributions, return the average log likelihood of
    the reference values, given the probability distributions.

    :param reference: A list of reference values
    :type reference: list
    :param test: A list of probability distributions over values to
        compare against the corresponding reference values.
    :type test: list(ProbDistI)
nltk.logic
Python Library Documentation: module nltk.sem.logic in nltk.sem

NAME
    nltk.sem.logic

DESCRIPTION
    A version of first order predicate logic, built on
    top of the typed lambda calculus.

CLASSES
    builtins.Exception(builtins.BaseException)
        LogicalExpressionException
            ExpectedMoreTokensException
            UnexpectedTokenException
        TypeException
            IllegalTypeException
            InconsistentTypeHierarchyException
            TypeResolutionException
    builtins.object
        LogicParser
        SubstituteBindingsI
            Expression
                AbstractVariableExpression
                    ConstantExpression
                    FunctionVariableExpression
                    IndividualVariableExpression
                        EventVariableExpression
                ApplicationExpression
                BinaryExpression
                    BooleanExpression
                        AndExpression
                        IffExpression
                        ImpExpression
                        OrExpression
                    EqualityExpression
                NegatedExpression
                VariableBinderExpression
                    LambdaExpression
                    QuantifiedExpression
                        AllExpression
                        ExistsExpression
                        IotaExpression
        Tokens
        Type
            BasicType
                AnyType(BasicType, ComplexType)
                EntityType
                EventType
                TruthValueType
            ComplexType
        Variable

    class AbstractVariableExpression(Expression)
     |  AbstractVariableExpression(variable)
     |
     |  This class represents a variable to be used as a predicate or entity
     |
     |  Method resolution order:
     |      AbstractVariableExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class AllExpression(QuantifiedExpression)
     |  AllExpression(variable, term)
     |
     |  Method resolution order:
     |      AllExpression
     |      QuantifiedExpression
     |      VariableBinderExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  getQuantifier(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from QuantifiedExpression:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from QuantifiedExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from VariableBinderExpression:
     |
     |  __eq__(self, other)
     |      Defines equality modulo alphabetic variance.  If we are comparing
     |      \x.M  and \y.N, then check equality of M and N[x/y].
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable, term)
     |      :param variable: ``Variable``, for the variable
     |      :param term: ``Expression``, for the term
     |
     |  alpha_convert(self, newvar)
     |      Rename all occurrences of the variable introduced by this variable
     |      binder in the expression to ``newvar``.
     |      :param newvar: ``Variable``, for the new variable
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  visit_structured(self, function, combinator)
     |      :see: Expression.visit_structured()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class AndExpression(BooleanExpression)
     |  AndExpression(first, second)
     |
     |  This class represents conjunctions
     |
     |  Method resolution order:
     |      AndExpression
     |      BooleanExpression
     |      BinaryExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  getOp(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from BinaryExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class AnyType(BasicType, ComplexType)
     |  Method resolution order:
     |      AnyType
     |      BasicType
     |      ComplexType
     |      Type
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Type
     |      Return hash(self).
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  matches(self, other)
     |
     |  resolve(self, other)
     |
     |  str(self)
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  first
     |
     |  second
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Type:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Type:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Type:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ApplicationExpression(Expression)
     |  ApplicationExpression(function, argument)
     |
     |  This class is used to represent two related types of logical expressions.
     |
     |  The first is a Predicate Expression, such as "P(x,y)".  A predicate
     |  expression is comprised of a ``FunctionVariableExpression`` or
     |  ``ConstantExpression`` as the predicate and a list of Expressions as the
     |  arguments.
     |
     |  The second is a an application of one expression to another, such as
     |  "(\x.dog(x))(fido)".
     |
     |  The reason Predicate Expressions are treated as Application Expressions is
     |  that the Variable Expression predicate of the expression may be replaced
     |  with another Expression, such as a LambdaExpression, which would mean that
     |  the Predicate should be thought of as being applied to the arguments.
     |
     |  The logical expression reader will always curry arguments in a application expression.
     |  So, "\x y.see(x,y)(john,mary)" will be represented internally as
     |  "((\x y.(see(x))(y))(john))(mary)".  This simplifies the internals since
     |  there will always be exactly one argument in an application.
     |
     |  The str() method will usually print the curried forms of application
     |  expressions.  The one exception is when the the application expression is
     |  really a predicate expression (ie, underlying function is an
     |  ``AbstractVariableExpression``).  This means that the example from above
     |  will be returned as "(\x y.see(x,y)(john))(mary)".
     |
     |  Method resolution order:
     |      ApplicationExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, function, argument)
     |      :param function: ``Expression``, for the function expression
     |      :param argument: ``Expression``, for the argument
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  is_atom(self)
     |      Is this expression an atom (as opposed to a lambda expression applied
     |      to a term)?
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  uncurry(self)
     |      Uncurry this application expression
     |
     |      return: A tuple (base-function, arg-list)
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  args
     |      Return uncurried arg-list
     |
     |  pred
     |      Return uncurried base-function.
     |      If this is an atom, then the result will be a variable expression.
     |      Otherwise, it will be a lambda expression.
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BasicType(Type)
     |  Method resolution order:
     |      BasicType
     |      Type
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Type
     |      Return hash(self).
     |
     |  matches(self, other)
     |
     |  resolve(self, other)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Type:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Type:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Type:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BinaryExpression(Expression)
     |  BinaryExpression(first, second)
     |
     |  Method resolution order:
     |      BinaryExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BooleanExpression(BinaryExpression)
     |  BooleanExpression(first, second)
     |
     |  Method resolution order:
     |      BooleanExpression
     |      BinaryExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods inherited from BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from BinaryExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ComplexType(Type)
     |  ComplexType(first, second)
     |
     |  Method resolution order:
     |      ComplexType
     |      Type
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Type
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  matches(self, other)
     |
     |  resolve(self, other)
     |
     |  str(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Type:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Type:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Type:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ConstantExpression(AbstractVariableExpression)
     |  ConstantExpression(variable)
     |
     |  This class represents variables that do not take the form of a single
     |  character followed by zero or more digits.
     |
     |  Method resolution order:
     |      ConstantExpression
     |      AbstractVariableExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  type = e
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractVariableExpression:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class EntityType(BasicType)
     |  Method resolution order:
     |      EntityType
     |      BasicType
     |      Type
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  str(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BasicType:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Type
     |      Return hash(self).
     |
     |  matches(self, other)
     |
     |  resolve(self, other)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Type:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Type:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Type:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class EqualityExpression(BinaryExpression)
     |  EqualityExpression(first, second)
     |
     |  This class represents equality expressions like "(x = y)".
     |
     |  Method resolution order:
     |      EqualityExpression
     |      BinaryExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  getOp(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from BinaryExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class EventType(BasicType)
     |  Method resolution order:
     |      EventType
     |      BasicType
     |      Type
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  str(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BasicType:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Type
     |      Return hash(self).
     |
     |  matches(self, other)
     |
     |  resolve(self, other)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Type:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Type:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Type:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class EventVariableExpression(IndividualVariableExpression)
     |  EventVariableExpression(variable)
     |
     |  This class represents variables that take the form of a single lowercase
     |  'e' character followed by zero or more digits.
     |
     |  Method resolution order:
     |      EventVariableExpression
     |      IndividualVariableExpression
     |      AbstractVariableExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Data and other attributes defined here:
     |
     |  type = v
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from IndividualVariableExpression:
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractVariableExpression:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ExistsExpression(QuantifiedExpression)
     |  ExistsExpression(variable, term)
     |
     |  Method resolution order:
     |      ExistsExpression
     |      QuantifiedExpression
     |      VariableBinderExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  getQuantifier(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from QuantifiedExpression:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from QuantifiedExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from VariableBinderExpression:
     |
     |  __eq__(self, other)
     |      Defines equality modulo alphabetic variance.  If we are comparing
     |      \x.M  and \y.N, then check equality of M and N[x/y].
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable, term)
     |      :param variable: ``Variable``, for the variable
     |      :param term: ``Expression``, for the term
     |
     |  alpha_convert(self, newvar)
     |      Rename all occurrences of the variable introduced by this variable
     |      binder in the expression to ``newvar``.
     |      :param newvar: ``Variable``, for the new variable
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  visit_structured(self, function, combinator)
     |      :see: Expression.visit_structured()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ExpectedMoreTokensException(LogicalExpressionException)
     |  ExpectedMoreTokensException(index, message=None)
     |
     |  Method resolution order:
     |      ExpectedMoreTokensException
     |      LogicalExpressionException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, index, message=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from LogicalExpressionException:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class Expression(SubstituteBindingsI)
     |  This is the base abstract object for all logical expressions
     |
     |  Method resolution order:
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  findtype(self, variable)
     |      Find the type of the given variable as it is used in this expression.
     |      For example, finding the type of "P" in "P(x) & Q(x,y)" yields "<e,t>"
     |
     |      :param variable: Variable
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FunctionVariableExpression(AbstractVariableExpression)
     |  FunctionVariableExpression(variable)
     |
     |  This class represents variables that take the form of a single uppercase
     |  character followed by zero or more digits.
     |
     |  Method resolution order:
     |      FunctionVariableExpression
     |      AbstractVariableExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  type = ?
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractVariableExpression:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IffExpression(BooleanExpression)
     |  IffExpression(first, second)
     |
     |  This class represents biconditionals
     |
     |  Method resolution order:
     |      IffExpression
     |      BooleanExpression
     |      BinaryExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  getOp(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from BinaryExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IllegalTypeException(TypeException)
     |  IllegalTypeException(expression, other_type, allowed_type)
     |
     |  Method resolution order:
     |      IllegalTypeException
     |      TypeException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, expression, other_type, allowed_type)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from TypeException:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class ImpExpression(BooleanExpression)
     |  ImpExpression(first, second)
     |
     |  This class represents implications
     |
     |  Method resolution order:
     |      ImpExpression
     |      BooleanExpression
     |      BinaryExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  getOp(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from BinaryExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class InconsistentTypeHierarchyException(TypeException)
     |  InconsistentTypeHierarchyException(variable, expression=None)
     |
     |  Method resolution order:
     |      InconsistentTypeHierarchyException
     |      TypeException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, variable, expression=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from TypeException:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class IndividualVariableExpression(AbstractVariableExpression)
     |  IndividualVariableExpression(variable)
     |
     |  This class represents variables that take the form of a single lowercase
     |  character (other than 'e') followed by zero or more digits.
     |
     |  Method resolution order:
     |      IndividualVariableExpression
     |      AbstractVariableExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  constants(self)
     |      :see: Expression.constants()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractVariableExpression:
     |
     |  __eq__(self, other)
     |      Allow equality between instances of ``AbstractVariableExpression``
     |      subtypes.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable)
     |      :param variable: ``Variable``, for the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  predicates(self)
     |      :see: Expression.predicates()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation:
     |
     |          return combinator(map(function, self.subexpressions))
     |
     |      Bound variables are neither applied upon by the function nor given to
     |      the combinator.
     |      :param function: ``Function<Expression,T>`` to call on each subexpression
     |      :param combinator: ``Function<list<T>,R>`` to combine the results of the
     |      function calls
     |      :return: result of combination ``R``
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class IotaExpression(QuantifiedExpression)
     |  IotaExpression(variable, term)
     |
     |  Method resolution order:
     |      IotaExpression
     |      QuantifiedExpression
     |      VariableBinderExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  getQuantifier(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from QuantifiedExpression:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from QuantifiedExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from VariableBinderExpression:
     |
     |  __eq__(self, other)
     |      Defines equality modulo alphabetic variance.  If we are comparing
     |      \x.M  and \y.N, then check equality of M and N[x/y].
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable, term)
     |      :param variable: ``Variable``, for the variable
     |      :param term: ``Expression``, for the term
     |
     |  alpha_convert(self, newvar)
     |      Rename all occurrences of the variable introduced by this variable
     |      binder in the expression to ``newvar``.
     |      :param newvar: ``Variable``, for the new variable
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  visit_structured(self, function, combinator)
     |      :see: Expression.visit_structured()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LambdaExpression(VariableBinderExpression)
     |  LambdaExpression(variable, term)
     |
     |  Method resolution order:
     |      LambdaExpression
     |      VariableBinderExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from VariableBinderExpression:
     |
     |  __eq__(self, other)
     |      Defines equality modulo alphabetic variance.  If we are comparing
     |      \x.M  and \y.N, then check equality of M and N[x/y].
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable, term)
     |      :param variable: ``Variable``, for the variable
     |      :param term: ``Expression``, for the term
     |
     |  alpha_convert(self, newvar)
     |      Rename all occurrences of the variable introduced by this variable
     |      binder in the expression to ``newvar``.
     |      :param newvar: ``Variable``, for the new variable
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  visit_structured(self, function, combinator)
     |      :see: Expression.visit_structured()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LogicParser(builtins.object)
     |  LogicParser(type_check=False)
     |
     |  A lambda calculus expression parser.
     |
     |  Methods defined here:
     |
     |  __init__(self, type_check=False)
     |      :param type_check: should type checking be performed
     |          to their types?
     |      :type type_check: bool
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  assertNextToken(self, expected)
     |
     |  assertToken(self, tok, expected)
     |
     |  attempt_ApplicationExpression(self, expression, context)
     |      Attempt to make an application expression.  The next tokens are
     |      a list of arguments in parens, then the argument expression is a
     |      function being applied to the arguments.  Otherwise, return the
     |      argument expression.
     |
     |  attempt_BooleanExpression(self, expression, context)
     |      Attempt to make a boolean expression.  If the next token is a boolean
     |      operator, then a BooleanExpression will be returned.  Otherwise, the
     |      parameter will be returned.
     |
     |  attempt_EqualityExpression(self, expression, context)
     |      Attempt to make an equality expression.  If the next token is an
     |      equality operator, then an EqualityExpression will be returned.
     |      Otherwise, the parameter will be returned.
     |
     |  attempt_adjuncts(self, expression, context)
     |
     |  get_BooleanExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different boolean operators
     |
     |  get_QuantifiedExpression_factory(self, tok)
     |      This method serves as a hook for other logic parsers that
     |      have different quantifiers
     |
     |  get_all_symbols(self)
     |      This method exists to be overridden
     |
     |  get_next_token_variable(self, description)
     |
     |  handle(self, tok, context)
     |      This method is intended to be overridden for logics that
     |      use different operators or expressions
     |
     |  handle_lambda(self, tok, context)
     |
     |  handle_negation(self, tok, context)
     |
     |  handle_open(self, tok, context)
     |
     |  handle_quant(self, tok, context)
     |
     |  handle_variable(self, tok, context)
     |
     |  has_priority(self, operation, context)
     |
     |  inRange(self, location)
     |      Return TRUE if the given location is within the buffer
     |
     |  isvariable(self, tok)
     |
     |  make_ApplicationExpression(self, function, argument)
     |
     |  make_BooleanExpression(self, factory, first, second)
     |
     |  make_EqualityExpression(self, first, second)
     |      This method serves as a hook for other logic parsers that
     |      have different equality expression classes
     |
     |  make_LambdaExpression(self, variable, term)
     |
     |  make_NegatedExpression(self, expression)
     |
     |  make_QuanifiedExpression(self, factory, variable, term)
     |
     |  make_VariableExpression(self, name)
     |
     |  parse(self, data, signature=None)
     |      Parse the expression.
     |
     |      :param data: str for the input to be parsed
     |      :param signature: ``dict<str, str>`` that maps variable names to type
     |          strings
     |      :returns: a parsed Expression
     |
     |  process(self, data)
     |      Split the data into tokens
     |
     |  process_next_expression(self, context)
     |      Parse the next complete expression from the stream and return it.
     |
     |  process_quoted_token(self, data_idx, data)
     |
     |  token(self, location=None)
     |      Get the next waiting token.  If a location is given, then
     |      return the token at currentIndex+location without advancing
     |      currentIndex; setting it gives lookahead/lookback capability.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MAX_PARSE_DEPTH = 200

    class LogicalExpressionException(builtins.Exception)
     |  LogicalExpressionException(index, message)
     |
     |  Method resolution order:
     |      LogicalExpressionException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, index, message)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class NegatedExpression(Expression)
     |  NegatedExpression(term)
     |
     |  Method resolution order:
     |      NegatedExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, term)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      Find the type of the given variable as it is used in this expression.
     |      For example, finding the type of "P" in "P(x) & Q(x,y)" yields "<e,t>"
     |
     |      :param variable: Variable
     |
     |  negate(self)
     |      :see: Expression.negate()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class OrExpression(BooleanExpression)
     |  OrExpression(first, second)
     |
     |  This class represents disjunctions
     |
     |  Method resolution order:
     |      OrExpression
     |      BooleanExpression
     |      BinaryExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  getOp(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BinaryExpression:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, first, second)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from BinaryExpression:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  free(self)
     |      Return a set of all the free (non-bound) variables.  This includes
     |      both individual and predicate variables, but not constants.
     |      :return: set of ``Variable`` objects
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      Replace every instance of 'variable' with 'expression'
     |      :param variable: ``Variable`` The variable to replace
     |      :param expression: ``Expression`` The expression with which to replace it
     |      :param replace_bound: bool Should bound variables be replaced?
     |      :param alpha_convert: bool Alpha convert automatically to avoid name clashes?
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  visit_structured(self, function, combinator)
     |      Recursively visit subexpressions.  Apply 'function' to each
     |      subexpression and pass the result of each function application
     |      to the 'combinator' for aggregation.  The combinator must have
     |      the same signature as the constructor.  The function is not
     |      applied to bound variables, but they are passed to the
     |      combinator.
     |      :param function: ``Function`` to call on each subexpression
     |      :param combinator: ``Function`` with the same signature as the
     |      constructor, to combine the results of the function calls
     |      :return: result of combination
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class QuantifiedExpression(VariableBinderExpression)
     |  QuantifiedExpression(variable, term)
     |
     |  Method resolution order:
     |      QuantifiedExpression
     |      VariableBinderExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  type
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from VariableBinderExpression:
     |
     |  __eq__(self, other)
     |      Defines equality modulo alphabetic variance.  If we are comparing
     |      \x.M  and \y.N, then check equality of M and N[x/y].
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable, term)
     |      :param variable: ``Variable``, for the variable
     |      :param term: ``Expression``, for the term
     |
     |  alpha_convert(self, newvar)
     |      Rename all occurrences of the variable introduced by this variable
     |      binder in the expression to ``newvar``.
     |      :param newvar: ``Variable``, for the new variable
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  visit_structured(self, function, combinator)
     |      :see: Expression.visit_structured()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SubstituteBindingsI(builtins.object)
     |  An interface for classes that can perform substitutions for
     |  variables.
     |
     |  Methods defined here:
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  variables(self)
     |      :return: A list of all variables in this object.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Tokens(builtins.object)
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  ALL = 'all'
     |
     |  ALL_LIST = ['all', 'forall']
     |
     |  AND = '&'
     |
     |  AND_LIST = ['and', '&', '^']
     |
     |  BINOPS = ['and', '&', '^', 'or', '|', 'implies', '->', '=>', 'iff', '<...
     |
     |  CLOSE = ')'
     |
     |  COMMA = ','
     |
     |  DOT = '.'
     |
     |  EQ = '='
     |
     |  EQ_LIST = ['=', '==']
     |
     |  EXISTS = 'exists'
     |
     |  EXISTS_LIST = ['some', 'exists', 'exist']
     |
     |  IFF = '<->'
     |
     |  IFF_LIST = ['iff', '<->', '<=>']
     |
     |  IMP = '->'
     |
     |  IMP_LIST = ['implies', '->', '=>']
     |
     |  IOTA = 'iota'
     |
     |  IOTA_LIST = ['iota']
     |
     |  LAMBDA = r'\'
     |
     |  LAMBDA_LIST = [r'\']
     |
     |  NEQ = '!='
     |
     |  NEQ_LIST = ['!=']
     |
     |  NOT = '-'
     |
     |  NOT_LIST = ['not', '-', '!']
     |
     |  OPEN = '('
     |
     |  OR = '|'
     |
     |  OR_LIST = ['or', '|']
     |
     |  PUNCT = ['.', '(', ')', ',']
     |
     |  QUANTS = ['some', 'exists', 'exist', 'all', 'forall', 'iota']
     |
     |  SYMBOLS = ['&', '^', '|', '->', '=>', '<->', '<=>', '=', '==', '!=', r...
     |
     |  TOKENS = ['and', '&', '^', 'or', '|', 'implies', '->', '=>', 'iff', '<...

    class TruthValueType(BasicType)
     |  Method resolution order:
     |      TruthValueType
     |      BasicType
     |      Type
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  str(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BasicType:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __hash__(self) from Type
     |      Return hash(self).
     |
     |  matches(self, other)
     |
     |  resolve(self, other)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Type:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Type:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Type:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Type(builtins.object)
     |  Methods defined here:
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  fromstring(s)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TypeException(builtins.Exception)
     |  TypeException(msg)
     |
     |  Method resolution order:
     |      TypeException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, msg)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class TypeResolutionException(TypeException)
     |  TypeResolutionException(expression, other_type)
     |
     |  Method resolution order:
     |      TypeResolutionException
     |      TypeException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, expression, other_type)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from TypeException:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class UnexpectedTokenException(LogicalExpressionException)
     |  UnexpectedTokenException(index, unexpected=None, expected=None, message=None)
     |
     |  Method resolution order:
     |      UnexpectedTokenException
     |      LogicalExpressionException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, index, unexpected=None, expected=None, message=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from LogicalExpressionException:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class Variable(builtins.object)
     |  Variable(name)
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __init__(self, name)
     |      :param name: the name of the variable
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  substitute_bindings(self, bindings)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class VariableBinderExpression(Expression)
     |  VariableBinderExpression(variable, term)
     |
     |  This an abstract class for any Expression that binds a variable in an
     |  Expression.  This includes LambdaExpressions and Quantified Expressions
     |
     |  Method resolution order:
     |      VariableBinderExpression
     |      Expression
     |      SubstituteBindingsI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Defines equality modulo alphabetic variance.  If we are comparing
     |      \x.M  and \y.N, then check equality of M and N[x/y].
     |
     |  __hash__(self) from Expression
     |      Return hash(self).
     |
     |  __init__(self, variable, term)
     |      :param variable: ``Variable``, for the variable
     |      :param term: ``Expression``, for the term
     |
     |  alpha_convert(self, newvar)
     |      Rename all occurrences of the variable introduced by this variable
     |      binder in the expression to ``newvar``.
     |      :param newvar: ``Variable``, for the new variable
     |
     |  findtype(self, variable)
     |      :see Expression.findtype()
     |
     |  free(self)
     |      :see: Expression.free()
     |
     |  replace(self, variable, expression, replace_bound=False, alpha_convert=True)
     |      :see: Expression.replace()
     |
     |  visit(self, function, combinator)
     |      :see: Expression.visit()
     |
     |  visit_structured(self, function, combinator)
     |      :see: Expression.visit_structured()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Expression:
     |
     |  __and__(self, other)
     |
     |  __call__(self, other, *additional)
     |      Call self as a function.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __neg__(self)
     |
     |  __or__(self, other)
     |      Return self|value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  applyto(self, other)
     |
     |  constants(self)
     |      Return a set of individual constants (non-predicates).
     |      :return: set of ``Variable`` objects
     |
     |  equiv(self, other, prover=None)
     |      Check for logical equivalence.
     |      Pass the expression (self <-> other) to the theorem prover.
     |      If the prover says it is valid, then the self and other are equal.
     |
     |      :param other: an ``Expression`` to check equality against
     |      :param prover: a ``nltk.inference.api.Prover``
     |
     |  make_VariableExpression(self, variable)
     |
     |  negate(self)
     |      If this is a negated expression, remove the negation.
     |      Otherwise add a negation.
     |
     |  normalize(self, newvars=None)
     |      Rename auto-generated unique variables
     |
     |  predicates(self)
     |      Return a set of predicates (constants, not variables).
     |      :return: set of ``Variable`` objects
     |
     |  simplify(self)
     |      :return: beta-converted version of this expression
     |
     |  substitute_bindings(self, bindings)
     |      :return: The object that is obtained by replacing
     |          each variable bound by ``bindings`` with its values.
     |          Aliases are already resolved. (maybe?)
     |      :rtype: (any)
     |
     |  typecheck(self, signature=None)
     |      Infer and check types.  Raise exceptions if necessary.
     |
     |      :param signature: dict that maps variable names to types (or string
     |          representations of types)
     |      :return: the signature, plus any additional type mappings
     |
     |  variables(self)
     |      Return a set of all the variables for binding substitution.
     |      The variables returned include all free (non-bound) individual
     |      variables and any variable starting with '?' or '@'.
     |      :return: set of ``Variable`` objects
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from Expression:
     |
     |  fromstring(s, type_check=False, signature=None)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubstituteBindingsI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    VariableExpression(variable)
        This is a factory method that instantiates and returns a subtype of
        ``AbstractVariableExpression`` appropriate for the given variable.

    binding_ops()
        Binding operators

    boolean_ops()
        Boolean operators

    demo()

    demoException(s)

    demo_errors()

    equality_preds()
        Equality predicates

    is_eventvar(expr)
        An event variable must be a single lowercase 'e' character followed by
        zero or more digits.

        :param expr: str
        :return: bool True if expr is of the correct form

    is_funcvar(expr)
        A function variable must be a single uppercase character followed by
        zero or more digits.

        :param expr: str
        :return: bool True if expr is of the correct form

    is_indvar(expr)
        An individual variable must be a single lowercase character other than 'e',
        followed by zero or more digits.

        :param expr: str
        :return: bool True if expr is of the correct form

    printtype(ex)

    read_logic(s, logic_parser=None, encoding=None)
        Convert a file of First Order Formulas into a list of {Expression}s.

        :param s: the contents of the file
        :type s: str
        :param logic_parser: The parser to be used to parse the logical expression
        :type logic_parser: LogicParser
        :param encoding: the encoding of the input string, if it is binary
        :type encoding: str
        :return: a list of parsed formulas.
        :rtype: list(Expression)

    read_type(type_string)

    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

    skolem_function(univ_scope=None)
        Return a skolem function over the variables in univ_scope
        param univ_scope

    typecheck(expressions, signature=None)
        Ensure correct typing across a collection of ``Expression`` objects.
        :param expressions: a collection of expressions
        :param signature: dict that maps variable names to types (or string
        representations of types)

    unique_variable(pattern=None, ignore=None)
        Return a new, unique variable.

        :param pattern: ``Variable`` that is being replaced.  The new variable must
            be the same type.
        :param term: a set of ``Variable`` objects that should not be returned from
            this function.
        :rtype: Variable

DATA
    ANY_TYPE = ?
    APP = 'APP'
    ENTITY_TYPE = e
    EVENT_TYPE = v
    MAX_SIMPLIFY_SIZE = 10000
    TRUTH_TYPE = t

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\sem\logic.py

nltk.mace
Python Library Documentation: module nltk.inference.mace in nltk.inference

NAME
    nltk.inference.mace - A model builder that makes use of the external 'Mace4' package.

CLASSES
    nltk.inference.api.BaseModelBuilderCommand(nltk.inference.api.BaseTheoremToolCommand, nltk.inference.api.ModelBuilderCommand)
        MaceCommand(nltk.inference.prover9.Prover9CommandParent, nltk.inference.api.BaseModelBuilderCommand)
    nltk.inference.api.ModelBuilder(builtins.object)
        Mace(nltk.inference.prover9.Prover9Parent, nltk.inference.api.ModelBuilder)
    nltk.inference.prover9.Prover9CommandParent(builtins.object)
        MaceCommand(nltk.inference.prover9.Prover9CommandParent, nltk.inference.api.BaseModelBuilderCommand)
    nltk.inference.prover9.Prover9Parent(builtins.object)
        Mace(nltk.inference.prover9.Prover9Parent, nltk.inference.api.ModelBuilder)

    class Mace(nltk.inference.prover9.Prover9Parent, nltk.inference.api.ModelBuilder)
     |  Mace(end_size=500)
     |
     |  Method resolution order:
     |      Mace
     |      nltk.inference.prover9.Prover9Parent
     |      nltk.inference.api.ModelBuilder
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, end_size=500)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.prover9.Prover9Parent:
     |
     |  binary_locations(self)
     |      A list of directories that should be searched for the prover9
     |      executables.  This list is used by ``config_prover9`` when searching
     |      for the prover9 executables.
     |
     |  config_prover9(self, binary_location, verbose=False)
     |
     |  prover9_input(self, goal, assumptions)
     |      :return: The input string that should be provided to the
     |          prover9 binary.  This string is formed based on the goal,
     |          assumptions, and timeout value of this object.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.inference.prover9.Prover9Parent:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.ModelBuilder:
     |
     |  build_model(self, goal=None, assumptions=None, verbose=False)
     |      Perform the actual model building.
     |      :return: Whether a model was generated
     |      :rtype: bool

    class MaceCommand(nltk.inference.prover9.Prover9CommandParent, nltk.inference.api.BaseModelBuilderCommand)
     |  MaceCommand(goal=None, assumptions=None, max_models=500, model_builder=None)
     |
     |  A ``MaceCommand`` specific to the ``Mace`` model builder.  It contains
     |  a print_assumptions() method that is used to print the list
     |  of assumptions in multiple formats.
     |
     |  Method resolution order:
     |      MaceCommand
     |      nltk.inference.prover9.Prover9CommandParent
     |      nltk.inference.api.BaseModelBuilderCommand
     |      nltk.inference.api.BaseTheoremToolCommand
     |      nltk.inference.api.ModelBuilderCommand
     |      nltk.inference.api.TheoremToolCommand
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, goal=None, assumptions=None, max_models=500, model_builder=None)
     |      :param goal: Input expression to prove
     |      :type goal: sem.Expression
     |      :param assumptions: Input expressions to use as assumptions in
     |          the proof.
     |      :type assumptions: list(sem.Expression)
     |      :param max_models: The maximum number of models that Mace will try before
     |          simply returning false. (Use 0 for no maximum.)
     |      :type max_models: int
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  valuation
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.prover9.Prover9CommandParent:
     |
     |  print_assumptions(self, output_format='nltk')
     |      Print the list of the current assumptions.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.inference.prover9.Prover9CommandParent:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.BaseModelBuilderCommand:
     |
     |  build_model(self, verbose=False)
     |      Attempt to build a model.  Store the result to prevent unnecessary
     |      re-building.
     |
     |  get_model_builder(self)
     |      Return the model builder object
     |      :return: ``ModelBuilder``
     |
     |  model(self, format=None)
     |      Return a string representation of the model
     |
     |      :param simplify: bool simplify the proof?
     |      :return: str
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.BaseTheoremToolCommand:
     |
     |  add_assumptions(self, new_assumptions)
     |      Add new assumptions to the assumption list.
     |
     |      :param new_assumptions: new assumptions
     |      :type new_assumptions: list(sem.Expression)
     |
     |  assumptions(self)
     |      List the current assumptions.
     |
     |      :return: list of ``Expression``
     |
     |  goal(self)
     |      Return the goal
     |
     |      :return: ``Expression``
     |
     |  retract_assumptions(self, retracted, debug=False)
     |      Retract assumptions from the assumption list.
     |
     |      :param debug: If True, give warning when ``retracted`` is not present on
     |          assumptions list.
     |      :type debug: bool
     |      :param retracted: assumptions to be retracted
     |      :type retracted: list(sem.Expression)

FUNCTIONS
    decode_result(found)
        Decode the result of model_found()

        :param found: The output of model_found()
        :type found: bool

    demo()

    spacer(num=30)

    test_build_model(arguments)
        Try to build a ``nltk.sem.Valuation``.

    test_make_relation_set()

    test_model_found(arguments)
        Try some proofs and exhibit the results.

    test_transform_output(argument_pair)
        Transform the model into various Mace4 ``interpformat`` formats.

DATA
    arguments = [('mortal(Socrates)', ['all x.(man(x) -> mortal(x))', 'man...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\inference\mace.py

nltk.malt
Python Library Documentation: module nltk.parse.malt in nltk.parse

NAME
    nltk.parse.malt

DESCRIPTION
    # Natural Language Toolkit: Interface to MaltParser
    #
    # Author: Dan Garrette <dhgarrette@gmail.com>
    # Contributor: Liling Tan, Mustufain, osamamukhtar11
    #
    # Copyright (C) 2001-2026 NLTK Project
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.parse.api.ParserI(builtins.object)
        MaltParser

    class MaltParser(nltk.parse.api.ParserI)
     |  MaltParser(parser_dirname='', model_filename=None, tagger=None, additional_java_args=None)
     |
     |  A class for dependency parsing with MaltParser. The input is the paths to:
     |  - (optionally) a maltparser directory
     |  - (optionally) the path to a pre-trained MaltParser .mco model file
     |  - (optionally) the tagger to use for POS tagging before parsing
     |  - (optionally) additional Java arguments
     |
     |  Example:
     |      >>> from nltk.parse import malt
     |      >>> # With MALT_PARSER and MALT_MODEL environment set.
     |      >>> mp = malt.MaltParser(model_filename='engmalt.linear-1.7.mco') # doctest: +SKIP
     |      >>> mp.parse_one('I shot an elephant in my pajamas .'.split()).tree() # doctest: +SKIP
     |      (shot I (elephant an) (in (pajamas my)) .)
     |      >>> # Without MALT_PARSER and MALT_MODEL environment.
     |      >>> mp = malt.MaltParser('/home/user/maltparser-1.9.2/', '/home/user/engmalt.linear-1.7.mco') # doctest: +SKIP
     |      >>> mp.parse_one('I shot an elephant in my pajamas .'.split()).tree() # doctest: +SKIP
     |      (shot I (elephant an) (in (pajamas my)) .)
     |
     |  Method resolution order:
     |      MaltParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, parser_dirname='', model_filename=None, tagger=None, additional_java_args=None)
     |      An interface for parsing with the Malt Parser.
     |
     |      :param parser_dirname: The path to the maltparser directory that
     |          contains the maltparser-1.x.jar
     |      :type parser_dirname: str
     |      :param model_filename: The name of the pre-trained model with .mco file
     |          extension. If provided, training will not be required.
     |          (see http://www.maltparser.org/mco/mco.html and
     |          see http://www.patful.com/chalk/node/185)
     |      :type model_filename: str
     |      :param tagger: The tagger used to POS tag the raw string before
     |          formatting to CONLL format. It should behave like `nltk.pos_tag`
     |      :type tagger: function
     |      :param additional_java_args: This is the additional Java arguments that
     |          one can use when calling Maltparser, usually this is the heapsize
     |          limits, e.g. `additional_java_args=['-Xmx1024m']`
     |          (see https://javarevisited.blogspot.com/2011/05/java-heap-space-memory-size-jvm.html)
     |      :type additional_java_args: list
     |
     |  generate_malt_command(self, inputfilename, outputfilename=None, mode=None)
     |      This function generates the maltparser command use at the terminal.
     |
     |      :param inputfilename: path to the input file
     |      :type inputfilename: str
     |      :param outputfilename: path to the output file
     |      :type outputfilename: str
     |
     |  parse_sents(self, sentences, verbose=False, top_relation_label='null')
     |      Use MaltParser to parse multiple sentences.
     |      Takes a list of sentences, where each sentence is a list of words.
     |      Each sentence will be automatically tagged with this
     |      MaltParser instance's tagger.
     |
     |      :param sentences: Input sentences to parse
     |      :type sentence: list(list(str))
     |      :return: iter(DependencyGraph)
     |
     |  parse_tagged_sents(self, sentences, verbose=False, top_relation_label='null')
     |      Use MaltParser to parse multiple POS tagged sentences. Takes multiple
     |      sentences where each sentence is a list of (word, tag) tuples.
     |      The sentences must have already been tokenized and tagged.
     |
     |      :param sentences: Input sentences to parse
     |      :type sentence: list(list(tuple(str, str)))
     |      :return: iter(iter(``DependencyGraph``)) the dependency graph
     |          representation of each sentence
     |
     |  train(self, depgraphs, verbose=False)
     |      Train MaltParser from a list of ``DependencyGraph`` objects
     |
     |      :param depgraphs: list of ``DependencyGraph`` objects for training input data
     |      :type depgraphs: DependencyGraph
     |
     |  train_from_file(self, conll_file, verbose=False)
     |      Train MaltParser from a file
     |      :param conll_file: str for the filename of the training input data
     |      :type conll_file: str
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, sent, *args, **kwargs)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    find_malt_model(model_filename)
        A module to find pre-trained MaltParser model.

    find_maltparser(parser_dirname)
        A module to find MaltParser .jar file and its dependencies.

    malt_regex_tagger()

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\malt.py

nltk.map_tag
Python Library Documentation: function map_tag in module nltk.tag.mapping

map_tag(source, target, source_tag)
    Maps the tag from the source tagset to the target tagset.

    >>> map_tag('en-ptb', 'universal', 'VBZ')
    'VERB'
    >>> map_tag('en-ptb', 'universal', 'VBP')
    'VERB'
    >>> map_tag('en-ptb', 'universal', '``')
    '.'
nltk.mapping
Python Library Documentation: module nltk.tag.mapping in nltk.tag

NAME
    nltk.tag.mapping

DESCRIPTION
    Interface for converting POS tags from various treebanks
    to the universal tagset of Petrov, Das, & McDonald.

    The tagset consists of the following 12 coarse tags:

    VERB - verbs (all tenses and modes)
    NOUN - nouns (common and proper)
    PRON - pronouns
    ADJ - adjectives
    ADV - adverbs
    ADP - adpositions (prepositions and postpositions)
    CONJ - conjunctions
    DET - determiners
    NUM - cardinal numbers
    PRT - particles or other function words
    X - other: foreign words, typos, abbreviations
    . - punctuation

    @see: https://arxiv.org/abs/1104.2086 and https://code.google.com/p/universal-pos-tags/

FUNCTIONS
    map_tag(source, target, source_tag)
        Maps the tag from the source tagset to the target tagset.

        >>> map_tag('en-ptb', 'universal', 'VBZ')
        'VERB'
        >>> map_tag('en-ptb', 'universal', 'VBP')
        'VERB'
        >>> map_tag('en-ptb', 'universal', '``')
        '.'

    tagset_mapping(source, target)
        Retrieve the mapping dictionary between tagsets.

        >>> tagset_mapping('ru-rnc', 'universal') == {'!': '.', 'A': 'ADJ', 'C': 'CONJ', 'AD': 'ADV',            'NN': 'NOUN', 'VG': 'VERB', 'COMP': 'CONJ', 'NC': 'NUM', 'VP': 'VERB', 'P': 'ADP',            'IJ': 'X', 'V': 'VERB', 'Z': 'X', 'VI': 'VERB', 'YES_NO_SENT': 'X', 'PTCL': 'PRT'}
        True

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\mapping.py

nltk.masi_distance
Python Library Documentation: function masi_distance in module nltk.metrics.distance

masi_distance(label1, label2)
    Distance metric that takes into account partial agreement when multiple
    labels are assigned.

    >>> from nltk.metrics import masi_distance
    >>> masi_distance(set([1, 2]), set([1, 2, 3, 4]))
    0.665

    Passonneau 2006, Measuring Agreement on Set-Valued Items (MASI)
    for Semantic and Pragmatic Annotation.
nltk.maxent
Python Library Documentation: module nltk.classify.maxent in nltk.classify

NAME
    nltk.classify.maxent

DESCRIPTION
    A classifier model based on maximum entropy modeling framework.  This
    framework considers all of the probability distributions that are
    empirically consistent with the training data; and chooses the
    distribution with the highest entropy.  A probability distribution is
    "empirically consistent" with a set of training data if its estimated
    frequency with which a class and a feature vector value co-occur is
    equal to the actual frequency in the data.

    Terminology: 'feature'
    ======================
    The term *feature* is usually used to refer to some property of an
    unlabeled token.  For example, when performing word sense
    disambiguation, we might define a ``'prevword'`` feature whose value is
    the word preceding the target word.  However, in the context of
    maxent modeling, the term *feature* is typically used to refer to a
    property of a "labeled" token.  In order to prevent confusion, we
    will introduce two distinct terms to disambiguate these two different
    concepts:

      - An "input-feature" is a property of an unlabeled token.
      - A "joint-feature" is a property of a labeled token.

    In the rest of the ``nltk.classify`` module, the term "features" is
    used to refer to what we will call "input-features" in this module.

    In literature that describes and discusses maximum entropy models,
    input-features are typically called "contexts", and joint-features
    are simply referred to as "features".

    Converting Input-Features to Joint-Features
    -------------------------------------------
    In maximum entropy models, joint-features are required to have numeric
    values.  Typically, each input-feature ``input_feat`` is mapped to a
    set of joint-features of the form:

    |   joint_feat(token, label) = { 1 if input_feat(token) == feat_val
    |                              {      and label == some_label
    |                              {
    |                              { 0 otherwise

    For all values of ``feat_val`` and ``some_label``.  This mapping is
    performed by classes that implement the ``MaxentFeatureEncodingI``
    interface.

CLASSES
    builtins.object
        MaxentFeatureEncodingI
            BinaryMaxentFeatureEncoding
                GISEncoding
                TadmEventMaxentFeatureEncoding
            FunctionBackedMaxentFeatureEncoding
            TypedMaxentFeatureEncoding
    nltk.classify.api.ClassifierI(builtins.object)
        MaxentClassifier
            TadmMaxentClassifier

    class BinaryMaxentFeatureEncoding(MaxentFeatureEncodingI)
     |  BinaryMaxentFeatureEncoding(labels, mapping, unseen_features=False, alwayson_features=False)
     |
     |  A feature encoding that generates vectors containing a binary
     |  joint-features of the form:
     |
     |  |  joint_feat(fs, l) = { 1 if (fs[fname] == fval) and (l == label)
     |  |                      {
     |  |                      { 0 otherwise
     |
     |  Where ``fname`` is the name of an input-feature, ``fval`` is a value
     |  for that input-feature, and ``label`` is a label.
     |
     |  Typically, these features are constructed based on a training
     |  corpus, using the ``train()`` method.  This method will create one
     |  feature for each combination of ``fname``, ``fval``, and ``label``
     |  that occurs at least once in the training corpus.
     |
     |  The ``unseen_features`` parameter can be used to add "unseen-value
     |  features", which are used whenever an input feature has a value
     |  that was not encountered in the training corpus.  These features
     |  have the form:
     |
     |  |  joint_feat(fs, l) = { 1 if is_unseen(fname, fs[fname])
     |  |                      {      and l == label
     |  |                      {
     |  |                      { 0 otherwise
     |
     |  Where ``is_unseen(fname, fval)`` is true if the encoding does not
     |  contain any joint features that are true when ``fs[fname]==fval``.
     |
     |  The ``alwayson_features`` parameter can be used to add "always-on
     |  features", which have the form::
     |
     |  |  joint_feat(fs, l) = { 1 if (l == label)
     |  |                      {
     |  |                      { 0 otherwise
     |
     |  These always-on features allow the maxent model to directly model
     |  the prior probabilities of each label.
     |
     |  Method resolution order:
     |      BinaryMaxentFeatureEncoding
     |      MaxentFeatureEncodingI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, labels, mapping, unseen_features=False, alwayson_features=False)
     |      :param labels: A list of the "known labels" for this encoding.
     |
     |      :param mapping: A dictionary mapping from ``(fname,fval,label)``
     |          tuples to corresponding joint-feature indexes.  These
     |          indexes must be the set of integers from 0...len(mapping).
     |          If ``mapping[fname,fval,label]=id``, then
     |          ``self.encode(..., fname:fval, ..., label)[id]`` is 1;
     |          otherwise, it is 0.
     |
     |      :param unseen_features: If true, then include unseen value
     |         features in the generated joint-feature vectors.
     |
     |      :param alwayson_features: If true, then include always-on
     |         features in the generated joint-feature vectors.
     |
     |  describe(self, f_id)
     |      :return: A string describing the value of the joint-feature
     |          whose index in the generated feature vectors is ``fid``.
     |      :rtype: str
     |
     |  encode(self, featureset, label)
     |      Given a (featureset, label) pair, return the corresponding
     |      vector of joint-feature values.  This vector is represented as
     |      a list of ``(index, value)`` tuples, specifying the value of
     |      each non-zero joint-feature.
     |
     |      :type featureset: dict
     |      :rtype: list(tuple(int, int))
     |
     |  labels(self)
     |      :return: A list of the "known labels" -- i.e., all labels
     |          ``l`` such that ``self.encode(fs,l)`` can be a nonzero
     |          joint-feature vector for some value of ``fs``.
     |      :rtype: list
     |
     |  length(self)
     |      :return: The size of the fixed-length joint-feature vectors
     |          that are generated by this encoding.
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  train(train_toks, count_cutoff=0, labels=None, **options)
     |      Construct and return new feature encoding, based on a given
     |      training corpus ``train_toks``.  See the class description
     |      ``BinaryMaxentFeatureEncoding`` for a description of the
     |      joint-features that will be included in this encoding.
     |
     |      :type train_toks: list(tuple(dict, str))
     |      :param train_toks: Training data, represented as a list of
     |          pairs, the first member of which is a feature dictionary,
     |          and the second of which is a classification label.
     |
     |      :type count_cutoff: int
     |      :param count_cutoff: A cutoff value that is used to discard
     |          rare joint-features.  If a joint-feature's value is 1
     |          fewer than ``count_cutoff`` times in the training corpus,
     |          then that joint-feature is not included in the generated
     |          encoding.
     |
     |      :type labels: list
     |      :param labels: A list of labels that should be used by the
     |          classifier.  If not specified, then the set of labels
     |          attested in ``train_toks`` will be used.
     |
     |      :param options: Extra parameters for the constructor, such as
     |          ``unseen_features`` and ``alwayson_features``.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from MaxentFeatureEncodingI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    ConditionalExponentialClassifier = class MaxentClassifier(nltk.classify.api.ClassifierI)
     |  ConditionalExponentialClassifier(encoding, weights, logarithmic=True)
     |
     |  A maximum entropy classifier (also known as a "conditional
     |  exponential classifier").  This classifier is parameterized by a
     |  set of "weights", which are used to combine the joint-features
     |  that are generated from a featureset by an "encoding".  In
     |  particular, the encoding maps each ``(featureset, label)`` pair to
     |  a vector.  The probability of each label is then computed using
     |  the following equation::
     |
     |                              dotprod(weights, encode(fs,label))
     |    prob(fs|label) = ---------------------------------------------------
     |                     sum(dotprod(weights, encode(fs,l)) for l in labels)
     |
     |  Where ``dotprod`` is the dot product::
     |
     |    dotprod(a,b) = sum(x*y for (x,y) in zip(a,b))
     |
     |  Method resolution order:
     |      MaxentClassifier
     |      nltk.classify.api.ClassifierI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, encoding, weights, logarithmic=True)
     |      Construct a new maxent classifier model.  Typically, new
     |      classifier models are created using the ``train()`` method.
     |
     |      :type encoding: MaxentFeatureEncodingI
     |      :param encoding: An encoding that is used to convert the
     |          featuresets that are given to the ``classify`` method into
     |          joint-feature vectors, which are used by the maxent
     |          classifier model.
     |
     |      :type weights: list of float
     |      :param weights:  The feature weight vector for this classifier.
     |
     |      :type logarithmic: bool
     |      :param logarithmic: If false, then use non-logarithmic weights.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  classify(self, featureset)
     |      :return: the most appropriate label for the given featureset.
     |      :rtype: label
     |
     |  explain(self, featureset, columns=4)
     |      Print a table showing the effect of each of the features in
     |      the given feature set, and how they combine to determine the
     |      probabilities of each label for that featureset.
     |
     |  labels(self)
     |      :return: the list of category labels used by this classifier.
     |      :rtype: list of (immutable)
     |
     |  most_informative_features(self, n=10)
     |      Generates the ranked list of informative features from most to least.
     |
     |  prob_classify(self, featureset)
     |      :return: a probability distribution over labels for the given
     |          featureset.
     |      :rtype: ProbDistI
     |
     |  set_weights(self, new_weights)
     |      Set the feature weight vector for this classifier.
     |      :param new_weights: The new feature weight vector.
     |      :type new_weights: list of float
     |
     |  show_most_informative_features(self, n=10, show='all')
     |      :param show: all, neg, or pos (for negative-only or positive-only)
     |      :type show: str
     |      :param n: The no. of top features
     |      :type n: int
     |
     |  weights(self)
     |      :return: The feature weight vector for this classifier.
     |      :rtype: list of float
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  train(train_toks, algorithm=None, trace=3, encoding=None, labels=None, gaussian_prior_sigma=0, **cutoffs)
     |      Train a new maxent classifier based on the given corpus of
     |      training samples.  This classifier will have its weights
     |      chosen to maximize entropy while remaining empirically
     |      consistent with the training corpus.
     |
     |      :rtype: MaxentClassifier
     |      :return: The new maxent classifier
     |
     |      :type train_toks: list
     |      :param train_toks: Training data, represented as a list of
     |          pairs, the first member of which is a featureset,
     |          and the second of which is a classification label.
     |
     |      :type algorithm: str
     |      :param algorithm: A case-insensitive string, specifying which
     |          algorithm should be used to train the classifier.  The
     |          following algorithms are currently available.
     |
     |          - Iterative Scaling Methods: Generalized Iterative Scaling (``'GIS'``),
     |            Improved Iterative Scaling (``'IIS'``)
     |          - External Libraries (requiring megam):
     |            LM-BFGS algorithm, with training performed by Megam (``'megam'``)
     |
     |          The default algorithm is ``'IIS'``.
     |
     |      :type trace: int
     |      :param trace: The level of diagnostic tracing output to produce.
     |          Higher values produce more verbose output.
     |      :type encoding: MaxentFeatureEncodingI
     |      :param encoding: A feature encoding, used to convert featuresets
     |          into feature vectors.  If none is specified, then a
     |          ``BinaryMaxentFeatureEncoding`` will be built based on the
     |          features that are attested in the training corpus.
     |      :type labels: list(str)
     |      :param labels: The set of possible labels.  If none is given, then
     |          the set of all labels attested in the training data will be
     |          used instead.
     |      :param gaussian_prior_sigma: The sigma value for a gaussian
     |          prior on model weights.  Currently, this is supported by
     |          ``megam``. For other algorithms, its value is ignored.
     |      :param cutoffs: Arguments specifying various conditions under
     |          which the training should be halted.  (Some of the cutoff
     |          conditions are not supported by some algorithms.)
     |
     |          - ``max_iter=v``: Terminate after ``v`` iterations.
     |          - ``min_ll=v``: Terminate after the negative average
     |            log-likelihood drops under ``v``.
     |          - ``min_lldelta=v``: Terminate if a single iteration improves
     |            log likelihood by less than ``v``.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  ALGORITHMS = ['GIS', 'IIS', 'MEGAM', 'TADM']
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.api.ClassifierI:
     |
     |  classify_many(self, featuresets)
     |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.classify(fs) for fs in featuresets]
     |
     |      :rtype: list(label)
     |
     |  prob_classify_many(self, featuresets)
     |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.prob_classify(fs) for fs in featuresets]
     |
     |      :rtype: list(ProbDistI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.classify.api.ClassifierI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FunctionBackedMaxentFeatureEncoding(MaxentFeatureEncodingI)
     |  FunctionBackedMaxentFeatureEncoding(func, length, labels)
     |
     |  A feature encoding that calls a user-supplied function to map a
     |  given featureset/label pair to a sparse joint-feature vector.
     |
     |  Method resolution order:
     |      FunctionBackedMaxentFeatureEncoding
     |      MaxentFeatureEncodingI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, func, length, labels)
     |      Construct a new feature encoding based on the given function.
     |
     |      :type func: (callable)
     |      :param func: A function that takes two arguments, a featureset
     |           and a label, and returns the sparse joint feature vector
     |           that encodes them::
     |
     |               func(featureset, label) -> feature_vector
     |
     |           This sparse joint feature vector (``feature_vector``) is a
     |           list of ``(index,value)`` tuples.
     |
     |      :type length: int
     |      :param length: The size of the fixed-length joint-feature
     |          vectors that are generated by this encoding.
     |
     |      :type labels: list
     |      :param labels: A list of the "known labels" for this
     |          encoding -- i.e., all labels ``l`` such that
     |          ``self.encode(fs,l)`` can be a nonzero joint-feature vector
     |          for some value of ``fs``.
     |
     |  describe(self, fid)
     |      :return: A string describing the value of the joint-feature
     |          whose index in the generated feature vectors is ``fid``.
     |      :rtype: str
     |
     |  encode(self, featureset, label)
     |      Given a (featureset, label) pair, return the corresponding
     |      vector of joint-feature values.  This vector is represented as
     |      a list of ``(index, value)`` tuples, specifying the value of
     |      each non-zero joint-feature.
     |
     |      :type featureset: dict
     |      :rtype: list(tuple(int, int))
     |
     |  labels(self)
     |      :return: A list of the "known labels" -- i.e., all labels
     |          ``l`` such that ``self.encode(fs,l)`` can be a nonzero
     |          joint-feature vector for some value of ``fs``.
     |      :rtype: list
     |
     |  length(self)
     |      :return: The size of the fixed-length joint-feature vectors
     |          that are generated by this encoding.
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from MaxentFeatureEncodingI:
     |
     |  train(cls, train_toks)
     |      Construct and return new feature encoding, based on a given
     |      training corpus ``train_toks``.
     |
     |      :type train_toks: list(tuple(dict, str))
     |      :param train_toks: Training data, represented as a list of
     |          pairs, the first member of which is a feature dictionary,
     |          and the second of which is a classification label.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from MaxentFeatureEncodingI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class GISEncoding(BinaryMaxentFeatureEncoding)
     |  GISEncoding(labels, mapping, unseen_features=False, alwayson_features=False, C=None)
     |
     |  A binary feature encoding which adds one new joint-feature to the
     |  joint-features defined by ``BinaryMaxentFeatureEncoding``: a
     |  correction feature, whose value is chosen to ensure that the
     |  sparse vector always sums to a constant non-negative number.  This
     |  new feature is used to ensure two preconditions for the GIS
     |  training algorithm:
     |
     |    - At least one feature vector index must be nonzero for every
     |      token.
     |    - The feature vector must sum to a constant non-negative number
     |      for every token.
     |
     |  Method resolution order:
     |      GISEncoding
     |      BinaryMaxentFeatureEncoding
     |      MaxentFeatureEncodingI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, labels, mapping, unseen_features=False, alwayson_features=False, C=None)
     |      :param C: The correction constant.  The value of the correction
     |          feature is based on this value.  In particular, its value is
     |          ``C - sum([v for (f,v) in encoding])``.
     |      :seealso: ``BinaryMaxentFeatureEncoding.__init__``
     |
     |  describe(self, f_id)
     |      :return: A string describing the value of the joint-feature
     |          whose index in the generated feature vectors is ``fid``.
     |      :rtype: str
     |
     |  encode(self, featureset, label)
     |      Given a (featureset, label) pair, return the corresponding
     |      vector of joint-feature values.  This vector is represented as
     |      a list of ``(index, value)`` tuples, specifying the value of
     |      each non-zero joint-feature.
     |
     |      :type featureset: dict
     |      :rtype: list(tuple(int, int))
     |
     |  length(self)
     |      :return: The size of the fixed-length joint-feature vectors
     |          that are generated by this encoding.
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  C
     |      The non-negative constant that all encoded feature vectors
     |      will sum to.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BinaryMaxentFeatureEncoding:
     |
     |  labels(self)
     |      :return: A list of the "known labels" -- i.e., all labels
     |          ``l`` such that ``self.encode(fs,l)`` can be a nonzero
     |          joint-feature vector for some value of ``fs``.
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from BinaryMaxentFeatureEncoding:
     |
     |  train(train_toks, count_cutoff=0, labels=None, **options)
     |      Construct and return new feature encoding, based on a given
     |      training corpus ``train_toks``.  See the class description
     |      ``BinaryMaxentFeatureEncoding`` for a description of the
     |      joint-features that will be included in this encoding.
     |
     |      :type train_toks: list(tuple(dict, str))
     |      :param train_toks: Training data, represented as a list of
     |          pairs, the first member of which is a feature dictionary,
     |          and the second of which is a classification label.
     |
     |      :type count_cutoff: int
     |      :param count_cutoff: A cutoff value that is used to discard
     |          rare joint-features.  If a joint-feature's value is 1
     |          fewer than ``count_cutoff`` times in the training corpus,
     |          then that joint-feature is not included in the generated
     |          encoding.
     |
     |      :type labels: list
     |      :param labels: A list of labels that should be used by the
     |          classifier.  If not specified, then the set of labels
     |          attested in ``train_toks`` will be used.
     |
     |      :param options: Extra parameters for the constructor, such as
     |          ``unseen_features`` and ``alwayson_features``.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from MaxentFeatureEncodingI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class MaxentClassifier(nltk.classify.api.ClassifierI)
     |  MaxentClassifier(encoding, weights, logarithmic=True)
     |
     |  A maximum entropy classifier (also known as a "conditional
     |  exponential classifier").  This classifier is parameterized by a
     |  set of "weights", which are used to combine the joint-features
     |  that are generated from a featureset by an "encoding".  In
     |  particular, the encoding maps each ``(featureset, label)`` pair to
     |  a vector.  The probability of each label is then computed using
     |  the following equation::
     |
     |                              dotprod(weights, encode(fs,label))
     |    prob(fs|label) = ---------------------------------------------------
     |                     sum(dotprod(weights, encode(fs,l)) for l in labels)
     |
     |  Where ``dotprod`` is the dot product::
     |
     |    dotprod(a,b) = sum(x*y for (x,y) in zip(a,b))
     |
     |  Method resolution order:
     |      MaxentClassifier
     |      nltk.classify.api.ClassifierI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, encoding, weights, logarithmic=True)
     |      Construct a new maxent classifier model.  Typically, new
     |      classifier models are created using the ``train()`` method.
     |
     |      :type encoding: MaxentFeatureEncodingI
     |      :param encoding: An encoding that is used to convert the
     |          featuresets that are given to the ``classify`` method into
     |          joint-feature vectors, which are used by the maxent
     |          classifier model.
     |
     |      :type weights: list of float
     |      :param weights:  The feature weight vector for this classifier.
     |
     |      :type logarithmic: bool
     |      :param logarithmic: If false, then use non-logarithmic weights.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  classify(self, featureset)
     |      :return: the most appropriate label for the given featureset.
     |      :rtype: label
     |
     |  explain(self, featureset, columns=4)
     |      Print a table showing the effect of each of the features in
     |      the given feature set, and how they combine to determine the
     |      probabilities of each label for that featureset.
     |
     |  labels(self)
     |      :return: the list of category labels used by this classifier.
     |      :rtype: list of (immutable)
     |
     |  most_informative_features(self, n=10)
     |      Generates the ranked list of informative features from most to least.
     |
     |  prob_classify(self, featureset)
     |      :return: a probability distribution over labels for the given
     |          featureset.
     |      :rtype: ProbDistI
     |
     |  set_weights(self, new_weights)
     |      Set the feature weight vector for this classifier.
     |      :param new_weights: The new feature weight vector.
     |      :type new_weights: list of float
     |
     |  show_most_informative_features(self, n=10, show='all')
     |      :param show: all, neg, or pos (for negative-only or positive-only)
     |      :type show: str
     |      :param n: The no. of top features
     |      :type n: int
     |
     |  weights(self)
     |      :return: The feature weight vector for this classifier.
     |      :rtype: list of float
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  train(train_toks, algorithm=None, trace=3, encoding=None, labels=None, gaussian_prior_sigma=0, **cutoffs)
     |      Train a new maxent classifier based on the given corpus of
     |      training samples.  This classifier will have its weights
     |      chosen to maximize entropy while remaining empirically
     |      consistent with the training corpus.
     |
     |      :rtype: MaxentClassifier
     |      :return: The new maxent classifier
     |
     |      :type train_toks: list
     |      :param train_toks: Training data, represented as a list of
     |          pairs, the first member of which is a featureset,
     |          and the second of which is a classification label.
     |
     |      :type algorithm: str
     |      :param algorithm: A case-insensitive string, specifying which
     |          algorithm should be used to train the classifier.  The
     |          following algorithms are currently available.
     |
     |          - Iterative Scaling Methods: Generalized Iterative Scaling (``'GIS'``),
     |            Improved Iterative Scaling (``'IIS'``)
     |          - External Libraries (requiring megam):
     |            LM-BFGS algorithm, with training performed by Megam (``'megam'``)
     |
     |          The default algorithm is ``'IIS'``.
     |
     |      :type trace: int
     |      :param trace: The level of diagnostic tracing output to produce.
     |          Higher values produce more verbose output.
     |      :type encoding: MaxentFeatureEncodingI
     |      :param encoding: A feature encoding, used to convert featuresets
     |          into feature vectors.  If none is specified, then a
     |          ``BinaryMaxentFeatureEncoding`` will be built based on the
     |          features that are attested in the training corpus.
     |      :type labels: list(str)
     |      :param labels: The set of possible labels.  If none is given, then
     |          the set of all labels attested in the training data will be
     |          used instead.
     |      :param gaussian_prior_sigma: The sigma value for a gaussian
     |          prior on model weights.  Currently, this is supported by
     |          ``megam``. For other algorithms, its value is ignored.
     |      :param cutoffs: Arguments specifying various conditions under
     |          which the training should be halted.  (Some of the cutoff
     |          conditions are not supported by some algorithms.)
     |
     |          - ``max_iter=v``: Terminate after ``v`` iterations.
     |          - ``min_ll=v``: Terminate after the negative average
     |            log-likelihood drops under ``v``.
     |          - ``min_lldelta=v``: Terminate if a single iteration improves
     |            log likelihood by less than ``v``.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  ALGORITHMS = ['GIS', 'IIS', 'MEGAM', 'TADM']
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.api.ClassifierI:
     |
     |  classify_many(self, featuresets)
     |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.classify(fs) for fs in featuresets]
     |
     |      :rtype: list(label)
     |
     |  prob_classify_many(self, featuresets)
     |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.prob_classify(fs) for fs in featuresets]
     |
     |      :rtype: list(ProbDistI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.classify.api.ClassifierI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class MaxentFeatureEncodingI(builtins.object)
     |  A mapping that converts a set of input-feature values to a vector
     |  of joint-feature values, given a label.  This conversion is
     |  necessary to translate featuresets into a format that can be used
     |  by maximum entropy models.
     |
     |  The set of joint-features used by a given encoding is fixed, and
     |  each index in the generated joint-feature vectors corresponds to a
     |  single joint-feature.  The length of the generated joint-feature
     |  vectors is therefore constant (for a given encoding).
     |
     |  Because the joint-feature vectors generated by
     |  ``MaxentFeatureEncodingI`` are typically very sparse, they are
     |  represented as a list of ``(index, value)`` tuples, specifying the
     |  value of each non-zero joint-feature.
     |
     |  Feature encodings are generally created using the ``train()``
     |  method, which generates an appropriate encoding based on the
     |  input-feature values and labels that are present in a given
     |  corpus.
     |
     |  Methods defined here:
     |
     |  describe(self, fid)
     |      :return: A string describing the value of the joint-feature
     |          whose index in the generated feature vectors is ``fid``.
     |      :rtype: str
     |
     |  encode(self, featureset, label)
     |      Given a (featureset, label) pair, return the corresponding
     |      vector of joint-feature values.  This vector is represented as
     |      a list of ``(index, value)`` tuples, specifying the value of
     |      each non-zero joint-feature.
     |
     |      :type featureset: dict
     |      :rtype: list(tuple(int, int))
     |
     |  labels(self)
     |      :return: A list of the "known labels" -- i.e., all labels
     |          ``l`` such that ``self.encode(fs,l)`` can be a nonzero
     |          joint-feature vector for some value of ``fs``.
     |      :rtype: list
     |
     |  length(self)
     |      :return: The size of the fixed-length joint-feature vectors
     |          that are generated by this encoding.
     |      :rtype: int
     |
     |  train(cls, train_toks)
     |      Construct and return new feature encoding, based on a given
     |      training corpus ``train_toks``.
     |
     |      :type train_toks: list(tuple(dict, str))
     |      :param train_toks: Training data, represented as a list of
     |          pairs, the first member of which is a feature dictionary,
     |          and the second of which is a classification label.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TadmEventMaxentFeatureEncoding(BinaryMaxentFeatureEncoding)
     |  TadmEventMaxentFeatureEncoding(labels, mapping, unseen_features=False, alwayson_features=False)
     |
     |  Method resolution order:
     |      TadmEventMaxentFeatureEncoding
     |      BinaryMaxentFeatureEncoding
     |      MaxentFeatureEncodingI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, labels, mapping, unseen_features=False, alwayson_features=False)
     |      :param labels: A list of the "known labels" for this encoding.
     |
     |      :param mapping: A dictionary mapping from ``(fname,fval,label)``
     |          tuples to corresponding joint-feature indexes.  These
     |          indexes must be the set of integers from 0...len(mapping).
     |          If ``mapping[fname,fval,label]=id``, then
     |          ``self.encode(..., fname:fval, ..., label)[id]`` is 1;
     |          otherwise, it is 0.
     |
     |      :param unseen_features: If true, then include unseen value
     |         features in the generated joint-feature vectors.
     |
     |      :param alwayson_features: If true, then include always-on
     |         features in the generated joint-feature vectors.
     |
     |  describe(self, fid)
     |      :return: A string describing the value of the joint-feature
     |          whose index in the generated feature vectors is ``fid``.
     |      :rtype: str
     |
     |  encode(self, featureset, label)
     |      Given a (featureset, label) pair, return the corresponding
     |      vector of joint-feature values.  This vector is represented as
     |      a list of ``(index, value)`` tuples, specifying the value of
     |      each non-zero joint-feature.
     |
     |      :type featureset: dict
     |      :rtype: list(tuple(int, int))
     |
     |  labels(self)
     |      :return: A list of the "known labels" -- i.e., all labels
     |          ``l`` such that ``self.encode(fs,l)`` can be a nonzero
     |          joint-feature vector for some value of ``fs``.
     |      :rtype: list
     |
     |  length(self)
     |      :return: The size of the fixed-length joint-feature vectors
     |          that are generated by this encoding.
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  train(train_toks, count_cutoff=0, labels=None, **options)
     |      Construct and return new feature encoding, based on a given
     |      training corpus ``train_toks``.  See the class description
     |      ``BinaryMaxentFeatureEncoding`` for a description of the
     |      joint-features that will be included in this encoding.
     |
     |      :type train_toks: list(tuple(dict, str))
     |      :param train_toks: Training data, represented as a list of
     |          pairs, the first member of which is a feature dictionary,
     |          and the second of which is a classification label.
     |
     |      :type count_cutoff: int
     |      :param count_cutoff: A cutoff value that is used to discard
     |          rare joint-features.  If a joint-feature's value is 1
     |          fewer than ``count_cutoff`` times in the training corpus,
     |          then that joint-feature is not included in the generated
     |          encoding.
     |
     |      :type labels: list
     |      :param labels: A list of labels that should be used by the
     |          classifier.  If not specified, then the set of labels
     |          attested in ``train_toks`` will be used.
     |
     |      :param options: Extra parameters for the constructor, such as
     |          ``unseen_features`` and ``alwayson_features``.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from MaxentFeatureEncodingI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TadmMaxentClassifier(MaxentClassifier)
     |  TadmMaxentClassifier(encoding, weights, logarithmic=True)
     |
     |  Method resolution order:
     |      TadmMaxentClassifier
     |      MaxentClassifier
     |      nltk.classify.api.ClassifierI
     |      builtins.object
     |
     |  Class methods defined here:
     |
     |  train(train_toks, **kwargs)
     |      Train a new maxent classifier based on the given corpus of
     |      training samples.  This classifier will have its weights
     |      chosen to maximize entropy while remaining empirically
     |      consistent with the training corpus.
     |
     |      :rtype: MaxentClassifier
     |      :return: The new maxent classifier
     |
     |      :type train_toks: list
     |      :param train_toks: Training data, represented as a list of
     |          pairs, the first member of which is a featureset,
     |          and the second of which is a classification label.
     |
     |      :type algorithm: str
     |      :param algorithm: A case-insensitive string, specifying which
     |          algorithm should be used to train the classifier.  The
     |          following algorithms are currently available.
     |
     |          - Iterative Scaling Methods: Generalized Iterative Scaling (``'GIS'``),
     |            Improved Iterative Scaling (``'IIS'``)
     |          - External Libraries (requiring megam):
     |            LM-BFGS algorithm, with training performed by Megam (``'megam'``)
     |
     |          The default algorithm is ``'IIS'``.
     |
     |      :type trace: int
     |      :param trace: The level of diagnostic tracing output to produce.
     |          Higher values produce more verbose output.
     |      :type encoding: MaxentFeatureEncodingI
     |      :param encoding: A feature encoding, used to convert featuresets
     |          into feature vectors.  If none is specified, then a
     |          ``BinaryMaxentFeatureEncoding`` will be built based on the
     |          features that are attested in the training corpus.
     |      :type labels: list(str)
     |      :param labels: The set of possible labels.  If none is given, then
     |          the set of all labels attested in the training data will be
     |          used instead.
     |      :param gaussian_prior_sigma: The sigma value for a gaussian
     |          prior on model weights.  Currently, this is supported by
     |          ``megam``. For other algorithms, its value is ignored.
     |      :param cutoffs: Arguments specifying various conditions under
     |          which the training should be halted.  (Some of the cutoff
     |          conditions are not supported by some algorithms.)
     |
     |          - ``max_iter=v``: Terminate after ``v`` iterations.
     |          - ``min_ll=v``: Terminate after the negative average
     |            log-likelihood drops under ``v``.
     |          - ``min_lldelta=v``: Terminate if a single iteration improves
     |            log likelihood by less than ``v``.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from MaxentClassifier:
     |
     |  __init__(self, encoding, weights, logarithmic=True)
     |      Construct a new maxent classifier model.  Typically, new
     |      classifier models are created using the ``train()`` method.
     |
     |      :type encoding: MaxentFeatureEncodingI
     |      :param encoding: An encoding that is used to convert the
     |          featuresets that are given to the ``classify`` method into
     |          joint-feature vectors, which are used by the maxent
     |          classifier model.
     |
     |      :type weights: list of float
     |      :param weights:  The feature weight vector for this classifier.
     |
     |      :type logarithmic: bool
     |      :param logarithmic: If false, then use non-logarithmic weights.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  classify(self, featureset)
     |      :return: the most appropriate label for the given featureset.
     |      :rtype: label
     |
     |  explain(self, featureset, columns=4)
     |      Print a table showing the effect of each of the features in
     |      the given feature set, and how they combine to determine the
     |      probabilities of each label for that featureset.
     |
     |  labels(self)
     |      :return: the list of category labels used by this classifier.
     |      :rtype: list of (immutable)
     |
     |  most_informative_features(self, n=10)
     |      Generates the ranked list of informative features from most to least.
     |
     |  prob_classify(self, featureset)
     |      :return: a probability distribution over labels for the given
     |          featureset.
     |      :rtype: ProbDistI
     |
     |  set_weights(self, new_weights)
     |      Set the feature weight vector for this classifier.
     |      :param new_weights: The new feature weight vector.
     |      :type new_weights: list of float
     |
     |  show_most_informative_features(self, n=10, show='all')
     |      :param show: all, neg, or pos (for negative-only or positive-only)
     |      :type show: str
     |      :param n: The no. of top features
     |      :type n: int
     |
     |  weights(self)
     |      :return: The feature weight vector for this classifier.
     |      :rtype: list of float
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from MaxentClassifier:
     |
     |  ALGORITHMS = ['GIS', 'IIS', 'MEGAM', 'TADM']
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.api.ClassifierI:
     |
     |  classify_many(self, featuresets)
     |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.classify(fs) for fs in featuresets]
     |
     |      :rtype: list(label)
     |
     |  prob_classify_many(self, featuresets)
     |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.prob_classify(fs) for fs in featuresets]
     |
     |      :rtype: list(ProbDistI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.classify.api.ClassifierI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TypedMaxentFeatureEncoding(MaxentFeatureEncodingI)
     |  TypedMaxentFeatureEncoding(labels, mapping, unseen_features=False, alwayson_features=False)
     |
     |  A feature encoding that generates vectors containing integer,
     |  float and binary joint-features of the form:
     |
     |  Binary (for string and boolean features):
     |
     |  |  joint_feat(fs, l) = { 1 if (fs[fname] == fval) and (l == label)
     |  |                      {
     |  |                      { 0 otherwise
     |
     |  Value (for integer and float features):
     |
     |  |  joint_feat(fs, l) = { fval if     (fs[fname] == type(fval))
     |  |                      {         and (l == label)
     |  |                      {
     |  |                      { not encoded otherwise
     |
     |  Where ``fname`` is the name of an input-feature, ``fval`` is a value
     |  for that input-feature, and ``label`` is a label.
     |
     |  Typically, these features are constructed based on a training
     |  corpus, using the ``train()`` method.
     |
     |  For string and boolean features [type(fval) not in (int, float)]
     |  this method will create one feature for each combination of
     |  ``fname``, ``fval``, and ``label`` that occurs at least once in the
     |  training corpus.
     |
     |  For integer and float features [type(fval) in (int, float)] this
     |  method will create one feature for each combination of ``fname``
     |  and ``label`` that occurs at least once in the training corpus.
     |
     |  For binary features the ``unseen_features`` parameter can be used
     |  to add "unseen-value features", which are used whenever an input
     |  feature has a value that was not encountered in the training
     |  corpus.  These features have the form:
     |
     |  |  joint_feat(fs, l) = { 1 if is_unseen(fname, fs[fname])
     |  |                      {      and l == label
     |  |                      {
     |  |                      { 0 otherwise
     |
     |  Where ``is_unseen(fname, fval)`` is true if the encoding does not
     |  contain any joint features that are true when ``fs[fname]==fval``.
     |
     |  The ``alwayson_features`` parameter can be used to add "always-on
     |  features", which have the form:
     |
     |  |  joint_feat(fs, l) = { 1 if (l == label)
     |  |                      {
     |  |                      { 0 otherwise
     |
     |  These always-on features allow the maxent model to directly model
     |  the prior probabilities of each label.
     |
     |  Method resolution order:
     |      TypedMaxentFeatureEncoding
     |      MaxentFeatureEncodingI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, labels, mapping, unseen_features=False, alwayson_features=False)
     |      :param labels: A list of the "known labels" for this encoding.
     |
     |      :param mapping: A dictionary mapping from ``(fname,fval,label)``
     |          tuples to corresponding joint-feature indexes.  These
     |          indexes must be the set of integers from 0...len(mapping).
     |          If ``mapping[fname,fval,label]=id``, then
     |          ``self.encode({..., fname:fval, ...``, label)[id]} is 1;
     |          otherwise, it is 0.
     |
     |      :param unseen_features: If true, then include unseen value
     |         features in the generated joint-feature vectors.
     |
     |      :param alwayson_features: If true, then include always-on
     |         features in the generated joint-feature vectors.
     |
     |  describe(self, f_id)
     |      :return: A string describing the value of the joint-feature
     |          whose index in the generated feature vectors is ``fid``.
     |      :rtype: str
     |
     |  encode(self, featureset, label)
     |      Given a (featureset, label) pair, return the corresponding
     |      vector of joint-feature values.  This vector is represented as
     |      a list of ``(index, value)`` tuples, specifying the value of
     |      each non-zero joint-feature.
     |
     |      :type featureset: dict
     |      :rtype: list(tuple(int, int))
     |
     |  labels(self)
     |      :return: A list of the "known labels" -- i.e., all labels
     |          ``l`` such that ``self.encode(fs,l)`` can be a nonzero
     |          joint-feature vector for some value of ``fs``.
     |      :rtype: list
     |
     |  length(self)
     |      :return: The size of the fixed-length joint-feature vectors
     |          that are generated by this encoding.
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  train(train_toks, count_cutoff=0, labels=None, **options)
     |      Construct and return new feature encoding, based on a given
     |      training corpus ``train_toks``.  See the class description
     |      ``TypedMaxentFeatureEncoding`` for a description of the
     |      joint-features that will be included in this encoding.
     |
     |      Note: recognized feature values types are (int, float), over
     |      types are interpreted as regular binary features.
     |
     |      :type train_toks: list(tuple(dict, str))
     |      :param train_toks: Training data, represented as a list of
     |          pairs, the first member of which is a feature dictionary,
     |          and the second of which is a classification label.
     |
     |      :type count_cutoff: int
     |      :param count_cutoff: A cutoff value that is used to discard
     |          rare joint-features.  If a joint-feature's value is 1
     |          fewer than ``count_cutoff`` times in the training corpus,
     |          then that joint-feature is not included in the generated
     |          encoding.
     |
     |      :type labels: list
     |      :param labels: A list of labels that should be used by the
     |          classifier.  If not specified, then the set of labels
     |          attested in ``train_toks`` will be used.
     |
     |      :param options: Extra parameters for the constructor, such as
     |          ``unseen_features`` and ``alwayson_features``.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from MaxentFeatureEncodingI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    calculate_deltas(train_toks, classifier, unattested, ffreq_empirical, nfmap, nfarray, nftranspose, encoding)
        Calculate the update values for the classifier weights for
        this iteration of IIS.  These update weights are the value of
        ``delta`` that solves the equation::

          ffreq_empirical[i]
                 =
          SUM[fs,l] (classifier.prob_classify(fs).prob(l) *
                     feature_vector(fs,l)[i] *
                     exp(delta[i] * nf(feature_vector(fs,l))))

        Where:
            - *(fs,l)* is a (featureset, label) tuple from ``train_toks``
            - *feature_vector(fs,l)* = ``encoding.encode(fs,l)``
            - *nf(vector)* = ``sum([val for (id,val) in vector])``

        This method uses Newton's method to solve this equation for
        *delta[i]*.  In particular, it starts with a guess of
        ``delta[i]`` = 1; and iteratively updates ``delta`` with:

        | delta[i] -= (ffreq_empirical[i] - sum1[i])/(-sum2[i])

        until convergence, where *sum1* and *sum2* are defined as:

        |    sum1[i](delta) = SUM[fs,l] f[i](fs,l,delta)
        |    sum2[i](delta) = SUM[fs,l] (f[i](fs,l,delta).nf(feature_vector(fs,l)))
        |    f[i](fs,l,delta) = (classifier.prob_classify(fs).prob(l) .
        |                        feature_vector(fs,l)[i] .
        |                        exp(delta[i] . nf(feature_vector(fs,l))))

        Note that *sum1* and *sum2* depend on ``delta``; so they need
        to be re-computed each iteration.

        The variables ``nfmap``, ``nfarray``, and ``nftranspose`` are
        used to generate a dense encoding for *nf(ltext)*.  This
        allows ``_deltas`` to calculate *sum1* and *sum2* using
        matrices, which yields a significant performance improvement.

        :param train_toks: The set of training tokens.
        :type train_toks: list(tuple(dict, str))
        :param classifier: The current classifier.
        :type classifier: ClassifierI
        :param ffreq_empirical: An array containing the empirical
            frequency for each feature.  The *i*\ th element of this
            array is the empirical frequency for feature *i*.
        :type ffreq_empirical: sequence of float
        :param unattested: An array that is 1 for features that are
            not attested in the training data; and 0 for features that
            are attested.  In other words, ``unattested[i]==0`` iff
            ``ffreq_empirical[i]==0``.
        :type unattested: sequence of int
        :param nfmap: A map that can be used to compress ``nf`` to a dense
            vector.
        :type nfmap: dict(int -> int)
        :param nfarray: An array that can be used to uncompress ``nf``
            from a dense vector.
        :type nfarray: array(float)
        :param nftranspose: The transpose of ``nfarray``
        :type nftranspose: array(float)

    calculate_empirical_fcount(train_toks, encoding)

    calculate_estimated_fcount(classifier, train_toks, encoding)

    calculate_nfmap(train_toks, encoding)
        Construct a map that can be used to compress ``nf`` (which is
        typically sparse).

        *nf(feature_vector)* is the sum of the feature values for
        *feature_vector*.

        This represents the number of features that are active for a
        given labeled text.  This method finds all values of *nf(t)*
        that are attested for at least one token in the given list of
        training tokens; and constructs a dictionary mapping these
        attested values to a continuous range *0...N*.  For example,
        if the only values of *nf()* that were attested were 3, 5, and
        7, then ``_nfmap`` might return the dictionary ``{3:0, 5:1, 7:2}``.

        :return: A map that can be used to compress ``nf`` to a dense
            vector.
        :rtype: dict(int -> int)

    demo()
        ######################################################################
        # { Demo
        ######################################################################

    load_maxent_params(tab_dir)

    maxent_pos_tagger()

    save_maxent_params(wgt, mpg, lab, aon, tab_dir='/tmp')

    train_maxent_classifier_with_gis(train_toks, trace=3, encoding=None, labels=None, **cutoffs)
        Train a new ``ConditionalExponentialClassifier``, using the given
        training samples, using the Generalized Iterative Scaling
        algorithm.  This ``ConditionalExponentialClassifier`` will encode
        the model that maximizes entropy from all the models that are
        empirically consistent with ``train_toks``.

        :see: ``train_maxent_classifier()`` for parameter descriptions.

    train_maxent_classifier_with_iis(train_toks, trace=3, encoding=None, labels=None, **cutoffs)
        Train a new ``ConditionalExponentialClassifier``, using the given
        training samples, using the Improved Iterative Scaling algorithm.
        This ``ConditionalExponentialClassifier`` will encode the model
        that maximizes entropy from all the models that are empirically
        consistent with ``train_toks``.

        :see: ``train_maxent_classifier()`` for parameter descriptions.

    train_maxent_classifier_with_megam(train_toks, trace=3, encoding=None, labels=None, gaussian_prior_sigma=0, **kwargs)
        Train a new ``ConditionalExponentialClassifier``, using the given
        training samples, using the external ``megam`` library.  This
        ``ConditionalExponentialClassifier`` will encode the model that
        maximizes entropy from all the models that are empirically
        consistent with ``train_toks``.

        :see: ``train_maxent_classifier()`` for parameter descriptions.
        :see: ``nltk.classify.megam``

DATA
    __docformat__ = 'epytext en'

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\maxent.py

nltk.megam
Python Library Documentation: module nltk.classify.megam in nltk.classify

NAME
    nltk.classify.megam

DESCRIPTION
    A set of functions used to interface with the external megam_ maxent
    optimization package. Before megam can be used, you should tell NLTK where it
    can find the megam binary, using the ``config_megam()`` function. Typical
    usage:

        >>> from nltk.classify import megam
        >>> megam.config_megam() # pass path to megam if not found in PATH # doctest: +SKIP
        [Found megam: ...]

    Use with MaxentClassifier. Example below, see MaxentClassifier documentation
    for details.

        nltk.classify.MaxentClassifier.train(corpus, 'megam')

    .. _megam: https://www.umiacs.umd.edu/~hal/megam/index.html

FUNCTIONS
    call_megam(args)
        Call the ``megam`` binary with the given arguments.

    config_megam(bin=None)
        Configure NLTK's interface to the ``megam`` maxent optimization
        package.

        :param bin: The full path to the ``megam`` binary.  If not specified,
            then nltk will search the system for a ``megam`` binary; and if
            one is not found, it will raise a ``LookupError`` exception.
        :type bin: str

    parse_megam_weights(s, features_count, explicit=True)
        Given the stdout output generated by ``megam`` when training a
        model, return a ``numpy`` array containing the corresponding weight
        vector.  This function does not currently handle bias features.

    write_megam_file(train_toks, encoding, stream, bernoulli=True, explicit=True)
        Generate an input file for ``megam`` based on the given corpus of
        classified tokens.

        :type train_toks: list(tuple(dict, str))
        :param train_toks: Training data, represented as a list of
            pairs, the first member of which is a feature dictionary,
            and the second of which is a classification label.

        :type encoding: MaxentFeatureEncodingI
        :param encoding: A feature encoding, used to convert featuresets
            into feature vectors. May optionally implement a cost() method
            in order to assign different costs to different class predictions.

        :type stream: stream
        :param stream: The stream to which the megam input file should be
            written.

        :param bernoulli: If true, then use the 'bernoulli' format.  I.e.,
            all joint features have binary values, and are listed iff they
            are true.  Otherwise, list feature values explicitly.  If
            ``bernoulli=False``, then you must call ``megam`` with the
            ``-fvals`` option.

        :param explicit: If true, then use the 'explicit' format.  I.e.,
            list the features that would fire for any of the possible
            labels, for each token.  If ``explicit=True``, then you must
            call ``megam`` with the ``-explicit`` option.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\megam.py

nltk.memoize
Python Library Documentation: function memoize in module nltk.decorators

memoize(func)
nltk.meteor
Python Library Documentation: function meteor_score in module nltk.translate.meteor_score

meteor_score(references: collections.abc.Iterable[collections.abc.Iterable[str]], hypothesis: collections.abc.Iterable[str], preprocess: collections.abc.Callable[[str], str] = <method 'lower' of 'str' objects>, stemmer: nltk.stem.api.StemmerI = <PorterStemmer>, wordnet: nltk.corpus.reader.wordnet.WordNetCorpusReader = <WordNetCorpusReader in '.../corpora/wordnet' (not loaded yet)>, alpha: float = 0.9, beta: float = 3.0, gamma: float = 0.5) -> float
    Calculates METEOR score for hypothesis with multiple references as
    described in "Meteor: An Automatic Metric for MT Evaluation with
    HighLevels of Correlation with Human Judgments" by Alon Lavie and
    Abhaya Agarwal, in Proceedings of ACL.
    https://www.cs.cmu.edu/~alavie/METEOR/pdf/Lavie-Agarwal-2007-METEOR.pdf


    In case of multiple references the best score is chosen. This method
    iterates over single_meteor_score and picks the best pair among all
    the references for a given hypothesis

    >>> hypothesis1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which', 'ensures', 'that', 'the', 'military', 'always', 'obeys', 'the', 'commands', 'of', 'the', 'party']
    >>> hypothesis2 = ['It', 'is', 'to', 'insure', 'the', 'troops', 'forever', 'hearing', 'the', 'activity', 'guidebook', 'that', 'party', 'direct']

    >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that', 'ensures', 'that', 'the', 'military', 'will', 'forever', 'heed', 'Party', 'commands']
    >>> reference2 = ['It', 'is', 'the', 'guiding', 'principle', 'which', 'guarantees', 'the', 'military', 'forces', 'always', 'being', 'under', 'the', 'command', 'of', 'the', 'Party']
    >>> reference3 = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the', 'army', 'always', 'to', 'heed', 'the', 'directions', 'of', 'the', 'party']

    >>> round(meteor_score([reference1, reference2, reference3], hypothesis1),4)
    0.6944

        If there is no words match during the alignment the method returns the
        score as 0. We can safely  return a zero instead of raising a
        division by zero error as no match usually implies a bad translation.

    >>> round(meteor_score([['this', 'is', 'a', 'cat']], ['non', 'matching', 'hypothesis']),4)
    0.0

    :param references: pre-tokenized reference sentences
    :param hypothesis: a pre-tokenized hypothesis sentence
    :param preprocess: preprocessing function (default str.lower)
    :param stemmer: nltk.stem.api.StemmerI object (default PorterStemmer())
    :param wordnet: a wordnet corpus reader object (default nltk.corpus.wordnet)
    :param alpha: parameter for controlling relative weights of precision and recall.
    :param beta: parameter for controlling shape of penalty as a function
                 of as a function of fragmentation.
    :param gamma: relative weight assigned to fragmentation penalty.
    :return: The sentence-level METEOR score.
nltk.meteor_score
Python Library Documentation: module nltk.translate.meteor_score in nltk.translate

NAME
    nltk.translate.meteor_score

DESCRIPTION
    # Natural Language Toolkit: Machine Translation
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Uday Krishna <udaykrishna5@gmail.com>
    # Contributor: Tom Aarsen
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

FUNCTIONS
    align_words(hypothesis: collections.abc.Iterable[str], reference: collections.abc.Iterable[str], stemmer: nltk.stem.api.StemmerI = <PorterStemmer>, wordnet: nltk.corpus.reader.wordnet.WordNetCorpusReader = <WordNetCorpusReader in '.../corpora/wordnet' (not loaded yet)>) -> tuple[list[tuple[int, int]], list[tuple[int, str]], list[tuple[int, str]]]
        Aligns/matches words in the hypothesis to reference by sequentially
        applying exact match, stemmed match and wordnet based synonym match.
        In case there are multiple matches the match which has the least number
        of crossing is chosen.

        :param hypothesis: pre-tokenized hypothesis
        :param reference: pre-tokenized reference
        :param stemmer: nltk.stem.api.StemmerI object (default PorterStemmer())
        :param wordnet: a wordnet corpus reader object (default nltk.corpus.wordnet)
        :return: sorted list of matched tuples, unmatched hypothesis list, unmatched reference list

    exact_match(hypothesis: collections.abc.Iterable[str], reference: collections.abc.Iterable[str]) -> tuple[list[tuple[int, int]], list[tuple[int, str]], list[tuple[int, str]]]
        matches exact words in hypothesis and reference
        and returns a word mapping based on the enumerated
        word id between hypothesis and reference

        :param hypothesis: pre-tokenized hypothesis
        :param reference: pre-tokenized reference
        :return: enumerated matched tuples, enumerated unmatched hypothesis tuples,
                 enumerated unmatched reference tuples

    meteor_score(references: collections.abc.Iterable[collections.abc.Iterable[str]], hypothesis: collections.abc.Iterable[str], preprocess: collections.abc.Callable[[str], str] = <method 'lower' of 'str' objects>, stemmer: nltk.stem.api.StemmerI = <PorterStemmer>, wordnet: nltk.corpus.reader.wordnet.WordNetCorpusReader = <WordNetCorpusReader in '.../corpora/wordnet' (not loaded yet)>, alpha: float = 0.9, beta: float = 3.0, gamma: float = 0.5) -> float
        Calculates METEOR score for hypothesis with multiple references as
        described in "Meteor: An Automatic Metric for MT Evaluation with
        HighLevels of Correlation with Human Judgments" by Alon Lavie and
        Abhaya Agarwal, in Proceedings of ACL.
        https://www.cs.cmu.edu/~alavie/METEOR/pdf/Lavie-Agarwal-2007-METEOR.pdf


        In case of multiple references the best score is chosen. This method
        iterates over single_meteor_score and picks the best pair among all
        the references for a given hypothesis

        >>> hypothesis1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which', 'ensures', 'that', 'the', 'military', 'always', 'obeys', 'the', 'commands', 'of', 'the', 'party']
        >>> hypothesis2 = ['It', 'is', 'to', 'insure', 'the', 'troops', 'forever', 'hearing', 'the', 'activity', 'guidebook', 'that', 'party', 'direct']

        >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that', 'ensures', 'that', 'the', 'military', 'will', 'forever', 'heed', 'Party', 'commands']
        >>> reference2 = ['It', 'is', 'the', 'guiding', 'principle', 'which', 'guarantees', 'the', 'military', 'forces', 'always', 'being', 'under', 'the', 'command', 'of', 'the', 'Party']
        >>> reference3 = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the', 'army', 'always', 'to', 'heed', 'the', 'directions', 'of', 'the', 'party']

        >>> round(meteor_score([reference1, reference2, reference3], hypothesis1),4)
        0.6944

            If there is no words match during the alignment the method returns the
            score as 0. We can safely  return a zero instead of raising a
            division by zero error as no match usually implies a bad translation.

        >>> round(meteor_score([['this', 'is', 'a', 'cat']], ['non', 'matching', 'hypothesis']),4)
        0.0

        :param references: pre-tokenized reference sentences
        :param hypothesis: a pre-tokenized hypothesis sentence
        :param preprocess: preprocessing function (default str.lower)
        :param stemmer: nltk.stem.api.StemmerI object (default PorterStemmer())
        :param wordnet: a wordnet corpus reader object (default nltk.corpus.wordnet)
        :param alpha: parameter for controlling relative weights of precision and recall.
        :param beta: parameter for controlling shape of penalty as a function
                     of as a function of fragmentation.
        :param gamma: relative weight assigned to fragmentation penalty.
        :return: The sentence-level METEOR score.

    single_meteor_score(reference: collections.abc.Iterable[str], hypothesis: collections.abc.Iterable[str], preprocess: collections.abc.Callable[[str], str] = <method 'lower' of 'str' objects>, stemmer: nltk.stem.api.StemmerI = <PorterStemmer>, wordnet: nltk.corpus.reader.wordnet.WordNetCorpusReader = <WordNetCorpusReader in '.../corpora/wordnet' (not loaded yet)>, alpha: float = 0.9, beta: float = 3.0, gamma: float = 0.5) -> float
        Calculates METEOR score for single hypothesis and reference as per
        "Meteor: An Automatic Metric for MT Evaluation with HighLevels of
        Correlation with Human Judgments" by Alon Lavie and Abhaya Agarwal,
        in Proceedings of ACL.
        https://www.cs.cmu.edu/~alavie/METEOR/pdf/Lavie-Agarwal-2007-METEOR.pdf


        >>> hypothesis1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which', 'ensures', 'that', 'the', 'military', 'always', 'obeys', 'the', 'commands', 'of', 'the', 'party']

        >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that', 'ensures', 'that', 'the', 'military', 'will', 'forever', 'heed', 'Party', 'commands']


        >>> round(single_meteor_score(reference1, hypothesis1),4)
        0.6944

            If there is no words match during the alignment the method returns the
            score as 0. We can safely  return a zero instead of raising a
            division by zero error as no match usually implies a bad translation.

        >>> round(single_meteor_score(['this', 'is', 'a', 'cat'], ['non', 'matching', 'hypothesis']),4)
        0.0

        :param reference: pre-tokenized reference
        :param hypothesis: pre-tokenized hypothesis
        :param preprocess: preprocessing function (default str.lower)
        :param stemmer: nltk.stem.api.StemmerI object (default PorterStemmer())
        :param wordnet: a wordnet corpus reader object (default nltk.corpus.wordnet)
        :param alpha: parameter for controlling relative weights of precision and recall.
        :param beta: parameter for controlling shape of penalty as a
                     function of as a function of fragmentation.
        :param gamma: relative weight assigned to fragmentation penalty.
        :return: The sentence-level METEOR score.

    stem_match(hypothesis: collections.abc.Iterable[str], reference: collections.abc.Iterable[str], stemmer: nltk.stem.api.StemmerI = <PorterStemmer>) -> tuple[list[tuple[int, int]], list[tuple[int, str]], list[tuple[int, str]]]
        Stems each word and matches them in hypothesis and reference
        and returns a word mapping between hypothesis and reference

        :param hypothesis: pre-tokenized hypothesis
        :param reference: pre-tokenized reference
        :param stemmer: nltk.stem.api.StemmerI object (default PorterStemmer())
        :return: enumerated matched tuples, enumerated unmatched hypothesis tuples,
                 enumerated unmatched reference tuples

    wordnetsyn_match(hypothesis: collections.abc.Iterable[str], reference: collections.abc.Iterable[str], wordnet: nltk.corpus.reader.wordnet.WordNetCorpusReader = <WordNetCorpusReader in '.../corpora/wordnet' (not loaded yet)>) -> tuple[list[tuple[int, int]], list[tuple[int, str]], list[tuple[int, str]]]
        Matches each word in reference to a word in hypothesis if any synonym
        of a hypothesis word is the exact match to the reference word.

        :param hypothesis: pre-tokenized hypothesis
        :param reference: pre-tokenized reference
        :param wordnet: a wordnet corpus reader object (default nltk.corpus.wordnet)
        :return: list of mapped tuples

DATA
    List = typing.List
        A generic version of list.

    Tuple = typing.Tuple
        Deprecated alias to builtins.tuple.

        Tuple[X, Y] is the cross-product type of X and Y.

        Example: Tuple[T1, T2] is a tuple of two elements corresponding
        to type variables T1 and T2.  Tuple[int, float, str] is a tuple
        of an int, a float and a string.

        To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].

    wordnet = <WordNetCorpusReader in '.../corpora/wordnet' (not loaded ye...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\meteor_score.py

nltk.metrics
Python Library Documentation: module nltk.translate.metrics in nltk.translate

NAME
    nltk.translate.metrics

DESCRIPTION
    # Natural Language Toolkit: Translation metrics
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Will Zhang <wilzzha@gmail.com>
    #         Guan Gui <ggui@student.unimelb.edu.au>
    #         Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

FUNCTIONS
    alignment_error_rate(reference, hypothesis, possible=None)
        Return the Alignment Error Rate (AER) of an alignment
        with respect to a "gold standard" reference alignment.
        Return an error rate between 0.0 (perfect alignment) and 1.0 (no
        alignment).

            >>> from nltk.translate import Alignment
            >>> ref = Alignment([(0, 0), (1, 1), (2, 2)])
            >>> test = Alignment([(0, 0), (1, 2), (2, 1)])
            >>> alignment_error_rate(ref, test) # doctest: +ELLIPSIS
            0.6666666666666667

        :type reference: Alignment
        :param reference: A gold standard alignment (sure alignments)
        :type hypothesis: Alignment
        :param hypothesis: A hypothesis alignment (aka. candidate alignments)
        :type possible: Alignment or None
        :param possible: A gold standard reference of possible alignments
            (defaults to *reference* if None)
        :rtype: float or None

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\metrics.py

nltk.misc
Python Library Documentation: package nltk.misc in nltk

NAME
    nltk.misc

DESCRIPTION
    # Natural Language Toolkit: Miscellaneous modules
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

PACKAGE CONTENTS
    babelfish
    chomsky
    minimalset
    sort
    wordfinder

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\misc\__init__.py

nltk.mwe
Python Library Documentation: module nltk.tokenize.mwe in nltk.tokenize

NAME
    nltk.tokenize.mwe - Multi-Word Expression Tokenizer

DESCRIPTION
    A ``MWETokenizer`` takes a string which has already been divided into tokens and
    retokenizes it, merging multi-word expressions into single tokens, using a lexicon
    of MWEs:


        >>> from nltk.tokenize import MWETokenizer

        >>> tokenizer = MWETokenizer([('a', 'little'), ('a', 'little', 'bit'), ('a', 'lot')])
        >>> tokenizer.add_mwe(('in', 'spite', 'of'))

        >>> tokenizer.tokenize('Testing testing testing one two three'.split())
        ['Testing', 'testing', 'testing', 'one', 'two', 'three']

        >>> tokenizer.tokenize('This is a test in spite'.split())
        ['This', 'is', 'a', 'test', 'in', 'spite']

        >>> tokenizer.tokenize('In a little or a little bit or a lot in spite of'.split())
        ['In', 'a_little', 'or', 'a_little_bit', 'or', 'a_lot', 'in_spite_of']

CLASSES
    nltk.tokenize.api.TokenizerI(abc.ABC)
        MWETokenizer

    class MWETokenizer(nltk.tokenize.api.TokenizerI)
     |  MWETokenizer(mwes=None, separator='_')
     |
     |  A tokenizer that processes tokenized text and merges multi-word expressions
     |  into single tokens.
     |
     |  Method resolution order:
     |      MWETokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, mwes=None, separator='_')
     |      Initialize the multi-word tokenizer with a list of expressions and a
     |      separator
     |
     |      :type mwes: list(list(str))
     |      :param mwes: A sequence of multi-word expressions to be merged, where
     |          each MWE is a sequence of strings.
     |      :type separator: str
     |      :param separator: String that should be inserted between words in a multi-word
     |          expression token. (Default is '_')
     |
     |  add_mwe(self, mwe)
     |      Add a multi-word expression to the lexicon (stored as a word trie)
     |
     |      We use ``util.Trie`` to represent the trie. Its form is a dict of dicts.
     |      The key True marks the end of a valid MWE.
     |
     |      :param mwe: The multi-word expression we're adding into the word trie
     |      :type mwe: tuple(str) or list(str)
     |
     |      :Example:
     |
     |      >>> tokenizer = MWETokenizer()
     |      >>> tokenizer.add_mwe(('a', 'b'))
     |      >>> tokenizer.add_mwe(('a', 'b', 'c'))
     |      >>> tokenizer.add_mwe(('a', 'x'))
     |      >>> expected = {'a': {'x': {True: None}, 'b': {True: None, 'c': {True: None}}}}
     |      >>> tokenizer._mwes == expected
     |      True
     |
     |  tokenize(self, text)
     |      :param text: A list containing tokenized text
     |      :type text: list(str)
     |      :return: A list of the tokenized text with multi-words merged together
     |      :rtype: list(str)
     |
     |      :Example:
     |
     |      >>> tokenizer = MWETokenizer([('hors', "d'oeuvre")], separator='+')
     |      >>> tokenizer.tokenize("An hors d'oeuvre tonight, sir?".split())
     |      ['An', "hors+d'oeuvre", 'tonight,', 'sir?']
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\mwe.py

nltk.naivebayes
Python Library Documentation: module nltk.classify.naivebayes in nltk.classify

NAME
    nltk.classify.naivebayes

DESCRIPTION
    A classifier based on the Naive Bayes algorithm.  In order to find the
    probability for a label, this algorithm first uses the Bayes rule to
    express P(label|features) in terms of P(label) and P(features|label):

    |                       P(label) * P(features|label)
    |  P(label|features) = ------------------------------
    |                              P(features)

    The algorithm then makes the 'naive' assumption that all features are
    independent, given the label:

    |                       P(label) * P(f1|label) * ... * P(fn|label)
    |  P(label|features) = --------------------------------------------
    |                                         P(features)

    Rather than computing P(features) explicitly, the algorithm just
    calculates the numerator for each label, and normalizes them so they
    sum to one:

    |                       P(label) * P(f1|label) * ... * P(fn|label)
    |  P(label|features) = --------------------------------------------
    |                        SUM[l]( P(l) * P(f1|l) * ... * P(fn|l) )

CLASSES
    nltk.classify.api.ClassifierI(builtins.object)
        NaiveBayesClassifier

    class NaiveBayesClassifier(nltk.classify.api.ClassifierI)
     |  NaiveBayesClassifier(label_probdist, feature_probdist)
     |
     |  A Naive Bayes classifier.  Naive Bayes classifiers are
     |  paramaterized by two probability distributions:
     |
     |    - P(label) gives the probability that an input will receive each
     |      label, given no information about the input's features.
     |
     |    - P(fname=fval|label) gives the probability that a given feature
     |      (fname) will receive a given value (fval), given that the
     |      label (label).
     |
     |  If the classifier encounters an input with a feature that has
     |  never been seen with any label, then rather than assigning a
     |  probability of 0 to all labels, it will ignore that feature.
     |
     |  The feature value 'None' is reserved for unseen feature values;
     |  you generally should not use 'None' as a feature value for one of
     |  your own features.
     |
     |  Method resolution order:
     |      NaiveBayesClassifier
     |      nltk.classify.api.ClassifierI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, label_probdist, feature_probdist)
     |      :param label_probdist: P(label), the probability distribution
     |          over labels.  It is expressed as a ``ProbDistI`` whose
     |          samples are labels.  I.e., P(label) =
     |          ``label_probdist.prob(label)``.
     |
     |      :param feature_probdist: P(fname=fval|label), the probability
     |          distribution for feature values, given labels.  It is
     |          expressed as a dictionary whose keys are ``(label, fname)``
     |          pairs and whose values are ``ProbDistI`` objects over feature
     |          values.  I.e., P(fname=fval|label) =
     |          ``feature_probdist[label,fname].prob(fval)``.  If a given
     |          ``(label,fname)`` is not a key in ``feature_probdist``, then
     |          it is assumed that the corresponding P(fname=fval|label)
     |          is 0 for all values of ``fval``.
     |
     |  classify(self, featureset)
     |      :return: the most appropriate label for the given featureset.
     |      :rtype: label
     |
     |  labels(self)
     |      :return: the list of category labels used by this classifier.
     |      :rtype: list of (immutable)
     |
     |  most_informative_features(self, n=100)
     |      Return a list of the 'most informative' features used by this
     |      classifier.  For the purpose of this function, the
     |      informativeness of a feature ``(fname,fval)`` is equal to the
     |      highest value of P(fname=fval|label), for any label, divided by
     |      the lowest value of P(fname=fval|label), for any label:
     |
     |      |  max[ P(fname=fval|label1) / P(fname=fval|label2) ]
     |
     |  prob_classify(self, featureset)
     |      :return: a probability distribution over labels for the given
     |          featureset.
     |      :rtype: ProbDistI
     |
     |  show_most_informative_features(self, n=10)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  train(labeled_featuresets, estimator=<class 'nltk.probability.ELEProbDist'>)
     |      :param labeled_featuresets: A list of classified featuresets,
     |          i.e., a list of tuples ``(featureset, label)``.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.api.ClassifierI:
     |
     |  classify_many(self, featuresets)
     |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.classify(fs) for fs in featuresets]
     |
     |      :rtype: list(label)
     |
     |  prob_classify_many(self, featuresets)
     |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.prob_classify(fs) for fs in featuresets]
     |
     |      :rtype: list(ProbDistI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.classify.api.ClassifierI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\naivebayes.py

nltk.named_entity
Python Library Documentation: module nltk.chunk.named_entity in nltk.chunk

NAME
    nltk.chunk.named_entity - Named entity chunker

CLASSES
    nltk.chunk.api.ChunkParserI(nltk.parse.api.ParserI)
        NEChunkParser
            Maxent_NE_Chunker
    nltk.tag.sequential.ClassifierBasedTagger(nltk.tag.sequential.SequentialBackoffTagger, nltk.tag.api.FeaturesetTaggerI)
        NEChunkParserTagger

    class Maxent_NE_Chunker(NEChunkParser)
     |  Maxent_NE_Chunker(fmt='multiclass')
     |
     |  Expected input: list of pos-tagged words
     |
     |  Method resolution order:
     |      Maxent_NE_Chunker
     |      NEChunkParser
     |      nltk.chunk.api.ChunkParserI
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, fmt='multiclass')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  load_params(self)
     |
     |  save_params(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from NEChunkParser:
     |
     |  parse(self, tokens)
     |      Each token should be a pos-tagged word
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.chunk.api.ChunkParserI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the chunker against the gold standard.
     |      Remove the chunking the gold standard text, rechunk it using
     |      the chunker, and return a ``ChunkScore`` object
     |      reflecting the performance of this chunk parser.
     |
     |      :type gold: list(Tree)
     |      :param gold: The list of chunked sentences to score the chunker on.
     |      :rtype: ChunkScore
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class NEChunkParser(nltk.chunk.api.ChunkParserI)
     |  NEChunkParser(train)
     |
     |  Expected input: list of pos-tagged words
     |
     |  Method resolution order:
     |      NEChunkParser
     |      nltk.chunk.api.ChunkParserI
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, train)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  parse(self, tokens)
     |      Each token should be a pos-tagged word
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.chunk.api.ChunkParserI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the chunker against the gold standard.
     |      Remove the chunking the gold standard text, rechunk it using
     |      the chunker, and return a ``ChunkScore`` object
     |      reflecting the performance of this chunk parser.
     |
     |      :type gold: list(Tree)
     |      :param gold: The list of chunked sentences to score the chunker on.
     |      :rtype: ChunkScore
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class NEChunkParserTagger(nltk.tag.sequential.ClassifierBasedTagger)
     |  NEChunkParserTagger(train=None, classifier=None)
     |
     |  The IOB tagger used by the chunk parser.
     |
     |  Method resolution order:
     |      NEChunkParserTagger
     |      nltk.tag.sequential.ClassifierBasedTagger
     |      nltk.tag.sequential.SequentialBackoffTagger
     |      nltk.tag.api.FeaturesetTaggerI
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, train=None, classifier=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.sequential.ClassifierBasedTagger:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  classifier(self)
     |      Return the classifier that this tagger uses to choose a tag
     |      for each word in a sentence.  The input for this classifier is
     |      generated using this tagger's feature detector.
     |      See ``feature_detector()``
     |
     |  feature_detector(self, tokens, index, history)
     |      Return the feature detector that this tagger uses to generate
     |      featuresets for its classifier.  The feature detector is a
     |      function with the signature::
     |
     |        feature_detector(tokens, index, history) -> featureset
     |
     |      See ``classifier()``
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.sequential.SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from nltk.tag.sequential.SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    build_model(fmt='multiclass')

    cmp_chunks(correct, guessed)
        # This probably belongs in a more general-purpose location (as does
        # the parse_to_tagged function).

    load_ace_data(roots, fmt='binary', skip_bnews=True)

    load_ace_file(textfile, fmt)

    postag_tree(tree)

    shape(word)

    simplify_pos(s)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\chunk\named_entity.py

nltk.ne_chunk
Python Library Documentation: function ne_chunk in module nltk.chunk

ne_chunk(tagged_tokens, binary=False)
    Use NLTK's currently recommended named entity chunker to
    chunk the given list of tagged tokens.

    >>> from nltk.chunk import ne_chunk
    >>> from nltk.corpus import treebank
    >>> from pprint import pprint
    >>> pprint(ne_chunk(treebank.tagged_sents()[2][8:14])) # doctest: +NORMALIZE_WHITESPACE
    Tree('S', [('chairman', 'NN'), ('of', 'IN'), Tree('ORGANIZATION', [('Consolidated', 'NNP'), ('Gold', 'NNP'), ('Fields', 'NNP')]), ('PLC', 'NNP')])
nltk.ne_chunk_sents
Python Library Documentation: function ne_chunk_sents in module nltk.chunk

ne_chunk_sents(tagged_sentences, binary=False)
    Use NLTK's currently recommended named entity chunker to chunk the
    given list of tagged sentences, each consisting of a list of tagged tokens.
nltk.ne_chunker
Python Library Documentation: function ne_chunker in module nltk.chunk

ne_chunker(fmt='multiclass')
    Load NLTK's currently recommended named entity chunker.
nltk.ngrams
Python Library Documentation: function ngrams in module nltk.util

ngrams(sequence, n, **kwargs)
    Return the ngrams generated from a sequence of items, as an iterator.
    For example:

        >>> from nltk.util import ngrams
        >>> list(ngrams([1,2,3,4,5], 3))
        [(1, 2, 3), (2, 3, 4), (3, 4, 5)]

    Wrap with list for a list version of this function.  Set pad_left
    or pad_right to true in order to get additional ngrams:

        >>> list(ngrams([1,2,3,4,5], 2, pad_right=True))
        [(1, 2), (2, 3), (3, 4), (4, 5), (5, None)]
        >>> list(ngrams([1,2,3,4,5], 2, pad_right=True, right_pad_symbol='</s>'))
        [(1, 2), (2, 3), (3, 4), (4, 5), (5, '</s>')]
        >>> list(ngrams([1,2,3,4,5], 2, pad_left=True, left_pad_symbol='<s>'))
        [('<s>', 1), (1, 2), (2, 3), (3, 4), (4, 5)]
        >>> list(ngrams([1,2,3,4,5], 2, pad_left=True, pad_right=True, left_pad_symbol='<s>', right_pad_symbol='</s>'))
        [('<s>', 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, '</s>')]


    :param sequence: the source data to be converted into ngrams
    :type sequence: sequence or iter
    :param n: the degree of the ngrams
    :type n: int
    :param pad_left: whether the ngrams should be left-padded
    :type pad_left: bool
    :param pad_right: whether the ngrams should be right-padded
    :type pad_right: bool
    :param left_pad_symbol: the symbol to use for left padding (default is None)
    :type left_pad_symbol: any
    :param right_pad_symbol: the symbol to use for right padding (default is None)
    :type right_pad_symbol: any
    :rtype: sequence or iter
nltk.nist
Python Library Documentation: function sentence_nist in module nltk.translate.nist_score

sentence_nist(references, hypothesis, n=5)
    Calculate NIST score from
    George Doddington. 2002. "Automatic evaluation of machine translation quality
    using n-gram co-occurrence statistics." Proceedings of HLT.
    Morgan Kaufmann Publishers Inc. https://dl.acm.org/citation.cfm?id=1289189.1289273

    DARPA commissioned NIST to develop an MT evaluation facility based on the BLEU
    score. The official script used by NIST to compute BLEU and NIST score is
    mteval-14.pl. The main differences are:

     - BLEU uses geometric mean of the ngram overlaps, NIST uses arithmetic mean.
     - NIST has a different brevity penalty
     - NIST score from mteval-14.pl has a self-contained tokenizer

    Note: The mteval-14.pl includes a smoothing function for BLEU score that is NOT
          used in the NIST score computation.

    >>> hypothesis1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which',
    ...               'ensures', 'that', 'the', 'military', 'always',
    ...               'obeys', 'the', 'commands', 'of', 'the', 'party']

    >>> hypothesis2 = ['It', 'is', 'to', 'insure', 'the', 'troops',
    ...               'forever', 'hearing', 'the', 'activity', 'guidebook',
    ...               'that', 'party', 'direct']

    >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that',
    ...               'ensures', 'that', 'the', 'military', 'will', 'forever',
    ...               'heed', 'Party', 'commands']

    >>> reference2 = ['It', 'is', 'the', 'guiding', 'principle', 'which',
    ...               'guarantees', 'the', 'military', 'forces', 'always',
    ...               'being', 'under', 'the', 'command', 'of', 'the',
    ...               'Party']

    >>> reference3 = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the',
    ...               'army', 'always', 'to', 'heed', 'the', 'directions',
    ...               'of', 'the', 'party']

    >>> sentence_nist([reference1, reference2, reference3], hypothesis1) # doctest: +ELLIPSIS
    3.3709...

    >>> sentence_nist([reference1, reference2, reference3], hypothesis2) # doctest: +ELLIPSIS
    1.4619...

    :param references: reference sentences
    :type references: list(list(str))
    :param hypothesis: a hypothesis sentence
    :type hypothesis: list(str)
    :param n: highest n-gram order
    :type n: int
nltk.nist_score
Python Library Documentation: module nltk.translate.nist_score in nltk.translate

NAME
    nltk.translate.nist_score - NIST score implementation.

FUNCTIONS
    corpus_nist(list_of_references, hypotheses, n=5)
        Calculate a single corpus-level NIST score (aka. system-level BLEU) for all
        the hypotheses and their respective references.

        :param references: a corpus of lists of reference sentences, w.r.t. hypotheses
        :type references: list(list(list(str)))
        :param hypotheses: a list of hypothesis sentences
        :type hypotheses: list(list(str))
        :param n: highest n-gram order
        :type n: int

    nist_length_penalty(ref_len, hyp_len)
        Calculates the NIST length penalty, from Eq. 3 in Doddington (2002)

            penalty = exp( beta * log( min( len(hyp)/len(ref) , 1.0 )))

        where,

            `beta` is chosen to make the brevity penalty factor = 0.5 when the
            no. of words in the system output (hyp) is 2/3 of the average
            no. of words in the reference translation (ref)

        The NIST penalty is different from BLEU's such that it minimize the impact
        of the score of small variations in the length of a translation.
        See Fig. 4 in  Doddington (2002)

    sentence_nist(references, hypothesis, n=5)
        Calculate NIST score from
        George Doddington. 2002. "Automatic evaluation of machine translation quality
        using n-gram co-occurrence statistics." Proceedings of HLT.
        Morgan Kaufmann Publishers Inc. https://dl.acm.org/citation.cfm?id=1289189.1289273

        DARPA commissioned NIST to develop an MT evaluation facility based on the BLEU
        score. The official script used by NIST to compute BLEU and NIST score is
        mteval-14.pl. The main differences are:

         - BLEU uses geometric mean of the ngram overlaps, NIST uses arithmetic mean.
         - NIST has a different brevity penalty
         - NIST score from mteval-14.pl has a self-contained tokenizer

        Note: The mteval-14.pl includes a smoothing function for BLEU score that is NOT
              used in the NIST score computation.

        >>> hypothesis1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which',
        ...               'ensures', 'that', 'the', 'military', 'always',
        ...               'obeys', 'the', 'commands', 'of', 'the', 'party']

        >>> hypothesis2 = ['It', 'is', 'to', 'insure', 'the', 'troops',
        ...               'forever', 'hearing', 'the', 'activity', 'guidebook',
        ...               'that', 'party', 'direct']

        >>> reference1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'that',
        ...               'ensures', 'that', 'the', 'military', 'will', 'forever',
        ...               'heed', 'Party', 'commands']

        >>> reference2 = ['It', 'is', 'the', 'guiding', 'principle', 'which',
        ...               'guarantees', 'the', 'military', 'forces', 'always',
        ...               'being', 'under', 'the', 'command', 'of', 'the',
        ...               'Party']

        >>> reference3 = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the',
        ...               'army', 'always', 'to', 'heed', 'the', 'directions',
        ...               'of', 'the', 'party']

        >>> sentence_nist([reference1, reference2, reference3], hypothesis1) # doctest: +ELLIPSIS
        3.3709...

        >>> sentence_nist([reference1, reference2, reference3], hypothesis2) # doctest: +ELLIPSIS
        1.4619...

        :param references: reference sentences
        :type references: list(list(str))
        :param hypothesis: a hypothesis sentence
        :type hypothesis: list(str)
        :param n: highest n-gram order
        :type n: int

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\nist_score.py

nltk.nonprojectivedependencyparser
Python Library Documentation: module nltk.parse.nonprojectivedependencyparser in nltk.parse

NAME
    nltk.parse.nonprojectivedependencyparser

DESCRIPTION
    # Natural Language Toolkit: Dependency Grammars
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Jason Narad <jason.narad@gmail.com>
    #
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT
    #

CLASSES
    builtins.object
        DependencyScorerI
            DemoScorer
            NaiveBayesDependencyScorer
        NonprojectiveDependencyParser
        ProbabilisticNonprojectiveParser

    class DemoScorer(DependencyScorerI)
     |  #################################################################
     |  # A Scorer for Demo Purposes
     |  #################################################################
     |  # A short class necessary to show parsing example from paper
     |
     |  Method resolution order:
     |      DemoScorer
     |      DependencyScorerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  score(self, graph)
     |      :type graph: DependencyGraph
     |      :param graph: A dependency graph whose set of edges need to be
     |          scored.
     |      :rtype: A three-dimensional list of numbers.
     |      :return: The score is returned in a multidimensional(3) list, such
     |          that the outer-dimension refers to the head, and the
     |          inner-dimension refers to the dependencies.  For instance,
     |          scores[0][1] would reference the list of scores corresponding to
     |          arcs from node 0 to node 1.  The node's 'address' field can be used
     |          to determine its number identification.
     |
     |      For further illustration, a score list corresponding to Fig.2 of
     |      Keith Hall's 'K-best Spanning Tree Parsing' paper::
     |
     |            scores = [[[], [5],  [1],  [1]],
     |                     [[], [],   [11], [4]],
     |                     [[], [10], [],   [5]],
     |                     [[], [8],  [8],  []]]
     |
     |      When used in conjunction with a MaxEntClassifier, each score would
     |      correspond to the confidence of a particular edge being classified
     |      with the positive training examples.
     |
     |  train(self, graphs)
     |      :type graphs: list(DependencyGraph)
     |      :param graphs: A list of dependency graphs to train the scorer.
     |          Typically the edges present in the graphs can be used as
     |          positive training examples, and the edges not present as negative
     |          examples.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from DependencyScorerI:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DependencyScorerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DependencyScorerI(builtins.object)
     |  A scorer for calculated the weights on the edges of a weighted
     |  dependency graph.  This is used by a
     |  ``ProbabilisticNonprojectiveParser`` to initialize the edge
     |  weights of a ``DependencyGraph``.  While typically this would be done
     |  by training a binary classifier, any class that can return a
     |  multidimensional list representation of the edge weights can
     |  implement this interface.  As such, it has no necessary
     |  fields.
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  score(self, graph)
     |      :type graph: DependencyGraph
     |      :param graph: A dependency graph whose set of edges need to be
     |          scored.
     |      :rtype: A three-dimensional list of numbers.
     |      :return: The score is returned in a multidimensional(3) list, such
     |          that the outer-dimension refers to the head, and the
     |          inner-dimension refers to the dependencies.  For instance,
     |          scores[0][1] would reference the list of scores corresponding to
     |          arcs from node 0 to node 1.  The node's 'address' field can be used
     |          to determine its number identification.
     |
     |      For further illustration, a score list corresponding to Fig.2 of
     |      Keith Hall's 'K-best Spanning Tree Parsing' paper::
     |
     |            scores = [[[], [5],  [1],  [1]],
     |                     [[], [],   [11], [4]],
     |                     [[], [10], [],   [5]],
     |                     [[], [8],  [8],  []]]
     |
     |      When used in conjunction with a MaxEntClassifier, each score would
     |      correspond to the confidence of a particular edge being classified
     |      with the positive training examples.
     |
     |  train(self, graphs)
     |      :type graphs: list(DependencyGraph)
     |      :param graphs: A list of dependency graphs to train the scorer.
     |          Typically the edges present in the graphs can be used as
     |          positive training examples, and the edges not present as negative
     |          examples.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class NaiveBayesDependencyScorer(DependencyScorerI)
     |  A dependency scorer built around a MaxEnt classifier.  In this
     |  particular class that classifier is a ``NaiveBayesClassifier``.
     |  It uses head-word, head-tag, child-word, and child-tag features
     |  for classification.
     |
     |  >>> from nltk.parse.dependencygraph import DependencyGraph, conll_data2
     |
     |  >>> graphs = [DependencyGraph(entry) for entry in conll_data2.split('\n\n') if entry]
     |  >>> npp = ProbabilisticNonprojectiveParser()
     |  >>> npp.train(graphs, NaiveBayesDependencyScorer())
     |  >>> parses = npp.parse(['Cathy', 'zag', 'hen', 'zwaaien', '.'], ['N', 'V', 'Pron', 'Adj', 'N', 'Punc'])
     |  >>> len(list(parses))
     |  1
     |
     |  Method resolution order:
     |      NaiveBayesDependencyScorer
     |      DependencyScorerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  score(self, graph)
     |      Converts the graph into a feature-based representation of
     |      each edge, and then assigns a score to each based on the
     |      confidence of the classifier in assigning it to the
     |      positive label.  Scores are returned in a multidimensional list.
     |
     |      :type graph: DependencyGraph
     |      :param graph: A dependency graph to score.
     |      :rtype: 3 dimensional list
     |      :return: Edge scores for the graph parameter.
     |
     |  train(self, graphs)
     |      Trains a ``NaiveBayesClassifier`` using the edges present in
     |      graphs list as positive examples, the edges not present as
     |      negative examples.  Uses a feature vector of head-word,
     |      head-tag, child-word, and child-tag.
     |
     |      :type graphs: list(DependencyGraph)
     |      :param graphs: A list of dependency graphs to train the scorer.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from DependencyScorerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class NonprojectiveDependencyParser(builtins.object)
     |  NonprojectiveDependencyParser(dependency_grammar)
     |
     |  A non-projective, rule-based, dependency parser.  This parser
     |  will return the set of all possible non-projective parses based on
     |  the word-to-word relations defined in the parser's dependency
     |  grammar, and will allow the branches of the parse tree to cross
     |  in order to capture a variety of linguistic phenomena that a
     |  projective parser will not.
     |
     |  Methods defined here:
     |
     |  __init__(self, dependency_grammar)
     |      Creates a new ``NonprojectiveDependencyParser``.
     |
     |      :param dependency_grammar: a grammar of word-to-word relations.
     |      :type dependency_grammar: DependencyGrammar
     |
     |  parse(self, tokens)
     |      Parses the input tokens with respect to the parser's grammar.  Parsing
     |      is accomplished by representing the search-space of possible parses as
     |      a fully-connected directed graph.  Arcs that would lead to ungrammatical
     |      parses are removed and a lattice is constructed of length n, where n is
     |      the number of input tokens, to represent all possible grammatical
     |      traversals.  All possible paths through the lattice are then enumerated
     |      to produce the set of non-projective parses.
     |
     |      param tokens: A list of tokens to parse.
     |      type tokens: list(str)
     |      return: An iterator of non-projective parses.
     |      rtype: iter(DependencyGraph)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProbabilisticNonprojectiveParser(builtins.object)
     |  A probabilistic non-projective dependency parser.
     |
     |  Nonprojective dependencies allows for "crossing branches" in the parse tree
     |  which is necessary for representing particular linguistic phenomena, or even
     |  typical parses in some languages.  This parser follows the MST parsing
     |  algorithm, outlined in McDonald(2005), which likens the search for the best
     |  non-projective parse to finding the maximum spanning tree in a weighted
     |  directed graph.
     |
     |  >>> class Scorer(DependencyScorerI):
     |  ...     def train(self, graphs):
     |  ...         pass
     |  ...
     |  ...     def score(self, graph):
     |  ...         return [
     |  ...             [[], [5],  [1],  [1]],
     |  ...             [[], [],   [11], [4]],
     |  ...             [[], [10], [],   [5]],
     |  ...             [[], [8],  [8],  []],
     |  ...         ]
     |
     |
     |  >>> npp = ProbabilisticNonprojectiveParser()
     |  >>> npp.train([], Scorer())
     |
     |  >>> parses = npp.parse(['v1', 'v2', 'v3'], [None, None, None])
     |  >>> len(list(parses))
     |  1
     |
     |  Rule based example
     |
     |  >>> from nltk.grammar import DependencyGrammar
     |
     |  >>> grammar = DependencyGrammar.fromstring('''
     |  ... 'taught' -> 'play' | 'man'
     |  ... 'man' -> 'the' | 'in'
     |  ... 'in' -> 'corner'
     |  ... 'corner' -> 'the'
     |  ... 'play' -> 'golf' | 'dachshund' | 'to'
     |  ... 'dachshund' -> 'his'
     |  ... ''')
     |
     |  >>> ndp = NonprojectiveDependencyParser(grammar)
     |  >>> parses = ndp.parse(['the', 'man', 'in', 'the', 'corner', 'taught', 'his', 'dachshund', 'to', 'play', 'golf'])
     |  >>> len(list(parses))
     |  4
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Creates a new non-projective parser.
     |
     |  best_incoming_arc(self, node_index)
     |      Returns the source of the best incoming arc to the
     |      node with address: node_index
     |
     |      :type node_index: integer.
     |      :param node_index: The address of the 'destination' node,
     |          the node that is arced to.
     |
     |  collapse_nodes(self, new_node, cycle_path, g_graph, b_graph, c_graph)
     |      Takes a list of nodes that have been identified to belong to a cycle,
     |      and collapses them into on larger node.  The arcs of all nodes in
     |      the graph must be updated to account for this.
     |
     |      :type new_node: Node.
     |      :param new_node: A Node (Dictionary) to collapse the cycle nodes into.
     |      :type cycle_path: A list of integers.
     |      :param cycle_path: A list of node addresses, each of which is in the cycle.
     |      :type g_graph, b_graph, c_graph: DependencyGraph
     |      :param g_graph, b_graph, c_graph: Graphs which need to be updated.
     |
     |  compute_max_subtract_score(self, column_index, cycle_indexes)
     |      When updating scores the score of the highest-weighted incoming
     |      arc is subtracted upon collapse.  This returns the correct
     |      amount to subtract from that edge.
     |
     |      :type column_index: integer.
     |      :param column_index: A index representing the column of incoming arcs
     |          to a particular node being updated
     |      :type cycle_indexes: A list of integers.
     |      :param cycle_indexes: Only arcs from cycle nodes are considered.  This
     |          is a list of such nodes addresses.
     |
     |  compute_original_indexes(self, new_indexes)
     |      As nodes are collapsed into others, they are replaced
     |      by the new node in the graph, but it's still necessary
     |      to keep track of what these original nodes were.  This
     |      takes a list of node addresses and replaces any collapsed
     |      node addresses with their original addresses.
     |
     |      :type new_indexes: A list of integers.
     |      :param new_indexes: A list of node addresses to check for
     |          subsumed nodes.
     |
     |  initialize_edge_scores(self, graph)
     |      Assigns a score to every edge in the ``DependencyGraph`` graph.
     |      These scores are generated via the parser's scorer which
     |      was assigned during the training process.
     |
     |      :type graph: DependencyGraph
     |      :param graph: A dependency graph to assign scores to.
     |
     |  original_best_arc(self, node_index)
     |
     |  parse(self, tokens, tags)
     |      Parses a list of tokens in accordance to the MST parsing algorithm
     |      for non-projective dependency parses.  Assumes that the tokens to
     |      be parsed have already been tagged and those tags are provided.  Various
     |      scoring methods can be used by implementing the ``DependencyScorerI``
     |      interface and passing it to the training algorithm.
     |
     |      :type tokens: list(str)
     |      :param tokens: A list of words or punctuation to be parsed.
     |      :type tags: list(str)
     |      :param tags: A list of tags corresponding by index to the words in the tokens list.
     |      :return: An iterator of non-projective parses.
     |      :rtype: iter(DependencyGraph)
     |
     |  train(self, graphs, dependency_scorer)
     |      Trains a ``DependencyScorerI`` from a set of ``DependencyGraph`` objects,
     |      and establishes this as the parser's scorer.  This is used to
     |      initialize the scores on a ``DependencyGraph`` during the parsing
     |      procedure.
     |
     |      :type graphs: list(DependencyGraph)
     |      :param graphs: A list of dependency graphs to train the scorer.
     |      :type dependency_scorer: DependencyScorerI
     |      :param dependency_scorer: A scorer which implements the
     |          ``DependencyScorerI`` interface.
     |
     |  update_edge_scores(self, new_node, cycle_path)
     |      Updates the edge scores to reflect a collapse operation into
     |      new_node.
     |
     |      :type new_node: A Node.
     |      :param new_node: The node which cycle nodes are collapsed into.
     |      :type cycle_path: A list of integers.
     |      :param cycle_path: A list of node addresses that belong to the cycle.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()

    hall_demo()

    nonprojective_conll_parse_demo()

    rule_based_demo()

DATA
    logger = <Logger nltk.parse.nonprojectivedependencyparser (WARNING)>

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\nonprojectivedependencyparser.py

nltk.nonterminals
Python Library Documentation: function nonterminals in module nltk.grammar

nonterminals(symbols)
    Given a string containing a list of symbol names, return a list of
    ``Nonterminals`` constructed from those symbols.

    :param symbols: The symbol name string.  This string can be
        delimited by either spaces or commas.
    :type symbols: str
    :return: A list of ``Nonterminals`` constructed from the symbol
        names given in ``symbols``.  The ``Nonterminals`` are sorted
        in the same order as the symbols names.
    :rtype: list(Nonterminal)
nltk.numpy
Python Library Documentation: package numpy

NAME
    numpy

DESCRIPTION
    NumPy
    =====

    Provides
      1. An array object of arbitrary homogeneous items
      2. Fast mathematical operations over arrays
      3. Linear Algebra, Fourier Transforms, Random Number Generation

    How to use the documentation
    ----------------------------
    Documentation is available in two forms: docstrings provided
    with the code, and a loose standing reference guide, available from
    `the NumPy homepage <https://numpy.org>`_.

    We recommend exploring the docstrings using
    `IPython <https://ipython.org>`_, an advanced Python shell with
    TAB-completion and introspection capabilities.  See below for further
    instructions.

    The docstring examples assume that `numpy` has been imported as ``np``::

      >>> import numpy as np

    Code snippets are indicated by three greater-than signs::

      >>> x = 42
      >>> x = x + 1

    Use the built-in ``help`` function to view a function's docstring::

      >>> help(np.sort)
      ... # doctest: +SKIP

    For some objects, ``np.info(obj)`` may provide additional help.  This is
    particularly true if you see the line "Help on ufunc object:" at the top
    of the help() page.  Ufuncs are implemented in C, not Python, for speed.
    The native Python help() does not know how to view their help, but our
    np.info() function does.

    Available subpackages
    ---------------------
    lib
        Basic functions used by several sub-packages.
    random
        Core Random Tools
    linalg
        Core Linear Algebra Tools
    fft
        Core FFT routines
    polynomial
        Polynomial tools
    testing
        NumPy testing tools
    distutils
        Enhancements to distutils with support for
        Fortran compilers support and more (for Python <= 3.11)

    Utilities
    ---------
    test
        Run numpy unittests
    show_config
        Show numpy build configuration
    __version__
        NumPy version string

    Viewing documentation using IPython
    -----------------------------------

    Start IPython and import `numpy` usually under the alias ``np``: `import
    numpy as np`.  Then, directly past or use the ``%cpaste`` magic to paste
    examples into the shell.  To see which functions are available in `numpy`,
    type ``np.<TAB>`` (where ``<TAB>`` refers to the TAB key), or use
    ``np.*cos*?<ENTER>`` (where ``<ENTER>`` refers to the ENTER key) to narrow
    down the list.  To view the docstring for a function, use
    ``np.cos?<ENTER>`` (to view the docstring) and ``np.cos??<ENTER>`` (to view
    the source code).

    Copies vs. in-place operation
    -----------------------------
    Most of the functions in `numpy` return a copy of the array argument
    (e.g., `np.sort`).  In-place versions of these functions are often
    available as array methods, i.e. ``x = np.array([1,2,3]); x.sort()``.
    Exceptions to this rule are documented.

PACKAGE CONTENTS
    __config__
    _array_api_info
    _configtool
    _core (package)
    _distributor_init
    _expired_attrs_2_0
    _globals
    _pyinstaller (package)
    _pytesttester
    _typing (package)
    _utils (package)
    char (package)
    compat (package)
    conftest
    core (package)
    ctypeslib
    dtypes
    exceptions
    f2py (package)
    fft (package)
    lib (package)
    linalg (package)
    ma (package)
    matlib
    matrixlib (package)
    polynomial (package)
    random (package)
    rec (package)
    strings (package)
    testing (package)
    tests (package)
    typing (package)
    version

SUBMODULES
    _mat
    emath

CLASSES
    builtins.bytes(builtins.object)
        bytes_(builtins.bytes, character)
    builtins.object
        __array_namespace_info__
        broadcast
        busdaycalendar
        dtype
        errstate
        finfo
        flatiter
        generic
            bool
            datetime64
            flexible
                character
                    bytes_(builtins.bytes, character)
                    str_(builtins.str, character)
                void
                    record
            number
                inexact
                    complexfloating
                        clongdouble
                        complex128(complexfloating, builtins.complex)
                        complex64
                    floating
                        float16
                        float32
                        float64(floating, builtins.float)
                        longdouble
                integer
                    signedinteger
                        int16
                        int32
                        int64
                        int8
                        intc
                        timedelta64
                    unsignedinteger
                        uint16
                        uint32
                        uint64
                        uint8
                        uintc
            object_
        iinfo
        ndarray
            matrix
            memmap
            numpy.rec.recarray
        ndenumerate
        ndindex
        nditer
        poly1d
        ufunc
        vectorize
    builtins.str(builtins.object)
        str_(builtins.str, character)

    class __array_namespace_info__(builtins.object)
     |  Get the array API inspection namespace for NumPy.
     |
     |  The array API inspection namespace defines the following functions:
     |
     |  - capabilities()
     |  - default_device()
     |  - default_dtypes()
     |  - dtypes()
     |  - devices()
     |
     |  See
     |  https://data-apis.org/array-api/latest/API_specification/inspection.html
     |  for more details.
     |
     |  Returns
     |  -------
     |  info : ModuleType
     |      The array API inspection namespace for NumPy.
     |
     |  Examples
     |  --------
     |  >>> info = np.__array_namespace_info__()
     |  >>> info.default_dtypes()
     |  {'real floating': numpy.float64,
     |   'complex floating': numpy.complex128,
     |   'integral': numpy.int64,
     |   'indexing': numpy.int64}
     |
     |  Methods defined here:
     |
     |  capabilities(self) from numpy._array_api_info.__array_namespace_info__
     |      Return a dictionary of array API library capabilities.
     |
     |      The resulting dictionary has the following keys:
     |
     |      - **"boolean indexing"**: boolean indicating whether an array library
     |        supports boolean indexing. Always ``True`` for NumPy.
     |
     |      - **"data-dependent shapes"**: boolean indicating whether an array
     |        library supports data-dependent output shapes. Always ``True`` for
     |        NumPy.
     |
     |      See
     |      https://data-apis.org/array-api/latest/API_specification/generated/array_api.info.capabilities.html
     |      for more details.
     |
     |      See Also
     |      --------
     |      __array_namespace_info__.default_device,
     |      __array_namespace_info__.default_dtypes,
     |      __array_namespace_info__.dtypes,
     |      __array_namespace_info__.devices
     |
     |      Returns
     |      -------
     |      capabilities : dict
     |          A dictionary of array API library capabilities.
     |
     |      Examples
     |      --------
     |      >>> info = np.__array_namespace_info__()
     |      >>> info.capabilities()
     |      {'boolean indexing': True,
     |       'data-dependent shapes': True}
     |
     |  default_device(self) from numpy._array_api_info.__array_namespace_info__
     |      The default device used for new NumPy arrays.
     |
     |      For NumPy, this always returns ``'cpu'``.
     |
     |      See Also
     |      --------
     |      __array_namespace_info__.capabilities,
     |      __array_namespace_info__.default_dtypes,
     |      __array_namespace_info__.dtypes,
     |      __array_namespace_info__.devices
     |
     |      Returns
     |      -------
     |      device : str
     |          The default device used for new NumPy arrays.
     |
     |      Examples
     |      --------
     |      >>> info = np.__array_namespace_info__()
     |      >>> info.default_device()
     |      'cpu'
     |
     |  default_dtypes(self, *, device=None) from numpy._array_api_info.__array_namespace_info__
     |      The default data types used for new NumPy arrays.
     |
     |      For NumPy, this always returns the following dictionary:
     |
     |      - **"real floating"**: ``numpy.float64``
     |      - **"complex floating"**: ``numpy.complex128``
     |      - **"integral"**: ``numpy.intp``
     |      - **"indexing"**: ``numpy.intp``
     |
     |      Parameters
     |      ----------
     |      device : str, optional
     |          The device to get the default data types for. For NumPy, only
     |          ``'cpu'`` is allowed.
     |
     |      Returns
     |      -------
     |      dtypes : dict
     |          A dictionary describing the default data types used for new NumPy
     |          arrays.
     |
     |      See Also
     |      --------
     |      __array_namespace_info__.capabilities,
     |      __array_namespace_info__.default_device,
     |      __array_namespace_info__.dtypes,
     |      __array_namespace_info__.devices
     |
     |      Examples
     |      --------
     |      >>> info = np.__array_namespace_info__()
     |      >>> info.default_dtypes()
     |      {'real floating': numpy.float64,
     |       'complex floating': numpy.complex128,
     |       'integral': numpy.int64,
     |       'indexing': numpy.int64}
     |
     |  devices(self) from numpy._array_api_info.__array_namespace_info__
     |      The devices supported by NumPy.
     |
     |      For NumPy, this always returns ``['cpu']``.
     |
     |      Returns
     |      -------
     |      devices : list of str
     |          The devices supported by NumPy.
     |
     |      See Also
     |      --------
     |      __array_namespace_info__.capabilities,
     |      __array_namespace_info__.default_device,
     |      __array_namespace_info__.default_dtypes,
     |      __array_namespace_info__.dtypes
     |
     |      Examples
     |      --------
     |      >>> info = np.__array_namespace_info__()
     |      >>> info.devices()
     |      ['cpu']
     |
     |  dtypes(self, *, device=None, kind=None) from numpy._array_api_info.__array_namespace_info__
     |      The array API data types supported by NumPy.
     |
     |      Note that this function only returns data types that are defined by
     |      the array API.
     |
     |      Parameters
     |      ----------
     |      device : str, optional
     |          The device to get the data types for. For NumPy, only ``'cpu'`` is
     |          allowed.
     |      kind : str or tuple of str, optional
     |          The kind of data types to return. If ``None``, all data types are
     |          returned. If a string, only data types of that kind are returned.
     |          If a tuple, a dictionary containing the union of the given kinds
     |          is returned. The following kinds are supported:
     |
     |          - ``'bool'``: boolean data types (i.e., ``bool``).
     |          - ``'signed integer'``: signed integer data types (i.e., ``int8``,
     |            ``int16``, ``int32``, ``int64``).
     |          - ``'unsigned integer'``: unsigned integer data types (i.e.,
     |            ``uint8``, ``uint16``, ``uint32``, ``uint64``).
     |          - ``'integral'``: integer data types. Shorthand for ``('signed
     |            integer', 'unsigned integer')``.
     |          - ``'real floating'``: real-valued floating-point data types
     |            (i.e., ``float32``, ``float64``).
     |          - ``'complex floating'``: complex floating-point data types (i.e.,
     |            ``complex64``, ``complex128``).
     |          - ``'numeric'``: numeric data types. Shorthand for ``('integral',
     |            'real floating', 'complex floating')``.
     |
     |      Returns
     |      -------
     |      dtypes : dict
     |          A dictionary mapping the names of data types to the corresponding
     |          NumPy data types.
     |
     |      See Also
     |      --------
     |      __array_namespace_info__.capabilities,
     |      __array_namespace_info__.default_device,
     |      __array_namespace_info__.default_dtypes,
     |      __array_namespace_info__.devices
     |
     |      Examples
     |      --------
     |      >>> info = np.__array_namespace_info__()
     |      >>> info.dtypes(kind='signed integer')
     |      {'int8': numpy.int8,
     |       'int16': numpy.int16,
     |       'int32': numpy.int32,
     |       'int64': numpy.int64}
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class bool(generic)
     |  Boolean type (True or False), stored as a byte.
     |
     |  .. warning::
     |
     |     The :class:`bool` type is not a subclass of the :class:`int_` type
     |     (the :class:`bool` is not even a number type). This is different
     |     than Python's default implementation of :class:`bool` as a
     |     sub-class of :class:`int`.
     |
     |  :Character code: ``'?'``
     |
     |  Method resolution order:
     |      bool
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    bool_ = class bool(generic)
     |  Boolean type (True or False), stored as a byte.
     |
     |  .. warning::
     |
     |     The :class:`bool` type is not a subclass of the :class:`int_` type
     |     (the :class:`bool` is not even a number type). This is different
     |     than Python's default implementation of :class:`bool` as a
     |     sub-class of :class:`int`.
     |
     |  :Character code: ``'?'``
     |
     |  Method resolution order:
     |      bool
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class broadcast(builtins.object)
     |  Produce an object that mimics broadcasting.
     |
     |  Parameters
     |  ----------
     |  in1, in2, ... : array_like
     |      Input parameters.
     |
     |  Returns
     |  -------
     |  b : broadcast object
     |      Broadcast the input parameters against one another, and
     |      return an object that encapsulates the result.
     |      Amongst others, it has ``shape`` and ``nd`` properties, and
     |      may be used as an iterator.
     |
     |  See Also
     |  --------
     |  broadcast_arrays
     |  broadcast_to
     |  broadcast_shapes
     |
     |  Examples
     |  --------
     |
     |  Manually adding two vectors, using broadcasting:
     |
     |  >>> import numpy as np
     |  >>> x = np.array([[1], [2], [3]])
     |  >>> y = np.array([4, 5, 6])
     |  >>> b = np.broadcast(x, y)
     |
     |  >>> out = np.empty(b.shape)
     |  >>> out.flat = [u+v for (u,v) in b]
     |  >>> out
     |  array([[5.,  6.,  7.],
     |         [6.,  7.,  8.],
     |         [7.,  8.,  9.]])
     |
     |  Compare against built-in broadcasting:
     |
     |  >>> x + y
     |  array([[5, 6, 7],
     |         [6, 7, 8],
     |         [7, 8, 9]])
     |
     |  Methods defined here:
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __next__(self, /)
     |      Implement next(self).
     |
     |  reset(...)
     |      reset()
     |
     |      Reset the broadcasted result's iterator(s).
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      None
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> y = np.array([[4], [5], [6]])
     |      >>> b = np.broadcast(x, y)
     |      >>> b.index
     |      0
     |      >>> next(b), next(b), next(b)
     |      ((1, 4), (2, 4), (3, 4))
     |      >>> b.index
     |      3
     |      >>> b.reset()
     |      >>> b.index
     |      0
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  index
     |      current index in broadcasted result
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> x = np.array([[1], [2], [3]])
     |      >>> y = np.array([4, 5, 6])
     |      >>> b = np.broadcast(x, y)
     |      >>> b.index
     |      0
     |      >>> next(b), next(b), next(b)
     |      ((1, 4), (1, 5), (1, 6))
     |      >>> b.index
     |      3
     |
     |  iters
     |      tuple of iterators along ``self``'s "components."
     |
     |      Returns a tuple of `numpy.flatiter` objects, one for each "component"
     |      of ``self``.
     |
     |      See Also
     |      --------
     |      numpy.flatiter
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> y = np.array([[4], [5], [6]])
     |      >>> b = np.broadcast(x, y)
     |      >>> row, col = b.iters
     |      >>> next(row), next(col)
     |      (1, 4)
     |
     |  nd
     |      Number of dimensions of broadcasted result. For code intended for NumPy
     |      1.12.0 and later the more consistent `ndim` is preferred.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> y = np.array([[4], [5], [6]])
     |      >>> b = np.broadcast(x, y)
     |      >>> b.nd
     |      2
     |
     |  ndim
     |      Number of dimensions of broadcasted result. Alias for `nd`.
     |
     |      .. versionadded:: 1.12.0
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> y = np.array([[4], [5], [6]])
     |      >>> b = np.broadcast(x, y)
     |      >>> b.ndim
     |      2
     |
     |  numiter
     |      Number of iterators possessed by the broadcasted result.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> y = np.array([[4], [5], [6]])
     |      >>> b = np.broadcast(x, y)
     |      >>> b.numiter
     |      2
     |
     |  shape
     |      Shape of broadcasted result.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> y = np.array([[4], [5], [6]])
     |      >>> b = np.broadcast(x, y)
     |      >>> b.shape
     |      (3, 3)
     |
     |  size
     |      Total size of broadcasted result.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> y = np.array([[4], [5], [6]])
     |      >>> b = np.broadcast(x, y)
     |      >>> b.size
     |      9

    class busdaycalendar(builtins.object)
     |  busdaycalendar(weekmask='1111100', holidays=None)
     |
     |  A business day calendar object that efficiently stores information
     |  defining valid days for the busday family of functions.
     |
     |  The default valid days are Monday through Friday ("business days").
     |  A busdaycalendar object can be specified with any set of weekly
     |  valid days, plus an optional "holiday" dates that always will be invalid.
     |
     |  Once a busdaycalendar object is created, the weekmask and holidays
     |  cannot be modified.
     |
     |  .. versionadded:: 1.7.0
     |
     |  Parameters
     |  ----------
     |  weekmask : str or array_like of bool, optional
     |      A seven-element array indicating which of Monday through Sunday are
     |      valid days. May be specified as a length-seven list or array, like
     |      [1,1,1,1,1,0,0]; a length-seven string, like '1111100'; or a string
     |      like "Mon Tue Wed Thu Fri", made up of 3-character abbreviations for
     |      weekdays, optionally separated by white space. Valid abbreviations
     |      are: Mon Tue Wed Thu Fri Sat Sun
     |  holidays : array_like of datetime64[D], optional
     |      An array of dates to consider as invalid dates, no matter which
     |      weekday they fall upon.  Holiday dates may be specified in any
     |      order, and NaT (not-a-time) dates are ignored.  This list is
     |      saved in a normalized form that is suited for fast calculations
     |      of valid days.
     |
     |  Returns
     |  -------
     |  out : busdaycalendar
     |      A business day calendar object containing the specified
     |      weekmask and holidays values.
     |
     |  See Also
     |  --------
     |  is_busday : Returns a boolean array indicating valid days.
     |  busday_offset : Applies an offset counted in valid days.
     |  busday_count : Counts how many valid days are in a half-open date range.
     |
     |  Attributes
     |  ----------
     |  weekmask : (copy) seven-element array of bool
     |  holidays : (copy) sorted array of datetime64[D]
     |
     |  Notes
     |  -----
     |  Once a busdaycalendar object is created, you cannot modify the
     |  weekmask or holidays.  The attributes return copies of internal data.
     |
     |  Examples
     |  --------
     |  >>> import numpy as np
     |  >>> # Some important days in July
     |  ... bdd = np.busdaycalendar(
     |  ...             holidays=['2011-07-01', '2011-07-04', '2011-07-17'])
     |  >>> # Default is Monday to Friday weekdays
     |  ... bdd.weekmask
     |  array([ True,  True,  True,  True,  True, False, False])
     |  >>> # Any holidays already on the weekend are removed
     |  ... bdd.holidays
     |  array(['2011-07-01', '2011-07-04'], dtype='datetime64[D]')
     |
     |  Methods defined here:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  holidays
     |      A copy of the holiday array indicating additional invalid days.
     |
     |  weekmask
     |      A copy of the seven-element boolean mask indicating valid days.

    byte = class int8(signedinteger)
     |  Signed integer type, compatible with C ``char``.
     |
     |  :Character code: ``'b'``
     |  :Canonical name: `numpy.byte`
     |  :Alias on this platform (win32 AMD64): `numpy.int8`: 8-bit signed integer (``-128`` to ``127``).
     |
     |  Method resolution order:
     |      int8
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int8.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int8(127).bit_count()
     |      7
     |      >>> np.int8(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class bytes_(builtins.bytes, character)
     |  A byte string.
     |
     |  When used in arrays, this type strips trailing null bytes.
     |
     |  :Character code: ``'S'``
     |
     |  Method resolution order:
     |      bytes_
     |      builtins.bytes
     |      character
     |      flexible
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.bytes:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __bytes__(self, /)
     |      Convert this value to exact type bytes.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(...)
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  capitalize(...)
     |      B.capitalize() -> copy of B
     |
     |      Return a copy of B with only its first character capitalized (ASCII)
     |      and the rest lower-cased.
     |
     |  center(self, width, fillchar=b' ', /)
     |      Return a centered string of length width.
     |
     |      Padding is done using the specified fill character.
     |
     |  count(...)
     |      B.count(sub[, start[, end]]) -> int
     |
     |      Return the number of non-overlapping occurrences of subsection sub in
     |      bytes B[start:end].  Optional arguments start and end are interpreted
     |      as in slice notation.
     |
     |  decode(self, /, encoding='utf-8', errors='strict')
     |      Decode the bytes using the codec registered for encoding.
     |
     |      encoding
     |        The encoding with which to decode the bytes.
     |      errors
     |        The error handling scheme to use for the handling of decoding errors.
     |        The default is 'strict' meaning that decoding errors raise a
     |        UnicodeDecodeError. Other possible values are 'ignore' and 'replace'
     |        as well as any other name registered with codecs.register_error that
     |        can handle UnicodeDecodeErrors.
     |
     |  endswith(...)
     |      B.endswith(suffix[, start[, end]]) -> bool
     |
     |      Return True if B ends with the specified suffix, False otherwise.
     |      With optional start, test B beginning at that position.
     |      With optional end, stop comparing B at that position.
     |      suffix can also be a tuple of bytes to try.
     |
     |  expandtabs(self, /, tabsize=8)
     |      Return a copy where all tab characters are expanded using spaces.
     |
     |      If tabsize is not given, a tab size of 8 characters is assumed.
     |
     |  find(...)
     |      B.find(sub[, start[, end]]) -> int
     |
     |      Return the lowest index in B where subsection sub is found,
     |      such that sub is contained within B[start,end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Return -1 on failure.
     |
     |  hex(...)
     |      Create a string of hexadecimal numbers from a bytes object.
     |
     |        sep
     |          An optional single character or byte to separate hex bytes.
     |        bytes_per_sep
     |          How many bytes between separators.  Positive values count from the
     |          right, negative values count from the left.
     |
     |      Example:
     |      >>> value = b'\xb9\x01\xef'
     |      >>> value.hex()
     |      'b901ef'
     |      >>> value.hex(':')
     |      'b9:01:ef'
     |      >>> value.hex(':', 2)
     |      'b9:01ef'
     |      >>> value.hex(':', -2)
     |      'b901:ef'
     |
     |  index(...)
     |      B.index(sub[, start[, end]]) -> int
     |
     |      Return the lowest index in B where subsection sub is found,
     |      such that sub is contained within B[start,end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Raises ValueError when the subsection is not found.
     |
     |  isalnum(...)
     |      B.isalnum() -> bool
     |
     |      Return True if all characters in B are alphanumeric
     |      and there is at least one character in B, False otherwise.
     |
     |  isalpha(...)
     |      B.isalpha() -> bool
     |
     |      Return True if all characters in B are alphabetic
     |      and there is at least one character in B, False otherwise.
     |
     |  isascii(...)
     |      B.isascii() -> bool
     |
     |      Return True if B is empty or all characters in B are ASCII,
     |      False otherwise.
     |
     |  isdigit(...)
     |      B.isdigit() -> bool
     |
     |      Return True if all characters in B are digits
     |      and there is at least one character in B, False otherwise.
     |
     |  islower(...)
     |      B.islower() -> bool
     |
     |      Return True if all cased characters in B are lowercase and there is
     |      at least one cased character in B, False otherwise.
     |
     |  isspace(...)
     |      B.isspace() -> bool
     |
     |      Return True if all characters in B are whitespace
     |      and there is at least one character in B, False otherwise.
     |
     |  istitle(...)
     |      B.istitle() -> bool
     |
     |      Return True if B is a titlecased string and there is at least one
     |      character in B, i.e. uppercase characters may only follow uncased
     |      characters and lowercase characters only cased ones. Return False
     |      otherwise.
     |
     |  isupper(...)
     |      B.isupper() -> bool
     |
     |      Return True if all cased characters in B are uppercase and there is
     |      at least one cased character in B, False otherwise.
     |
     |  join(self, iterable_of_bytes, /)
     |      Concatenate any number of bytes objects.
     |
     |      The bytes whose method is called is inserted in between each pair.
     |
     |      The result is returned as a new bytes object.
     |
     |      Example: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'.
     |
     |  ljust(self, width, fillchar=b' ', /)
     |      Return a left-justified string of length width.
     |
     |      Padding is done using the specified fill character.
     |
     |  lower(...)
     |      B.lower() -> copy of B
     |
     |      Return a copy of B with all ASCII characters converted to lowercase.
     |
     |  lstrip(self, bytes=None, /)
     |      Strip leading bytes contained in the argument.
     |
     |      If the argument is omitted or None, strip leading  ASCII whitespace.
     |
     |  partition(self, sep, /)
     |      Partition the bytes into three parts using the given separator.
     |
     |      This will search for the separator sep in the bytes. If the separator is found,
     |      returns a 3-tuple containing the part before the separator, the separator
     |      itself, and the part after it.
     |
     |      If the separator is not found, returns a 3-tuple containing the original bytes
     |      object and two empty bytes objects.
     |
     |  removeprefix(self, prefix, /)
     |      Return a bytes object with the given prefix string removed if present.
     |
     |      If the bytes starts with the prefix string, return bytes[len(prefix):].
     |      Otherwise, return a copy of the original bytes.
     |
     |  removesuffix(self, suffix, /)
     |      Return a bytes object with the given suffix string removed if present.
     |
     |      If the bytes ends with the suffix string and that suffix is not empty,
     |      return bytes[:-len(prefix)].  Otherwise, return a copy of the original
     |      bytes.
     |
     |  replace(self, old, new, count=-1, /)
     |      Return a copy with all occurrences of substring old replaced by new.
     |
     |        count
     |          Maximum number of occurrences to replace.
     |          -1 (the default value) means replace all occurrences.
     |
     |      If the optional argument count is given, only the first count occurrences are
     |      replaced.
     |
     |  rfind(...)
     |      B.rfind(sub[, start[, end]]) -> int
     |
     |      Return the highest index in B where subsection sub is found,
     |      such that sub is contained within B[start,end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Return -1 on failure.
     |
     |  rindex(...)
     |      B.rindex(sub[, start[, end]]) -> int
     |
     |      Return the highest index in B where subsection sub is found,
     |      such that sub is contained within B[start,end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Raise ValueError when the subsection is not found.
     |
     |  rjust(self, width, fillchar=b' ', /)
     |      Return a right-justified string of length width.
     |
     |      Padding is done using the specified fill character.
     |
     |  rpartition(self, sep, /)
     |      Partition the bytes into three parts using the given separator.
     |
     |      This will search for the separator sep in the bytes, starting at the end. If
     |      the separator is found, returns a 3-tuple containing the part before the
     |      separator, the separator itself, and the part after it.
     |
     |      If the separator is not found, returns a 3-tuple containing two empty bytes
     |      objects and the original bytes object.
     |
     |  rsplit(self, /, sep=None, maxsplit=-1)
     |      Return a list of the sections in the bytes, using sep as the delimiter.
     |
     |        sep
     |          The delimiter according which to split the bytes.
     |          None (the default value) means split on ASCII whitespace characters
     |          (space, tab, return, newline, formfeed, vertical tab).
     |        maxsplit
     |          Maximum number of splits to do.
     |          -1 (the default value) means no limit.
     |
     |      Splitting is done starting at the end of the bytes and working to the front.
     |
     |  rstrip(self, bytes=None, /)
     |      Strip trailing bytes contained in the argument.
     |
     |      If the argument is omitted or None, strip trailing ASCII whitespace.
     |
     |  split(self, /, sep=None, maxsplit=-1)
     |      Return a list of the sections in the bytes, using sep as the delimiter.
     |
     |      sep
     |        The delimiter according which to split the bytes.
     |        None (the default value) means split on ASCII whitespace characters
     |        (space, tab, return, newline, formfeed, vertical tab).
     |      maxsplit
     |        Maximum number of splits to do.
     |        -1 (the default value) means no limit.
     |
     |  splitlines(self, /, keepends=False)
     |      Return a list of the lines in the bytes, breaking at line boundaries.
     |
     |      Line breaks are not included in the resulting list unless keepends is given and
     |      true.
     |
     |  startswith(...)
     |      B.startswith(prefix[, start[, end]]) -> bool
     |
     |      Return True if B starts with the specified prefix, False otherwise.
     |      With optional start, test B beginning at that position.
     |      With optional end, stop comparing B at that position.
     |      prefix can also be a tuple of bytes to try.
     |
     |  strip(self, bytes=None, /)
     |      Strip leading and trailing bytes contained in the argument.
     |
     |      If the argument is omitted or None, strip leading and trailing ASCII whitespace.
     |
     |  swapcase(...)
     |      B.swapcase() -> copy of B
     |
     |      Return a copy of B with uppercase ASCII characters converted
     |      to lowercase ASCII and vice versa.
     |
     |  title(...)
     |      B.title() -> copy of B
     |
     |      Return a titlecased version of B, i.e. ASCII words start with uppercase
     |      characters, all remaining cased characters have lowercase.
     |
     |  translate(self, table, /, delete=b'')
     |      Return a copy with each character mapped by the given translation table.
     |
     |        table
     |          Translation table, which must be a bytes object of length 256.
     |
     |      All characters occurring in the optional argument delete are removed.
     |      The remaining characters are mapped through the given translation table.
     |
     |  upper(...)
     |      B.upper() -> copy of B
     |
     |      Return a copy of B with all ASCII characters converted to uppercase.
     |
     |  zfill(self, width, /)
     |      Pad a numeric string with zeros on the left, to fill a field of the given width.
     |
     |      The original string is never truncated.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.bytes:
     |
     |  fromhex(string, /)
     |      Create a bytes object from a string of hexadecimal numbers.
     |
     |      Spaces between two numbers are accepted.
     |      Example: bytes.fromhex('B9 01EF') -> b'\\xb9\\x01\\xef'.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.bytes:
     |
     |  maketrans(frm, to, /)
     |      Return a translation table useable for the bytes or bytearray translate method.
     |
     |      The returned table will be one where each byte in frm is mapped to the byte at
     |      the same position in to.
     |
     |      The bytes objects frm and to must be of the same length.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    cdouble = class complex128(complexfloating, builtins.complex)
     |  cdouble(real=0, imag=0)
     |
     |  Complex number type composed of two double-precision floating-point
     |  numbers, compatible with Python :class:`complex`.
     |
     |  :Character code: ``'D'``
     |  :Canonical name: `numpy.cdouble`
     |  :Alias on this platform (win32 AMD64): `numpy.complex128`: Complex number type composed of 2 64-bit-precision floating-point numbers.
     |
     |  Method resolution order:
     |      complex128
     |      complexfloating
     |      inexact
     |      number
     |      generic
     |      builtins.complex
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from complexfloating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.complex:
     |
     |  __complex__(self, /)
     |      Convert this value to exact type complex.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getnewargs__(self, /)

    class character(flexible)
     |  Abstract base class of all character string scalar types.
     |
     |  Method resolution order:
     |      character
     |      flexible
     |      generic
     |      builtins.object
     |
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from generic:
     |
     |  __hash__ = None

    class clongdouble(complexfloating)
     |  Complex number type composed of two extended-precision floating-point
     |  numbers.
     |
     |  :Character code: ``'G'``
     |
     |  Method resolution order:
     |      clongdouble
     |      complexfloating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __complex__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from complexfloating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class complex128(complexfloating, builtins.complex)
     |  complex128(real=0, imag=0)
     |
     |  Complex number type composed of two double-precision floating-point
     |  numbers, compatible with Python :class:`complex`.
     |
     |  :Character code: ``'D'``
     |  :Canonical name: `numpy.cdouble`
     |  :Alias on this platform (win32 AMD64): `numpy.complex128`: Complex number type composed of 2 64-bit-precision floating-point numbers.
     |
     |  Method resolution order:
     |      complex128
     |      complexfloating
     |      inexact
     |      number
     |      generic
     |      builtins.complex
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from complexfloating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.complex:
     |
     |  __complex__(self, /)
     |      Convert this value to exact type complex.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getnewargs__(self, /)

    class complex64(complexfloating)
     |  Complex number type composed of two single-precision floating-point
     |  numbers.
     |
     |  :Character code: ``'F'``
     |  :Canonical name: `numpy.csingle`
     |  :Alias on this platform (win32 AMD64): `numpy.complex64`: Complex number type composed of 2 32-bit-precision floating-point numbers.
     |
     |  Method resolution order:
     |      complex64
     |      complexfloating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __complex__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from complexfloating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class complexfloating(inexact)
     |  Abstract base class of all complex number scalar types that are made up of
     |  floating-point numbers.
     |
     |  Method resolution order:
     |      complexfloating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from number:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from generic:
     |
     |  __hash__ = None

    csingle = class complex64(complexfloating)
     |  Complex number type composed of two single-precision floating-point
     |  numbers.
     |
     |  :Character code: ``'F'``
     |  :Canonical name: `numpy.csingle`
     |  :Alias on this platform (win32 AMD64): `numpy.complex64`: Complex number type composed of 2 32-bit-precision floating-point numbers.
     |
     |  Method resolution order:
     |      complex64
     |      complexfloating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __complex__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from complexfloating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class datetime64(generic)
     |  If created from a 64-bit integer, it represents an offset from
     |  ``1970-01-01T00:00:00``.
     |  If created from string, the string can be in ISO 8601 date
     |  or datetime format.
     |
     |  When parsing a string to create a datetime object, if the string contains
     |  a trailing timezone (A 'Z' or a timezone offset), the timezone will be
     |  dropped and a User Warning is given.
     |
     |  Datetime64 objects should be considered to be UTC and therefore have an
     |  offset of +0000.
     |
     |  >>> np.datetime64(10, 'Y')
     |  np.datetime64('1980')
     |  >>> np.datetime64('1980', 'Y')
     |  np.datetime64('1980')
     |  >>> np.datetime64(10, 'D')
     |  np.datetime64('1970-01-11')
     |
     |  See :ref:`arrays.datetime` for more information.
     |
     |  :Character code: ``'M'``
     |
     |  Method resolution order:
     |      datetime64
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    double = class float64(floating, builtins.float)
     |  double(x=0, /)
     |
     |  Double-precision floating-point number type, compatible with Python
     |  :class:`float` and C ``double``.
     |
     |  :Character code: ``'d'``
     |  :Canonical name: `numpy.double`
     |  :Alias on this platform (win32 AMD64): `numpy.float64`: 64-bit precision floating-point number type: sign bit, 11 bits exponent, 52 bits mantissa.
     |
     |  Method resolution order:
     |      float64
     |      floating
     |      inexact
     |      number
     |      generic
     |      builtins.float
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  as_integer_ratio(...)
     |      double.as_integer_ratio() -> (int, int)
     |
     |      Return a pair of integers, whose ratio is exactly equal to the original
     |      floating point number, and with a positive denominator.
     |      Raise `OverflowError` on infinities and a `ValueError` on NaNs.
     |
     |      >>> np.double(10.0).as_integer_ratio()
     |      (10, 1)
     |      >>> np.double(0.0).as_integer_ratio()
     |      (0, 1)
     |      >>> np.double(-.25).as_integer_ratio()
     |      (-1, 4)
     |
     |  is_integer(...)
     |      double.is_integer() -> bool
     |
     |      Return ``True`` if the floating point number is finite with integral
     |      value, and ``False`` otherwise.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> np.double(-2.0).is_integer()
     |      True
     |      >>> np.double(3.2).is_integer()
     |      False
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from floating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.float:
     |
     |  __ceil__(self, /)
     |      Return the ceiling as an Integral.
     |
     |  __floor__(self, /)
     |      Return the floor as an Integral.
     |
     |  __getnewargs__(self, /)
     |
     |  __trunc__(self, /)
     |      Return the Integral closest to x between 0 and x.
     |
     |  hex(self, /)
     |      Return a hexadecimal representation of a floating-point number.
     |
     |      >>> (-0.1).hex()
     |      '-0x1.999999999999ap-4'
     |      >>> 3.14159.hex()
     |      '0x1.921f9f01b866ep+1'
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.float:
     |
     |  __getformat__(typestr, /)
     |      You probably don't want to use this function.
     |
     |        typestr
     |          Must be 'double' or 'float'.
     |
     |      It exists mainly to be used in Python's test suite.
     |
     |      This function returns whichever of 'unknown', 'IEEE, big-endian' or 'IEEE,
     |      little-endian' best describes the format of floating-point numbers used by the
     |      C type named by typestr.
     |
     |  fromhex(string, /)
     |      Create a floating-point number from a hexadecimal string.
     |
     |      >>> float.fromhex('0x1.ffffp10')
     |      2047.984375
     |      >>> float.fromhex('-0x1p-1074')
     |      -5e-324

    class dtype(builtins.object)
     |  dtype(dtype, align=False, copy=False, [metadata])
     |
     |  Create a data type object.
     |
     |  A numpy array is homogeneous, and contains elements described by a
     |  dtype object. A dtype object can be constructed from different
     |  combinations of fundamental numeric types.
     |
     |  Parameters
     |  ----------
     |  dtype
     |      Object to be converted to a data type object.
     |  align : bool, optional
     |      Add padding to the fields to match what a C compiler would output
     |      for a similar C-struct. Can be ``True`` only if `obj` is a dictionary
     |      or a comma-separated string. If a struct dtype is being created,
     |      this also sets a sticky alignment flag ``isalignedstruct``.
     |  copy : bool, optional
     |      Make a new copy of the data-type object. If ``False``, the result
     |      may just be a reference to a built-in data-type object.
     |  metadata : dict, optional
     |      An optional dictionary with dtype metadata.
     |
     |  See also
     |  --------
     |  result_type
     |
     |  Examples
     |  --------
     |  Using array-scalar type:
     |
     |  >>> import numpy as np
     |  >>> np.dtype(np.int16)
     |  dtype('int16')
     |
     |  Structured type, one field name 'f1', containing int16:
     |
     |  >>> np.dtype([('f1', np.int16)])
     |  dtype([('f1', '<i2')])
     |
     |  Structured type, one field named 'f1', in itself containing a structured
     |  type with one field:
     |
     |  >>> np.dtype([('f1', [('f1', np.int16)])])
     |  dtype([('f1', [('f1', '<i2')])])
     |
     |  Structured type, two fields: the first field contains an unsigned int, the
     |  second an int32:
     |
     |  >>> np.dtype([('f1', np.uint64), ('f2', np.int32)])
     |  dtype([('f1', '<u8'), ('f2', '<i4')])
     |
     |  Using array-protocol type strings:
     |
     |  >>> np.dtype([('a','f8'),('b','S10')])
     |  dtype([('a', '<f8'), ('b', 'S10')])
     |
     |  Using comma-separated field formats.  The shape is (2,3):
     |
     |  >>> np.dtype("i4, (2,3)f8")
     |  dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))])
     |
     |  Using tuples.  ``int`` is a fixed type, 3 the field's shape.  ``void``
     |  is a flexible type, here of size 10:
     |
     |  >>> np.dtype([('hello',(np.int64,3)),('world',np.void,10)])
     |  dtype([('hello', '<i8', (3,)), ('world', 'V10')])
     |
     |  Subdivide ``int16`` into 2 ``int8``'s, called x and y.  0 and 1 are
     |  the offsets in bytes:
     |
     |  >>> np.dtype((np.int16, {'x':(np.int8,0), 'y':(np.int8,1)}))
     |  dtype((numpy.int16, [('x', 'i1'), ('y', 'i1')]))
     |
     |  Using dictionaries.  Two fields named 'gender' and 'age':
     |
     |  >>> np.dtype({'names':['gender','age'], 'formats':['S1',np.uint8]})
     |  dtype([('gender', 'S1'), ('age', 'u1')])
     |
     |  Offsets in bytes, here 0 and 25:
     |
     |  >>> np.dtype({'surname':('S25',0),'age':(np.uint8,25)})
     |  dtype([('surname', 'S25'), ('age', 'u1')])
     |
     |  Methods defined here:
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  newbyteorder(...)
     |      newbyteorder(new_order='S', /)
     |
     |      Return a new dtype with a different byte order.
     |
     |      Changes are also made in all fields and sub-arrays of the data type.
     |
     |      Parameters
     |      ----------
     |      new_order : string, optional
     |          Byte order to force; a value from the byte order specifications
     |          below.  The default value ('S') results in swapping the current
     |          byte order.  `new_order` codes can be any of:
     |
     |          * 'S' - swap dtype from current to opposite endian
     |          * {'<', 'little'} - little endian
     |          * {'>', 'big'} - big endian
     |          * {'=', 'native'} - native order
     |          * {'|', 'I'} - ignore (no change to byte order)
     |
     |      Returns
     |      -------
     |      new_dtype : dtype
     |          New dtype object with the given change to the byte order.
     |
     |      Notes
     |      -----
     |      Changes are also made in all fields and sub-arrays of the data type.
     |
     |      Examples
     |      --------
     |      >>> import sys
     |      >>> sys_is_le = sys.byteorder == 'little'
     |      >>> native_code = '<' if sys_is_le else '>'
     |      >>> swapped_code = '>' if sys_is_le else '<'
     |      >>> import numpy as np
     |      >>> native_dt = np.dtype(native_code+'i2')
     |      >>> swapped_dt = np.dtype(swapped_code+'i2')
     |      >>> native_dt.newbyteorder('S') == swapped_dt
     |      True
     |      >>> native_dt.newbyteorder() == swapped_dt
     |      True
     |      >>> native_dt == swapped_dt.newbyteorder('S')
     |      True
     |      >>> native_dt == swapped_dt.newbyteorder('=')
     |      True
     |      >>> native_dt == swapped_dt.newbyteorder('N')
     |      True
     |      >>> native_dt == native_dt.newbyteorder('|')
     |      True
     |      >>> np.dtype('<i2') == native_dt.newbyteorder('<')
     |      True
     |      >>> np.dtype('<i2') == native_dt.newbyteorder('L')
     |      True
     |      >>> np.dtype('>i2') == native_dt.newbyteorder('>')
     |      True
     |      >>> np.dtype('>i2') == native_dt.newbyteorder('B')
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.dtype` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.dtype` type.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |
     |      >>> np.dtype[np.int64]
     |      numpy.dtype[numpy.int64]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  alignment
     |      The required alignment (bytes) of this data-type according to the compiler.
     |
     |      More information is available in the C-API section of the manual.
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> x = np.dtype('i4')
     |      >>> x.alignment
     |      4
     |
     |      >>> x = np.dtype(float)
     |      >>> x.alignment
     |      8
     |
     |  base
     |      Returns dtype for the base element of the subarrays,
     |      regardless of their dimension or shape.
     |
     |      See Also
     |      --------
     |      dtype.subdtype
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = numpy.dtype('8f')
     |      >>> x.base
     |      dtype('float32')
     |
     |      >>> x =  numpy.dtype('i2')
     |      >>> x.base
     |      dtype('int16')
     |
     |  byteorder
     |      A character indicating the byte-order of this data-type object.
     |
     |      One of:
     |
     |      ===  ==============
     |      '='  native
     |      '<'  little-endian
     |      '>'  big-endian
     |      '|'  not applicable
     |      ===  ==============
     |
     |      All built-in data-type objects have byteorder either '=' or '|'.
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> dt = np.dtype('i2')
     |      >>> dt.byteorder
     |      '='
     |      >>> # endian is not relevant for 8 bit numbers
     |      >>> np.dtype('i1').byteorder
     |      '|'
     |      >>> # or ASCII strings
     |      >>> np.dtype('S2').byteorder
     |      '|'
     |      >>> # Even if specific code is given, and it is native
     |      >>> # '=' is the byteorder
     |      >>> import sys
     |      >>> sys_is_le = sys.byteorder == 'little'
     |      >>> native_code = '<' if sys_is_le else '>'
     |      >>> swapped_code = '>' if sys_is_le else '<'
     |      >>> dt = np.dtype(native_code + 'i2')
     |      >>> dt.byteorder
     |      '='
     |      >>> # Swapped code shows up as itself
     |      >>> dt = np.dtype(swapped_code + 'i2')
     |      >>> dt.byteorder == swapped_code
     |      True
     |
     |  char
     |      A unique character code for each of the 21 different built-in types.
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> x = np.dtype(float)
     |      >>> x.char
     |      'd'
     |
     |  descr
     |      `__array_interface__` description of the data-type.
     |
     |      The format is that required by the 'descr' key in the
     |      `__array_interface__` attribute.
     |
     |      Warning: This attribute exists specifically for `__array_interface__`,
     |      and passing it directly to `numpy.dtype` will not accurately reconstruct
     |      some dtypes (e.g., scalar and subarray dtypes).
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> x = np.dtype(float)
     |      >>> x.descr
     |      [('', '<f8')]
     |
     |      >>> dt = np.dtype([('name', np.str_, 16), ('grades', np.float64, (2,))])
     |      >>> dt.descr
     |      [('name', '<U16'), ('grades', '<f8', (2,))]
     |
     |  fields
     |      Dictionary of named fields defined for this data type, or ``None``.
     |
     |      The dictionary is indexed by keys that are the names of the fields.
     |      Each entry in the dictionary is a tuple fully describing the field::
     |
     |        (dtype, offset[, title])
     |
     |      Offset is limited to C int, which is signed and usually 32 bits.
     |      If present, the optional title can be any object (if it is a string
     |      or unicode then it will also be a key in the fields dictionary,
     |      otherwise it's meta-data). Notice also that the first two elements
     |      of the tuple can be passed directly as arguments to the
     |      ``ndarray.getfield`` and ``ndarray.setfield`` methods.
     |
     |      See Also
     |      --------
     |      ndarray.getfield, ndarray.setfield
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> dt = np.dtype([('name', np.str_, 16), ('grades', np.float64, (2,))])
     |      >>> print(dt.fields)
     |      {'grades': (dtype(('float64',(2,))), 16), 'name': (dtype('|S16'), 0)}
     |
     |  flags
     |      Bit-flags describing how this data type is to be interpreted.
     |
     |      Bit-masks are in ``numpy._core.multiarray`` as the constants
     |      `ITEM_HASOBJECT`, `LIST_PICKLE`, `ITEM_IS_POINTER`, `NEEDS_INIT`,
     |      `NEEDS_PYAPI`, `USE_GETITEM`, `USE_SETITEM`. A full explanation
     |      of these flags is in C-API documentation; they are largely useful
     |      for user-defined data-types.
     |
     |      The following example demonstrates that operations on this particular
     |      dtype requires Python C-API.
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> x = np.dtype([('a', np.int32, 8), ('b', np.float64, 6)])
     |      >>> x.flags
     |      16
     |      >>> np._core.multiarray.NEEDS_PYAPI
     |      16
     |
     |  hasobject
     |      Boolean indicating whether this dtype contains any reference-counted
     |      objects in any fields or sub-dtypes.
     |
     |      Recall that what is actually in the ndarray memory representing
     |      the Python object is the memory address of that object (a pointer).
     |      Special handling may be required, and this attribute is useful for
     |      distinguishing data types that may contain arbitrary Python objects
     |      and data-types that won't.
     |
     |  isalignedstruct
     |      Boolean indicating whether the dtype is a struct which maintains
     |      field alignment. This flag is sticky, so when combining multiple
     |      structs together, it is preserved and produces new dtypes which
     |      are also aligned.
     |
     |  isbuiltin
     |      Integer indicating how this dtype relates to the built-in dtypes.
     |
     |      Read-only.
     |
     |      =  ========================================================================
     |      0  if this is a structured array type, with fields
     |      1  if this is a dtype compiled into numpy (such as ints, floats etc)
     |      2  if the dtype is for a user-defined numpy type
     |         A user-defined type uses the numpy C-API machinery to extend
     |         numpy to handle a new array type. See
     |         :ref:`user.user-defined-data-types` in the NumPy manual.
     |      =  ========================================================================
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> dt = np.dtype('i2')
     |      >>> dt.isbuiltin
     |      1
     |      >>> dt = np.dtype('f8')
     |      >>> dt.isbuiltin
     |      1
     |      >>> dt = np.dtype([('field1', 'f8')])
     |      >>> dt.isbuiltin
     |      0
     |
     |  isnative
     |      Boolean indicating whether the byte order of this dtype is native
     |      to the platform.
     |
     |  itemsize
     |      The element size of this data-type object.
     |
     |      For 18 of the 21 types this number is fixed by the data-type.
     |      For the flexible data-types, this number can be anything.
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> arr = np.array([[1, 2], [3, 4]])
     |      >>> arr.dtype
     |      dtype('int64')
     |      >>> arr.itemsize
     |      8
     |
     |      >>> dt = np.dtype([('name', np.str_, 16), ('grades', np.float64, (2,))])
     |      >>> dt.itemsize
     |      80
     |
     |  kind
     |      A character code (one of 'biufcmMOSUV') identifying the general kind of data.
     |
     |      =  ======================
     |      b  boolean
     |      i  signed integer
     |      u  unsigned integer
     |      f  floating-point
     |      c  complex floating-point
     |      m  timedelta
     |      M  datetime
     |      O  object
     |      S  (byte-)string
     |      U  Unicode
     |      V  void
     |      =  ======================
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> dt = np.dtype('i4')
     |      >>> dt.kind
     |      'i'
     |      >>> dt = np.dtype('f8')
     |      >>> dt.kind
     |      'f'
     |      >>> dt = np.dtype([('field1', 'f8')])
     |      >>> dt.kind
     |      'V'
     |
     |  metadata
     |      Either ``None`` or a readonly dictionary of metadata (mappingproxy).
     |
     |      The metadata field can be set using any dictionary at data-type
     |      creation. NumPy currently has no uniform approach to propagating
     |      metadata; although some array operations preserve it, there is no
     |      guarantee that others will.
     |
     |      .. warning::
     |
     |          Although used in certain projects, this feature was long undocumented
     |          and is not well supported. Some aspects of metadata propagation
     |          are expected to change in the future.
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> dt = np.dtype(float, metadata={"key": "value"})
     |      >>> dt.metadata["key"]
     |      'value'
     |      >>> arr = np.array([1, 2, 3], dtype=dt)
     |      >>> arr.dtype.metadata
     |      mappingproxy({'key': 'value'})
     |
     |      Adding arrays with identical datatypes currently preserves the metadata:
     |
     |      >>> (arr + arr).dtype.metadata
     |      mappingproxy({'key': 'value'})
     |
     |      But if the arrays have different dtype metadata, the metadata may be
     |      dropped:
     |
     |      >>> dt2 = np.dtype(float, metadata={"key2": "value2"})
     |      >>> arr2 = np.array([3, 2, 1], dtype=dt2)
     |      >>> (arr + arr2).dtype.metadata is None
     |      True  # The metadata field is cleared so None is returned
     |
     |  name
     |      A bit-width name for this data-type.
     |
     |      Un-sized flexible data-type objects do not have this attribute.
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> x = np.dtype(float)
     |      >>> x.name
     |      'float64'
     |      >>> x = np.dtype([('a', np.int32, 8), ('b', np.float64, 6)])
     |      >>> x.name
     |      'void640'
     |
     |  names
     |      Ordered list of field names, or ``None`` if there are no fields.
     |
     |      The names are ordered according to increasing byte offset. This can be
     |      used, for example, to walk through all of the named fields in offset order.
     |
     |      Examples
     |      --------
     |      >>> dt = np.dtype([('name', np.str_, 16), ('grades', np.float64, (2,))])
     |      >>> dt.names
     |      ('name', 'grades')
     |
     |  ndim
     |      Number of dimensions of the sub-array if this data type describes a
     |      sub-array, and ``0`` otherwise.
     |
     |      .. versionadded:: 1.13.0
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.dtype(float)
     |      >>> x.ndim
     |      0
     |
     |      >>> x = np.dtype((float, 8))
     |      >>> x.ndim
     |      1
     |
     |      >>> x = np.dtype(('i4', (3, 4)))
     |      >>> x.ndim
     |      2
     |
     |  num
     |      A unique number for each of the 21 different built-in types.
     |
     |      These are roughly ordered from least-to-most precision.
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> dt = np.dtype(str)
     |      >>> dt.num
     |      19
     |
     |      >>> dt = np.dtype(float)
     |      >>> dt.num
     |      12
     |
     |  shape
     |      Shape tuple of the sub-array if this data type describes a sub-array,
     |      and ``()`` otherwise.
     |
     |      Examples
     |      --------
     |
     |      >>> import numpy as np
     |      >>> dt = np.dtype(('i4', 4))
     |      >>> dt.shape
     |      (4,)
     |
     |      >>> dt = np.dtype(('i4', (2, 3)))
     |      >>> dt.shape
     |      (2, 3)
     |
     |  str
     |      The array-protocol typestring of this data-type object.
     |
     |  subdtype
     |      Tuple ``(item_dtype, shape)`` if this `dtype` describes a sub-array, and
     |      None otherwise.
     |
     |      The *shape* is the fixed shape of the sub-array described by this
     |      data type, and *item_dtype* the data type of the array.
     |
     |      If a field whose dtype object has this attribute is retrieved,
     |      then the extra dimensions implied by *shape* are tacked on to
     |      the end of the retrieved array.
     |
     |      See Also
     |      --------
     |      dtype.base
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = numpy.dtype('8f')
     |      >>> x.subdtype
     |      (dtype('float32'), (8,))
     |
     |      >>> x =  numpy.dtype('i2')
     |      >>> x.subdtype
     |      >>>
     |
     |  type

    class errstate(builtins.object)
     |  errstate(*, call=<numpy._core._ufunc_config._unspecified object at 0x0000028F8B72FE60>, all=None, divide=None, over=None, under=None, invalid=None)
     |
     |  errstate(**kwargs)
     |
     |  Context manager for floating-point error handling.
     |
     |  Using an instance of `errstate` as a context manager allows statements in
     |  that context to execute with a known error handling behavior. Upon entering
     |  the context the error handling is set with `seterr` and `seterrcall`, and
     |  upon exiting it is reset to what it was before.
     |
     |  ..  versionchanged:: 1.17.0
     |      `errstate` is also usable as a function decorator, saving
     |      a level of indentation if an entire function is wrapped.
     |
     |  .. versionchanged:: 2.0
     |      `errstate` is now fully thread and asyncio safe, but may not be
     |      entered more than once.
     |      It is not safe to decorate async functions using ``errstate``.
     |
     |  Parameters
     |  ----------
     |  kwargs : {divide, over, under, invalid}
     |      Keyword arguments. The valid keywords are the possible floating-point
     |      exceptions. Each keyword should have a string value that defines the
     |      treatment for the particular error. Possible values are
     |      {'ignore', 'warn', 'raise', 'call', 'print', 'log'}.
     |
     |  See Also
     |  --------
     |  seterr, geterr, seterrcall, geterrcall
     |
     |  Notes
     |  -----
     |  For complete documentation of the types of floating-point exceptions and
     |  treatment options, see `seterr`.
     |
     |  Examples
     |  --------
     |  >>> import numpy as np
     |  >>> olderr = np.seterr(all='ignore')  # Set error handling to known state.
     |
     |  >>> np.arange(3) / 0.
     |  array([nan, inf, inf])
     |  >>> with np.errstate(divide='ignore'):
     |  ...     np.arange(3) / 0.
     |  array([nan, inf, inf])
     |
     |  >>> np.sqrt(-1)
     |  np.float64(nan)
     |  >>> with np.errstate(invalid='raise'):
     |  ...     np.sqrt(-1)
     |  Traceback (most recent call last):
     |    File "<stdin>", line 2, in <module>
     |  FloatingPointError: invalid value encountered in sqrt
     |
     |  Outside the context the error handling behavior has not changed:
     |
     |  >>> np.geterr()
     |  {'divide': 'ignore', 'over': 'ignore', 'under': 'ignore', 'invalid': 'ignore'}
     |  >>> olderr = np.seterr(**olderr)  # restore original state
     |
     |  Methods defined here:
     |
     |  __call__(self, func) from numpy._core._ufunc_config.errstate
     |      Call self as a function.
     |
     |  __enter__(self) from numpy._core._ufunc_config.errstate
     |
     |  __exit__(self, *exc_info) from numpy._core._ufunc_config.errstate
     |
     |  __init__(self, *, call=<numpy._core._ufunc_config._unspecified object at 0x0000028F8B72FE60>, all=None, divide=None, over=None, under=None, invalid=None) from numpy._core._ufunc_config.errstate
     |      Initialize self.  See help(type(self)) for accurate signature.

    class finfo(builtins.object)
     |  finfo(dtype)
     |
     |  finfo(dtype)
     |
     |  Machine limits for floating point types.
     |
     |  Attributes
     |  ----------
     |  bits : int
     |      The number of bits occupied by the type.
     |  dtype : dtype
     |      Returns the dtype for which `finfo` returns information. For complex
     |      input, the returned dtype is the associated ``float*`` dtype for its
     |      real and complex components.
     |  eps : float
     |      The difference between 1.0 and the next smallest representable float
     |      larger than 1.0. For example, for 64-bit binary floats in the IEEE-754
     |      standard, ``eps = 2**-52``, approximately 2.22e-16.
     |  epsneg : float
     |      The difference between 1.0 and the next smallest representable float
     |      less than 1.0. For example, for 64-bit binary floats in the IEEE-754
     |      standard, ``epsneg = 2**-53``, approximately 1.11e-16.
     |  iexp : int
     |      The number of bits in the exponent portion of the floating point
     |      representation.
     |  machep : int
     |      The exponent that yields `eps`.
     |  max : floating point number of the appropriate type
     |      The largest representable number.
     |  maxexp : int
     |      The smallest positive power of the base (2) that causes overflow.
     |  min : floating point number of the appropriate type
     |      The smallest representable number, typically ``-max``.
     |  minexp : int
     |      The most negative power of the base (2) consistent with there
     |      being no leading 0's in the mantissa.
     |  negep : int
     |      The exponent that yields `epsneg`.
     |  nexp : int
     |      The number of bits in the exponent including its sign and bias.
     |  nmant : int
     |      The number of bits in the mantissa.
     |  precision : int
     |      The approximate number of decimal digits to which this kind of
     |      float is precise.
     |  resolution : floating point number of the appropriate type
     |      The approximate decimal resolution of this type, i.e.,
     |      ``10**-precision``.
     |  tiny : float
     |      An alias for `smallest_normal`, kept for backwards compatibility.
     |  smallest_normal : float
     |      The smallest positive floating point number with 1 as leading bit in
     |      the mantissa following IEEE-754 (see Notes).
     |  smallest_subnormal : float
     |      The smallest positive floating point number with 0 as leading bit in
     |      the mantissa following IEEE-754.
     |
     |  Parameters
     |  ----------
     |  dtype : float, dtype, or instance
     |      Kind of floating point or complex floating point
     |      data-type about which to get information.
     |
     |  See Also
     |  --------
     |  iinfo : The equivalent for integer data types.
     |  spacing : The distance between a value and the nearest adjacent number
     |  nextafter : The next floating point value after x1 towards x2
     |
     |  Notes
     |  -----
     |  For developers of NumPy: do not instantiate this at the module level.
     |  The initial calculation of these parameters is expensive and negatively
     |  impacts import times.  These objects are cached, so calling ``finfo()``
     |  repeatedly inside your functions is not a problem.
     |
     |  Note that ``smallest_normal`` is not actually the smallest positive
     |  representable value in a NumPy floating point type. As in the IEEE-754
     |  standard [1]_, NumPy floating point types make use of subnormal numbers to
     |  fill the gap between 0 and ``smallest_normal``. However, subnormal numbers
     |  may have significantly reduced precision [2]_.
     |
     |  This function can also be used for complex data types as well. If used,
     |  the output will be the same as the corresponding real float type
     |  (e.g. numpy.finfo(numpy.csingle) is the same as numpy.finfo(numpy.single)).
     |  However, the output is true for the real and imaginary components.
     |
     |  References
     |  ----------
     |  .. [1] IEEE Standard for Floating-Point Arithmetic, IEEE Std 754-2008,
     |         pp.1-70, 2008, https://doi.org/10.1109/IEEESTD.2008.4610935
     |  .. [2] Wikipedia, "Denormal Numbers",
     |         https://en.wikipedia.org/wiki/Denormal_number
     |
     |  Examples
     |  --------
     |  >>> import numpy as np
     |  >>> np.finfo(np.float64).dtype
     |  dtype('float64')
     |  >>> np.finfo(np.complex64).dtype
     |  dtype('float32')
     |
     |  Methods defined here:
     |
     |  __repr__(self) from numpy._core.getlimits.finfo
     |      Return repr(self).
     |
     |  __str__(self) from numpy._core.getlimits.finfo
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(cls, dtype) from numpy._core.getlimits.finfo
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  smallest_normal
     |      Return the value for the smallest normal.
     |
     |      Returns
     |      -------
     |      smallest_normal : float
     |          Value for the smallest normal.
     |
     |      Warns
     |      -----
     |      UserWarning
     |          If the calculated value for the smallest normal is requested for
     |          double-double.
     |
     |  tiny
     |      Return the value for tiny, alias of smallest_normal.
     |
     |      Returns
     |      -------
     |      tiny : float
     |          Value for the smallest normal, alias of smallest_normal.
     |
     |      Warns
     |      -----
     |      UserWarning
     |          If the calculated value for the smallest normal is requested for
     |          double-double.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class flatiter(builtins.object)
     |  Flat iterator object to iterate over arrays.
     |
     |  A `flatiter` iterator is returned by ``x.flat`` for any array `x`.
     |  It allows iterating over the array as if it were a 1-D array,
     |  either in a for-loop or by calling its `next` method.
     |
     |  Iteration is done in row-major, C-style order (the last
     |  index varying the fastest). The iterator can also be indexed using
     |  basic slicing or advanced indexing.
     |
     |  See Also
     |  --------
     |  ndarray.flat : Return a flat iterator over an array.
     |  ndarray.flatten : Returns a flattened copy of an array.
     |
     |  Notes
     |  -----
     |  A `flatiter` iterator can not be constructed directly from Python code
     |  by calling the `flatiter` constructor.
     |
     |  Examples
     |  --------
     |  >>> import numpy as np
     |  >>> x = np.arange(6).reshape(2, 3)
     |  >>> fl = x.flat
     |  >>> type(fl)
     |  <class 'numpy.flatiter'>
     |  >>> for item in fl:
     |  ...     print(item)
     |  ...
     |  0
     |  1
     |  2
     |  3
     |  4
     |  5
     |
     |  >>> fl[2:4]
     |  array([2, 3])
     |
     |  Methods defined here:
     |
     |  __array__(...)
     |      __array__(type=None) Get array from iterator
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __next__(self, /)
     |      Implement next(self).
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  copy(...)
     |      copy()
     |
     |      Get a copy of the iterator as a 1-D array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.arange(6).reshape(2, 3)
     |      >>> x
     |      array([[0, 1, 2],
     |             [3, 4, 5]])
     |      >>> fl = x.flat
     |      >>> fl.copy()
     |      array([0, 1, 2, 3, 4, 5])
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  base
     |      A reference to the array that is iterated over.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.arange(5)
     |      >>> fl = x.flat
     |      >>> fl.base is x
     |      True
     |
     |  coords
     |      An N-dimensional tuple of current coordinates.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.arange(6).reshape(2, 3)
     |      >>> fl = x.flat
     |      >>> fl.coords
     |      (0, 0)
     |      >>> next(fl)
     |      0
     |      >>> fl.coords
     |      (0, 1)
     |
     |  index
     |      Current flat index into the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.arange(6).reshape(2, 3)
     |      >>> fl = x.flat
     |      >>> fl.index
     |      0
     |      >>> next(fl)
     |      0
     |      >>> fl.index
     |      1
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None

    class flexible(generic)
     |  Abstract base class of all scalar types without predefined length.
     |  The actual size of these types depends on the specific `numpy.dtype`
     |  instantiation.
     |
     |  Method resolution order:
     |      flexible
     |      generic
     |      builtins.object
     |
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from generic:
     |
     |  __hash__ = None

    class float16(floating)
     |  Half-precision floating-point number type.
     |
     |  :Character code: ``'e'``
     |  :Canonical name: `numpy.half`
     |  :Alias on this platform (win32 AMD64): `numpy.float16`: 16-bit-precision floating-point number type: sign bit, 5 bits exponent, 10 bits mantissa.
     |
     |  Method resolution order:
     |      float16
     |      floating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  as_integer_ratio(...)
     |      half.as_integer_ratio() -> (int, int)
     |
     |      Return a pair of integers, whose ratio is exactly equal to the original
     |      floating point number, and with a positive denominator.
     |      Raise `OverflowError` on infinities and a `ValueError` on NaNs.
     |
     |      >>> np.half(10.0).as_integer_ratio()
     |      (10, 1)
     |      >>> np.half(0.0).as_integer_ratio()
     |      (0, 1)
     |      >>> np.half(-.25).as_integer_ratio()
     |      (-1, 4)
     |
     |  is_integer(...)
     |      half.is_integer() -> bool
     |
     |      Return ``True`` if the floating point number is finite with integral
     |      value, and ``False`` otherwise.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> np.half(-2.0).is_integer()
     |      True
     |      >>> np.half(3.2).is_integer()
     |      False
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from floating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class float32(floating)
     |  Single-precision floating-point number type, compatible with C ``float``.
     |
     |  :Character code: ``'f'``
     |  :Canonical name: `numpy.single`
     |  :Alias on this platform (win32 AMD64): `numpy.float32`: 32-bit-precision floating-point number type: sign bit, 8 bits exponent, 23 bits mantissa.
     |
     |  Method resolution order:
     |      float32
     |      floating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  as_integer_ratio(...)
     |      single.as_integer_ratio() -> (int, int)
     |
     |      Return a pair of integers, whose ratio is exactly equal to the original
     |      floating point number, and with a positive denominator.
     |      Raise `OverflowError` on infinities and a `ValueError` on NaNs.
     |
     |      >>> np.single(10.0).as_integer_ratio()
     |      (10, 1)
     |      >>> np.single(0.0).as_integer_ratio()
     |      (0, 1)
     |      >>> np.single(-.25).as_integer_ratio()
     |      (-1, 4)
     |
     |  is_integer(...)
     |      single.is_integer() -> bool
     |
     |      Return ``True`` if the floating point number is finite with integral
     |      value, and ``False`` otherwise.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> np.single(-2.0).is_integer()
     |      True
     |      >>> np.single(3.2).is_integer()
     |      False
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from floating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class float64(floating, builtins.float)
     |  float64(x=0, /)
     |
     |  Double-precision floating-point number type, compatible with Python
     |  :class:`float` and C ``double``.
     |
     |  :Character code: ``'d'``
     |  :Canonical name: `numpy.double`
     |  :Alias on this platform (win32 AMD64): `numpy.float64`: 64-bit precision floating-point number type: sign bit, 11 bits exponent, 52 bits mantissa.
     |
     |  Method resolution order:
     |      float64
     |      floating
     |      inexact
     |      number
     |      generic
     |      builtins.float
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  as_integer_ratio(...)
     |      double.as_integer_ratio() -> (int, int)
     |
     |      Return a pair of integers, whose ratio is exactly equal to the original
     |      floating point number, and with a positive denominator.
     |      Raise `OverflowError` on infinities and a `ValueError` on NaNs.
     |
     |      >>> np.double(10.0).as_integer_ratio()
     |      (10, 1)
     |      >>> np.double(0.0).as_integer_ratio()
     |      (0, 1)
     |      >>> np.double(-.25).as_integer_ratio()
     |      (-1, 4)
     |
     |  is_integer(...)
     |      double.is_integer() -> bool
     |
     |      Return ``True`` if the floating point number is finite with integral
     |      value, and ``False`` otherwise.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> np.double(-2.0).is_integer()
     |      True
     |      >>> np.double(3.2).is_integer()
     |      False
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from floating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.float:
     |
     |  __ceil__(self, /)
     |      Return the ceiling as an Integral.
     |
     |  __floor__(self, /)
     |      Return the floor as an Integral.
     |
     |  __getnewargs__(self, /)
     |
     |  __trunc__(self, /)
     |      Return the Integral closest to x between 0 and x.
     |
     |  hex(self, /)
     |      Return a hexadecimal representation of a floating-point number.
     |
     |      >>> (-0.1).hex()
     |      '-0x1.999999999999ap-4'
     |      >>> 3.14159.hex()
     |      '0x1.921f9f01b866ep+1'
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.float:
     |
     |  __getformat__(typestr, /)
     |      You probably don't want to use this function.
     |
     |        typestr
     |          Must be 'double' or 'float'.
     |
     |      It exists mainly to be used in Python's test suite.
     |
     |      This function returns whichever of 'unknown', 'IEEE, big-endian' or 'IEEE,
     |      little-endian' best describes the format of floating-point numbers used by the
     |      C type named by typestr.
     |
     |  fromhex(string, /)
     |      Create a floating-point number from a hexadecimal string.
     |
     |      >>> float.fromhex('0x1.ffffp10')
     |      2047.984375
     |      >>> float.fromhex('-0x1p-1074')
     |      -5e-324

    class floating(inexact)
     |  Abstract base class of all floating-point scalar types.
     |
     |  Method resolution order:
     |      floating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from number:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from generic:
     |
     |  __hash__ = None

    class generic(builtins.object)
     |  Base class for numpy scalar types.
     |
     |  Class from which most (all?) numpy scalar types are derived.  For
     |  consistency, exposes the same API as `ndarray`, despite many
     |  consequent attributes being either "get-only," or completely irrelevant.
     |  This is the class from which it is strongly suggested users should derive
     |  custom scalar types.
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None

    half = class float16(floating)
     |  Half-precision floating-point number type.
     |
     |  :Character code: ``'e'``
     |  :Canonical name: `numpy.half`
     |  :Alias on this platform (win32 AMD64): `numpy.float16`: 16-bit-precision floating-point number type: sign bit, 5 bits exponent, 10 bits mantissa.
     |
     |  Method resolution order:
     |      float16
     |      floating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  as_integer_ratio(...)
     |      half.as_integer_ratio() -> (int, int)
     |
     |      Return a pair of integers, whose ratio is exactly equal to the original
     |      floating point number, and with a positive denominator.
     |      Raise `OverflowError` on infinities and a `ValueError` on NaNs.
     |
     |      >>> np.half(10.0).as_integer_ratio()
     |      (10, 1)
     |      >>> np.half(0.0).as_integer_ratio()
     |      (0, 1)
     |      >>> np.half(-.25).as_integer_ratio()
     |      (-1, 4)
     |
     |  is_integer(...)
     |      half.is_integer() -> bool
     |
     |      Return ``True`` if the floating point number is finite with integral
     |      value, and ``False`` otherwise.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> np.half(-2.0).is_integer()
     |      True
     |      >>> np.half(3.2).is_integer()
     |      False
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from floating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class iinfo(builtins.object)
     |  iinfo(int_type)
     |
     |  iinfo(type)
     |
     |  Machine limits for integer types.
     |
     |  Attributes
     |  ----------
     |  bits : int
     |      The number of bits occupied by the type.
     |  dtype : dtype
     |      Returns the dtype for which `iinfo` returns information.
     |  min : int
     |      The smallest integer expressible by the type.
     |  max : int
     |      The largest integer expressible by the type.
     |
     |  Parameters
     |  ----------
     |  int_type : integer type, dtype, or instance
     |      The kind of integer data type to get information about.
     |
     |  See Also
     |  --------
     |  finfo : The equivalent for floating point data types.
     |
     |  Examples
     |  --------
     |  With types:
     |
     |  >>> import numpy as np
     |  >>> ii16 = np.iinfo(np.int16)
     |  >>> ii16.min
     |  -32768
     |  >>> ii16.max
     |  32767
     |  >>> ii32 = np.iinfo(np.int32)
     |  >>> ii32.min
     |  -2147483648
     |  >>> ii32.max
     |  2147483647
     |
     |  With instances:
     |
     |  >>> ii32 = np.iinfo(np.int32(10))
     |  >>> ii32.min
     |  -2147483648
     |  >>> ii32.max
     |  2147483647
     |
     |  Methods defined here:
     |
     |  __init__(self, int_type) from numpy._core.getlimits.iinfo
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self) from numpy._core.getlimits.iinfo
     |      Return repr(self).
     |
     |  __str__(self) from numpy._core.getlimits.iinfo
     |      String representation.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  max
     |      Maximum value of given dtype.
     |
     |  min
     |      Minimum value of given dtype.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class inexact(number)
     |  Abstract base class of all numeric scalar types with a (potentially)
     |  inexact representation of the values in its range, such as
     |  floating-point numbers.
     |
     |  Method resolution order:
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Class methods inherited from number:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from generic:
     |
     |  __hash__ = None

    class int16(signedinteger)
     |  Signed integer type, compatible with C ``short``.
     |
     |  :Character code: ``'h'``
     |  :Canonical name: `numpy.short`
     |  :Alias on this platform (win32 AMD64): `numpy.int16`: 16-bit signed integer (``-32_768`` to ``32_767``).
     |
     |  Method resolution order:
     |      int16
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int16.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int16(127).bit_count()
     |      7
     |      >>> np.int16(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class int32(signedinteger)
     |  Method resolution order:
     |      int32
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int32.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int32(127).bit_count()
     |      7
     |      >>> np.int32(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class int64(signedinteger)
     |  Default signed integer type, 64bit on 64bit systems and 32bit on 32bit
     |  systems.
     |
     |  :Character code: ``'q'``
     |  :Canonical name: `numpy.int_`
     |  :Alias on this platform (win32 AMD64): `numpy.int64`: 64-bit signed integer (``-9_223_372_036_854_775_808`` to ``9_223_372_036_854_775_807``).
     |  :Alias on this platform (win32 AMD64): `numpy.intp`: Signed integer large enough to fit pointer, compatible with C ``intptr_t``.
     |
     |  Method resolution order:
     |      int64
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int64.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int64(127).bit_count()
     |      7
     |      >>> np.int64(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class int8(signedinteger)
     |  Signed integer type, compatible with C ``char``.
     |
     |  :Character code: ``'b'``
     |  :Canonical name: `numpy.byte`
     |  :Alias on this platform (win32 AMD64): `numpy.int8`: 8-bit signed integer (``-128`` to ``127``).
     |
     |  Method resolution order:
     |      int8
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int8.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int8(127).bit_count()
     |      7
     |      >>> np.int8(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    int_ = class int64(signedinteger)
     |  Default signed integer type, 64bit on 64bit systems and 32bit on 32bit
     |  systems.
     |
     |  :Character code: ``'q'``
     |  :Canonical name: `numpy.int_`
     |  :Alias on this platform (win32 AMD64): `numpy.int64`: 64-bit signed integer (``-9_223_372_036_854_775_808`` to ``9_223_372_036_854_775_807``).
     |  :Alias on this platform (win32 AMD64): `numpy.intp`: Signed integer large enough to fit pointer, compatible with C ``intptr_t``.
     |
     |  Method resolution order:
     |      int64
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int64.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int64(127).bit_count()
     |      7
     |      >>> np.int64(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class intc(signedinteger)
     |  Signed integer type, compatible with C ``int``.
     |
     |  :Character code: ``'i'``
     |
     |  Method resolution order:
     |      intc
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class integer(number)
     |  Abstract base class of all integer scalar types.
     |
     |  Method resolution order:
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from number:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from generic:
     |
     |  __hash__ = None

    intp = class int64(signedinteger)
     |  Default signed integer type, 64bit on 64bit systems and 32bit on 32bit
     |  systems.
     |
     |  :Character code: ``'q'``
     |  :Canonical name: `numpy.int_`
     |  :Alias on this platform (win32 AMD64): `numpy.int64`: 64-bit signed integer (``-9_223_372_036_854_775_808`` to ``9_223_372_036_854_775_807``).
     |  :Alias on this platform (win32 AMD64): `numpy.intp`: Signed integer large enough to fit pointer, compatible with C ``intptr_t``.
     |
     |  Method resolution order:
     |      int64
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int64.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int64(127).bit_count()
     |      7
     |      >>> np.int64(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    long = class int32(signedinteger)
     |  Method resolution order:
     |      int32
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int32.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int32(127).bit_count()
     |      7
     |      >>> np.int32(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class longdouble(floating)
     |  Extended-precision floating-point number type, compatible with C
     |  ``long double`` but not necessarily with IEEE 754 quadruple-precision.
     |
     |  :Character code: ``'g'``
     |
     |  Method resolution order:
     |      longdouble
     |      floating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  as_integer_ratio(...)
     |      longdouble.as_integer_ratio() -> (int, int)
     |
     |      Return a pair of integers, whose ratio is exactly equal to the original
     |      floating point number, and with a positive denominator.
     |      Raise `OverflowError` on infinities and a `ValueError` on NaNs.
     |
     |      >>> np.longdouble(10.0).as_integer_ratio()
     |      (10, 1)
     |      >>> np.longdouble(0.0).as_integer_ratio()
     |      (0, 1)
     |      >>> np.longdouble(-.25).as_integer_ratio()
     |      (-1, 4)
     |
     |  is_integer(...)
     |      longdouble.is_integer() -> bool
     |
     |      Return ``True`` if the floating point number is finite with integral
     |      value, and ``False`` otherwise.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> np.longdouble(-2.0).is_integer()
     |      True
     |      >>> np.longdouble(3.2).is_integer()
     |      False
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from floating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    longlong = class int64(signedinteger)
     |  Default signed integer type, 64bit on 64bit systems and 32bit on 32bit
     |  systems.
     |
     |  :Character code: ``'q'``
     |  :Canonical name: `numpy.int_`
     |  :Alias on this platform (win32 AMD64): `numpy.int64`: 64-bit signed integer (``-9_223_372_036_854_775_808`` to ``9_223_372_036_854_775_807``).
     |  :Alias on this platform (win32 AMD64): `numpy.intp`: Signed integer large enough to fit pointer, compatible with C ``intptr_t``.
     |
     |  Method resolution order:
     |      int64
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int64.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int64(127).bit_count()
     |      7
     |      >>> np.int64(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class matrix(ndarray)
     |  matrix(data, dtype=None, copy=True)
     |
     |  matrix(data, dtype=None, copy=True)
     |
     |  Returns a matrix from an array-like object, or from a string of data.
     |
     |  A matrix is a specialized 2-D array that retains its 2-D nature
     |  through operations.  It has certain special operators, such as ``*``
     |  (matrix multiplication) and ``**`` (matrix power).
     |
     |  .. note:: It is no longer recommended to use this class, even for linear
     |            algebra. Instead use regular arrays. The class may be removed
     |            in the future.
     |
     |  Parameters
     |  ----------
     |  data : array_like or string
     |     If `data` is a string, it is interpreted as a matrix with commas
     |     or spaces separating columns, and semicolons separating rows.
     |  dtype : data-type
     |     Data-type of the output matrix.
     |  copy : bool
     |     If `data` is already an `ndarray`, then this flag determines
     |     whether the data is copied (the default), or whether a view is
     |     constructed.
     |
     |  See Also
     |  --------
     |  array
     |
     |  Examples
     |  --------
     |  >>> import numpy as np
     |  >>> a = np.matrix('1 2; 3 4')
     |  >>> a
     |  matrix([[1, 2],
     |          [3, 4]])
     |
     |  >>> np.matrix([[1, 2], [3, 4]])
     |  matrix([[1, 2],
     |          [3, 4]])
     |
     |  Method resolution order:
     |      matrix
     |      ndarray
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __array_finalize__(self, obj) from numpy.matrixlib.defmatrix.matrix
     |      a.__array_finalize__(obj, /)
     |
     |      Present so subclasses can call super. Does nothing.
     |
     |  __getitem__(self, index) from numpy.matrixlib.defmatrix.matrix
     |      Return self[key].
     |
     |  __imul__(self, other) from numpy.matrixlib.defmatrix.matrix
     |      Return self*=value.
     |
     |  __ipow__(self, other) from numpy.matrixlib.defmatrix.matrix
     |      Return self**=value.
     |
     |  __mul__(self, other) from numpy.matrixlib.defmatrix.matrix
     |      Return self*value.
     |
     |  __pow__(self, other) from numpy.matrixlib.defmatrix.matrix
     |      Return pow(self, value, mod).
     |
     |  __rmul__(self, other) from numpy.matrixlib.defmatrix.matrix
     |      Return value*self.
     |
     |  __rpow__(self, other) from numpy.matrixlib.defmatrix.matrix
     |      Return pow(value, self, mod).
     |
     |  all(self, axis=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Test whether all matrix elements along a given axis evaluate to True.
     |
     |      Parameters
     |      ----------
     |      See `numpy.all` for complete descriptions
     |
     |      See Also
     |      --------
     |      numpy.all
     |
     |      Notes
     |      -----
     |      This is the same as `ndarray.all`, but it returns a `matrix` object.
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> y = x[0]; y
     |      matrix([[0, 1, 2, 3]])
     |      >>> (x == y)
     |      matrix([[ True,  True,  True,  True],
     |              [False, False, False, False],
     |              [False, False, False, False]])
     |      >>> (x == y).all()
     |      False
     |      >>> (x == y).all(0)
     |      matrix([[False, False, False, False]])
     |      >>> (x == y).all(1)
     |      matrix([[ True],
     |              [False],
     |              [False]])
     |
     |  any(self, axis=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Test whether any array element along a given axis evaluates to True.
     |
     |      Refer to `numpy.any` for full documentation.
     |
     |      Parameters
     |      ----------
     |      axis : int, optional
     |          Axis along which logical OR is performed
     |      out : ndarray, optional
     |          Output to existing array instead of creating new one, must have
     |          same shape as expected output
     |
     |      Returns
     |      -------
     |          any : bool, ndarray
     |              Returns a single bool if `axis` is ``None``; otherwise,
     |              returns `ndarray`
     |
     |  argmax(self, axis=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Indexes of the maximum values along an axis.
     |
     |      Return the indexes of the first occurrences of the maximum values
     |      along the specified axis.  If axis is None, the index is for the
     |      flattened matrix.
     |
     |      Parameters
     |      ----------
     |      See `numpy.argmax` for complete descriptions
     |
     |      See Also
     |      --------
     |      numpy.argmax
     |
     |      Notes
     |      -----
     |      This is the same as `ndarray.argmax`, but returns a `matrix` object
     |      where `ndarray.argmax` would return an `ndarray`.
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.argmax()
     |      11
     |      >>> x.argmax(0)
     |      matrix([[2, 2, 2, 2]])
     |      >>> x.argmax(1)
     |      matrix([[3],
     |              [3],
     |              [3]])
     |
     |  argmin(self, axis=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Indexes of the minimum values along an axis.
     |
     |      Return the indexes of the first occurrences of the minimum values
     |      along the specified axis.  If axis is None, the index is for the
     |      flattened matrix.
     |
     |      Parameters
     |      ----------
     |      See `numpy.argmin` for complete descriptions.
     |
     |      See Also
     |      --------
     |      numpy.argmin
     |
     |      Notes
     |      -----
     |      This is the same as `ndarray.argmin`, but returns a `matrix` object
     |      where `ndarray.argmin` would return an `ndarray`.
     |
     |      Examples
     |      --------
     |      >>> x = -np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[  0,  -1,  -2,  -3],
     |              [ -4,  -5,  -6,  -7],
     |              [ -8,  -9, -10, -11]])
     |      >>> x.argmin()
     |      11
     |      >>> x.argmin(0)
     |      matrix([[2, 2, 2, 2]])
     |      >>> x.argmin(1)
     |      matrix([[3],
     |              [3],
     |              [3]])
     |
     |  flatten(self, order='C') from numpy.matrixlib.defmatrix.matrix
     |      Return a flattened copy of the matrix.
     |
     |      All `N` elements of the matrix are placed into a single row.
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          'C' means to flatten in row-major (C-style) order. 'F' means to
     |          flatten in column-major (Fortran-style) order. 'A' means to
     |          flatten in column-major order if `m` is Fortran *contiguous* in
     |          memory, row-major order otherwise. 'K' means to flatten `m` in
     |          the order the elements occur in memory. The default is 'C'.
     |
     |      Returns
     |      -------
     |      y : matrix
     |          A copy of the matrix, flattened to a `(1, N)` matrix where `N`
     |          is the number of elements in the original matrix.
     |
     |      See Also
     |      --------
     |      ravel : Return a flattened array.
     |      flat : A 1-D flat iterator over the matrix.
     |
     |      Examples
     |      --------
     |      >>> m = np.matrix([[1,2], [3,4]])
     |      >>> m.flatten()
     |      matrix([[1, 2, 3, 4]])
     |      >>> m.flatten('F')
     |      matrix([[1, 3, 2, 4]])
     |
     |  getA = A(self) from numpy.matrixlib.defmatrix.matrix
     |      Return `self` as an `ndarray` object.
     |
     |      Equivalent to ``np.asarray(self)``.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : ndarray
     |          `self` as an `ndarray`
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.getA()
     |      array([[ 0,  1,  2,  3],
     |             [ 4,  5,  6,  7],
     |             [ 8,  9, 10, 11]])
     |
     |  getA1 = A1(self) from numpy.matrixlib.defmatrix.matrix
     |      Return `self` as a flattened `ndarray`.
     |
     |      Equivalent to ``np.asarray(x).ravel()``
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : ndarray
     |          `self`, 1-D, as an `ndarray`
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.getA1()
     |      array([ 0,  1,  2, ...,  9, 10, 11])
     |
     |  getH = H(self) from numpy.matrixlib.defmatrix.matrix
     |      Returns the (complex) conjugate transpose of `self`.
     |
     |      Equivalent to ``np.transpose(self)`` if `self` is real-valued.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : matrix object
     |          complex conjugate transpose of `self`
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4)))
     |      >>> z = x - 1j*x; z
     |      matrix([[  0. +0.j,   1. -1.j,   2. -2.j,   3. -3.j],
     |              [  4. -4.j,   5. -5.j,   6. -6.j,   7. -7.j],
     |              [  8. -8.j,   9. -9.j,  10.-10.j,  11.-11.j]])
     |      >>> z.getH()
     |      matrix([[ 0. -0.j,  4. +4.j,  8. +8.j],
     |              [ 1. +1.j,  5. +5.j,  9. +9.j],
     |              [ 2. +2.j,  6. +6.j, 10.+10.j],
     |              [ 3. +3.j,  7. +7.j, 11.+11.j]])
     |
     |  getI = I(self) from numpy.matrixlib.defmatrix.matrix
     |      Returns the (multiplicative) inverse of invertible `self`.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : matrix object
     |          If `self` is non-singular, `ret` is such that ``ret * self`` ==
     |          ``self * ret`` == ``np.matrix(np.eye(self[0,:].size))`` all return
     |          ``True``.
     |
     |      Raises
     |      ------
     |      numpy.linalg.LinAlgError: Singular matrix
     |          If `self` is singular.
     |
     |      See Also
     |      --------
     |      linalg.inv
     |
     |      Examples
     |      --------
     |      >>> m = np.matrix('[1, 2; 3, 4]'); m
     |      matrix([[1, 2],
     |              [3, 4]])
     |      >>> m.getI()
     |      matrix([[-2. ,  1. ],
     |              [ 1.5, -0.5]])
     |      >>> m.getI() * m
     |      matrix([[ 1.,  0.], # may vary
     |              [ 0.,  1.]])
     |
     |  getT = T(self) from numpy.matrixlib.defmatrix.matrix
     |      Returns the transpose of the matrix.
     |
     |      Does *not* conjugate!  For the complex conjugate transpose, use ``.H``.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : matrix object
     |          The (non-conjugated) transpose of the matrix.
     |
     |      See Also
     |      --------
     |      transpose, getH
     |
     |      Examples
     |      --------
     |      >>> m = np.matrix('[1, 2; 3, 4]')
     |      >>> m
     |      matrix([[1, 2],
     |              [3, 4]])
     |      >>> m.getT()
     |      matrix([[1, 3],
     |              [2, 4]])
     |
     |  max(self, axis=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Return the maximum value along an axis.
     |
     |      Parameters
     |      ----------
     |      See `amax` for complete descriptions
     |
     |      See Also
     |      --------
     |      amax, ndarray.max
     |
     |      Notes
     |      -----
     |      This is the same as `ndarray.max`, but returns a `matrix` object
     |      where `ndarray.max` would return an ndarray.
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.max()
     |      11
     |      >>> x.max(0)
     |      matrix([[ 8,  9, 10, 11]])
     |      >>> x.max(1)
     |      matrix([[ 3],
     |              [ 7],
     |              [11]])
     |
     |  mean(self, axis=None, dtype=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Returns the average of the matrix elements along the given axis.
     |
     |      Refer to `numpy.mean` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.mean
     |
     |      Notes
     |      -----
     |      Same as `ndarray.mean` except that, where that returns an `ndarray`,
     |      this returns a `matrix` object.
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3, 4)))
     |      >>> x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.mean()
     |      5.5
     |      >>> x.mean(0)
     |      matrix([[4., 5., 6., 7.]])
     |      >>> x.mean(1)
     |      matrix([[ 1.5],
     |              [ 5.5],
     |              [ 9.5]])
     |
     |  min(self, axis=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Return the minimum value along an axis.
     |
     |      Parameters
     |      ----------
     |      See `amin` for complete descriptions.
     |
     |      See Also
     |      --------
     |      amin, ndarray.min
     |
     |      Notes
     |      -----
     |      This is the same as `ndarray.min`, but returns a `matrix` object
     |      where `ndarray.min` would return an ndarray.
     |
     |      Examples
     |      --------
     |      >>> x = -np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[  0,  -1,  -2,  -3],
     |              [ -4,  -5,  -6,  -7],
     |              [ -8,  -9, -10, -11]])
     |      >>> x.min()
     |      -11
     |      >>> x.min(0)
     |      matrix([[ -8,  -9, -10, -11]])
     |      >>> x.min(1)
     |      matrix([[ -3],
     |              [ -7],
     |              [-11]])
     |
     |  prod(self, axis=None, dtype=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Return the product of the array elements over the given axis.
     |
     |      Refer to `prod` for full documentation.
     |
     |      See Also
     |      --------
     |      prod, ndarray.prod
     |
     |      Notes
     |      -----
     |      Same as `ndarray.prod`, except, where that returns an `ndarray`, this
     |      returns a `matrix` object instead.
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.prod()
     |      0
     |      >>> x.prod(0)
     |      matrix([[  0,  45, 120, 231]])
     |      >>> x.prod(1)
     |      matrix([[   0],
     |              [ 840],
     |              [7920]])
     |
     |  ptp(self, axis=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Peak-to-peak (maximum - minimum) value along the given axis.
     |
     |      Refer to `numpy.ptp` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.ptp
     |
     |      Notes
     |      -----
     |      Same as `ndarray.ptp`, except, where that would return an `ndarray` object,
     |      this returns a `matrix` object.
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.ptp()
     |      11
     |      >>> x.ptp(0)
     |      matrix([[8, 8, 8, 8]])
     |      >>> x.ptp(1)
     |      matrix([[3],
     |              [3],
     |              [3]])
     |
     |  ravel(self, order='C') from numpy.matrixlib.defmatrix.matrix
     |      Return a flattened matrix.
     |
     |      Refer to `numpy.ravel` for more documentation.
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          The elements of `m` are read using this index order. 'C' means to
     |          index the elements in C-like order, with the last axis index
     |          changing fastest, back to the first axis index changing slowest.
     |          'F' means to index the elements in Fortran-like index order, with
     |          the first index changing fastest, and the last index changing
     |          slowest. Note that the 'C' and 'F' options take no account of the
     |          memory layout of the underlying array, and only refer to the order
     |          of axis indexing.  'A' means to read the elements in Fortran-like
     |          index order if `m` is Fortran *contiguous* in memory, C-like order
     |          otherwise.  'K' means to read the elements in the order they occur
     |          in memory, except for reversing the data when strides are negative.
     |          By default, 'C' index order is used.
     |
     |      Returns
     |      -------
     |      ret : matrix
     |          Return the matrix flattened to shape `(1, N)` where `N`
     |          is the number of elements in the original matrix.
     |          A copy is made only if necessary.
     |
     |      See Also
     |      --------
     |      matrix.flatten : returns a similar output matrix but always a copy
     |      matrix.flat : a flat iterator on the array.
     |      numpy.ravel : related function which returns an ndarray
     |
     |  squeeze(self, axis=None) from numpy.matrixlib.defmatrix.matrix
     |      Return a possibly reshaped matrix.
     |
     |      Refer to `numpy.squeeze` for more documentation.
     |
     |      Parameters
     |      ----------
     |      axis : None or int or tuple of ints, optional
     |          Selects a subset of the axes of length one in the shape.
     |          If an axis is selected with shape entry greater than one,
     |          an error is raised.
     |
     |      Returns
     |      -------
     |      squeezed : matrix
     |          The matrix, but as a (1, N) matrix if it had shape (N, 1).
     |
     |      See Also
     |      --------
     |      numpy.squeeze : related function
     |
     |      Notes
     |      -----
     |      If `m` has a single column then that column is returned
     |      as the single row of a matrix.  Otherwise `m` is returned.
     |      The returned matrix is always either `m` itself or a view into `m`.
     |      Supplying an axis keyword argument will not affect the returned matrix
     |      but it may cause an error to be raised.
     |
     |      Examples
     |      --------
     |      >>> c = np.matrix([[1], [2]])
     |      >>> c
     |      matrix([[1],
     |              [2]])
     |      >>> c.squeeze()
     |      matrix([[1, 2]])
     |      >>> r = c.T
     |      >>> r
     |      matrix([[1, 2]])
     |      >>> r.squeeze()
     |      matrix([[1, 2]])
     |      >>> m = np.matrix([[1, 2], [3, 4]])
     |      >>> m.squeeze()
     |      matrix([[1, 2],
     |              [3, 4]])
     |
     |  std(self, axis=None, dtype=None, out=None, ddof=0) from numpy.matrixlib.defmatrix.matrix
     |      Return the standard deviation of the array elements along the given axis.
     |
     |      Refer to `numpy.std` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.std
     |
     |      Notes
     |      -----
     |      This is the same as `ndarray.std`, except that where an `ndarray` would
     |      be returned, a `matrix` object is returned instead.
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3, 4)))
     |      >>> x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.std()
     |      3.4520525295346629 # may vary
     |      >>> x.std(0)
     |      matrix([[ 3.26598632,  3.26598632,  3.26598632,  3.26598632]]) # may vary
     |      >>> x.std(1)
     |      matrix([[ 1.11803399],
     |              [ 1.11803399],
     |              [ 1.11803399]])
     |
     |  sum(self, axis=None, dtype=None, out=None) from numpy.matrixlib.defmatrix.matrix
     |      Returns the sum of the matrix elements, along the given axis.
     |
     |      Refer to `numpy.sum` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.sum
     |
     |      Notes
     |      -----
     |      This is the same as `ndarray.sum`, except that where an `ndarray` would
     |      be returned, a `matrix` object is returned instead.
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix([[1, 2], [4, 3]])
     |      >>> x.sum()
     |      10
     |      >>> x.sum(axis=1)
     |      matrix([[3],
     |              [7]])
     |      >>> x.sum(axis=1, dtype='float')
     |      matrix([[3.],
     |              [7.]])
     |      >>> out = np.zeros((2, 1), dtype='float')
     |      >>> x.sum(axis=1, dtype='float', out=np.asmatrix(out))
     |      matrix([[3.],
     |              [7.]])
     |
     |  tolist(self) from numpy.matrixlib.defmatrix.matrix
     |      Return the matrix as a (possibly nested) list.
     |
     |      See `ndarray.tolist` for full documentation.
     |
     |      See Also
     |      --------
     |      ndarray.tolist
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.tolist()
     |      [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]]
     |
     |  var(self, axis=None, dtype=None, out=None, ddof=0) from numpy.matrixlib.defmatrix.matrix
     |      Returns the variance of the matrix elements, along the given axis.
     |
     |      Refer to `numpy.var` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.var
     |
     |      Notes
     |      -----
     |      This is the same as `ndarray.var`, except that where an `ndarray` would
     |      be returned, a `matrix` object is returned instead.
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3, 4)))
     |      >>> x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.var()
     |      11.916666666666666
     |      >>> x.var(0)
     |      matrix([[ 10.66666667,  10.66666667,  10.66666667,  10.66666667]]) # may vary
     |      >>> x.var(1)
     |      matrix([[1.25],
     |              [1.25],
     |              [1.25]])
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(subtype, data, dtype=None, copy=True) from numpy.matrixlib.defmatrix.matrix
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  A
     |      Return `self` as an `ndarray` object.
     |
     |      Equivalent to ``np.asarray(self)``.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : ndarray
     |          `self` as an `ndarray`
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.getA()
     |      array([[ 0,  1,  2,  3],
     |             [ 4,  5,  6,  7],
     |             [ 8,  9, 10, 11]])
     |
     |  A1
     |      Return `self` as a flattened `ndarray`.
     |
     |      Equivalent to ``np.asarray(x).ravel()``
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : ndarray
     |          `self`, 1-D, as an `ndarray`
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4))); x
     |      matrix([[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]])
     |      >>> x.getA1()
     |      array([ 0,  1,  2, ...,  9, 10, 11])
     |
     |  H
     |      Returns the (complex) conjugate transpose of `self`.
     |
     |      Equivalent to ``np.transpose(self)`` if `self` is real-valued.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : matrix object
     |          complex conjugate transpose of `self`
     |
     |      Examples
     |      --------
     |      >>> x = np.matrix(np.arange(12).reshape((3,4)))
     |      >>> z = x - 1j*x; z
     |      matrix([[  0. +0.j,   1. -1.j,   2. -2.j,   3. -3.j],
     |              [  4. -4.j,   5. -5.j,   6. -6.j,   7. -7.j],
     |              [  8. -8.j,   9. -9.j,  10.-10.j,  11.-11.j]])
     |      >>> z.getH()
     |      matrix([[ 0. -0.j,  4. +4.j,  8. +8.j],
     |              [ 1. +1.j,  5. +5.j,  9. +9.j],
     |              [ 2. +2.j,  6. +6.j, 10.+10.j],
     |              [ 3. +3.j,  7. +7.j, 11.+11.j]])
     |
     |  I
     |      Returns the (multiplicative) inverse of invertible `self`.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : matrix object
     |          If `self` is non-singular, `ret` is such that ``ret * self`` ==
     |          ``self * ret`` == ``np.matrix(np.eye(self[0,:].size))`` all return
     |          ``True``.
     |
     |      Raises
     |      ------
     |      numpy.linalg.LinAlgError: Singular matrix
     |          If `self` is singular.
     |
     |      See Also
     |      --------
     |      linalg.inv
     |
     |      Examples
     |      --------
     |      >>> m = np.matrix('[1, 2; 3, 4]'); m
     |      matrix([[1, 2],
     |              [3, 4]])
     |      >>> m.getI()
     |      matrix([[-2. ,  1. ],
     |              [ 1.5, -0.5]])
     |      >>> m.getI() * m
     |      matrix([[ 1.,  0.], # may vary
     |              [ 0.,  1.]])
     |
     |  T
     |      Returns the transpose of the matrix.
     |
     |      Does *not* conjugate!  For the complex conjugate transpose, use ``.H``.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      ret : matrix object
     |          The (non-conjugated) transpose of the matrix.
     |
     |      See Also
     |      --------
     |      transpose, getH
     |
     |      Examples
     |      --------
     |      >>> m = np.matrix('[1, 2; 3, 4]')
     |      >>> m
     |      matrix([[1, 2],
     |              [3, 4]])
     |      >>> m.getT()
     |      matrix([[1, 3],
     |              [2, 4]])
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __annotations__ = {}
     |
     |  __array_priority__ = 10.0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ndarray:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      a.__array__([dtype], *, copy=None)
     |
     |      For ``dtype`` parameter it returns a new reference to self if
     |      ``dtype`` is not given or it matches array's data type.
     |      A new array of provided data type is returned if ``dtype``
     |      is different from the current data type of the array.
     |      For ``copy`` parameter it returns a new reference to self if
     |      ``copy=False`` or ``copy=None`` and copying isn't enforced by ``dtype``
     |      parameter. The method returns a new array for ``copy=True``, regardless of
     |      ``dtype`` parameter.
     |
     |      A more detailed explanation of the ``__array__`` interface
     |      can be found in :ref:`dunder_array.interface`.
     |
     |  __array_function__(...)
     |
     |  __array_namespace__(...)
     |
     |  __array_ufunc__(...)
     |
     |  __array_wrap__(...)
     |      a.__array_wrap__(array[, context], /)
     |
     |      Returns a view of `array` with the same type as self.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __complex__(...)
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __copy__(...)
     |      a.__copy__()
     |
     |      Used if :func:`copy.copy` is called on an array. Returns a copy of the array.
     |
     |      Equivalent to ``a.copy(order='K')``.
     |
     |  __deepcopy__(...)
     |      a.__deepcopy__(memo, /)
     |
     |      Used if :func:`copy.deepcopy` is called on an array.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __dlpack__(...)
     |      a.__dlpack__(*, stream=None, max_version=None, dl_device=None, copy=None)
     |
     |      DLPack Protocol: Part of the Array API.
     |
     |  __dlpack_device__(...)
     |      a.__dlpack_device__()
     |
     |      DLPack Protocol: Part of the Array API.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      Default object formatter.
     |
     |      Return str(self) if format_spec is empty. Raise TypeError otherwise.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __iadd__(self, value, /)
     |      Return self+=value.
     |
     |  __iand__(self, value, /)
     |      Return self&=value.
     |
     |  __ifloordiv__(self, value, /)
     |      Return self//=value.
     |
     |  __ilshift__(self, value, /)
     |      Return self<<=value.
     |
     |  __imatmul__(self, value, /)
     |      Return self@=value.
     |
     |  __imod__(self, value, /)
     |      Return self%=value.
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __irshift__(self, value, /)
     |      Return self>>=value.
     |
     |  __isub__(self, value, /)
     |      Return self-=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __itruediv__(self, value, /)
     |      Return self/=value.
     |
     |  __ixor__(self, value, /)
     |      Return self^=value.
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __matmul__(self, value, /)
     |      Return self@value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      a.__reduce__()
     |
     |      For pickling.
     |
     |  __reduce_ex__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmatmul__(self, value, /)
     |      Return value@self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __setstate__(...)
     |      a.__setstate__(state, /)
     |
     |      For unpickling.
     |
     |      The `state` argument must be a sequence that contains the following
     |      elements:
     |
     |      Parameters
     |      ----------
     |      version : int
     |          optional pickle version. If omitted defaults to 0.
     |      shape : tuple
     |      dtype : data-type
     |      isFortran : bool
     |      rawdata : string or list
     |          a binary string with the data (or a list if 'a' is an object array)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  argpartition(...)
     |      a.argpartition(kth, axis=-1, kind='introselect', order=None)
     |
     |      Returns the indices that would partition this array.
     |
     |      Refer to `numpy.argpartition` for full documentation.
     |
     |      .. versionadded:: 1.8.0
     |
     |      See Also
     |      --------
     |      numpy.argpartition : equivalent function
     |
     |  argsort(...)
     |      a.argsort(axis=-1, kind=None, order=None)
     |
     |      Returns the indices that would sort this array.
     |
     |      Refer to `numpy.argsort` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.argsort : equivalent function
     |
     |  astype(...)
     |      a.astype(dtype, order='K', casting='unsafe', subok=True, copy=True)
     |
     |      Copy of the array, cast to a specified type.
     |
     |      Parameters
     |      ----------
     |      dtype : str or dtype
     |          Typecode or data-type to which the array is cast.
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          Controls the memory layout order of the result.
     |          'C' means C order, 'F' means Fortran order, 'A'
     |          means 'F' order if all the arrays are Fortran contiguous,
     |          'C' order otherwise, and 'K' means as close to the
     |          order the array elements appear in memory as possible.
     |          Default is 'K'.
     |      casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
     |          Controls what kind of data casting may occur. Defaults to 'unsafe'
     |          for backwards compatibility.
     |
     |          * 'no' means the data types should not be cast at all.
     |          * 'equiv' means only byte-order changes are allowed.
     |          * 'safe' means only casts which can preserve values are allowed.
     |          * 'same_kind' means only safe casts or casts within a kind,
     |            like float64 to float32, are allowed.
     |          * 'unsafe' means any data conversions may be done.
     |      subok : bool, optional
     |          If True, then sub-classes will be passed-through (default), otherwise
     |          the returned array will be forced to be a base-class array.
     |      copy : bool, optional
     |          By default, astype always returns a newly allocated array. If this
     |          is set to false, and the `dtype`, `order`, and `subok`
     |          requirements are satisfied, the input array is returned instead
     |          of a copy.
     |
     |      Returns
     |      -------
     |      arr_t : ndarray
     |          Unless `copy` is False and the other conditions for returning the input
     |          array are satisfied (see description for `copy` input parameter), `arr_t`
     |          is a new array of the same shape as the input array, with dtype, order
     |          given by `dtype`, `order`.
     |
     |      Notes
     |      -----
     |      .. versionchanged:: 1.17.0
     |         Casting between a simple data type and a structured one is possible only
     |         for "unsafe" casting.  Casting to multiple fields is allowed, but
     |         casting from multiple fields is not.
     |
     |      .. versionchanged:: 1.9.0
     |         Casting from numeric to string types in 'safe' casting mode requires
     |         that the string dtype length is long enough to store the max
     |         integer/float value converted.
     |
     |      Raises
     |      ------
     |      ComplexWarning
     |          When casting from complex to float or int. To avoid this,
     |          one should use ``a.real.astype(t)``.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 2.5])
     |      >>> x
     |      array([1. ,  2. ,  2.5])
     |
     |      >>> x.astype(int)
     |      array([1, 2, 2])
     |
     |  byteswap(...)
     |      a.byteswap(inplace=False)
     |
     |      Swap the bytes of the array elements
     |
     |      Toggle between low-endian and big-endian data representation by
     |      returning a byteswapped array, optionally swapped in-place.
     |      Arrays of byte-strings are not swapped. The real and imaginary
     |      parts of a complex number are swapped individually.
     |
     |      Parameters
     |      ----------
     |      inplace : bool, optional
     |          If ``True``, swap bytes in-place, default is ``False``.
     |
     |      Returns
     |      -------
     |      out : ndarray
     |          The byteswapped array. If `inplace` is ``True``, this is
     |          a view to self.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> A = np.array([1, 256, 8755], dtype=np.int16)
     |      >>> list(map(hex, A))
     |      ['0x1', '0x100', '0x2233']
     |      >>> A.byteswap(inplace=True)
     |      array([  256,     1, 13090], dtype=int16)
     |      >>> list(map(hex, A))
     |      ['0x100', '0x1', '0x3322']
     |
     |      Arrays of byte-strings are not swapped
     |
     |      >>> A = np.array([b'ceg', b'fac'])
     |      >>> A.byteswap()
     |      array([b'ceg', b'fac'], dtype='|S3')
     |
     |      ``A.view(A.dtype.newbyteorder()).byteswap()`` produces an array with
     |      the same values but different representation in memory
     |
     |      >>> A = np.array([1, 2, 3])
     |      >>> A.view(np.uint8)
     |      array([1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
     |             0, 0], dtype=uint8)
     |      >>> A.view(A.dtype.newbyteorder()).byteswap(inplace=True)
     |      array([1, 2, 3])
     |      >>> A.view(np.uint8)
     |      array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
     |             0, 3], dtype=uint8)
     |
     |  choose(...)
     |      a.choose(choices, out=None, mode='raise')
     |
     |      Use an index array to construct a new array from a set of choices.
     |
     |      Refer to `numpy.choose` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.choose : equivalent function
     |
     |  clip(...)
     |      a.clip(min=None, max=None, out=None, **kwargs)
     |
     |      Return an array whose values are limited to ``[min, max]``.
     |      One of max or min must be given.
     |
     |      Refer to `numpy.clip` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.clip : equivalent function
     |
     |  compress(...)
     |      a.compress(condition, axis=None, out=None)
     |
     |      Return selected slices of this array along given axis.
     |
     |      Refer to `numpy.compress` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.compress : equivalent function
     |
     |  conj(...)
     |      a.conj()
     |
     |      Complex-conjugate all elements.
     |
     |      Refer to `numpy.conjugate` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.conjugate : equivalent function
     |
     |  conjugate(...)
     |      a.conjugate()
     |
     |      Return the complex conjugate, element-wise.
     |
     |      Refer to `numpy.conjugate` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.conjugate : equivalent function
     |
     |  copy(...)
     |      a.copy(order='C')
     |
     |      Return a copy of the array.
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          Controls the memory layout of the copy. 'C' means C-order,
     |          'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
     |          'C' otherwise. 'K' means match the layout of `a` as closely
     |          as possible. (Note that this function and :func:`numpy.copy` are very
     |          similar but have different default values for their order=
     |          arguments, and this function always passes sub-classes through.)
     |
     |      See also
     |      --------
     |      numpy.copy : Similar function with different default behavior
     |      numpy.copyto
     |
     |      Notes
     |      -----
     |      This function is the preferred method for creating an array copy.  The
     |      function :func:`numpy.copy` is similar, but it defaults to using order 'K',
     |      and will not pass sub-classes through by default.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([[1,2,3],[4,5,6]], order='F')
     |
     |      >>> y = x.copy()
     |
     |      >>> x.fill(0)
     |
     |      >>> x
     |      array([[0, 0, 0],
     |             [0, 0, 0]])
     |
     |      >>> y
     |      array([[1, 2, 3],
     |             [4, 5, 6]])
     |
     |      >>> y.flags['C_CONTIGUOUS']
     |      True
     |
     |      For arrays containing Python objects (e.g. dtype=object),
     |      the copy is a shallow one. The new array will contain the
     |      same object which may lead to surprises if that object can
     |      be modified (is mutable):
     |
     |      >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object)
     |      >>> b = a.copy()
     |      >>> b[2][0] = 10
     |      >>> a
     |      array([1, 'm', list([10, 3, 4])], dtype=object)
     |
     |      To ensure all elements within an ``object`` array are copied,
     |      use `copy.deepcopy`:
     |
     |      >>> import copy
     |      >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object)
     |      >>> c = copy.deepcopy(a)
     |      >>> c[2][0] = 10
     |      >>> c
     |      array([1, 'm', list([10, 3, 4])], dtype=object)
     |      >>> a
     |      array([1, 'm', list([2, 3, 4])], dtype=object)
     |
     |  cumprod(...)
     |      a.cumprod(axis=None, dtype=None, out=None)
     |
     |      Return the cumulative product of the elements along the given axis.
     |
     |      Refer to `numpy.cumprod` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.cumprod : equivalent function
     |
     |  cumsum(...)
     |      a.cumsum(axis=None, dtype=None, out=None)
     |
     |      Return the cumulative sum of the elements along the given axis.
     |
     |      Refer to `numpy.cumsum` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.cumsum : equivalent function
     |
     |  diagonal(...)
     |      a.diagonal(offset=0, axis1=0, axis2=1)
     |
     |      Return specified diagonals. In NumPy 1.9 the returned array is a
     |      read-only view instead of a copy as in previous NumPy versions.  In
     |      a future version the read-only restriction will be removed.
     |
     |      Refer to :func:`numpy.diagonal` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.diagonal : equivalent function
     |
     |  dot(...)
     |
     |  dump(...)
     |      a.dump(file)
     |
     |      Dump a pickle of the array to the specified file.
     |      The array can be read back with pickle.load or numpy.load.
     |
     |      Parameters
     |      ----------
     |      file : str or Path
     |          A string naming the dump file.
     |
     |          .. versionchanged:: 1.17.0
     |              `pathlib.Path` objects are now accepted.
     |
     |  dumps(...)
     |      a.dumps()
     |
     |      Returns the pickle of the array as a string.
     |      pickle.loads will convert the string back to an array.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |  fill(...)
     |      a.fill(value)
     |
     |      Fill the array with a scalar value.
     |
     |      Parameters
     |      ----------
     |      value : scalar
     |          All elements of `a` will be assigned this value.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([1, 2])
     |      >>> a.fill(0)
     |      >>> a
     |      array([0, 0])
     |      >>> a = np.empty(2)
     |      >>> a.fill(1)
     |      >>> a
     |      array([1.,  1.])
     |
     |      Fill expects a scalar value and always behaves the same as assigning
     |      to a single array element.  The following is a rare example where this
     |      distinction is important:
     |
     |      >>> a = np.array([None, None], dtype=object)
     |      >>> a[0] = np.array(3)
     |      >>> a
     |      array([array(3), None], dtype=object)
     |      >>> a.fill(np.array(3))
     |      >>> a
     |      array([array(3), array(3)], dtype=object)
     |
     |      Where other forms of assignments will unpack the array being assigned:
     |
     |      >>> a[...] = np.array(3)
     |      >>> a
     |      array([3, 3], dtype=object)
     |
     |  getfield(...)
     |      a.getfield(dtype, offset=0)
     |
     |      Returns a field of the given array as a certain type.
     |
     |      A field is a view of the array data with a given data-type. The values in
     |      the view are determined by the given type and the offset into the current
     |      array in bytes. The offset needs to be such that the view dtype fits in the
     |      array dtype; for example an array of dtype complex128 has 16-byte elements.
     |      If taking a view with a 32-bit integer (4 bytes), the offset needs to be
     |      between 0 and 12 bytes.
     |
     |      Parameters
     |      ----------
     |      dtype : str or dtype
     |          The data type of the view. The dtype size of the view can not be larger
     |          than that of the array itself.
     |      offset : int
     |          Number of bytes to skip before beginning the element view.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.diag([1.+1.j]*2)
     |      >>> x[1, 1] = 2 + 4.j
     |      >>> x
     |      array([[1.+1.j,  0.+0.j],
     |             [0.+0.j,  2.+4.j]])
     |      >>> x.getfield(np.float64)
     |      array([[1.,  0.],
     |             [0.,  2.]])
     |
     |      By choosing an offset of 8 bytes we can select the complex part of the
     |      array for our view:
     |
     |      >>> x.getfield(np.float64, offset=8)
     |      array([[1.,  0.],
     |             [0.,  4.]])
     |
     |  item(...)
     |      a.item(*args)
     |
     |      Copy an element of an array to a standard Python scalar and return it.
     |
     |      Parameters
     |      ----------
     |      \*args : Arguments (variable number and type)
     |
     |          * none: in this case, the method only works for arrays
     |            with one element (`a.size == 1`), which element is
     |            copied into a standard Python scalar object and returned.
     |
     |          * int_type: this argument is interpreted as a flat index into
     |            the array, specifying which element to copy and return.
     |
     |          * tuple of int_types: functions as does a single int_type argument,
     |            except that the argument is interpreted as an nd-index into the
     |            array.
     |
     |      Returns
     |      -------
     |      z : Standard Python scalar object
     |          A copy of the specified element of the array as a suitable
     |          Python scalar
     |
     |      Notes
     |      -----
     |      When the data type of `a` is longdouble or clongdouble, item() returns
     |      a scalar array object because there is no available Python scalar that
     |      would not lose information. Void arrays return a buffer object for item(),
     |      unless fields are defined, in which case a tuple is returned.
     |
     |      `item` is very similar to a[args], except, instead of an array scalar,
     |      a standard Python scalar is returned. This can be useful for speeding up
     |      access to elements of the array and doing arithmetic on elements of the
     |      array using Python's optimized math.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.random.seed(123)
     |      >>> x = np.random.randint(9, size=(3, 3))
     |      >>> x
     |      array([[2, 2, 6],
     |             [1, 3, 6],
     |             [1, 0, 1]])
     |      >>> x.item(3)
     |      1
     |      >>> x.item(7)
     |      0
     |      >>> x.item((0, 1))
     |      2
     |      >>> x.item((2, 2))
     |      1
     |
     |      For an array with object dtype, elements are returned as-is.
     |
     |      >>> a = np.array([np.int64(1)], dtype=object)
     |      >>> a.item() #return np.int64
     |      np.int64(1)
     |
     |  nonzero(...)
     |      a.nonzero()
     |
     |      Return the indices of the elements that are non-zero.
     |
     |      Refer to `numpy.nonzero` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.nonzero : equivalent function
     |
     |  partition(...)
     |      a.partition(kth, axis=-1, kind='introselect', order=None)
     |
     |      Partially sorts the elements in the array in such a way that the value of
     |      the element in k-th position is in the position it would be in a sorted
     |      array. In the output array, all elements smaller than the k-th element
     |      are located to the left of this element and all equal or greater are
     |      located to its right. The ordering of the elements in the two partitions
     |      on the either side of the k-th element in the output array is undefined.
     |
     |      .. versionadded:: 1.8.0
     |
     |      Parameters
     |      ----------
     |      kth : int or sequence of ints
     |          Element index to partition by. The kth element value will be in its
     |          final sorted position and all smaller elements will be moved before it
     |          and all equal or greater elements behind it.
     |          The order of all elements in the partitions is undefined.
     |          If provided with a sequence of kth it will partition all elements
     |          indexed by kth of them into their sorted position at once.
     |
     |          .. deprecated:: 1.22.0
     |              Passing booleans as index is deprecated.
     |      axis : int, optional
     |          Axis along which to sort. Default is -1, which means sort along the
     |          last axis.
     |      kind : {'introselect'}, optional
     |          Selection algorithm. Default is 'introselect'.
     |      order : str or list of str, optional
     |          When `a` is an array with fields defined, this argument specifies
     |          which fields to compare first, second, etc. A single field can
     |          be specified as a string, and not all fields need to be specified,
     |          but unspecified fields will still be used, in the order in which
     |          they come up in the dtype, to break ties.
     |
     |      See Also
     |      --------
     |      numpy.partition : Return a partitioned copy of an array.
     |      argpartition : Indirect partition.
     |      sort : Full sort.
     |
     |      Notes
     |      -----
     |      See ``np.partition`` for notes on the different algorithms.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([3, 4, 2, 1])
     |      >>> a.partition(3)
     |      >>> a
     |      array([2, 1, 3, 4]) # may vary
     |
     |      >>> a.partition((1, 3))
     |      >>> a
     |      array([1, 2, 3, 4])
     |
     |  put(...)
     |      a.put(indices, values, mode='raise')
     |
     |      Set ``a.flat[n] = values[n]`` for all `n` in indices.
     |
     |      Refer to `numpy.put` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.put : equivalent function
     |
     |  repeat(...)
     |      a.repeat(repeats, axis=None)
     |
     |      Repeat elements of an array.
     |
     |      Refer to `numpy.repeat` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.repeat : equivalent function
     |
     |  reshape(...)
     |      a.reshape(shape, /, *, order='C', copy=None)
     |
     |      Returns an array containing the same data with a new shape.
     |
     |      Refer to `numpy.reshape` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.reshape : equivalent function
     |
     |      Notes
     |      -----
     |      Unlike the free function `numpy.reshape`, this method on `ndarray` allows
     |      the elements of the shape parameter to be passed in as separate arguments.
     |      For example, ``a.reshape(10, 11)`` is equivalent to
     |      ``a.reshape((10, 11))``.
     |
     |  resize(...)
     |      a.resize(new_shape, refcheck=True)
     |
     |      Change shape and size of array in-place.
     |
     |      Parameters
     |      ----------
     |      new_shape : tuple of ints, or `n` ints
     |          Shape of resized array.
     |      refcheck : bool, optional
     |          If False, reference count will not be checked. Default is True.
     |
     |      Returns
     |      -------
     |      None
     |
     |      Raises
     |      ------
     |      ValueError
     |          If `a` does not own its own data or references or views to it exist,
     |          and the data memory must be changed.
     |          PyPy only: will always raise if the data memory must be changed, since
     |          there is no reliable way to determine if references or views to it
     |          exist.
     |
     |      SystemError
     |          If the `order` keyword argument is specified. This behaviour is a
     |          bug in NumPy.
     |
     |      See Also
     |      --------
     |      resize : Return a new array with the specified shape.
     |
     |      Notes
     |      -----
     |      This reallocates space for the data area if necessary.
     |
     |      Only contiguous arrays (data elements consecutive in memory) can be
     |      resized.
     |
     |      The purpose of the reference count check is to make sure you
     |      do not use this array as a buffer for another Python object and then
     |      reallocate the memory. However, reference counts can increase in
     |      other ways so if you are sure that you have not shared the memory
     |      for this array with another Python object, then you may safely set
     |      `refcheck` to False.
     |
     |      Examples
     |      --------
     |      Shrinking an array: array is flattened (in the order that the data are
     |      stored in memory), resized, and reshaped:
     |
     |      >>> import numpy as np
     |
     |      >>> a = np.array([[0, 1], [2, 3]], order='C')
     |      >>> a.resize((2, 1))
     |      >>> a
     |      array([[0],
     |             [1]])
     |
     |      >>> a = np.array([[0, 1], [2, 3]], order='F')
     |      >>> a.resize((2, 1))
     |      >>> a
     |      array([[0],
     |             [2]])
     |
     |      Enlarging an array: as above, but missing entries are filled with zeros:
     |
     |      >>> b = np.array([[0, 1], [2, 3]])
     |      >>> b.resize(2, 3) # new_shape parameter doesn't have to be a tuple
     |      >>> b
     |      array([[0, 1, 2],
     |             [3, 0, 0]])
     |
     |      Referencing an array prevents resizing...
     |
     |      >>> c = a
     |      >>> a.resize((1, 1))
     |      Traceback (most recent call last):
     |      ...
     |      ValueError: cannot resize an array that references or is referenced ...
     |
     |      Unless `refcheck` is False:
     |
     |      >>> a.resize((1, 1), refcheck=False)
     |      >>> a
     |      array([[0]])
     |      >>> c
     |      array([[0]])
     |
     |  round(...)
     |      a.round(decimals=0, out=None)
     |
     |      Return `a` with each element rounded to the given number of decimals.
     |
     |      Refer to `numpy.around` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.around : equivalent function
     |
     |  searchsorted(...)
     |      a.searchsorted(v, side='left', sorter=None)
     |
     |      Find indices where elements of v should be inserted in a to maintain order.
     |
     |      For full documentation, see `numpy.searchsorted`
     |
     |      See Also
     |      --------
     |      numpy.searchsorted : equivalent function
     |
     |  setfield(...)
     |      a.setfield(val, dtype, offset=0)
     |
     |      Put a value into a specified place in a field defined by a data-type.
     |
     |      Place `val` into `a`'s field defined by `dtype` and beginning `offset`
     |      bytes into the field.
     |
     |      Parameters
     |      ----------
     |      val : object
     |          Value to be placed in field.
     |      dtype : dtype object
     |          Data-type of the field in which to place `val`.
     |      offset : int, optional
     |          The number of bytes into the field at which to place `val`.
     |
     |      Returns
     |      -------
     |      None
     |
     |      See Also
     |      --------
     |      getfield
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.eye(3)
     |      >>> x.getfield(np.float64)
     |      array([[1.,  0.,  0.],
     |             [0.,  1.,  0.],
     |             [0.,  0.,  1.]])
     |      >>> x.setfield(3, np.int32)
     |      >>> x.getfield(np.int32)
     |      array([[3, 3, 3],
     |             [3, 3, 3],
     |             [3, 3, 3]], dtype=int32)
     |      >>> x
     |      array([[1.0e+000, 1.5e-323, 1.5e-323],
     |             [1.5e-323, 1.0e+000, 1.5e-323],
     |             [1.5e-323, 1.5e-323, 1.0e+000]])
     |      >>> x.setfield(np.eye(3), np.int32)
     |      >>> x
     |      array([[1.,  0.,  0.],
     |             [0.,  1.,  0.],
     |             [0.,  0.,  1.]])
     |
     |  setflags(...)
     |      a.setflags(write=None, align=None, uic=None)
     |
     |      Set array flags WRITEABLE, ALIGNED, WRITEBACKIFCOPY,
     |      respectively.
     |
     |      These Boolean-valued flags affect how numpy interprets the memory
     |      area used by `a` (see Notes below). The ALIGNED flag can only
     |      be set to True if the data is actually aligned according to the type.
     |      The WRITEBACKIFCOPY flag can never be set
     |      to True. The flag WRITEABLE can only be set to True if the array owns its
     |      own memory, or the ultimate owner of the memory exposes a writeable buffer
     |      interface, or is a string. (The exception for string is made so that
     |      unpickling can be done without copying memory.)
     |
     |      Parameters
     |      ----------
     |      write : bool, optional
     |          Describes whether or not `a` can be written to.
     |      align : bool, optional
     |          Describes whether or not `a` is aligned properly for its type.
     |      uic : bool, optional
     |          Describes whether or not `a` is a copy of another "base" array.
     |
     |      Notes
     |      -----
     |      Array flags provide information about how the memory area used
     |      for the array is to be interpreted. There are 7 Boolean flags
     |      in use, only three of which can be changed by the user:
     |      WRITEBACKIFCOPY, WRITEABLE, and ALIGNED.
     |
     |      WRITEABLE (W) the data area can be written to;
     |
     |      ALIGNED (A) the data and strides are aligned appropriately for the hardware
     |      (as determined by the compiler);
     |
     |      WRITEBACKIFCOPY (X) this array is a copy of some other array (referenced
     |      by .base). When the C-API function PyArray_ResolveWritebackIfCopy is
     |      called, the base array will be updated with the contents of this array.
     |
     |      All flags can be accessed using the single (upper case) letter as well
     |      as the full name.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> y = np.array([[3, 1, 7],
     |      ...               [2, 0, 0],
     |      ...               [8, 5, 9]])
     |      >>> y
     |      array([[3, 1, 7],
     |             [2, 0, 0],
     |             [8, 5, 9]])
     |      >>> y.flags
     |        C_CONTIGUOUS : True
     |        F_CONTIGUOUS : False
     |        OWNDATA : True
     |        WRITEABLE : True
     |        ALIGNED : True
     |        WRITEBACKIFCOPY : False
     |      >>> y.setflags(write=0, align=0)
     |      >>> y.flags
     |        C_CONTIGUOUS : True
     |        F_CONTIGUOUS : False
     |        OWNDATA : True
     |        WRITEABLE : False
     |        ALIGNED : False
     |        WRITEBACKIFCOPY : False
     |      >>> y.setflags(uic=1)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      ValueError: cannot set WRITEBACKIFCOPY flag to True
     |
     |  sort(...)
     |      a.sort(axis=-1, kind=None, order=None)
     |
     |      Sort an array in-place. Refer to `numpy.sort` for full documentation.
     |
     |      Parameters
     |      ----------
     |      axis : int, optional
     |          Axis along which to sort. Default is -1, which means sort along the
     |          last axis.
     |      kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional
     |          Sorting algorithm. The default is 'quicksort'. Note that both 'stable'
     |          and 'mergesort' use timsort under the covers and, in general, the
     |          actual implementation will vary with datatype. The 'mergesort' option
     |          is retained for backwards compatibility.
     |
     |          .. versionchanged:: 1.15.0
     |             The 'stable' option was added.
     |
     |      order : str or list of str, optional
     |          When `a` is an array with fields defined, this argument specifies
     |          which fields to compare first, second, etc.  A single field can
     |          be specified as a string, and not all fields need be specified,
     |          but unspecified fields will still be used, in the order in which
     |          they come up in the dtype, to break ties.
     |
     |      See Also
     |      --------
     |      numpy.sort : Return a sorted copy of an array.
     |      numpy.argsort : Indirect sort.
     |      numpy.lexsort : Indirect stable sort on multiple keys.
     |      numpy.searchsorted : Find elements in sorted array.
     |      numpy.partition: Partial sort.
     |
     |      Notes
     |      -----
     |      See `numpy.sort` for notes on the different sorting algorithms.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1,4], [3,1]])
     |      >>> a.sort(axis=1)
     |      >>> a
     |      array([[1, 4],
     |             [1, 3]])
     |      >>> a.sort(axis=0)
     |      >>> a
     |      array([[1, 3],
     |             [1, 4]])
     |
     |      Use the `order` keyword to specify a field to use when sorting a
     |      structured array:
     |
     |      >>> a = np.array([('a', 2), ('c', 1)], dtype=[('x', 'S1'), ('y', int)])
     |      >>> a.sort(order='y')
     |      >>> a
     |      array([(b'c', 1), (b'a', 2)],
     |            dtype=[('x', 'S1'), ('y', '<i8')])
     |
     |  swapaxes(...)
     |      a.swapaxes(axis1, axis2)
     |
     |      Return a view of the array with `axis1` and `axis2` interchanged.
     |
     |      Refer to `numpy.swapaxes` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.swapaxes : equivalent function
     |
     |  take(...)
     |      a.take(indices, axis=None, out=None, mode='raise')
     |
     |      Return an array formed from the elements of `a` at the given indices.
     |
     |      Refer to `numpy.take` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.take : equivalent function
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |      a.tobytes(order='C')
     |
     |      Construct Python bytes containing the raw data bytes in the array.
     |
     |      Constructs Python bytes showing a copy of the raw contents of
     |      data memory. The bytes object is produced in C-order by default.
     |      This behavior is controlled by the ``order`` parameter.
     |
     |      .. versionadded:: 1.9.0
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A'}, optional
     |          Controls the memory layout of the bytes object. 'C' means C-order,
     |          'F' means F-order, 'A' (short for *Any*) means 'F' if `a` is
     |          Fortran contiguous, 'C' otherwise. Default is 'C'.
     |
     |      Returns
     |      -------
     |      s : bytes
     |          Python bytes exhibiting a copy of `a`'s raw data.
     |
     |      See also
     |      --------
     |      frombuffer
     |          Inverse of this operation, construct a 1-dimensional array from Python
     |          bytes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([[0, 1], [2, 3]], dtype='<u2')
     |      >>> x.tobytes()
     |      b'\x00\x00\x01\x00\x02\x00\x03\x00'
     |      >>> x.tobytes('C') == x.tobytes()
     |      True
     |      >>> x.tobytes('F')
     |      b'\x00\x00\x02\x00\x01\x00\x03\x00'
     |
     |  tofile(...)
     |      a.tofile(fid, sep="", format="%s")
     |
     |      Write array to a file as text or binary (default).
     |
     |      Data is always written in 'C' order, independent of the order of `a`.
     |      The data produced by this method can be recovered using the function
     |      fromfile().
     |
     |      Parameters
     |      ----------
     |      fid : file or str or Path
     |          An open file object, or a string containing a filename.
     |
     |          .. versionchanged:: 1.17.0
     |              `pathlib.Path` objects are now accepted.
     |
     |      sep : str
     |          Separator between array items for text output.
     |          If "" (empty), a binary file is written, equivalent to
     |          ``file.write(a.tobytes())``.
     |      format : str
     |          Format string for text file output.
     |          Each entry in the array is formatted to text by first converting
     |          it to the closest Python type, and then using "format" % item.
     |
     |      Notes
     |      -----
     |      This is a convenience function for quick storage of array data.
     |      Information on endianness and precision is lost, so this method is not a
     |      good choice for files intended to archive data or transport data between
     |      machines with different endianness. Some of these problems can be overcome
     |      by outputting the data as text files, at the expense of speed and file
     |      size.
     |
     |      When fid is a file object, array contents are directly written to the
     |      file, bypassing the file object's ``write`` method. As a result, tofile
     |      cannot be used with files objects supporting compression (e.g., GzipFile)
     |      or file-like objects that do not support ``fileno()`` (e.g., BytesIO).
     |
     |  tostring(...)
     |      a.tostring(order='C')
     |
     |      A compatibility alias for `~ndarray.tobytes`, with exactly the same
     |      behavior.
     |
     |      Despite its name, it returns :class:`bytes` not :class:`str`\ s.
     |
     |      .. deprecated:: 1.19.0
     |
     |  trace(...)
     |      a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)
     |
     |      Return the sum along diagonals of the array.
     |
     |      Refer to `numpy.trace` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.trace : equivalent function
     |
     |  transpose(...)
     |      a.transpose(*axes)
     |
     |      Returns a view of the array with axes transposed.
     |
     |      Refer to `numpy.transpose` for full documentation.
     |
     |      Parameters
     |      ----------
     |      axes : None, tuple of ints, or `n` ints
     |
     |       * None or no argument: reverses the order of the axes.
     |
     |       * tuple of ints: `i` in the `j`-th place in the tuple means that the
     |         array's `i`-th axis becomes the transposed array's `j`-th axis.
     |
     |       * `n` ints: same as an n-tuple of the same ints (this form is
     |         intended simply as a "convenience" alternative to the tuple form).
     |
     |      Returns
     |      -------
     |      p : ndarray
     |          View of the array with its axes suitably permuted.
     |
     |      See Also
     |      --------
     |      transpose : Equivalent function.
     |      ndarray.T : Array property returning the array transposed.
     |      ndarray.reshape : Give a new shape to an array without changing its data.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.transpose()
     |      array([[1, 3],
     |             [2, 4]])
     |      >>> a.transpose((1, 0))
     |      array([[1, 3],
     |             [2, 4]])
     |      >>> a.transpose(1, 0)
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> a
     |      array([1, 2, 3, 4])
     |      >>> a.transpose()
     |      array([1, 2, 3, 4])
     |
     |  view(...)
     |      a.view([dtype][, type])
     |
     |      New view of array with the same data.
     |
     |      .. note::
     |          Passing None for ``dtype`` is different from omitting the parameter,
     |          since the former invokes ``dtype(None)`` which is an alias for
     |          ``dtype('float64')``.
     |
     |      Parameters
     |      ----------
     |      dtype : data-type or ndarray sub-class, optional
     |          Data-type descriptor of the returned view, e.g., float32 or int16.
     |          Omitting it results in the view having the same data-type as `a`.
     |          This argument can also be specified as an ndarray sub-class, which
     |          then specifies the type of the returned object (this is equivalent to
     |          setting the ``type`` parameter).
     |      type : Python type, optional
     |          Type of the returned view, e.g., ndarray or matrix.  Again, omission
     |          of the parameter results in type preservation.
     |
     |      Notes
     |      -----
     |      ``a.view()`` is used two different ways:
     |
     |      ``a.view(some_dtype)`` or ``a.view(dtype=some_dtype)`` constructs a view
     |      of the array's memory with a different data-type.  This can cause a
     |      reinterpretation of the bytes of memory.
     |
     |      ``a.view(ndarray_subclass)`` or ``a.view(type=ndarray_subclass)`` just
     |      returns an instance of `ndarray_subclass` that looks at the same array
     |      (same shape, dtype, etc.)  This does not cause a reinterpretation of the
     |      memory.
     |
     |      For ``a.view(some_dtype)``, if ``some_dtype`` has a different number of
     |      bytes per entry than the previous dtype (for example, converting a regular
     |      array to a structured array), then the last axis of ``a`` must be
     |      contiguous. This axis will be resized in the result.
     |
     |      .. versionchanged:: 1.23.0
     |         Only the last axis needs to be contiguous. Previously, the entire array
     |         had to be C-contiguous.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([(-1, 2)], dtype=[('a', np.int8), ('b', np.int8)])
     |
     |      Viewing array data using a different type and dtype:
     |
     |      >>> nonneg = np.dtype([("a", np.uint8), ("b", np.uint8)])
     |      >>> y = x.view(dtype=nonneg, type=np.recarray)
     |      >>> x["a"]
     |      array([-1], dtype=int8)
     |      >>> y.a
     |      array([255], dtype=uint8)
     |
     |      Creating a view on a structured array so it can be used in calculations
     |
     |      >>> x = np.array([(1, 2),(3,4)], dtype=[('a', np.int8), ('b', np.int8)])
     |      >>> xv = x.view(dtype=np.int8).reshape(-1,2)
     |      >>> xv
     |      array([[1, 2],
     |             [3, 4]], dtype=int8)
     |      >>> xv.mean(0)
     |      array([2.,  3.])
     |
     |      Making changes to the view changes the underlying array
     |
     |      >>> xv[0,1] = 20
     |      >>> x
     |      array([(1, 20), (3,  4)], dtype=[('a', 'i1'), ('b', 'i1')])
     |
     |      Using a view to convert an array to a recarray:
     |
     |      >>> z = x.view(np.recarray)
     |      >>> z.a
     |      array([1, 3], dtype=int8)
     |
     |      Views share data:
     |
     |      >>> x[0] = (9, 10)
     |      >>> z[0]
     |      np.record((9, 10), dtype=[('a', 'i1'), ('b', 'i1')])
     |
     |      Views that change the dtype size (bytes per entry) should normally be
     |      avoided on arrays defined by slices, transposes, fortran-ordering, etc.:
     |
     |      >>> x = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.int16)
     |      >>> y = x[:, ::2]
     |      >>> y
     |      array([[1, 3],
     |             [4, 6]], dtype=int16)
     |      >>> y.view(dtype=[('width', np.int16), ('length', np.int16)])
     |      Traceback (most recent call last):
     |          ...
     |      ValueError: To change to a dtype of a different size, the last axis must be contiguous
     |      >>> z = y.copy()
     |      >>> z.view(dtype=[('width', np.int16), ('length', np.int16)])
     |      array([[(1, 3)],
     |             [(4, 6)]], dtype=[('width', '<i2'), ('length', '<i2')])
     |
     |      However, views that change dtype are totally fine for arrays with a
     |      contiguous last axis, even if the rest of the axes are not C-contiguous:
     |
     |      >>> x = np.arange(2 * 3 * 4, dtype=np.int8).reshape(2, 3, 4)
     |      >>> x.transpose(1, 0, 2).view(np.int16)
     |      array([[[ 256,  770],
     |              [3340, 3854]],
     |      <BLANKLINE>
     |             [[1284, 1798],
     |              [4368, 4882]],
     |      <BLANKLINE>
     |             [[2312, 2826],
     |              [5396, 5910]]], dtype=int16)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from ndarray:
     |
     |  __class_getitem__(...)
     |      a.__class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.ndarray` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.ndarray` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.ndarray[Any, np.dtype[Any]]
     |      numpy.ndarray[typing.Any, numpy.dtype[typing.Any]]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |      numpy.typing.NDArray : An ndarray alias :term:`generic <generic type>`
     |                          w.r.t. its `dtype.type <numpy.dtype.type>`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ndarray:
     |
     |  __array_interface__
     |      Array protocol: Python side.
     |
     |  __array_struct__
     |      Array protocol: C-struct side.
     |
     |  base
     |      Base object if memory is from some other object.
     |
     |      Examples
     |      --------
     |      The base of an array that owns its memory is None:
     |
     |      >>> import numpy as np
     |      >>> x = np.array([1,2,3,4])
     |      >>> x.base is None
     |      True
     |
     |      Slicing creates a view, whose memory is shared with x:
     |
     |      >>> y = x[2:]
     |      >>> y.base is x
     |      True
     |
     |  ctypes
     |      An object to simplify the interaction of the array with the ctypes
     |      module.
     |
     |      This attribute creates an object that makes it easier to use arrays
     |      when calling shared libraries with the ctypes module. The returned
     |      object has, among others, data, shape, and strides attributes (see
     |      Notes below) which themselves return ctypes objects that can be used
     |      as arguments to a shared library.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      c : Python object
     |          Possessing attributes data, shape, strides, etc.
     |
     |      See Also
     |      --------
     |      numpy.ctypeslib
     |
     |      Notes
     |      -----
     |      Below are the public attributes of this object which were documented
     |      in "Guide to NumPy" (we have omitted undocumented public attributes,
     |      as well as documented private attributes):
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.data
     |          :noindex:
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.shape
     |          :noindex:
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.strides
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.data_as
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.shape_as
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.strides_as
     |          :noindex:
     |
     |      If the ctypes module is not available, then the ctypes attribute
     |      of array objects still returns something useful, but ctypes objects
     |      are not returned and errors may be raised instead. In particular,
     |      the object will still have the ``as_parameter`` attribute which will
     |      return an integer equal to the data attribute.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> import ctypes
     |      >>> x = np.array([[0, 1], [2, 3]], dtype=np.int32)
     |      >>> x
     |      array([[0, 1],
     |             [2, 3]], dtype=int32)
     |      >>> x.ctypes.data
     |      31962608 # may vary
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint32))
     |      <__main__.LP_c_uint object at 0x7ff2fc1fc200> # may vary
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint32)).contents
     |      c_uint(0)
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint64)).contents
     |      c_ulong(4294967296)
     |      >>> x.ctypes.shape
     |      <numpy._core._internal.c_long_Array_2 object at 0x7ff2fc1fce60> # may vary
     |      >>> x.ctypes.strides
     |      <numpy._core._internal.c_long_Array_2 object at 0x7ff2fc1ff320> # may vary
     |
     |  data
     |      Python buffer object pointing to the start of the array's data.
     |
     |  device
     |
     |  dtype
     |      Data-type of the array's elements.
     |
     |      .. warning::
     |
     |          Setting ``arr.dtype`` is discouraged and may be deprecated in the
     |          future.  Setting will replace the ``dtype`` without modifying the
     |          memory (see also `ndarray.view` and `ndarray.astype`).
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      d : numpy dtype object
     |
     |      See Also
     |      --------
     |      ndarray.astype : Cast the values contained in the array to a new data-type.
     |      ndarray.view : Create a view of the same data but a different data-type.
     |      numpy.dtype
     |
     |      Examples
     |      --------
     |      >>> x
     |      array([[0, 1],
     |             [2, 3]])
     |      >>> x.dtype
     |      dtype('int32')
     |      >>> type(x.dtype)
     |      <type 'numpy.dtype'>
     |
     |  flags
     |      Information about the memory layout of the array.
     |
     |      Attributes
     |      ----------
     |      C_CONTIGUOUS (C)
     |          The data is in a single, C-style contiguous segment.
     |      F_CONTIGUOUS (F)
     |          The data is in a single, Fortran-style contiguous segment.
     |      OWNDATA (O)
     |          The array owns the memory it uses or borrows it from another object.
     |      WRITEABLE (W)
     |          The data area can be written to.  Setting this to False locks
     |          the data, making it read-only.  A view (slice, etc.) inherits WRITEABLE
     |          from its base array at creation time, but a view of a writeable
     |          array may be subsequently locked while the base array remains writeable.
     |          (The opposite is not true, in that a view of a locked array may not
     |          be made writeable.  However, currently, locking a base object does not
     |          lock any views that already reference it, so under that circumstance it
     |          is possible to alter the contents of a locked array via a previously
     |          created writeable view onto it.)  Attempting to change a non-writeable
     |          array raises a RuntimeError exception.
     |      ALIGNED (A)
     |          The data and all elements are aligned appropriately for the hardware.
     |      WRITEBACKIFCOPY (X)
     |          This array is a copy of some other array. The C-API function
     |          PyArray_ResolveWritebackIfCopy must be called before deallocating
     |          to the base array will be updated with the contents of this array.
     |      FNC
     |          F_CONTIGUOUS and not C_CONTIGUOUS.
     |      FORC
     |          F_CONTIGUOUS or C_CONTIGUOUS (one-segment test).
     |      BEHAVED (B)
     |          ALIGNED and WRITEABLE.
     |      CARRAY (CA)
     |          BEHAVED and C_CONTIGUOUS.
     |      FARRAY (FA)
     |          BEHAVED and F_CONTIGUOUS and not C_CONTIGUOUS.
     |
     |      Notes
     |      -----
     |      The `flags` object can be accessed dictionary-like (as in ``a.flags['WRITEABLE']``),
     |      or by using lowercased attribute names (as in ``a.flags.writeable``). Short flag
     |      names are only supported in dictionary access.
     |
     |      Only the WRITEBACKIFCOPY, WRITEABLE, and ALIGNED flags can be
     |      changed by the user, via direct assignment to the attribute or dictionary
     |      entry, or by calling `ndarray.setflags`.
     |
     |      The array flags cannot be set arbitrarily:
     |
     |      - WRITEBACKIFCOPY can only be set ``False``.
     |      - ALIGNED can only be set ``True`` if the data is truly aligned.
     |      - WRITEABLE can only be set ``True`` if the array owns its own memory
     |        or the ultimate owner of the memory exposes a writeable buffer
     |        interface or is a string.
     |
     |      Arrays can be both C-style and Fortran-style contiguous simultaneously.
     |      This is clear for 1-dimensional arrays, but can also be true for higher
     |      dimensional arrays.
     |
     |      Even for contiguous arrays a stride for a given dimension
     |      ``arr.strides[dim]`` may be *arbitrary* if ``arr.shape[dim] == 1``
     |      or the array has no elements.
     |      It does *not* generally hold that ``self.strides[-1] == self.itemsize``
     |      for C-style contiguous arrays or ``self.strides[0] == self.itemsize`` for
     |      Fortran-style contiguous arrays is true.
     |
     |  flat
     |      A 1-D iterator over the array.
     |
     |      This is a `numpy.flatiter` instance, which acts similarly to, but is not
     |      a subclass of, Python's built-in iterator object.
     |
     |      See Also
     |      --------
     |      flatten : Return a copy of the array collapsed into one dimension.
     |
     |      flatiter
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.arange(1, 7).reshape(2, 3)
     |      >>> x
     |      array([[1, 2, 3],
     |             [4, 5, 6]])
     |      >>> x.flat[3]
     |      4
     |      >>> x.T
     |      array([[1, 4],
     |             [2, 5],
     |             [3, 6]])
     |      >>> x.T.flat[3]
     |      5
     |      >>> type(x.flat)
     |      <class 'numpy.flatiter'>
     |
     |      An assignment example:
     |
     |      >>> x.flat = 3; x
     |      array([[3, 3, 3],
     |             [3, 3, 3]])
     |      >>> x.flat[[1,4]] = 1; x
     |      array([[3, 1, 3],
     |             [3, 1, 3]])
     |
     |  imag
     |      The imaginary part of the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.sqrt([1+0j, 0+1j])
     |      >>> x.imag
     |      array([ 0.        ,  0.70710678])
     |      >>> x.imag.dtype
     |      dtype('float64')
     |
     |  itemset
     |
     |  itemsize
     |      Length of one array element in bytes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1,2,3], dtype=np.float64)
     |      >>> x.itemsize
     |      8
     |      >>> x = np.array([1,2,3], dtype=np.complex128)
     |      >>> x.itemsize
     |      16
     |
     |  mT
     |      View of the matrix transposed array.
     |
     |      The matrix transpose is the transpose of the last two dimensions, even
     |      if the array is of higher dimension.
     |
     |      .. versionadded:: 2.0
     |
     |      Raises
     |      ------
     |      ValueError
     |          If the array is of dimension less than 2.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.mT
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.arange(8).reshape((2, 2, 2))
     |      >>> a
     |      array([[[0, 1],
     |              [2, 3]],
     |      <BLANKLINE>
     |             [[4, 5],
     |              [6, 7]]])
     |      >>> a.mT
     |      array([[[0, 2],
     |              [1, 3]],
     |      <BLANKLINE>
     |             [[4, 6],
     |              [5, 7]]])
     |
     |  nbytes
     |      Total bytes consumed by the elements of the array.
     |
     |      Notes
     |      -----
     |      Does not include memory consumed by non-element attributes of the
     |      array object.
     |
     |      See Also
     |      --------
     |      sys.getsizeof
     |          Memory consumed by the object itself without parents in case view.
     |          This does include memory consumed by non-element attributes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.zeros((3,5,2), dtype=np.complex128)
     |      >>> x.nbytes
     |      480
     |      >>> np.prod(x.shape) * x.itemsize
     |      480
     |
     |  ndim
     |      Number of array dimensions.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> x.ndim
     |      1
     |      >>> y = np.zeros((2, 3, 4))
     |      >>> y.ndim
     |      3
     |
     |  newbyteorder
     |
     |  real
     |      The real part of the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.sqrt([1+0j, 0+1j])
     |      >>> x.real
     |      array([ 1.        ,  0.70710678])
     |      >>> x.real.dtype
     |      dtype('float64')
     |
     |      See Also
     |      --------
     |      numpy.real : equivalent function
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |      The shape property is usually used to get the current shape of an array,
     |      but may also be used to reshape the array in-place by assigning a tuple of
     |      array dimensions to it.  As with `numpy.reshape`, one of the new shape
     |      dimensions can be -1, in which case its value is inferred from the size of
     |      the array and the remaining dimensions. Reshaping an array in-place will
     |      fail if a copy is required.
     |
     |      .. warning::
     |
     |          Setting ``arr.shape`` is discouraged and may be deprecated in the
     |          future.  Using `ndarray.reshape` is the preferred approach.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3, 4])
     |      >>> x.shape
     |      (4,)
     |      >>> y = np.zeros((2, 3, 4))
     |      >>> y.shape
     |      (2, 3, 4)
     |      >>> y.shape = (3, 8)
     |      >>> y
     |      array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
     |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
     |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])
     |      >>> y.shape = (3, 6)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      ValueError: total size of new array must be unchanged
     |      >>> np.zeros((4,2))[::2].shape = (-1,)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      AttributeError: Incompatible shape for in-place modification. Use
     |      `.reshape()` to make a copy with the desired shape.
     |
     |      See Also
     |      --------
     |      numpy.shape : Equivalent getter function.
     |      numpy.reshape : Function similar to setting ``shape``.
     |      ndarray.reshape : Method similar to setting ``shape``.
     |
     |  size
     |      Number of elements in the array.
     |
     |      Equal to ``np.prod(a.shape)``, i.e., the product of the array's
     |      dimensions.
     |
     |      Notes
     |      -----
     |      `a.size` returns a standard arbitrary precision Python integer. This
     |      may not be the case with other methods of obtaining the same value
     |      (like the suggested ``np.prod(a.shape)``, which returns an instance
     |      of ``np.int_``), and may be relevant if the value is used further in
     |      calculations that may overflow a fixed size integer type.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.zeros((3, 5, 2), dtype=np.complex128)
     |      >>> x.size
     |      30
     |      >>> np.prod(x.shape)
     |      30
     |
     |  strides
     |      Tuple of bytes to step in each dimension when traversing an array.
     |
     |      The byte offset of element ``(i[0], i[1], ..., i[n])`` in an array `a`
     |      is::
     |
     |          offset = sum(np.array(i) * a.strides)
     |
     |      A more detailed explanation of strides can be found in
     |      :ref:`arrays.ndarray`.
     |
     |      .. warning::
     |
     |          Setting ``arr.strides`` is discouraged and may be deprecated in the
     |          future.  `numpy.lib.stride_tricks.as_strided` should be preferred
     |          to create a new view of the same data in a safer way.
     |
     |      Notes
     |      -----
     |      Imagine an array of 32-bit integers (each 4 bytes)::
     |
     |        x = np.array([[0, 1, 2, 3, 4],
     |                      [5, 6, 7, 8, 9]], dtype=np.int32)
     |
     |      This array is stored in memory as 40 bytes, one after the other
     |      (known as a contiguous block of memory).  The strides of an array tell
     |      us how many bytes we have to skip in memory to move to the next position
     |      along a certain axis.  For example, we have to skip 4 bytes (1 value) to
     |      move to the next column, but 20 bytes (5 values) to get to the same
     |      position in the next row.  As such, the strides for the array `x` will be
     |      ``(20, 4)``.
     |
     |      See Also
     |      --------
     |      numpy.lib.stride_tricks.as_strided
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> y = np.reshape(np.arange(2*3*4), (2,3,4))
     |      >>> y
     |      array([[[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]],
     |             [[12, 13, 14, 15],
     |              [16, 17, 18, 19],
     |              [20, 21, 22, 23]]])
     |      >>> y.strides
     |      (48, 16, 4)
     |      >>> y[1,1,1]
     |      17
     |      >>> offset=sum(y.strides * np.array((1,1,1)))
     |      >>> offset/y.itemsize
     |      17
     |
     |      >>> x = np.reshape(np.arange(5*6*7*8), (5,6,7,8)).transpose(2,3,1,0)
     |      >>> x.strides
     |      (32, 4, 224, 1344)
     |      >>> i = np.array([3,5,2,2])
     |      >>> offset = sum(i * x.strides)
     |      >>> x[3,5,2,2]
     |      813
     |      >>> offset / x.itemsize
     |      813
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from ndarray:
     |
     |  __hash__ = None

    class memmap(ndarray)
     |  memmap(filename, dtype=<class 'numpy.uint8'>, mode='r+', offset=0, shape=None, order='C')
     |
     |  Create a memory-map to an array stored in a *binary* file on disk.
     |
     |  Memory-mapped files are used for accessing small segments of large files
     |  on disk, without reading the entire file into memory.  NumPy's
     |  memmap's are array-like objects.  This differs from Python's ``mmap``
     |  module, which uses file-like objects.
     |
     |  This subclass of ndarray has some unpleasant interactions with
     |  some operations, because it doesn't quite fit properly as a subclass.
     |  An alternative to using this subclass is to create the ``mmap``
     |  object yourself, then create an ndarray with ndarray.__new__ directly,
     |  passing the object created in its 'buffer=' parameter.
     |
     |  This class may at some point be turned into a factory function
     |  which returns a view into an mmap buffer.
     |
     |  Flush the memmap instance to write the changes to the file. Currently there
     |  is no API to close the underlying ``mmap``. It is tricky to ensure the
     |  resource is actually closed, since it may be shared between different
     |  memmap instances.
     |
     |
     |  Parameters
     |  ----------
     |  filename : str, file-like object, or pathlib.Path instance
     |      The file name or file object to be used as the array data buffer.
     |  dtype : data-type, optional
     |      The data-type used to interpret the file contents.
     |      Default is `uint8`.
     |  mode : {'r+', 'r', 'w+', 'c'}, optional
     |      The file is opened in this mode:
     |
     |      +------+-------------------------------------------------------------+
     |      | 'r'  | Open existing file for reading only.                        |
     |      +------+-------------------------------------------------------------+
     |      | 'r+' | Open existing file for reading and writing.                 |
     |      +------+-------------------------------------------------------------+
     |      | 'w+' | Create or overwrite existing file for reading and writing.  |
     |      |      | If ``mode == 'w+'`` then `shape` must also be specified.    |
     |      +------+-------------------------------------------------------------+
     |      | 'c'  | Copy-on-write: assignments affect data in memory, but       |
     |      |      | changes are not saved to disk.  The file on disk is         |
     |      |      | read-only.                                                  |
     |      +------+-------------------------------------------------------------+
     |
     |      Default is 'r+'.
     |  offset : int, optional
     |      In the file, array data starts at this offset. Since `offset` is
     |      measured in bytes, it should normally be a multiple of the byte-size
     |      of `dtype`. When ``mode != 'r'``, even positive offsets beyond end of
     |      file are valid; The file will be extended to accommodate the
     |      additional data. By default, ``memmap`` will start at the beginning of
     |      the file, even if ``filename`` is a file pointer ``fp`` and
     |      ``fp.tell() != 0``.
     |  shape : int or sequence of ints, optional
     |      The desired shape of the array. If ``mode == 'r'`` and the number
     |      of remaining bytes after `offset` is not a multiple of the byte-size
     |      of `dtype`, you must specify `shape`. By default, the returned array
     |      will be 1-D with the number of elements determined by file size
     |      and data-type.
     |
     |      .. versionchanged:: 2.0
     |       The shape parameter can now be any integer sequence type, previously
     |       types were limited to tuple and int.
     |
     |  order : {'C', 'F'}, optional
     |      Specify the order of the ndarray memory layout:
     |      :term:`row-major`, C-style or :term:`column-major`,
     |      Fortran-style.  This only has an effect if the shape is
     |      greater than 1-D.  The default order is 'C'.
     |
     |  Attributes
     |  ----------
     |  filename : str or pathlib.Path instance
     |      Path to the mapped file.
     |  offset : int
     |      Offset position in the file.
     |  mode : str
     |      File mode.
     |
     |  Methods
     |  -------
     |  flush
     |      Flush any changes in memory to file on disk.
     |      When you delete a memmap object, flush is called first to write
     |      changes to disk.
     |
     |
     |  See also
     |  --------
     |  lib.format.open_memmap : Create or load a memory-mapped ``.npy`` file.
     |
     |  Notes
     |  -----
     |  The memmap object can be used anywhere an ndarray is accepted.
     |  Given a memmap ``fp``, ``isinstance(fp, numpy.ndarray)`` returns
     |  ``True``.
     |
     |  Memory-mapped files cannot be larger than 2GB on 32-bit systems.
     |
     |  When a memmap causes a file to be created or extended beyond its
     |  current size in the filesystem, the contents of the new part are
     |  unspecified. On systems with POSIX filesystem semantics, the extended
     |  part will be filled with zero bytes.
     |
     |  Examples
     |  --------
     |  >>> import numpy as np
     |  >>> data = np.arange(12, dtype='float32')
     |  >>> data.resize((3,4))
     |
     |  This example uses a temporary file so that doctest doesn't write
     |  files to your directory. You would use a 'normal' filename.
     |
     |  >>> from tempfile import mkdtemp
     |  >>> import os.path as path
     |  >>> filename = path.join(mkdtemp(), 'newfile.dat')
     |
     |  Create a memmap with dtype and shape that matches our data:
     |
     |  >>> fp = np.memmap(filename, dtype='float32', mode='w+', shape=(3,4))
     |  >>> fp
     |  memmap([[0., 0., 0., 0.],
     |          [0., 0., 0., 0.],
     |          [0., 0., 0., 0.]], dtype=float32)
     |
     |  Write data to memmap array:
     |
     |  >>> fp[:] = data[:]
     |  >>> fp
     |  memmap([[  0.,   1.,   2.,   3.],
     |          [  4.,   5.,   6.,   7.],
     |          [  8.,   9.,  10.,  11.]], dtype=float32)
     |
     |  >>> fp.filename == path.abspath(filename)
     |  True
     |
     |  Flushes memory changes to disk in order to read them back
     |
     |  >>> fp.flush()
     |
     |  Load the memmap and verify data was stored:
     |
     |  >>> newfp = np.memmap(filename, dtype='float32', mode='r', shape=(3,4))
     |  >>> newfp
     |  memmap([[  0.,   1.,   2.,   3.],
     |          [  4.,   5.,   6.,   7.],
     |          [  8.,   9.,  10.,  11.]], dtype=float32)
     |
     |  Read-only memmap:
     |
     |  >>> fpr = np.memmap(filename, dtype='float32', mode='r', shape=(3,4))
     |  >>> fpr.flags.writeable
     |  False
     |
     |  Copy-on-write memmap:
     |
     |  >>> fpc = np.memmap(filename, dtype='float32', mode='c', shape=(3,4))
     |  >>> fpc.flags.writeable
     |  True
     |
     |  It's possible to assign to copy-on-write array, but values are only
     |  written into the memory copy of the array, and not written to disk:
     |
     |  >>> fpc
     |  memmap([[  0.,   1.,   2.,   3.],
     |          [  4.,   5.,   6.,   7.],
     |          [  8.,   9.,  10.,  11.]], dtype=float32)
     |  >>> fpc[0,:] = 0
     |  >>> fpc
     |  memmap([[  0.,   0.,   0.,   0.],
     |          [  4.,   5.,   6.,   7.],
     |          [  8.,   9.,  10.,  11.]], dtype=float32)
     |
     |  File on disk is unchanged:
     |
     |  >>> fpr
     |  memmap([[  0.,   1.,   2.,   3.],
     |          [  4.,   5.,   6.,   7.],
     |          [  8.,   9.,  10.,  11.]], dtype=float32)
     |
     |  Offset into a memmap:
     |
     |  >>> fpo = np.memmap(filename, dtype='float32', mode='r', offset=16)
     |  >>> fpo
     |  memmap([  4.,   5.,   6.,   7.,   8.,   9.,  10.,  11.], dtype=float32)
     |
     |  Method resolution order:
     |      memmap
     |      ndarray
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __array_finalize__(self, obj) from numpy._core.memmap.memmap
     |      a.__array_finalize__(obj, /)
     |
     |      Present so subclasses can call super. Does nothing.
     |
     |  __array_wrap__(self, arr, context=None, return_scalar=False) from numpy._core.memmap.memmap
     |      a.__array_wrap__(array[, context], /)
     |
     |      Returns a view of `array` with the same type as self.
     |
     |  __getitem__(self, index) from numpy._core.memmap.memmap
     |      Return self[key].
     |
     |  flush(self) from numpy._core.memmap.memmap
     |      Write any changes in the array to the file on disk.
     |
     |      For further information, see `memmap`.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      See Also
     |      --------
     |      memmap
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(subtype, filename, dtype=<class 'numpy.uint8'>, mode='r+', offset=0, shape=None, order='C') from numpy._core.memmap.memmap
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __array_priority__ = -100.0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ndarray:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      a.__array__([dtype], *, copy=None)
     |
     |      For ``dtype`` parameter it returns a new reference to self if
     |      ``dtype`` is not given or it matches array's data type.
     |      A new array of provided data type is returned if ``dtype``
     |      is different from the current data type of the array.
     |      For ``copy`` parameter it returns a new reference to self if
     |      ``copy=False`` or ``copy=None`` and copying isn't enforced by ``dtype``
     |      parameter. The method returns a new array for ``copy=True``, regardless of
     |      ``dtype`` parameter.
     |
     |      A more detailed explanation of the ``__array__`` interface
     |      can be found in :ref:`dunder_array.interface`.
     |
     |  __array_function__(...)
     |
     |  __array_namespace__(...)
     |
     |  __array_ufunc__(...)
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __complex__(...)
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __copy__(...)
     |      a.__copy__()
     |
     |      Used if :func:`copy.copy` is called on an array. Returns a copy of the array.
     |
     |      Equivalent to ``a.copy(order='K')``.
     |
     |  __deepcopy__(...)
     |      a.__deepcopy__(memo, /)
     |
     |      Used if :func:`copy.deepcopy` is called on an array.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __dlpack__(...)
     |      a.__dlpack__(*, stream=None, max_version=None, dl_device=None, copy=None)
     |
     |      DLPack Protocol: Part of the Array API.
     |
     |  __dlpack_device__(...)
     |      a.__dlpack_device__()
     |
     |      DLPack Protocol: Part of the Array API.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      Default object formatter.
     |
     |      Return str(self) if format_spec is empty. Raise TypeError otherwise.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __iadd__(self, value, /)
     |      Return self+=value.
     |
     |  __iand__(self, value, /)
     |      Return self&=value.
     |
     |  __ifloordiv__(self, value, /)
     |      Return self//=value.
     |
     |  __ilshift__(self, value, /)
     |      Return self<<=value.
     |
     |  __imatmul__(self, value, /)
     |      Return self@=value.
     |
     |  __imod__(self, value, /)
     |      Return self%=value.
     |
     |  __imul__(self, value, /)
     |      Return self*=value.
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __ipow__(self, value, /)
     |      Return self**=value.
     |
     |  __irshift__(self, value, /)
     |      Return self>>=value.
     |
     |  __isub__(self, value, /)
     |      Return self-=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __itruediv__(self, value, /)
     |      Return self/=value.
     |
     |  __ixor__(self, value, /)
     |      Return self^=value.
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __matmul__(self, value, /)
     |      Return self@value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      a.__reduce__()
     |
     |      For pickling.
     |
     |  __reduce_ex__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmatmul__(self, value, /)
     |      Return value@self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __setstate__(...)
     |      a.__setstate__(state, /)
     |
     |      For unpickling.
     |
     |      The `state` argument must be a sequence that contains the following
     |      elements:
     |
     |      Parameters
     |      ----------
     |      version : int
     |          optional pickle version. If omitted defaults to 0.
     |      shape : tuple
     |      dtype : data-type
     |      isFortran : bool
     |      rawdata : string or list
     |          a binary string with the data (or a list if 'a' is an object array)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      a.all(axis=None, out=None, keepdims=False, *, where=True)
     |
     |      Returns True if all elements evaluate to True.
     |
     |      Refer to `numpy.all` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.all : equivalent function
     |
     |  any(...)
     |      a.any(axis=None, out=None, keepdims=False, *, where=True)
     |
     |      Returns True if any of the elements of `a` evaluate to True.
     |
     |      Refer to `numpy.any` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.any : equivalent function
     |
     |  argmax(...)
     |      a.argmax(axis=None, out=None, *, keepdims=False)
     |
     |      Return indices of the maximum values along the given axis.
     |
     |      Refer to `numpy.argmax` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.argmax : equivalent function
     |
     |  argmin(...)
     |      a.argmin(axis=None, out=None, *, keepdims=False)
     |
     |      Return indices of the minimum values along the given axis.
     |
     |      Refer to `numpy.argmin` for detailed documentation.
     |
     |      See Also
     |      --------
     |      numpy.argmin : equivalent function
     |
     |  argpartition(...)
     |      a.argpartition(kth, axis=-1, kind='introselect', order=None)
     |
     |      Returns the indices that would partition this array.
     |
     |      Refer to `numpy.argpartition` for full documentation.
     |
     |      .. versionadded:: 1.8.0
     |
     |      See Also
     |      --------
     |      numpy.argpartition : equivalent function
     |
     |  argsort(...)
     |      a.argsort(axis=-1, kind=None, order=None)
     |
     |      Returns the indices that would sort this array.
     |
     |      Refer to `numpy.argsort` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.argsort : equivalent function
     |
     |  astype(...)
     |      a.astype(dtype, order='K', casting='unsafe', subok=True, copy=True)
     |
     |      Copy of the array, cast to a specified type.
     |
     |      Parameters
     |      ----------
     |      dtype : str or dtype
     |          Typecode or data-type to which the array is cast.
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          Controls the memory layout order of the result.
     |          'C' means C order, 'F' means Fortran order, 'A'
     |          means 'F' order if all the arrays are Fortran contiguous,
     |          'C' order otherwise, and 'K' means as close to the
     |          order the array elements appear in memory as possible.
     |          Default is 'K'.
     |      casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
     |          Controls what kind of data casting may occur. Defaults to 'unsafe'
     |          for backwards compatibility.
     |
     |          * 'no' means the data types should not be cast at all.
     |          * 'equiv' means only byte-order changes are allowed.
     |          * 'safe' means only casts which can preserve values are allowed.
     |          * 'same_kind' means only safe casts or casts within a kind,
     |            like float64 to float32, are allowed.
     |          * 'unsafe' means any data conversions may be done.
     |      subok : bool, optional
     |          If True, then sub-classes will be passed-through (default), otherwise
     |          the returned array will be forced to be a base-class array.
     |      copy : bool, optional
     |          By default, astype always returns a newly allocated array. If this
     |          is set to false, and the `dtype`, `order`, and `subok`
     |          requirements are satisfied, the input array is returned instead
     |          of a copy.
     |
     |      Returns
     |      -------
     |      arr_t : ndarray
     |          Unless `copy` is False and the other conditions for returning the input
     |          array are satisfied (see description for `copy` input parameter), `arr_t`
     |          is a new array of the same shape as the input array, with dtype, order
     |          given by `dtype`, `order`.
     |
     |      Notes
     |      -----
     |      .. versionchanged:: 1.17.0
     |         Casting between a simple data type and a structured one is possible only
     |         for "unsafe" casting.  Casting to multiple fields is allowed, but
     |         casting from multiple fields is not.
     |
     |      .. versionchanged:: 1.9.0
     |         Casting from numeric to string types in 'safe' casting mode requires
     |         that the string dtype length is long enough to store the max
     |         integer/float value converted.
     |
     |      Raises
     |      ------
     |      ComplexWarning
     |          When casting from complex to float or int. To avoid this,
     |          one should use ``a.real.astype(t)``.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 2.5])
     |      >>> x
     |      array([1. ,  2. ,  2.5])
     |
     |      >>> x.astype(int)
     |      array([1, 2, 2])
     |
     |  byteswap(...)
     |      a.byteswap(inplace=False)
     |
     |      Swap the bytes of the array elements
     |
     |      Toggle between low-endian and big-endian data representation by
     |      returning a byteswapped array, optionally swapped in-place.
     |      Arrays of byte-strings are not swapped. The real and imaginary
     |      parts of a complex number are swapped individually.
     |
     |      Parameters
     |      ----------
     |      inplace : bool, optional
     |          If ``True``, swap bytes in-place, default is ``False``.
     |
     |      Returns
     |      -------
     |      out : ndarray
     |          The byteswapped array. If `inplace` is ``True``, this is
     |          a view to self.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> A = np.array([1, 256, 8755], dtype=np.int16)
     |      >>> list(map(hex, A))
     |      ['0x1', '0x100', '0x2233']
     |      >>> A.byteswap(inplace=True)
     |      array([  256,     1, 13090], dtype=int16)
     |      >>> list(map(hex, A))
     |      ['0x100', '0x1', '0x3322']
     |
     |      Arrays of byte-strings are not swapped
     |
     |      >>> A = np.array([b'ceg', b'fac'])
     |      >>> A.byteswap()
     |      array([b'ceg', b'fac'], dtype='|S3')
     |
     |      ``A.view(A.dtype.newbyteorder()).byteswap()`` produces an array with
     |      the same values but different representation in memory
     |
     |      >>> A = np.array([1, 2, 3])
     |      >>> A.view(np.uint8)
     |      array([1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
     |             0, 0], dtype=uint8)
     |      >>> A.view(A.dtype.newbyteorder()).byteswap(inplace=True)
     |      array([1, 2, 3])
     |      >>> A.view(np.uint8)
     |      array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
     |             0, 3], dtype=uint8)
     |
     |  choose(...)
     |      a.choose(choices, out=None, mode='raise')
     |
     |      Use an index array to construct a new array from a set of choices.
     |
     |      Refer to `numpy.choose` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.choose : equivalent function
     |
     |  clip(...)
     |      a.clip(min=None, max=None, out=None, **kwargs)
     |
     |      Return an array whose values are limited to ``[min, max]``.
     |      One of max or min must be given.
     |
     |      Refer to `numpy.clip` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.clip : equivalent function
     |
     |  compress(...)
     |      a.compress(condition, axis=None, out=None)
     |
     |      Return selected slices of this array along given axis.
     |
     |      Refer to `numpy.compress` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.compress : equivalent function
     |
     |  conj(...)
     |      a.conj()
     |
     |      Complex-conjugate all elements.
     |
     |      Refer to `numpy.conjugate` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.conjugate : equivalent function
     |
     |  conjugate(...)
     |      a.conjugate()
     |
     |      Return the complex conjugate, element-wise.
     |
     |      Refer to `numpy.conjugate` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.conjugate : equivalent function
     |
     |  copy(...)
     |      a.copy(order='C')
     |
     |      Return a copy of the array.
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          Controls the memory layout of the copy. 'C' means C-order,
     |          'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
     |          'C' otherwise. 'K' means match the layout of `a` as closely
     |          as possible. (Note that this function and :func:`numpy.copy` are very
     |          similar but have different default values for their order=
     |          arguments, and this function always passes sub-classes through.)
     |
     |      See also
     |      --------
     |      numpy.copy : Similar function with different default behavior
     |      numpy.copyto
     |
     |      Notes
     |      -----
     |      This function is the preferred method for creating an array copy.  The
     |      function :func:`numpy.copy` is similar, but it defaults to using order 'K',
     |      and will not pass sub-classes through by default.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([[1,2,3],[4,5,6]], order='F')
     |
     |      >>> y = x.copy()
     |
     |      >>> x.fill(0)
     |
     |      >>> x
     |      array([[0, 0, 0],
     |             [0, 0, 0]])
     |
     |      >>> y
     |      array([[1, 2, 3],
     |             [4, 5, 6]])
     |
     |      >>> y.flags['C_CONTIGUOUS']
     |      True
     |
     |      For arrays containing Python objects (e.g. dtype=object),
     |      the copy is a shallow one. The new array will contain the
     |      same object which may lead to surprises if that object can
     |      be modified (is mutable):
     |
     |      >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object)
     |      >>> b = a.copy()
     |      >>> b[2][0] = 10
     |      >>> a
     |      array([1, 'm', list([10, 3, 4])], dtype=object)
     |
     |      To ensure all elements within an ``object`` array are copied,
     |      use `copy.deepcopy`:
     |
     |      >>> import copy
     |      >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object)
     |      >>> c = copy.deepcopy(a)
     |      >>> c[2][0] = 10
     |      >>> c
     |      array([1, 'm', list([10, 3, 4])], dtype=object)
     |      >>> a
     |      array([1, 'm', list([2, 3, 4])], dtype=object)
     |
     |  cumprod(...)
     |      a.cumprod(axis=None, dtype=None, out=None)
     |
     |      Return the cumulative product of the elements along the given axis.
     |
     |      Refer to `numpy.cumprod` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.cumprod : equivalent function
     |
     |  cumsum(...)
     |      a.cumsum(axis=None, dtype=None, out=None)
     |
     |      Return the cumulative sum of the elements along the given axis.
     |
     |      Refer to `numpy.cumsum` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.cumsum : equivalent function
     |
     |  diagonal(...)
     |      a.diagonal(offset=0, axis1=0, axis2=1)
     |
     |      Return specified diagonals. In NumPy 1.9 the returned array is a
     |      read-only view instead of a copy as in previous NumPy versions.  In
     |      a future version the read-only restriction will be removed.
     |
     |      Refer to :func:`numpy.diagonal` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.diagonal : equivalent function
     |
     |  dot(...)
     |
     |  dump(...)
     |      a.dump(file)
     |
     |      Dump a pickle of the array to the specified file.
     |      The array can be read back with pickle.load or numpy.load.
     |
     |      Parameters
     |      ----------
     |      file : str or Path
     |          A string naming the dump file.
     |
     |          .. versionchanged:: 1.17.0
     |              `pathlib.Path` objects are now accepted.
     |
     |  dumps(...)
     |      a.dumps()
     |
     |      Returns the pickle of the array as a string.
     |      pickle.loads will convert the string back to an array.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |  fill(...)
     |      a.fill(value)
     |
     |      Fill the array with a scalar value.
     |
     |      Parameters
     |      ----------
     |      value : scalar
     |          All elements of `a` will be assigned this value.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([1, 2])
     |      >>> a.fill(0)
     |      >>> a
     |      array([0, 0])
     |      >>> a = np.empty(2)
     |      >>> a.fill(1)
     |      >>> a
     |      array([1.,  1.])
     |
     |      Fill expects a scalar value and always behaves the same as assigning
     |      to a single array element.  The following is a rare example where this
     |      distinction is important:
     |
     |      >>> a = np.array([None, None], dtype=object)
     |      >>> a[0] = np.array(3)
     |      >>> a
     |      array([array(3), None], dtype=object)
     |      >>> a.fill(np.array(3))
     |      >>> a
     |      array([array(3), array(3)], dtype=object)
     |
     |      Where other forms of assignments will unpack the array being assigned:
     |
     |      >>> a[...] = np.array(3)
     |      >>> a
     |      array([3, 3], dtype=object)
     |
     |  flatten(...)
     |      a.flatten(order='C')
     |
     |      Return a copy of the array collapsed into one dimension.
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          'C' means to flatten in row-major (C-style) order.
     |          'F' means to flatten in column-major (Fortran-
     |          style) order. 'A' means to flatten in column-major
     |          order if `a` is Fortran *contiguous* in memory,
     |          row-major order otherwise. 'K' means to flatten
     |          `a` in the order the elements occur in memory.
     |          The default is 'C'.
     |
     |      Returns
     |      -------
     |      y : ndarray
     |          A copy of the input array, flattened to one dimension.
     |
     |      See Also
     |      --------
     |      ravel : Return a flattened array.
     |      flat : A 1-D flat iterator over the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1,2], [3,4]])
     |      >>> a.flatten()
     |      array([1, 2, 3, 4])
     |      >>> a.flatten('F')
     |      array([1, 3, 2, 4])
     |
     |  getfield(...)
     |      a.getfield(dtype, offset=0)
     |
     |      Returns a field of the given array as a certain type.
     |
     |      A field is a view of the array data with a given data-type. The values in
     |      the view are determined by the given type and the offset into the current
     |      array in bytes. The offset needs to be such that the view dtype fits in the
     |      array dtype; for example an array of dtype complex128 has 16-byte elements.
     |      If taking a view with a 32-bit integer (4 bytes), the offset needs to be
     |      between 0 and 12 bytes.
     |
     |      Parameters
     |      ----------
     |      dtype : str or dtype
     |          The data type of the view. The dtype size of the view can not be larger
     |          than that of the array itself.
     |      offset : int
     |          Number of bytes to skip before beginning the element view.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.diag([1.+1.j]*2)
     |      >>> x[1, 1] = 2 + 4.j
     |      >>> x
     |      array([[1.+1.j,  0.+0.j],
     |             [0.+0.j,  2.+4.j]])
     |      >>> x.getfield(np.float64)
     |      array([[1.,  0.],
     |             [0.,  2.]])
     |
     |      By choosing an offset of 8 bytes we can select the complex part of the
     |      array for our view:
     |
     |      >>> x.getfield(np.float64, offset=8)
     |      array([[1.,  0.],
     |             [0.,  4.]])
     |
     |  item(...)
     |      a.item(*args)
     |
     |      Copy an element of an array to a standard Python scalar and return it.
     |
     |      Parameters
     |      ----------
     |      \*args : Arguments (variable number and type)
     |
     |          * none: in this case, the method only works for arrays
     |            with one element (`a.size == 1`), which element is
     |            copied into a standard Python scalar object and returned.
     |
     |          * int_type: this argument is interpreted as a flat index into
     |            the array, specifying which element to copy and return.
     |
     |          * tuple of int_types: functions as does a single int_type argument,
     |            except that the argument is interpreted as an nd-index into the
     |            array.
     |
     |      Returns
     |      -------
     |      z : Standard Python scalar object
     |          A copy of the specified element of the array as a suitable
     |          Python scalar
     |
     |      Notes
     |      -----
     |      When the data type of `a` is longdouble or clongdouble, item() returns
     |      a scalar array object because there is no available Python scalar that
     |      would not lose information. Void arrays return a buffer object for item(),
     |      unless fields are defined, in which case a tuple is returned.
     |
     |      `item` is very similar to a[args], except, instead of an array scalar,
     |      a standard Python scalar is returned. This can be useful for speeding up
     |      access to elements of the array and doing arithmetic on elements of the
     |      array using Python's optimized math.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.random.seed(123)
     |      >>> x = np.random.randint(9, size=(3, 3))
     |      >>> x
     |      array([[2, 2, 6],
     |             [1, 3, 6],
     |             [1, 0, 1]])
     |      >>> x.item(3)
     |      1
     |      >>> x.item(7)
     |      0
     |      >>> x.item((0, 1))
     |      2
     |      >>> x.item((2, 2))
     |      1
     |
     |      For an array with object dtype, elements are returned as-is.
     |
     |      >>> a = np.array([np.int64(1)], dtype=object)
     |      >>> a.item() #return np.int64
     |      np.int64(1)
     |
     |  max(...)
     |      a.max(axis=None, out=None, keepdims=False, initial=<no value>, where=True)
     |
     |      Return the maximum along a given axis.
     |
     |      Refer to `numpy.amax` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.amax : equivalent function
     |
     |  mean(...)
     |      a.mean(axis=None, dtype=None, out=None, keepdims=False, *, where=True)
     |
     |      Returns the average of the array elements along given axis.
     |
     |      Refer to `numpy.mean` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.mean : equivalent function
     |
     |  min(...)
     |      a.min(axis=None, out=None, keepdims=False, initial=<no value>, where=True)
     |
     |      Return the minimum along a given axis.
     |
     |      Refer to `numpy.amin` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.amin : equivalent function
     |
     |  nonzero(...)
     |      a.nonzero()
     |
     |      Return the indices of the elements that are non-zero.
     |
     |      Refer to `numpy.nonzero` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.nonzero : equivalent function
     |
     |  partition(...)
     |      a.partition(kth, axis=-1, kind='introselect', order=None)
     |
     |      Partially sorts the elements in the array in such a way that the value of
     |      the element in k-th position is in the position it would be in a sorted
     |      array. In the output array, all elements smaller than the k-th element
     |      are located to the left of this element and all equal or greater are
     |      located to its right. The ordering of the elements in the two partitions
     |      on the either side of the k-th element in the output array is undefined.
     |
     |      .. versionadded:: 1.8.0
     |
     |      Parameters
     |      ----------
     |      kth : int or sequence of ints
     |          Element index to partition by. The kth element value will be in its
     |          final sorted position and all smaller elements will be moved before it
     |          and all equal or greater elements behind it.
     |          The order of all elements in the partitions is undefined.
     |          If provided with a sequence of kth it will partition all elements
     |          indexed by kth of them into their sorted position at once.
     |
     |          .. deprecated:: 1.22.0
     |              Passing booleans as index is deprecated.
     |      axis : int, optional
     |          Axis along which to sort. Default is -1, which means sort along the
     |          last axis.
     |      kind : {'introselect'}, optional
     |          Selection algorithm. Default is 'introselect'.
     |      order : str or list of str, optional
     |          When `a` is an array with fields defined, this argument specifies
     |          which fields to compare first, second, etc. A single field can
     |          be specified as a string, and not all fields need to be specified,
     |          but unspecified fields will still be used, in the order in which
     |          they come up in the dtype, to break ties.
     |
     |      See Also
     |      --------
     |      numpy.partition : Return a partitioned copy of an array.
     |      argpartition : Indirect partition.
     |      sort : Full sort.
     |
     |      Notes
     |      -----
     |      See ``np.partition`` for notes on the different algorithms.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([3, 4, 2, 1])
     |      >>> a.partition(3)
     |      >>> a
     |      array([2, 1, 3, 4]) # may vary
     |
     |      >>> a.partition((1, 3))
     |      >>> a
     |      array([1, 2, 3, 4])
     |
     |  prod(...)
     |      a.prod(axis=None, dtype=None, out=None, keepdims=False,
     |          initial=1, where=True)
     |
     |      Return the product of the array elements over the given axis
     |
     |      Refer to `numpy.prod` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.prod : equivalent function
     |
     |  put(...)
     |      a.put(indices, values, mode='raise')
     |
     |      Set ``a.flat[n] = values[n]`` for all `n` in indices.
     |
     |      Refer to `numpy.put` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.put : equivalent function
     |
     |  ravel(...)
     |      a.ravel([order])
     |
     |      Return a flattened array.
     |
     |      Refer to `numpy.ravel` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.ravel : equivalent function
     |
     |      ndarray.flat : a flat iterator on the array.
     |
     |  repeat(...)
     |      a.repeat(repeats, axis=None)
     |
     |      Repeat elements of an array.
     |
     |      Refer to `numpy.repeat` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.repeat : equivalent function
     |
     |  reshape(...)
     |      a.reshape(shape, /, *, order='C', copy=None)
     |
     |      Returns an array containing the same data with a new shape.
     |
     |      Refer to `numpy.reshape` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.reshape : equivalent function
     |
     |      Notes
     |      -----
     |      Unlike the free function `numpy.reshape`, this method on `ndarray` allows
     |      the elements of the shape parameter to be passed in as separate arguments.
     |      For example, ``a.reshape(10, 11)`` is equivalent to
     |      ``a.reshape((10, 11))``.
     |
     |  resize(...)
     |      a.resize(new_shape, refcheck=True)
     |
     |      Change shape and size of array in-place.
     |
     |      Parameters
     |      ----------
     |      new_shape : tuple of ints, or `n` ints
     |          Shape of resized array.
     |      refcheck : bool, optional
     |          If False, reference count will not be checked. Default is True.
     |
     |      Returns
     |      -------
     |      None
     |
     |      Raises
     |      ------
     |      ValueError
     |          If `a` does not own its own data or references or views to it exist,
     |          and the data memory must be changed.
     |          PyPy only: will always raise if the data memory must be changed, since
     |          there is no reliable way to determine if references or views to it
     |          exist.
     |
     |      SystemError
     |          If the `order` keyword argument is specified. This behaviour is a
     |          bug in NumPy.
     |
     |      See Also
     |      --------
     |      resize : Return a new array with the specified shape.
     |
     |      Notes
     |      -----
     |      This reallocates space for the data area if necessary.
     |
     |      Only contiguous arrays (data elements consecutive in memory) can be
     |      resized.
     |
     |      The purpose of the reference count check is to make sure you
     |      do not use this array as a buffer for another Python object and then
     |      reallocate the memory. However, reference counts can increase in
     |      other ways so if you are sure that you have not shared the memory
     |      for this array with another Python object, then you may safely set
     |      `refcheck` to False.
     |
     |      Examples
     |      --------
     |      Shrinking an array: array is flattened (in the order that the data are
     |      stored in memory), resized, and reshaped:
     |
     |      >>> import numpy as np
     |
     |      >>> a = np.array([[0, 1], [2, 3]], order='C')
     |      >>> a.resize((2, 1))
     |      >>> a
     |      array([[0],
     |             [1]])
     |
     |      >>> a = np.array([[0, 1], [2, 3]], order='F')
     |      >>> a.resize((2, 1))
     |      >>> a
     |      array([[0],
     |             [2]])
     |
     |      Enlarging an array: as above, but missing entries are filled with zeros:
     |
     |      >>> b = np.array([[0, 1], [2, 3]])
     |      >>> b.resize(2, 3) # new_shape parameter doesn't have to be a tuple
     |      >>> b
     |      array([[0, 1, 2],
     |             [3, 0, 0]])
     |
     |      Referencing an array prevents resizing...
     |
     |      >>> c = a
     |      >>> a.resize((1, 1))
     |      Traceback (most recent call last):
     |      ...
     |      ValueError: cannot resize an array that references or is referenced ...
     |
     |      Unless `refcheck` is False:
     |
     |      >>> a.resize((1, 1), refcheck=False)
     |      >>> a
     |      array([[0]])
     |      >>> c
     |      array([[0]])
     |
     |  round(...)
     |      a.round(decimals=0, out=None)
     |
     |      Return `a` with each element rounded to the given number of decimals.
     |
     |      Refer to `numpy.around` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.around : equivalent function
     |
     |  searchsorted(...)
     |      a.searchsorted(v, side='left', sorter=None)
     |
     |      Find indices where elements of v should be inserted in a to maintain order.
     |
     |      For full documentation, see `numpy.searchsorted`
     |
     |      See Also
     |      --------
     |      numpy.searchsorted : equivalent function
     |
     |  setfield(...)
     |      a.setfield(val, dtype, offset=0)
     |
     |      Put a value into a specified place in a field defined by a data-type.
     |
     |      Place `val` into `a`'s field defined by `dtype` and beginning `offset`
     |      bytes into the field.
     |
     |      Parameters
     |      ----------
     |      val : object
     |          Value to be placed in field.
     |      dtype : dtype object
     |          Data-type of the field in which to place `val`.
     |      offset : int, optional
     |          The number of bytes into the field at which to place `val`.
     |
     |      Returns
     |      -------
     |      None
     |
     |      See Also
     |      --------
     |      getfield
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.eye(3)
     |      >>> x.getfield(np.float64)
     |      array([[1.,  0.,  0.],
     |             [0.,  1.,  0.],
     |             [0.,  0.,  1.]])
     |      >>> x.setfield(3, np.int32)
     |      >>> x.getfield(np.int32)
     |      array([[3, 3, 3],
     |             [3, 3, 3],
     |             [3, 3, 3]], dtype=int32)
     |      >>> x
     |      array([[1.0e+000, 1.5e-323, 1.5e-323],
     |             [1.5e-323, 1.0e+000, 1.5e-323],
     |             [1.5e-323, 1.5e-323, 1.0e+000]])
     |      >>> x.setfield(np.eye(3), np.int32)
     |      >>> x
     |      array([[1.,  0.,  0.],
     |             [0.,  1.,  0.],
     |             [0.,  0.,  1.]])
     |
     |  setflags(...)
     |      a.setflags(write=None, align=None, uic=None)
     |
     |      Set array flags WRITEABLE, ALIGNED, WRITEBACKIFCOPY,
     |      respectively.
     |
     |      These Boolean-valued flags affect how numpy interprets the memory
     |      area used by `a` (see Notes below). The ALIGNED flag can only
     |      be set to True if the data is actually aligned according to the type.
     |      The WRITEBACKIFCOPY flag can never be set
     |      to True. The flag WRITEABLE can only be set to True if the array owns its
     |      own memory, or the ultimate owner of the memory exposes a writeable buffer
     |      interface, or is a string. (The exception for string is made so that
     |      unpickling can be done without copying memory.)
     |
     |      Parameters
     |      ----------
     |      write : bool, optional
     |          Describes whether or not `a` can be written to.
     |      align : bool, optional
     |          Describes whether or not `a` is aligned properly for its type.
     |      uic : bool, optional
     |          Describes whether or not `a` is a copy of another "base" array.
     |
     |      Notes
     |      -----
     |      Array flags provide information about how the memory area used
     |      for the array is to be interpreted. There are 7 Boolean flags
     |      in use, only three of which can be changed by the user:
     |      WRITEBACKIFCOPY, WRITEABLE, and ALIGNED.
     |
     |      WRITEABLE (W) the data area can be written to;
     |
     |      ALIGNED (A) the data and strides are aligned appropriately for the hardware
     |      (as determined by the compiler);
     |
     |      WRITEBACKIFCOPY (X) this array is a copy of some other array (referenced
     |      by .base). When the C-API function PyArray_ResolveWritebackIfCopy is
     |      called, the base array will be updated with the contents of this array.
     |
     |      All flags can be accessed using the single (upper case) letter as well
     |      as the full name.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> y = np.array([[3, 1, 7],
     |      ...               [2, 0, 0],
     |      ...               [8, 5, 9]])
     |      >>> y
     |      array([[3, 1, 7],
     |             [2, 0, 0],
     |             [8, 5, 9]])
     |      >>> y.flags
     |        C_CONTIGUOUS : True
     |        F_CONTIGUOUS : False
     |        OWNDATA : True
     |        WRITEABLE : True
     |        ALIGNED : True
     |        WRITEBACKIFCOPY : False
     |      >>> y.setflags(write=0, align=0)
     |      >>> y.flags
     |        C_CONTIGUOUS : True
     |        F_CONTIGUOUS : False
     |        OWNDATA : True
     |        WRITEABLE : False
     |        ALIGNED : False
     |        WRITEBACKIFCOPY : False
     |      >>> y.setflags(uic=1)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      ValueError: cannot set WRITEBACKIFCOPY flag to True
     |
     |  sort(...)
     |      a.sort(axis=-1, kind=None, order=None)
     |
     |      Sort an array in-place. Refer to `numpy.sort` for full documentation.
     |
     |      Parameters
     |      ----------
     |      axis : int, optional
     |          Axis along which to sort. Default is -1, which means sort along the
     |          last axis.
     |      kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional
     |          Sorting algorithm. The default is 'quicksort'. Note that both 'stable'
     |          and 'mergesort' use timsort under the covers and, in general, the
     |          actual implementation will vary with datatype. The 'mergesort' option
     |          is retained for backwards compatibility.
     |
     |          .. versionchanged:: 1.15.0
     |             The 'stable' option was added.
     |
     |      order : str or list of str, optional
     |          When `a` is an array with fields defined, this argument specifies
     |          which fields to compare first, second, etc.  A single field can
     |          be specified as a string, and not all fields need be specified,
     |          but unspecified fields will still be used, in the order in which
     |          they come up in the dtype, to break ties.
     |
     |      See Also
     |      --------
     |      numpy.sort : Return a sorted copy of an array.
     |      numpy.argsort : Indirect sort.
     |      numpy.lexsort : Indirect stable sort on multiple keys.
     |      numpy.searchsorted : Find elements in sorted array.
     |      numpy.partition: Partial sort.
     |
     |      Notes
     |      -----
     |      See `numpy.sort` for notes on the different sorting algorithms.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1,4], [3,1]])
     |      >>> a.sort(axis=1)
     |      >>> a
     |      array([[1, 4],
     |             [1, 3]])
     |      >>> a.sort(axis=0)
     |      >>> a
     |      array([[1, 3],
     |             [1, 4]])
     |
     |      Use the `order` keyword to specify a field to use when sorting a
     |      structured array:
     |
     |      >>> a = np.array([('a', 2), ('c', 1)], dtype=[('x', 'S1'), ('y', int)])
     |      >>> a.sort(order='y')
     |      >>> a
     |      array([(b'c', 1), (b'a', 2)],
     |            dtype=[('x', 'S1'), ('y', '<i8')])
     |
     |  squeeze(...)
     |      a.squeeze(axis=None)
     |
     |      Remove axes of length one from `a`.
     |
     |      Refer to `numpy.squeeze` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.squeeze : equivalent function
     |
     |  std(...)
     |      a.std(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
     |
     |      Returns the standard deviation of the array elements along given axis.
     |
     |      Refer to `numpy.std` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.std : equivalent function
     |
     |  sum(...)
     |      a.sum(axis=None, dtype=None, out=None, keepdims=False, initial=0, where=True)
     |
     |      Return the sum of the array elements over the given axis.
     |
     |      Refer to `numpy.sum` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.sum : equivalent function
     |
     |  swapaxes(...)
     |      a.swapaxes(axis1, axis2)
     |
     |      Return a view of the array with `axis1` and `axis2` interchanged.
     |
     |      Refer to `numpy.swapaxes` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.swapaxes : equivalent function
     |
     |  take(...)
     |      a.take(indices, axis=None, out=None, mode='raise')
     |
     |      Return an array formed from the elements of `a` at the given indices.
     |
     |      Refer to `numpy.take` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.take : equivalent function
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |      a.tobytes(order='C')
     |
     |      Construct Python bytes containing the raw data bytes in the array.
     |
     |      Constructs Python bytes showing a copy of the raw contents of
     |      data memory. The bytes object is produced in C-order by default.
     |      This behavior is controlled by the ``order`` parameter.
     |
     |      .. versionadded:: 1.9.0
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A'}, optional
     |          Controls the memory layout of the bytes object. 'C' means C-order,
     |          'F' means F-order, 'A' (short for *Any*) means 'F' if `a` is
     |          Fortran contiguous, 'C' otherwise. Default is 'C'.
     |
     |      Returns
     |      -------
     |      s : bytes
     |          Python bytes exhibiting a copy of `a`'s raw data.
     |
     |      See also
     |      --------
     |      frombuffer
     |          Inverse of this operation, construct a 1-dimensional array from Python
     |          bytes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([[0, 1], [2, 3]], dtype='<u2')
     |      >>> x.tobytes()
     |      b'\x00\x00\x01\x00\x02\x00\x03\x00'
     |      >>> x.tobytes('C') == x.tobytes()
     |      True
     |      >>> x.tobytes('F')
     |      b'\x00\x00\x02\x00\x01\x00\x03\x00'
     |
     |  tofile(...)
     |      a.tofile(fid, sep="", format="%s")
     |
     |      Write array to a file as text or binary (default).
     |
     |      Data is always written in 'C' order, independent of the order of `a`.
     |      The data produced by this method can be recovered using the function
     |      fromfile().
     |
     |      Parameters
     |      ----------
     |      fid : file or str or Path
     |          An open file object, or a string containing a filename.
     |
     |          .. versionchanged:: 1.17.0
     |              `pathlib.Path` objects are now accepted.
     |
     |      sep : str
     |          Separator between array items for text output.
     |          If "" (empty), a binary file is written, equivalent to
     |          ``file.write(a.tobytes())``.
     |      format : str
     |          Format string for text file output.
     |          Each entry in the array is formatted to text by first converting
     |          it to the closest Python type, and then using "format" % item.
     |
     |      Notes
     |      -----
     |      This is a convenience function for quick storage of array data.
     |      Information on endianness and precision is lost, so this method is not a
     |      good choice for files intended to archive data or transport data between
     |      machines with different endianness. Some of these problems can be overcome
     |      by outputting the data as text files, at the expense of speed and file
     |      size.
     |
     |      When fid is a file object, array contents are directly written to the
     |      file, bypassing the file object's ``write`` method. As a result, tofile
     |      cannot be used with files objects supporting compression (e.g., GzipFile)
     |      or file-like objects that do not support ``fileno()`` (e.g., BytesIO).
     |
     |  tolist(...)
     |      a.tolist()
     |
     |      Return the array as an ``a.ndim``-levels deep nested list of Python scalars.
     |
     |      Return a copy of the array data as a (nested) Python list.
     |      Data items are converted to the nearest compatible builtin Python type, via
     |      the `~numpy.ndarray.item` function.
     |
     |      If ``a.ndim`` is 0, then since the depth of the nested list is 0, it will
     |      not be a list at all, but a simple Python scalar.
     |
     |      Parameters
     |      ----------
     |      none
     |
     |      Returns
     |      -------
     |      y : object, or list of object, or list of list of object, or ...
     |          The possibly nested list of array elements.
     |
     |      Notes
     |      -----
     |      The array may be recreated via ``a = np.array(a.tolist())``, although this
     |      may sometimes lose precision.
     |
     |      Examples
     |      --------
     |      For a 1D array, ``a.tolist()`` is almost the same as ``list(a)``,
     |      except that ``tolist`` changes numpy scalars to Python scalars:
     |
     |      >>> import numpy as np
     |      >>> a = np.uint32([1, 2])
     |      >>> a_list = list(a)
     |      >>> a_list
     |      [1, 2]
     |      >>> type(a_list[0])
     |      <class 'numpy.uint32'>
     |      >>> a_tolist = a.tolist()
     |      >>> a_tolist
     |      [1, 2]
     |      >>> type(a_tolist[0])
     |      <class 'int'>
     |
     |      Additionally, for a 2D array, ``tolist`` applies recursively:
     |
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> list(a)
     |      [array([1, 2]), array([3, 4])]
     |      >>> a.tolist()
     |      [[1, 2], [3, 4]]
     |
     |      The base case for this recursion is a 0D array:
     |
     |      >>> a = np.array(1)
     |      >>> list(a)
     |      Traceback (most recent call last):
     |        ...
     |      TypeError: iteration over a 0-d array
     |      >>> a.tolist()
     |      1
     |
     |  tostring(...)
     |      a.tostring(order='C')
     |
     |      A compatibility alias for `~ndarray.tobytes`, with exactly the same
     |      behavior.
     |
     |      Despite its name, it returns :class:`bytes` not :class:`str`\ s.
     |
     |      .. deprecated:: 1.19.0
     |
     |  trace(...)
     |      a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)
     |
     |      Return the sum along diagonals of the array.
     |
     |      Refer to `numpy.trace` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.trace : equivalent function
     |
     |  transpose(...)
     |      a.transpose(*axes)
     |
     |      Returns a view of the array with axes transposed.
     |
     |      Refer to `numpy.transpose` for full documentation.
     |
     |      Parameters
     |      ----------
     |      axes : None, tuple of ints, or `n` ints
     |
     |       * None or no argument: reverses the order of the axes.
     |
     |       * tuple of ints: `i` in the `j`-th place in the tuple means that the
     |         array's `i`-th axis becomes the transposed array's `j`-th axis.
     |
     |       * `n` ints: same as an n-tuple of the same ints (this form is
     |         intended simply as a "convenience" alternative to the tuple form).
     |
     |      Returns
     |      -------
     |      p : ndarray
     |          View of the array with its axes suitably permuted.
     |
     |      See Also
     |      --------
     |      transpose : Equivalent function.
     |      ndarray.T : Array property returning the array transposed.
     |      ndarray.reshape : Give a new shape to an array without changing its data.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.transpose()
     |      array([[1, 3],
     |             [2, 4]])
     |      >>> a.transpose((1, 0))
     |      array([[1, 3],
     |             [2, 4]])
     |      >>> a.transpose(1, 0)
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> a
     |      array([1, 2, 3, 4])
     |      >>> a.transpose()
     |      array([1, 2, 3, 4])
     |
     |  var(...)
     |      a.var(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
     |
     |      Returns the variance of the array elements, along given axis.
     |
     |      Refer to `numpy.var` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.var : equivalent function
     |
     |  view(...)
     |      a.view([dtype][, type])
     |
     |      New view of array with the same data.
     |
     |      .. note::
     |          Passing None for ``dtype`` is different from omitting the parameter,
     |          since the former invokes ``dtype(None)`` which is an alias for
     |          ``dtype('float64')``.
     |
     |      Parameters
     |      ----------
     |      dtype : data-type or ndarray sub-class, optional
     |          Data-type descriptor of the returned view, e.g., float32 or int16.
     |          Omitting it results in the view having the same data-type as `a`.
     |          This argument can also be specified as an ndarray sub-class, which
     |          then specifies the type of the returned object (this is equivalent to
     |          setting the ``type`` parameter).
     |      type : Python type, optional
     |          Type of the returned view, e.g., ndarray or matrix.  Again, omission
     |          of the parameter results in type preservation.
     |
     |      Notes
     |      -----
     |      ``a.view()`` is used two different ways:
     |
     |      ``a.view(some_dtype)`` or ``a.view(dtype=some_dtype)`` constructs a view
     |      of the array's memory with a different data-type.  This can cause a
     |      reinterpretation of the bytes of memory.
     |
     |      ``a.view(ndarray_subclass)`` or ``a.view(type=ndarray_subclass)`` just
     |      returns an instance of `ndarray_subclass` that looks at the same array
     |      (same shape, dtype, etc.)  This does not cause a reinterpretation of the
     |      memory.
     |
     |      For ``a.view(some_dtype)``, if ``some_dtype`` has a different number of
     |      bytes per entry than the previous dtype (for example, converting a regular
     |      array to a structured array), then the last axis of ``a`` must be
     |      contiguous. This axis will be resized in the result.
     |
     |      .. versionchanged:: 1.23.0
     |         Only the last axis needs to be contiguous. Previously, the entire array
     |         had to be C-contiguous.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([(-1, 2)], dtype=[('a', np.int8), ('b', np.int8)])
     |
     |      Viewing array data using a different type and dtype:
     |
     |      >>> nonneg = np.dtype([("a", np.uint8), ("b", np.uint8)])
     |      >>> y = x.view(dtype=nonneg, type=np.recarray)
     |      >>> x["a"]
     |      array([-1], dtype=int8)
     |      >>> y.a
     |      array([255], dtype=uint8)
     |
     |      Creating a view on a structured array so it can be used in calculations
     |
     |      >>> x = np.array([(1, 2),(3,4)], dtype=[('a', np.int8), ('b', np.int8)])
     |      >>> xv = x.view(dtype=np.int8).reshape(-1,2)
     |      >>> xv
     |      array([[1, 2],
     |             [3, 4]], dtype=int8)
     |      >>> xv.mean(0)
     |      array([2.,  3.])
     |
     |      Making changes to the view changes the underlying array
     |
     |      >>> xv[0,1] = 20
     |      >>> x
     |      array([(1, 20), (3,  4)], dtype=[('a', 'i1'), ('b', 'i1')])
     |
     |      Using a view to convert an array to a recarray:
     |
     |      >>> z = x.view(np.recarray)
     |      >>> z.a
     |      array([1, 3], dtype=int8)
     |
     |      Views share data:
     |
     |      >>> x[0] = (9, 10)
     |      >>> z[0]
     |      np.record((9, 10), dtype=[('a', 'i1'), ('b', 'i1')])
     |
     |      Views that change the dtype size (bytes per entry) should normally be
     |      avoided on arrays defined by slices, transposes, fortran-ordering, etc.:
     |
     |      >>> x = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.int16)
     |      >>> y = x[:, ::2]
     |      >>> y
     |      array([[1, 3],
     |             [4, 6]], dtype=int16)
     |      >>> y.view(dtype=[('width', np.int16), ('length', np.int16)])
     |      Traceback (most recent call last):
     |          ...
     |      ValueError: To change to a dtype of a different size, the last axis must be contiguous
     |      >>> z = y.copy()
     |      >>> z.view(dtype=[('width', np.int16), ('length', np.int16)])
     |      array([[(1, 3)],
     |             [(4, 6)]], dtype=[('width', '<i2'), ('length', '<i2')])
     |
     |      However, views that change dtype are totally fine for arrays with a
     |      contiguous last axis, even if the rest of the axes are not C-contiguous:
     |
     |      >>> x = np.arange(2 * 3 * 4, dtype=np.int8).reshape(2, 3, 4)
     |      >>> x.transpose(1, 0, 2).view(np.int16)
     |      array([[[ 256,  770],
     |              [3340, 3854]],
     |      <BLANKLINE>
     |             [[1284, 1798],
     |              [4368, 4882]],
     |      <BLANKLINE>
     |             [[2312, 2826],
     |              [5396, 5910]]], dtype=int16)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from ndarray:
     |
     |  __class_getitem__(...)
     |      a.__class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.ndarray` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.ndarray` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.ndarray[Any, np.dtype[Any]]
     |      numpy.ndarray[typing.Any, numpy.dtype[typing.Any]]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |      numpy.typing.NDArray : An ndarray alias :term:`generic <generic type>`
     |                          w.r.t. its `dtype.type <numpy.dtype.type>`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ndarray:
     |
     |  T
     |      View of the transposed array.
     |
     |      Same as ``self.transpose()``.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.T
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> a
     |      array([1, 2, 3, 4])
     |      >>> a.T
     |      array([1, 2, 3, 4])
     |
     |      See Also
     |      --------
     |      transpose
     |
     |  __array_interface__
     |      Array protocol: Python side.
     |
     |  __array_struct__
     |      Array protocol: C-struct side.
     |
     |  base
     |      Base object if memory is from some other object.
     |
     |      Examples
     |      --------
     |      The base of an array that owns its memory is None:
     |
     |      >>> import numpy as np
     |      >>> x = np.array([1,2,3,4])
     |      >>> x.base is None
     |      True
     |
     |      Slicing creates a view, whose memory is shared with x:
     |
     |      >>> y = x[2:]
     |      >>> y.base is x
     |      True
     |
     |  ctypes
     |      An object to simplify the interaction of the array with the ctypes
     |      module.
     |
     |      This attribute creates an object that makes it easier to use arrays
     |      when calling shared libraries with the ctypes module. The returned
     |      object has, among others, data, shape, and strides attributes (see
     |      Notes below) which themselves return ctypes objects that can be used
     |      as arguments to a shared library.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      c : Python object
     |          Possessing attributes data, shape, strides, etc.
     |
     |      See Also
     |      --------
     |      numpy.ctypeslib
     |
     |      Notes
     |      -----
     |      Below are the public attributes of this object which were documented
     |      in "Guide to NumPy" (we have omitted undocumented public attributes,
     |      as well as documented private attributes):
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.data
     |          :noindex:
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.shape
     |          :noindex:
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.strides
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.data_as
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.shape_as
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.strides_as
     |          :noindex:
     |
     |      If the ctypes module is not available, then the ctypes attribute
     |      of array objects still returns something useful, but ctypes objects
     |      are not returned and errors may be raised instead. In particular,
     |      the object will still have the ``as_parameter`` attribute which will
     |      return an integer equal to the data attribute.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> import ctypes
     |      >>> x = np.array([[0, 1], [2, 3]], dtype=np.int32)
     |      >>> x
     |      array([[0, 1],
     |             [2, 3]], dtype=int32)
     |      >>> x.ctypes.data
     |      31962608 # may vary
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint32))
     |      <__main__.LP_c_uint object at 0x7ff2fc1fc200> # may vary
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint32)).contents
     |      c_uint(0)
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint64)).contents
     |      c_ulong(4294967296)
     |      >>> x.ctypes.shape
     |      <numpy._core._internal.c_long_Array_2 object at 0x7ff2fc1fce60> # may vary
     |      >>> x.ctypes.strides
     |      <numpy._core._internal.c_long_Array_2 object at 0x7ff2fc1ff320> # may vary
     |
     |  data
     |      Python buffer object pointing to the start of the array's data.
     |
     |  device
     |
     |  dtype
     |      Data-type of the array's elements.
     |
     |      .. warning::
     |
     |          Setting ``arr.dtype`` is discouraged and may be deprecated in the
     |          future.  Setting will replace the ``dtype`` without modifying the
     |          memory (see also `ndarray.view` and `ndarray.astype`).
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      d : numpy dtype object
     |
     |      See Also
     |      --------
     |      ndarray.astype : Cast the values contained in the array to a new data-type.
     |      ndarray.view : Create a view of the same data but a different data-type.
     |      numpy.dtype
     |
     |      Examples
     |      --------
     |      >>> x
     |      array([[0, 1],
     |             [2, 3]])
     |      >>> x.dtype
     |      dtype('int32')
     |      >>> type(x.dtype)
     |      <type 'numpy.dtype'>
     |
     |  flags
     |      Information about the memory layout of the array.
     |
     |      Attributes
     |      ----------
     |      C_CONTIGUOUS (C)
     |          The data is in a single, C-style contiguous segment.
     |      F_CONTIGUOUS (F)
     |          The data is in a single, Fortran-style contiguous segment.
     |      OWNDATA (O)
     |          The array owns the memory it uses or borrows it from another object.
     |      WRITEABLE (W)
     |          The data area can be written to.  Setting this to False locks
     |          the data, making it read-only.  A view (slice, etc.) inherits WRITEABLE
     |          from its base array at creation time, but a view of a writeable
     |          array may be subsequently locked while the base array remains writeable.
     |          (The opposite is not true, in that a view of a locked array may not
     |          be made writeable.  However, currently, locking a base object does not
     |          lock any views that already reference it, so under that circumstance it
     |          is possible to alter the contents of a locked array via a previously
     |          created writeable view onto it.)  Attempting to change a non-writeable
     |          array raises a RuntimeError exception.
     |      ALIGNED (A)
     |          The data and all elements are aligned appropriately for the hardware.
     |      WRITEBACKIFCOPY (X)
     |          This array is a copy of some other array. The C-API function
     |          PyArray_ResolveWritebackIfCopy must be called before deallocating
     |          to the base array will be updated with the contents of this array.
     |      FNC
     |          F_CONTIGUOUS and not C_CONTIGUOUS.
     |      FORC
     |          F_CONTIGUOUS or C_CONTIGUOUS (one-segment test).
     |      BEHAVED (B)
     |          ALIGNED and WRITEABLE.
     |      CARRAY (CA)
     |          BEHAVED and C_CONTIGUOUS.
     |      FARRAY (FA)
     |          BEHAVED and F_CONTIGUOUS and not C_CONTIGUOUS.
     |
     |      Notes
     |      -----
     |      The `flags` object can be accessed dictionary-like (as in ``a.flags['WRITEABLE']``),
     |      or by using lowercased attribute names (as in ``a.flags.writeable``). Short flag
     |      names are only supported in dictionary access.
     |
     |      Only the WRITEBACKIFCOPY, WRITEABLE, and ALIGNED flags can be
     |      changed by the user, via direct assignment to the attribute or dictionary
     |      entry, or by calling `ndarray.setflags`.
     |
     |      The array flags cannot be set arbitrarily:
     |
     |      - WRITEBACKIFCOPY can only be set ``False``.
     |      - ALIGNED can only be set ``True`` if the data is truly aligned.
     |      - WRITEABLE can only be set ``True`` if the array owns its own memory
     |        or the ultimate owner of the memory exposes a writeable buffer
     |        interface or is a string.
     |
     |      Arrays can be both C-style and Fortran-style contiguous simultaneously.
     |      This is clear for 1-dimensional arrays, but can also be true for higher
     |      dimensional arrays.
     |
     |      Even for contiguous arrays a stride for a given dimension
     |      ``arr.strides[dim]`` may be *arbitrary* if ``arr.shape[dim] == 1``
     |      or the array has no elements.
     |      It does *not* generally hold that ``self.strides[-1] == self.itemsize``
     |      for C-style contiguous arrays or ``self.strides[0] == self.itemsize`` for
     |      Fortran-style contiguous arrays is true.
     |
     |  flat
     |      A 1-D iterator over the array.
     |
     |      This is a `numpy.flatiter` instance, which acts similarly to, but is not
     |      a subclass of, Python's built-in iterator object.
     |
     |      See Also
     |      --------
     |      flatten : Return a copy of the array collapsed into one dimension.
     |
     |      flatiter
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.arange(1, 7).reshape(2, 3)
     |      >>> x
     |      array([[1, 2, 3],
     |             [4, 5, 6]])
     |      >>> x.flat[3]
     |      4
     |      >>> x.T
     |      array([[1, 4],
     |             [2, 5],
     |             [3, 6]])
     |      >>> x.T.flat[3]
     |      5
     |      >>> type(x.flat)
     |      <class 'numpy.flatiter'>
     |
     |      An assignment example:
     |
     |      >>> x.flat = 3; x
     |      array([[3, 3, 3],
     |             [3, 3, 3]])
     |      >>> x.flat[[1,4]] = 1; x
     |      array([[3, 1, 3],
     |             [3, 1, 3]])
     |
     |  imag
     |      The imaginary part of the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.sqrt([1+0j, 0+1j])
     |      >>> x.imag
     |      array([ 0.        ,  0.70710678])
     |      >>> x.imag.dtype
     |      dtype('float64')
     |
     |  itemset
     |
     |  itemsize
     |      Length of one array element in bytes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1,2,3], dtype=np.float64)
     |      >>> x.itemsize
     |      8
     |      >>> x = np.array([1,2,3], dtype=np.complex128)
     |      >>> x.itemsize
     |      16
     |
     |  mT
     |      View of the matrix transposed array.
     |
     |      The matrix transpose is the transpose of the last two dimensions, even
     |      if the array is of higher dimension.
     |
     |      .. versionadded:: 2.0
     |
     |      Raises
     |      ------
     |      ValueError
     |          If the array is of dimension less than 2.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.mT
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.arange(8).reshape((2, 2, 2))
     |      >>> a
     |      array([[[0, 1],
     |              [2, 3]],
     |      <BLANKLINE>
     |             [[4, 5],
     |              [6, 7]]])
     |      >>> a.mT
     |      array([[[0, 2],
     |              [1, 3]],
     |      <BLANKLINE>
     |             [[4, 6],
     |              [5, 7]]])
     |
     |  nbytes
     |      Total bytes consumed by the elements of the array.
     |
     |      Notes
     |      -----
     |      Does not include memory consumed by non-element attributes of the
     |      array object.
     |
     |      See Also
     |      --------
     |      sys.getsizeof
     |          Memory consumed by the object itself without parents in case view.
     |          This does include memory consumed by non-element attributes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.zeros((3,5,2), dtype=np.complex128)
     |      >>> x.nbytes
     |      480
     |      >>> np.prod(x.shape) * x.itemsize
     |      480
     |
     |  ndim
     |      Number of array dimensions.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> x.ndim
     |      1
     |      >>> y = np.zeros((2, 3, 4))
     |      >>> y.ndim
     |      3
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.sqrt([1+0j, 0+1j])
     |      >>> x.real
     |      array([ 1.        ,  0.70710678])
     |      >>> x.real.dtype
     |      dtype('float64')
     |
     |      See Also
     |      --------
     |      numpy.real : equivalent function
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |      The shape property is usually used to get the current shape of an array,
     |      but may also be used to reshape the array in-place by assigning a tuple of
     |      array dimensions to it.  As with `numpy.reshape`, one of the new shape
     |      dimensions can be -1, in which case its value is inferred from the size of
     |      the array and the remaining dimensions. Reshaping an array in-place will
     |      fail if a copy is required.
     |
     |      .. warning::
     |
     |          Setting ``arr.shape`` is discouraged and may be deprecated in the
     |          future.  Using `ndarray.reshape` is the preferred approach.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3, 4])
     |      >>> x.shape
     |      (4,)
     |      >>> y = np.zeros((2, 3, 4))
     |      >>> y.shape
     |      (2, 3, 4)
     |      >>> y.shape = (3, 8)
     |      >>> y
     |      array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
     |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
     |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])
     |      >>> y.shape = (3, 6)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      ValueError: total size of new array must be unchanged
     |      >>> np.zeros((4,2))[::2].shape = (-1,)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      AttributeError: Incompatible shape for in-place modification. Use
     |      `.reshape()` to make a copy with the desired shape.
     |
     |      See Also
     |      --------
     |      numpy.shape : Equivalent getter function.
     |      numpy.reshape : Function similar to setting ``shape``.
     |      ndarray.reshape : Method similar to setting ``shape``.
     |
     |  size
     |      Number of elements in the array.
     |
     |      Equal to ``np.prod(a.shape)``, i.e., the product of the array's
     |      dimensions.
     |
     |      Notes
     |      -----
     |      `a.size` returns a standard arbitrary precision Python integer. This
     |      may not be the case with other methods of obtaining the same value
     |      (like the suggested ``np.prod(a.shape)``, which returns an instance
     |      of ``np.int_``), and may be relevant if the value is used further in
     |      calculations that may overflow a fixed size integer type.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.zeros((3, 5, 2), dtype=np.complex128)
     |      >>> x.size
     |      30
     |      >>> np.prod(x.shape)
     |      30
     |
     |  strides
     |      Tuple of bytes to step in each dimension when traversing an array.
     |
     |      The byte offset of element ``(i[0], i[1], ..., i[n])`` in an array `a`
     |      is::
     |
     |          offset = sum(np.array(i) * a.strides)
     |
     |      A more detailed explanation of strides can be found in
     |      :ref:`arrays.ndarray`.
     |
     |      .. warning::
     |
     |          Setting ``arr.strides`` is discouraged and may be deprecated in the
     |          future.  `numpy.lib.stride_tricks.as_strided` should be preferred
     |          to create a new view of the same data in a safer way.
     |
     |      Notes
     |      -----
     |      Imagine an array of 32-bit integers (each 4 bytes)::
     |
     |        x = np.array([[0, 1, 2, 3, 4],
     |                      [5, 6, 7, 8, 9]], dtype=np.int32)
     |
     |      This array is stored in memory as 40 bytes, one after the other
     |      (known as a contiguous block of memory).  The strides of an array tell
     |      us how many bytes we have to skip in memory to move to the next position
     |      along a certain axis.  For example, we have to skip 4 bytes (1 value) to
     |      move to the next column, but 20 bytes (5 values) to get to the same
     |      position in the next row.  As such, the strides for the array `x` will be
     |      ``(20, 4)``.
     |
     |      See Also
     |      --------
     |      numpy.lib.stride_tricks.as_strided
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> y = np.reshape(np.arange(2*3*4), (2,3,4))
     |      >>> y
     |      array([[[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]],
     |             [[12, 13, 14, 15],
     |              [16, 17, 18, 19],
     |              [20, 21, 22, 23]]])
     |      >>> y.strides
     |      (48, 16, 4)
     |      >>> y[1,1,1]
     |      17
     |      >>> offset=sum(y.strides * np.array((1,1,1)))
     |      >>> offset/y.itemsize
     |      17
     |
     |      >>> x = np.reshape(np.arange(5*6*7*8), (5,6,7,8)).transpose(2,3,1,0)
     |      >>> x.strides
     |      (32, 4, 224, 1344)
     |      >>> i = np.array([3,5,2,2])
     |      >>> offset = sum(i * x.strides)
     |      >>> x[3,5,2,2]
     |      813
     |      >>> offset / x.itemsize
     |      813
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from ndarray:
     |
     |  __hash__ = None

    class ndarray(builtins.object)
     |  ndarray(shape, dtype=float, buffer=None, offset=0,
     |          strides=None, order=None)
     |
     |  An array object represents a multidimensional, homogeneous array
     |  of fixed-size items.  An associated data-type object describes the
     |  format of each element in the array (its byte-order, how many bytes it
     |  occupies in memory, whether it is an integer, a floating point number,
     |  or something else, etc.)
     |
     |  Arrays should be constructed using `array`, `zeros` or `empty` (refer
     |  to the See Also section below).  The parameters given here refer to
     |  a low-level method (`ndarray(...)`) for instantiating an array.
     |
     |  For more information, refer to the `numpy` module and examine the
     |  methods and attributes of an array.
     |
     |  Parameters
     |  ----------
     |  (for the __new__ method; see Notes below)
     |
     |  shape : tuple of ints
     |      Shape of created array.
     |  dtype : data-type, optional
     |      Any object that can be interpreted as a numpy data type.
     |  buffer : object exposing buffer interface, optional
     |      Used to fill the array with data.
     |  offset : int, optional
     |      Offset of array data in buffer.
     |  strides : tuple of ints, optional
     |      Strides of data in memory.
     |  order : {'C', 'F'}, optional
     |      Row-major (C-style) or column-major (Fortran-style) order.
     |
     |  Attributes
     |  ----------
     |  T : ndarray
     |      Transpose of the array.
     |  data : buffer
     |      The array's elements, in memory.
     |  dtype : dtype object
     |      Describes the format of the elements in the array.
     |  flags : dict
     |      Dictionary containing information related to memory use, e.g.,
     |      'C_CONTIGUOUS', 'OWNDATA', 'WRITEABLE', etc.
     |  flat : numpy.flatiter object
     |      Flattened version of the array as an iterator.  The iterator
     |      allows assignments, e.g., ``x.flat = 3`` (See `ndarray.flat` for
     |      assignment examples; TODO).
     |  imag : ndarray
     |      Imaginary part of the array.
     |  real : ndarray
     |      Real part of the array.
     |  size : int
     |      Number of elements in the array.
     |  itemsize : int
     |      The memory use of each array element in bytes.
     |  nbytes : int
     |      The total number of bytes required to store the array data,
     |      i.e., ``itemsize * size``.
     |  ndim : int
     |      The array's number of dimensions.
     |  shape : tuple of ints
     |      Shape of the array.
     |  strides : tuple of ints
     |      The step-size required to move from one element to the next in
     |      memory. For example, a contiguous ``(3, 4)`` array of type
     |      ``int16`` in C-order has strides ``(8, 2)``.  This implies that
     |      to move from element to element in memory requires jumps of 2 bytes.
     |      To move from row-to-row, one needs to jump 8 bytes at a time
     |      (``2 * 4``).
     |  ctypes : ctypes object
     |      Class containing properties of the array needed for interaction
     |      with ctypes.
     |  base : ndarray
     |      If the array is a view into another array, that array is its `base`
     |      (unless that array is also a view).  The `base` array is where the
     |      array data is actually stored.
     |
     |  See Also
     |  --------
     |  array : Construct an array.
     |  zeros : Create an array, each element of which is zero.
     |  empty : Create an array, but leave its allocated memory unchanged (i.e.,
     |          it contains "garbage").
     |  dtype : Create a data-type.
     |  numpy.typing.NDArray : An ndarray alias :term:`generic <generic type>`
     |                         w.r.t. its `dtype.type <numpy.dtype.type>`.
     |
     |  Notes
     |  -----
     |  There are two modes of creating an array using ``__new__``:
     |
     |  1. If `buffer` is None, then only `shape`, `dtype`, and `order`
     |     are used.
     |  2. If `buffer` is an object exposing the buffer interface, then
     |     all keywords are interpreted.
     |
     |  No ``__init__`` method is needed because the array is fully initialized
     |  after the ``__new__`` method.
     |
     |  Examples
     |  --------
     |  These examples illustrate the low-level `ndarray` constructor.  Refer
     |  to the `See Also` section above for easier ways of constructing an
     |  ndarray.
     |
     |  First mode, `buffer` is None:
     |
     |  >>> import numpy as np
     |  >>> np.ndarray(shape=(2,2), dtype=float, order='F')
     |  array([[0.0e+000, 0.0e+000], # random
     |         [     nan, 2.5e-323]])
     |
     |  Second mode:
     |
     |  >>> np.ndarray((2,), buffer=np.array([1,2,3]),
     |  ...            offset=np.int_().itemsize,
     |  ...            dtype=int) # offset = 1*itemsize, i.e. skip first element
     |  array([2, 3])
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      a.__array__([dtype], *, copy=None)
     |
     |      For ``dtype`` parameter it returns a new reference to self if
     |      ``dtype`` is not given or it matches array's data type.
     |      A new array of provided data type is returned if ``dtype``
     |      is different from the current data type of the array.
     |      For ``copy`` parameter it returns a new reference to self if
     |      ``copy=False`` or ``copy=None`` and copying isn't enforced by ``dtype``
     |      parameter. The method returns a new array for ``copy=True``, regardless of
     |      ``dtype`` parameter.
     |
     |      A more detailed explanation of the ``__array__`` interface
     |      can be found in :ref:`dunder_array.interface`.
     |
     |  __array_finalize__(...)
     |      a.__array_finalize__(obj, /)
     |
     |      Present so subclasses can call super. Does nothing.
     |
     |  __array_function__(...)
     |
     |  __array_namespace__(...)
     |
     |  __array_ufunc__(...)
     |
     |  __array_wrap__(...)
     |      a.__array_wrap__(array[, context], /)
     |
     |      Returns a view of `array` with the same type as self.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __complex__(...)
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __copy__(...)
     |      a.__copy__()
     |
     |      Used if :func:`copy.copy` is called on an array. Returns a copy of the array.
     |
     |      Equivalent to ``a.copy(order='K')``.
     |
     |  __deepcopy__(...)
     |      a.__deepcopy__(memo, /)
     |
     |      Used if :func:`copy.deepcopy` is called on an array.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __dlpack__(...)
     |      a.__dlpack__(*, stream=None, max_version=None, dl_device=None, copy=None)
     |
     |      DLPack Protocol: Part of the Array API.
     |
     |  __dlpack_device__(...)
     |      a.__dlpack_device__()
     |
     |      DLPack Protocol: Part of the Array API.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      Default object formatter.
     |
     |      Return str(self) if format_spec is empty. Raise TypeError otherwise.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __iadd__(self, value, /)
     |      Return self+=value.
     |
     |  __iand__(self, value, /)
     |      Return self&=value.
     |
     |  __ifloordiv__(self, value, /)
     |      Return self//=value.
     |
     |  __ilshift__(self, value, /)
     |      Return self<<=value.
     |
     |  __imatmul__(self, value, /)
     |      Return self@=value.
     |
     |  __imod__(self, value, /)
     |      Return self%=value.
     |
     |  __imul__(self, value, /)
     |      Return self*=value.
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __ipow__(self, value, /)
     |      Return self**=value.
     |
     |  __irshift__(self, value, /)
     |      Return self>>=value.
     |
     |  __isub__(self, value, /)
     |      Return self-=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __itruediv__(self, value, /)
     |      Return self/=value.
     |
     |  __ixor__(self, value, /)
     |      Return self^=value.
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __matmul__(self, value, /)
     |      Return self@value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      a.__reduce__()
     |
     |      For pickling.
     |
     |  __reduce_ex__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmatmul__(self, value, /)
     |      Return value@self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __setstate__(...)
     |      a.__setstate__(state, /)
     |
     |      For unpickling.
     |
     |      The `state` argument must be a sequence that contains the following
     |      elements:
     |
     |      Parameters
     |      ----------
     |      version : int
     |          optional pickle version. If omitted defaults to 0.
     |      shape : tuple
     |      dtype : data-type
     |      isFortran : bool
     |      rawdata : string or list
     |          a binary string with the data (or a list if 'a' is an object array)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      a.all(axis=None, out=None, keepdims=False, *, where=True)
     |
     |      Returns True if all elements evaluate to True.
     |
     |      Refer to `numpy.all` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.all : equivalent function
     |
     |  any(...)
     |      a.any(axis=None, out=None, keepdims=False, *, where=True)
     |
     |      Returns True if any of the elements of `a` evaluate to True.
     |
     |      Refer to `numpy.any` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.any : equivalent function
     |
     |  argmax(...)
     |      a.argmax(axis=None, out=None, *, keepdims=False)
     |
     |      Return indices of the maximum values along the given axis.
     |
     |      Refer to `numpy.argmax` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.argmax : equivalent function
     |
     |  argmin(...)
     |      a.argmin(axis=None, out=None, *, keepdims=False)
     |
     |      Return indices of the minimum values along the given axis.
     |
     |      Refer to `numpy.argmin` for detailed documentation.
     |
     |      See Also
     |      --------
     |      numpy.argmin : equivalent function
     |
     |  argpartition(...)
     |      a.argpartition(kth, axis=-1, kind='introselect', order=None)
     |
     |      Returns the indices that would partition this array.
     |
     |      Refer to `numpy.argpartition` for full documentation.
     |
     |      .. versionadded:: 1.8.0
     |
     |      See Also
     |      --------
     |      numpy.argpartition : equivalent function
     |
     |  argsort(...)
     |      a.argsort(axis=-1, kind=None, order=None)
     |
     |      Returns the indices that would sort this array.
     |
     |      Refer to `numpy.argsort` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.argsort : equivalent function
     |
     |  astype(...)
     |      a.astype(dtype, order='K', casting='unsafe', subok=True, copy=True)
     |
     |      Copy of the array, cast to a specified type.
     |
     |      Parameters
     |      ----------
     |      dtype : str or dtype
     |          Typecode or data-type to which the array is cast.
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          Controls the memory layout order of the result.
     |          'C' means C order, 'F' means Fortran order, 'A'
     |          means 'F' order if all the arrays are Fortran contiguous,
     |          'C' order otherwise, and 'K' means as close to the
     |          order the array elements appear in memory as possible.
     |          Default is 'K'.
     |      casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
     |          Controls what kind of data casting may occur. Defaults to 'unsafe'
     |          for backwards compatibility.
     |
     |          * 'no' means the data types should not be cast at all.
     |          * 'equiv' means only byte-order changes are allowed.
     |          * 'safe' means only casts which can preserve values are allowed.
     |          * 'same_kind' means only safe casts or casts within a kind,
     |            like float64 to float32, are allowed.
     |          * 'unsafe' means any data conversions may be done.
     |      subok : bool, optional
     |          If True, then sub-classes will be passed-through (default), otherwise
     |          the returned array will be forced to be a base-class array.
     |      copy : bool, optional
     |          By default, astype always returns a newly allocated array. If this
     |          is set to false, and the `dtype`, `order`, and `subok`
     |          requirements are satisfied, the input array is returned instead
     |          of a copy.
     |
     |      Returns
     |      -------
     |      arr_t : ndarray
     |          Unless `copy` is False and the other conditions for returning the input
     |          array are satisfied (see description for `copy` input parameter), `arr_t`
     |          is a new array of the same shape as the input array, with dtype, order
     |          given by `dtype`, `order`.
     |
     |      Notes
     |      -----
     |      .. versionchanged:: 1.17.0
     |         Casting between a simple data type and a structured one is possible only
     |         for "unsafe" casting.  Casting to multiple fields is allowed, but
     |         casting from multiple fields is not.
     |
     |      .. versionchanged:: 1.9.0
     |         Casting from numeric to string types in 'safe' casting mode requires
     |         that the string dtype length is long enough to store the max
     |         integer/float value converted.
     |
     |      Raises
     |      ------
     |      ComplexWarning
     |          When casting from complex to float or int. To avoid this,
     |          one should use ``a.real.astype(t)``.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 2.5])
     |      >>> x
     |      array([1. ,  2. ,  2.5])
     |
     |      >>> x.astype(int)
     |      array([1, 2, 2])
     |
     |  byteswap(...)
     |      a.byteswap(inplace=False)
     |
     |      Swap the bytes of the array elements
     |
     |      Toggle between low-endian and big-endian data representation by
     |      returning a byteswapped array, optionally swapped in-place.
     |      Arrays of byte-strings are not swapped. The real and imaginary
     |      parts of a complex number are swapped individually.
     |
     |      Parameters
     |      ----------
     |      inplace : bool, optional
     |          If ``True``, swap bytes in-place, default is ``False``.
     |
     |      Returns
     |      -------
     |      out : ndarray
     |          The byteswapped array. If `inplace` is ``True``, this is
     |          a view to self.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> A = np.array([1, 256, 8755], dtype=np.int16)
     |      >>> list(map(hex, A))
     |      ['0x1', '0x100', '0x2233']
     |      >>> A.byteswap(inplace=True)
     |      array([  256,     1, 13090], dtype=int16)
     |      >>> list(map(hex, A))
     |      ['0x100', '0x1', '0x3322']
     |
     |      Arrays of byte-strings are not swapped
     |
     |      >>> A = np.array([b'ceg', b'fac'])
     |      >>> A.byteswap()
     |      array([b'ceg', b'fac'], dtype='|S3')
     |
     |      ``A.view(A.dtype.newbyteorder()).byteswap()`` produces an array with
     |      the same values but different representation in memory
     |
     |      >>> A = np.array([1, 2, 3])
     |      >>> A.view(np.uint8)
     |      array([1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
     |             0, 0], dtype=uint8)
     |      >>> A.view(A.dtype.newbyteorder()).byteswap(inplace=True)
     |      array([1, 2, 3])
     |      >>> A.view(np.uint8)
     |      array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
     |             0, 3], dtype=uint8)
     |
     |  choose(...)
     |      a.choose(choices, out=None, mode='raise')
     |
     |      Use an index array to construct a new array from a set of choices.
     |
     |      Refer to `numpy.choose` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.choose : equivalent function
     |
     |  clip(...)
     |      a.clip(min=None, max=None, out=None, **kwargs)
     |
     |      Return an array whose values are limited to ``[min, max]``.
     |      One of max or min must be given.
     |
     |      Refer to `numpy.clip` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.clip : equivalent function
     |
     |  compress(...)
     |      a.compress(condition, axis=None, out=None)
     |
     |      Return selected slices of this array along given axis.
     |
     |      Refer to `numpy.compress` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.compress : equivalent function
     |
     |  conj(...)
     |      a.conj()
     |
     |      Complex-conjugate all elements.
     |
     |      Refer to `numpy.conjugate` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.conjugate : equivalent function
     |
     |  conjugate(...)
     |      a.conjugate()
     |
     |      Return the complex conjugate, element-wise.
     |
     |      Refer to `numpy.conjugate` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.conjugate : equivalent function
     |
     |  copy(...)
     |      a.copy(order='C')
     |
     |      Return a copy of the array.
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          Controls the memory layout of the copy. 'C' means C-order,
     |          'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
     |          'C' otherwise. 'K' means match the layout of `a` as closely
     |          as possible. (Note that this function and :func:`numpy.copy` are very
     |          similar but have different default values for their order=
     |          arguments, and this function always passes sub-classes through.)
     |
     |      See also
     |      --------
     |      numpy.copy : Similar function with different default behavior
     |      numpy.copyto
     |
     |      Notes
     |      -----
     |      This function is the preferred method for creating an array copy.  The
     |      function :func:`numpy.copy` is similar, but it defaults to using order 'K',
     |      and will not pass sub-classes through by default.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([[1,2,3],[4,5,6]], order='F')
     |
     |      >>> y = x.copy()
     |
     |      >>> x.fill(0)
     |
     |      >>> x
     |      array([[0, 0, 0],
     |             [0, 0, 0]])
     |
     |      >>> y
     |      array([[1, 2, 3],
     |             [4, 5, 6]])
     |
     |      >>> y.flags['C_CONTIGUOUS']
     |      True
     |
     |      For arrays containing Python objects (e.g. dtype=object),
     |      the copy is a shallow one. The new array will contain the
     |      same object which may lead to surprises if that object can
     |      be modified (is mutable):
     |
     |      >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object)
     |      >>> b = a.copy()
     |      >>> b[2][0] = 10
     |      >>> a
     |      array([1, 'm', list([10, 3, 4])], dtype=object)
     |
     |      To ensure all elements within an ``object`` array are copied,
     |      use `copy.deepcopy`:
     |
     |      >>> import copy
     |      >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object)
     |      >>> c = copy.deepcopy(a)
     |      >>> c[2][0] = 10
     |      >>> c
     |      array([1, 'm', list([10, 3, 4])], dtype=object)
     |      >>> a
     |      array([1, 'm', list([2, 3, 4])], dtype=object)
     |
     |  cumprod(...)
     |      a.cumprod(axis=None, dtype=None, out=None)
     |
     |      Return the cumulative product of the elements along the given axis.
     |
     |      Refer to `numpy.cumprod` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.cumprod : equivalent function
     |
     |  cumsum(...)
     |      a.cumsum(axis=None, dtype=None, out=None)
     |
     |      Return the cumulative sum of the elements along the given axis.
     |
     |      Refer to `numpy.cumsum` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.cumsum : equivalent function
     |
     |  diagonal(...)
     |      a.diagonal(offset=0, axis1=0, axis2=1)
     |
     |      Return specified diagonals. In NumPy 1.9 the returned array is a
     |      read-only view instead of a copy as in previous NumPy versions.  In
     |      a future version the read-only restriction will be removed.
     |
     |      Refer to :func:`numpy.diagonal` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.diagonal : equivalent function
     |
     |  dot(...)
     |
     |  dump(...)
     |      a.dump(file)
     |
     |      Dump a pickle of the array to the specified file.
     |      The array can be read back with pickle.load or numpy.load.
     |
     |      Parameters
     |      ----------
     |      file : str or Path
     |          A string naming the dump file.
     |
     |          .. versionchanged:: 1.17.0
     |              `pathlib.Path` objects are now accepted.
     |
     |  dumps(...)
     |      a.dumps()
     |
     |      Returns the pickle of the array as a string.
     |      pickle.loads will convert the string back to an array.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |  fill(...)
     |      a.fill(value)
     |
     |      Fill the array with a scalar value.
     |
     |      Parameters
     |      ----------
     |      value : scalar
     |          All elements of `a` will be assigned this value.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([1, 2])
     |      >>> a.fill(0)
     |      >>> a
     |      array([0, 0])
     |      >>> a = np.empty(2)
     |      >>> a.fill(1)
     |      >>> a
     |      array([1.,  1.])
     |
     |      Fill expects a scalar value and always behaves the same as assigning
     |      to a single array element.  The following is a rare example where this
     |      distinction is important:
     |
     |      >>> a = np.array([None, None], dtype=object)
     |      >>> a[0] = np.array(3)
     |      >>> a
     |      array([array(3), None], dtype=object)
     |      >>> a.fill(np.array(3))
     |      >>> a
     |      array([array(3), array(3)], dtype=object)
     |
     |      Where other forms of assignments will unpack the array being assigned:
     |
     |      >>> a[...] = np.array(3)
     |      >>> a
     |      array([3, 3], dtype=object)
     |
     |  flatten(...)
     |      a.flatten(order='C')
     |
     |      Return a copy of the array collapsed into one dimension.
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          'C' means to flatten in row-major (C-style) order.
     |          'F' means to flatten in column-major (Fortran-
     |          style) order. 'A' means to flatten in column-major
     |          order if `a` is Fortran *contiguous* in memory,
     |          row-major order otherwise. 'K' means to flatten
     |          `a` in the order the elements occur in memory.
     |          The default is 'C'.
     |
     |      Returns
     |      -------
     |      y : ndarray
     |          A copy of the input array, flattened to one dimension.
     |
     |      See Also
     |      --------
     |      ravel : Return a flattened array.
     |      flat : A 1-D flat iterator over the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1,2], [3,4]])
     |      >>> a.flatten()
     |      array([1, 2, 3, 4])
     |      >>> a.flatten('F')
     |      array([1, 3, 2, 4])
     |
     |  getfield(...)
     |      a.getfield(dtype, offset=0)
     |
     |      Returns a field of the given array as a certain type.
     |
     |      A field is a view of the array data with a given data-type. The values in
     |      the view are determined by the given type and the offset into the current
     |      array in bytes. The offset needs to be such that the view dtype fits in the
     |      array dtype; for example an array of dtype complex128 has 16-byte elements.
     |      If taking a view with a 32-bit integer (4 bytes), the offset needs to be
     |      between 0 and 12 bytes.
     |
     |      Parameters
     |      ----------
     |      dtype : str or dtype
     |          The data type of the view. The dtype size of the view can not be larger
     |          than that of the array itself.
     |      offset : int
     |          Number of bytes to skip before beginning the element view.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.diag([1.+1.j]*2)
     |      >>> x[1, 1] = 2 + 4.j
     |      >>> x
     |      array([[1.+1.j,  0.+0.j],
     |             [0.+0.j,  2.+4.j]])
     |      >>> x.getfield(np.float64)
     |      array([[1.,  0.],
     |             [0.,  2.]])
     |
     |      By choosing an offset of 8 bytes we can select the complex part of the
     |      array for our view:
     |
     |      >>> x.getfield(np.float64, offset=8)
     |      array([[1.,  0.],
     |             [0.,  4.]])
     |
     |  item(...)
     |      a.item(*args)
     |
     |      Copy an element of an array to a standard Python scalar and return it.
     |
     |      Parameters
     |      ----------
     |      \*args : Arguments (variable number and type)
     |
     |          * none: in this case, the method only works for arrays
     |            with one element (`a.size == 1`), which element is
     |            copied into a standard Python scalar object and returned.
     |
     |          * int_type: this argument is interpreted as a flat index into
     |            the array, specifying which element to copy and return.
     |
     |          * tuple of int_types: functions as does a single int_type argument,
     |            except that the argument is interpreted as an nd-index into the
     |            array.
     |
     |      Returns
     |      -------
     |      z : Standard Python scalar object
     |          A copy of the specified element of the array as a suitable
     |          Python scalar
     |
     |      Notes
     |      -----
     |      When the data type of `a` is longdouble or clongdouble, item() returns
     |      a scalar array object because there is no available Python scalar that
     |      would not lose information. Void arrays return a buffer object for item(),
     |      unless fields are defined, in which case a tuple is returned.
     |
     |      `item` is very similar to a[args], except, instead of an array scalar,
     |      a standard Python scalar is returned. This can be useful for speeding up
     |      access to elements of the array and doing arithmetic on elements of the
     |      array using Python's optimized math.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.random.seed(123)
     |      >>> x = np.random.randint(9, size=(3, 3))
     |      >>> x
     |      array([[2, 2, 6],
     |             [1, 3, 6],
     |             [1, 0, 1]])
     |      >>> x.item(3)
     |      1
     |      >>> x.item(7)
     |      0
     |      >>> x.item((0, 1))
     |      2
     |      >>> x.item((2, 2))
     |      1
     |
     |      For an array with object dtype, elements are returned as-is.
     |
     |      >>> a = np.array([np.int64(1)], dtype=object)
     |      >>> a.item() #return np.int64
     |      np.int64(1)
     |
     |  max(...)
     |      a.max(axis=None, out=None, keepdims=False, initial=<no value>, where=True)
     |
     |      Return the maximum along a given axis.
     |
     |      Refer to `numpy.amax` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.amax : equivalent function
     |
     |  mean(...)
     |      a.mean(axis=None, dtype=None, out=None, keepdims=False, *, where=True)
     |
     |      Returns the average of the array elements along given axis.
     |
     |      Refer to `numpy.mean` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.mean : equivalent function
     |
     |  min(...)
     |      a.min(axis=None, out=None, keepdims=False, initial=<no value>, where=True)
     |
     |      Return the minimum along a given axis.
     |
     |      Refer to `numpy.amin` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.amin : equivalent function
     |
     |  nonzero(...)
     |      a.nonzero()
     |
     |      Return the indices of the elements that are non-zero.
     |
     |      Refer to `numpy.nonzero` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.nonzero : equivalent function
     |
     |  partition(...)
     |      a.partition(kth, axis=-1, kind='introselect', order=None)
     |
     |      Partially sorts the elements in the array in such a way that the value of
     |      the element in k-th position is in the position it would be in a sorted
     |      array. In the output array, all elements smaller than the k-th element
     |      are located to the left of this element and all equal or greater are
     |      located to its right. The ordering of the elements in the two partitions
     |      on the either side of the k-th element in the output array is undefined.
     |
     |      .. versionadded:: 1.8.0
     |
     |      Parameters
     |      ----------
     |      kth : int or sequence of ints
     |          Element index to partition by. The kth element value will be in its
     |          final sorted position and all smaller elements will be moved before it
     |          and all equal or greater elements behind it.
     |          The order of all elements in the partitions is undefined.
     |          If provided with a sequence of kth it will partition all elements
     |          indexed by kth of them into their sorted position at once.
     |
     |          .. deprecated:: 1.22.0
     |              Passing booleans as index is deprecated.
     |      axis : int, optional
     |          Axis along which to sort. Default is -1, which means sort along the
     |          last axis.
     |      kind : {'introselect'}, optional
     |          Selection algorithm. Default is 'introselect'.
     |      order : str or list of str, optional
     |          When `a` is an array with fields defined, this argument specifies
     |          which fields to compare first, second, etc. A single field can
     |          be specified as a string, and not all fields need to be specified,
     |          but unspecified fields will still be used, in the order in which
     |          they come up in the dtype, to break ties.
     |
     |      See Also
     |      --------
     |      numpy.partition : Return a partitioned copy of an array.
     |      argpartition : Indirect partition.
     |      sort : Full sort.
     |
     |      Notes
     |      -----
     |      See ``np.partition`` for notes on the different algorithms.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([3, 4, 2, 1])
     |      >>> a.partition(3)
     |      >>> a
     |      array([2, 1, 3, 4]) # may vary
     |
     |      >>> a.partition((1, 3))
     |      >>> a
     |      array([1, 2, 3, 4])
     |
     |  prod(...)
     |      a.prod(axis=None, dtype=None, out=None, keepdims=False,
     |          initial=1, where=True)
     |
     |      Return the product of the array elements over the given axis
     |
     |      Refer to `numpy.prod` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.prod : equivalent function
     |
     |  put(...)
     |      a.put(indices, values, mode='raise')
     |
     |      Set ``a.flat[n] = values[n]`` for all `n` in indices.
     |
     |      Refer to `numpy.put` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.put : equivalent function
     |
     |  ravel(...)
     |      a.ravel([order])
     |
     |      Return a flattened array.
     |
     |      Refer to `numpy.ravel` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.ravel : equivalent function
     |
     |      ndarray.flat : a flat iterator on the array.
     |
     |  repeat(...)
     |      a.repeat(repeats, axis=None)
     |
     |      Repeat elements of an array.
     |
     |      Refer to `numpy.repeat` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.repeat : equivalent function
     |
     |  reshape(...)
     |      a.reshape(shape, /, *, order='C', copy=None)
     |
     |      Returns an array containing the same data with a new shape.
     |
     |      Refer to `numpy.reshape` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.reshape : equivalent function
     |
     |      Notes
     |      -----
     |      Unlike the free function `numpy.reshape`, this method on `ndarray` allows
     |      the elements of the shape parameter to be passed in as separate arguments.
     |      For example, ``a.reshape(10, 11)`` is equivalent to
     |      ``a.reshape((10, 11))``.
     |
     |  resize(...)
     |      a.resize(new_shape, refcheck=True)
     |
     |      Change shape and size of array in-place.
     |
     |      Parameters
     |      ----------
     |      new_shape : tuple of ints, or `n` ints
     |          Shape of resized array.
     |      refcheck : bool, optional
     |          If False, reference count will not be checked. Default is True.
     |
     |      Returns
     |      -------
     |      None
     |
     |      Raises
     |      ------
     |      ValueError
     |          If `a` does not own its own data or references or views to it exist,
     |          and the data memory must be changed.
     |          PyPy only: will always raise if the data memory must be changed, since
     |          there is no reliable way to determine if references or views to it
     |          exist.
     |
     |      SystemError
     |          If the `order` keyword argument is specified. This behaviour is a
     |          bug in NumPy.
     |
     |      See Also
     |      --------
     |      resize : Return a new array with the specified shape.
     |
     |      Notes
     |      -----
     |      This reallocates space for the data area if necessary.
     |
     |      Only contiguous arrays (data elements consecutive in memory) can be
     |      resized.
     |
     |      The purpose of the reference count check is to make sure you
     |      do not use this array as a buffer for another Python object and then
     |      reallocate the memory. However, reference counts can increase in
     |      other ways so if you are sure that you have not shared the memory
     |      for this array with another Python object, then you may safely set
     |      `refcheck` to False.
     |
     |      Examples
     |      --------
     |      Shrinking an array: array is flattened (in the order that the data are
     |      stored in memory), resized, and reshaped:
     |
     |      >>> import numpy as np
     |
     |      >>> a = np.array([[0, 1], [2, 3]], order='C')
     |      >>> a.resize((2, 1))
     |      >>> a
     |      array([[0],
     |             [1]])
     |
     |      >>> a = np.array([[0, 1], [2, 3]], order='F')
     |      >>> a.resize((2, 1))
     |      >>> a
     |      array([[0],
     |             [2]])
     |
     |      Enlarging an array: as above, but missing entries are filled with zeros:
     |
     |      >>> b = np.array([[0, 1], [2, 3]])
     |      >>> b.resize(2, 3) # new_shape parameter doesn't have to be a tuple
     |      >>> b
     |      array([[0, 1, 2],
     |             [3, 0, 0]])
     |
     |      Referencing an array prevents resizing...
     |
     |      >>> c = a
     |      >>> a.resize((1, 1))
     |      Traceback (most recent call last):
     |      ...
     |      ValueError: cannot resize an array that references or is referenced ...
     |
     |      Unless `refcheck` is False:
     |
     |      >>> a.resize((1, 1), refcheck=False)
     |      >>> a
     |      array([[0]])
     |      >>> c
     |      array([[0]])
     |
     |  round(...)
     |      a.round(decimals=0, out=None)
     |
     |      Return `a` with each element rounded to the given number of decimals.
     |
     |      Refer to `numpy.around` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.around : equivalent function
     |
     |  searchsorted(...)
     |      a.searchsorted(v, side='left', sorter=None)
     |
     |      Find indices where elements of v should be inserted in a to maintain order.
     |
     |      For full documentation, see `numpy.searchsorted`
     |
     |      See Also
     |      --------
     |      numpy.searchsorted : equivalent function
     |
     |  setfield(...)
     |      a.setfield(val, dtype, offset=0)
     |
     |      Put a value into a specified place in a field defined by a data-type.
     |
     |      Place `val` into `a`'s field defined by `dtype` and beginning `offset`
     |      bytes into the field.
     |
     |      Parameters
     |      ----------
     |      val : object
     |          Value to be placed in field.
     |      dtype : dtype object
     |          Data-type of the field in which to place `val`.
     |      offset : int, optional
     |          The number of bytes into the field at which to place `val`.
     |
     |      Returns
     |      -------
     |      None
     |
     |      See Also
     |      --------
     |      getfield
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.eye(3)
     |      >>> x.getfield(np.float64)
     |      array([[1.,  0.,  0.],
     |             [0.,  1.,  0.],
     |             [0.,  0.,  1.]])
     |      >>> x.setfield(3, np.int32)
     |      >>> x.getfield(np.int32)
     |      array([[3, 3, 3],
     |             [3, 3, 3],
     |             [3, 3, 3]], dtype=int32)
     |      >>> x
     |      array([[1.0e+000, 1.5e-323, 1.5e-323],
     |             [1.5e-323, 1.0e+000, 1.5e-323],
     |             [1.5e-323, 1.5e-323, 1.0e+000]])
     |      >>> x.setfield(np.eye(3), np.int32)
     |      >>> x
     |      array([[1.,  0.,  0.],
     |             [0.,  1.,  0.],
     |             [0.,  0.,  1.]])
     |
     |  setflags(...)
     |      a.setflags(write=None, align=None, uic=None)
     |
     |      Set array flags WRITEABLE, ALIGNED, WRITEBACKIFCOPY,
     |      respectively.
     |
     |      These Boolean-valued flags affect how numpy interprets the memory
     |      area used by `a` (see Notes below). The ALIGNED flag can only
     |      be set to True if the data is actually aligned according to the type.
     |      The WRITEBACKIFCOPY flag can never be set
     |      to True. The flag WRITEABLE can only be set to True if the array owns its
     |      own memory, or the ultimate owner of the memory exposes a writeable buffer
     |      interface, or is a string. (The exception for string is made so that
     |      unpickling can be done without copying memory.)
     |
     |      Parameters
     |      ----------
     |      write : bool, optional
     |          Describes whether or not `a` can be written to.
     |      align : bool, optional
     |          Describes whether or not `a` is aligned properly for its type.
     |      uic : bool, optional
     |          Describes whether or not `a` is a copy of another "base" array.
     |
     |      Notes
     |      -----
     |      Array flags provide information about how the memory area used
     |      for the array is to be interpreted. There are 7 Boolean flags
     |      in use, only three of which can be changed by the user:
     |      WRITEBACKIFCOPY, WRITEABLE, and ALIGNED.
     |
     |      WRITEABLE (W) the data area can be written to;
     |
     |      ALIGNED (A) the data and strides are aligned appropriately for the hardware
     |      (as determined by the compiler);
     |
     |      WRITEBACKIFCOPY (X) this array is a copy of some other array (referenced
     |      by .base). When the C-API function PyArray_ResolveWritebackIfCopy is
     |      called, the base array will be updated with the contents of this array.
     |
     |      All flags can be accessed using the single (upper case) letter as well
     |      as the full name.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> y = np.array([[3, 1, 7],
     |      ...               [2, 0, 0],
     |      ...               [8, 5, 9]])
     |      >>> y
     |      array([[3, 1, 7],
     |             [2, 0, 0],
     |             [8, 5, 9]])
     |      >>> y.flags
     |        C_CONTIGUOUS : True
     |        F_CONTIGUOUS : False
     |        OWNDATA : True
     |        WRITEABLE : True
     |        ALIGNED : True
     |        WRITEBACKIFCOPY : False
     |      >>> y.setflags(write=0, align=0)
     |      >>> y.flags
     |        C_CONTIGUOUS : True
     |        F_CONTIGUOUS : False
     |        OWNDATA : True
     |        WRITEABLE : False
     |        ALIGNED : False
     |        WRITEBACKIFCOPY : False
     |      >>> y.setflags(uic=1)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      ValueError: cannot set WRITEBACKIFCOPY flag to True
     |
     |  sort(...)
     |      a.sort(axis=-1, kind=None, order=None)
     |
     |      Sort an array in-place. Refer to `numpy.sort` for full documentation.
     |
     |      Parameters
     |      ----------
     |      axis : int, optional
     |          Axis along which to sort. Default is -1, which means sort along the
     |          last axis.
     |      kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional
     |          Sorting algorithm. The default is 'quicksort'. Note that both 'stable'
     |          and 'mergesort' use timsort under the covers and, in general, the
     |          actual implementation will vary with datatype. The 'mergesort' option
     |          is retained for backwards compatibility.
     |
     |          .. versionchanged:: 1.15.0
     |             The 'stable' option was added.
     |
     |      order : str or list of str, optional
     |          When `a` is an array with fields defined, this argument specifies
     |          which fields to compare first, second, etc.  A single field can
     |          be specified as a string, and not all fields need be specified,
     |          but unspecified fields will still be used, in the order in which
     |          they come up in the dtype, to break ties.
     |
     |      See Also
     |      --------
     |      numpy.sort : Return a sorted copy of an array.
     |      numpy.argsort : Indirect sort.
     |      numpy.lexsort : Indirect stable sort on multiple keys.
     |      numpy.searchsorted : Find elements in sorted array.
     |      numpy.partition: Partial sort.
     |
     |      Notes
     |      -----
     |      See `numpy.sort` for notes on the different sorting algorithms.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1,4], [3,1]])
     |      >>> a.sort(axis=1)
     |      >>> a
     |      array([[1, 4],
     |             [1, 3]])
     |      >>> a.sort(axis=0)
     |      >>> a
     |      array([[1, 3],
     |             [1, 4]])
     |
     |      Use the `order` keyword to specify a field to use when sorting a
     |      structured array:
     |
     |      >>> a = np.array([('a', 2), ('c', 1)], dtype=[('x', 'S1'), ('y', int)])
     |      >>> a.sort(order='y')
     |      >>> a
     |      array([(b'c', 1), (b'a', 2)],
     |            dtype=[('x', 'S1'), ('y', '<i8')])
     |
     |  squeeze(...)
     |      a.squeeze(axis=None)
     |
     |      Remove axes of length one from `a`.
     |
     |      Refer to `numpy.squeeze` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.squeeze : equivalent function
     |
     |  std(...)
     |      a.std(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
     |
     |      Returns the standard deviation of the array elements along given axis.
     |
     |      Refer to `numpy.std` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.std : equivalent function
     |
     |  sum(...)
     |      a.sum(axis=None, dtype=None, out=None, keepdims=False, initial=0, where=True)
     |
     |      Return the sum of the array elements over the given axis.
     |
     |      Refer to `numpy.sum` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.sum : equivalent function
     |
     |  swapaxes(...)
     |      a.swapaxes(axis1, axis2)
     |
     |      Return a view of the array with `axis1` and `axis2` interchanged.
     |
     |      Refer to `numpy.swapaxes` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.swapaxes : equivalent function
     |
     |  take(...)
     |      a.take(indices, axis=None, out=None, mode='raise')
     |
     |      Return an array formed from the elements of `a` at the given indices.
     |
     |      Refer to `numpy.take` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.take : equivalent function
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |      a.tobytes(order='C')
     |
     |      Construct Python bytes containing the raw data bytes in the array.
     |
     |      Constructs Python bytes showing a copy of the raw contents of
     |      data memory. The bytes object is produced in C-order by default.
     |      This behavior is controlled by the ``order`` parameter.
     |
     |      .. versionadded:: 1.9.0
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A'}, optional
     |          Controls the memory layout of the bytes object. 'C' means C-order,
     |          'F' means F-order, 'A' (short for *Any*) means 'F' if `a` is
     |          Fortran contiguous, 'C' otherwise. Default is 'C'.
     |
     |      Returns
     |      -------
     |      s : bytes
     |          Python bytes exhibiting a copy of `a`'s raw data.
     |
     |      See also
     |      --------
     |      frombuffer
     |          Inverse of this operation, construct a 1-dimensional array from Python
     |          bytes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([[0, 1], [2, 3]], dtype='<u2')
     |      >>> x.tobytes()
     |      b'\x00\x00\x01\x00\x02\x00\x03\x00'
     |      >>> x.tobytes('C') == x.tobytes()
     |      True
     |      >>> x.tobytes('F')
     |      b'\x00\x00\x02\x00\x01\x00\x03\x00'
     |
     |  tofile(...)
     |      a.tofile(fid, sep="", format="%s")
     |
     |      Write array to a file as text or binary (default).
     |
     |      Data is always written in 'C' order, independent of the order of `a`.
     |      The data produced by this method can be recovered using the function
     |      fromfile().
     |
     |      Parameters
     |      ----------
     |      fid : file or str or Path
     |          An open file object, or a string containing a filename.
     |
     |          .. versionchanged:: 1.17.0
     |              `pathlib.Path` objects are now accepted.
     |
     |      sep : str
     |          Separator between array items for text output.
     |          If "" (empty), a binary file is written, equivalent to
     |          ``file.write(a.tobytes())``.
     |      format : str
     |          Format string for text file output.
     |          Each entry in the array is formatted to text by first converting
     |          it to the closest Python type, and then using "format" % item.
     |
     |      Notes
     |      -----
     |      This is a convenience function for quick storage of array data.
     |      Information on endianness and precision is lost, so this method is not a
     |      good choice for files intended to archive data or transport data between
     |      machines with different endianness. Some of these problems can be overcome
     |      by outputting the data as text files, at the expense of speed and file
     |      size.
     |
     |      When fid is a file object, array contents are directly written to the
     |      file, bypassing the file object's ``write`` method. As a result, tofile
     |      cannot be used with files objects supporting compression (e.g., GzipFile)
     |      or file-like objects that do not support ``fileno()`` (e.g., BytesIO).
     |
     |  tolist(...)
     |      a.tolist()
     |
     |      Return the array as an ``a.ndim``-levels deep nested list of Python scalars.
     |
     |      Return a copy of the array data as a (nested) Python list.
     |      Data items are converted to the nearest compatible builtin Python type, via
     |      the `~numpy.ndarray.item` function.
     |
     |      If ``a.ndim`` is 0, then since the depth of the nested list is 0, it will
     |      not be a list at all, but a simple Python scalar.
     |
     |      Parameters
     |      ----------
     |      none
     |
     |      Returns
     |      -------
     |      y : object, or list of object, or list of list of object, or ...
     |          The possibly nested list of array elements.
     |
     |      Notes
     |      -----
     |      The array may be recreated via ``a = np.array(a.tolist())``, although this
     |      may sometimes lose precision.
     |
     |      Examples
     |      --------
     |      For a 1D array, ``a.tolist()`` is almost the same as ``list(a)``,
     |      except that ``tolist`` changes numpy scalars to Python scalars:
     |
     |      >>> import numpy as np
     |      >>> a = np.uint32([1, 2])
     |      >>> a_list = list(a)
     |      >>> a_list
     |      [1, 2]
     |      >>> type(a_list[0])
     |      <class 'numpy.uint32'>
     |      >>> a_tolist = a.tolist()
     |      >>> a_tolist
     |      [1, 2]
     |      >>> type(a_tolist[0])
     |      <class 'int'>
     |
     |      Additionally, for a 2D array, ``tolist`` applies recursively:
     |
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> list(a)
     |      [array([1, 2]), array([3, 4])]
     |      >>> a.tolist()
     |      [[1, 2], [3, 4]]
     |
     |      The base case for this recursion is a 0D array:
     |
     |      >>> a = np.array(1)
     |      >>> list(a)
     |      Traceback (most recent call last):
     |        ...
     |      TypeError: iteration over a 0-d array
     |      >>> a.tolist()
     |      1
     |
     |  tostring(...)
     |      a.tostring(order='C')
     |
     |      A compatibility alias for `~ndarray.tobytes`, with exactly the same
     |      behavior.
     |
     |      Despite its name, it returns :class:`bytes` not :class:`str`\ s.
     |
     |      .. deprecated:: 1.19.0
     |
     |  trace(...)
     |      a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)
     |
     |      Return the sum along diagonals of the array.
     |
     |      Refer to `numpy.trace` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.trace : equivalent function
     |
     |  transpose(...)
     |      a.transpose(*axes)
     |
     |      Returns a view of the array with axes transposed.
     |
     |      Refer to `numpy.transpose` for full documentation.
     |
     |      Parameters
     |      ----------
     |      axes : None, tuple of ints, or `n` ints
     |
     |       * None or no argument: reverses the order of the axes.
     |
     |       * tuple of ints: `i` in the `j`-th place in the tuple means that the
     |         array's `i`-th axis becomes the transposed array's `j`-th axis.
     |
     |       * `n` ints: same as an n-tuple of the same ints (this form is
     |         intended simply as a "convenience" alternative to the tuple form).
     |
     |      Returns
     |      -------
     |      p : ndarray
     |          View of the array with its axes suitably permuted.
     |
     |      See Also
     |      --------
     |      transpose : Equivalent function.
     |      ndarray.T : Array property returning the array transposed.
     |      ndarray.reshape : Give a new shape to an array without changing its data.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.transpose()
     |      array([[1, 3],
     |             [2, 4]])
     |      >>> a.transpose((1, 0))
     |      array([[1, 3],
     |             [2, 4]])
     |      >>> a.transpose(1, 0)
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> a
     |      array([1, 2, 3, 4])
     |      >>> a.transpose()
     |      array([1, 2, 3, 4])
     |
     |  var(...)
     |      a.var(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
     |
     |      Returns the variance of the array elements, along given axis.
     |
     |      Refer to `numpy.var` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.var : equivalent function
     |
     |  view(...)
     |      a.view([dtype][, type])
     |
     |      New view of array with the same data.
     |
     |      .. note::
     |          Passing None for ``dtype`` is different from omitting the parameter,
     |          since the former invokes ``dtype(None)`` which is an alias for
     |          ``dtype('float64')``.
     |
     |      Parameters
     |      ----------
     |      dtype : data-type or ndarray sub-class, optional
     |          Data-type descriptor of the returned view, e.g., float32 or int16.
     |          Omitting it results in the view having the same data-type as `a`.
     |          This argument can also be specified as an ndarray sub-class, which
     |          then specifies the type of the returned object (this is equivalent to
     |          setting the ``type`` parameter).
     |      type : Python type, optional
     |          Type of the returned view, e.g., ndarray or matrix.  Again, omission
     |          of the parameter results in type preservation.
     |
     |      Notes
     |      -----
     |      ``a.view()`` is used two different ways:
     |
     |      ``a.view(some_dtype)`` or ``a.view(dtype=some_dtype)`` constructs a view
     |      of the array's memory with a different data-type.  This can cause a
     |      reinterpretation of the bytes of memory.
     |
     |      ``a.view(ndarray_subclass)`` or ``a.view(type=ndarray_subclass)`` just
     |      returns an instance of `ndarray_subclass` that looks at the same array
     |      (same shape, dtype, etc.)  This does not cause a reinterpretation of the
     |      memory.
     |
     |      For ``a.view(some_dtype)``, if ``some_dtype`` has a different number of
     |      bytes per entry than the previous dtype (for example, converting a regular
     |      array to a structured array), then the last axis of ``a`` must be
     |      contiguous. This axis will be resized in the result.
     |
     |      .. versionchanged:: 1.23.0
     |         Only the last axis needs to be contiguous. Previously, the entire array
     |         had to be C-contiguous.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([(-1, 2)], dtype=[('a', np.int8), ('b', np.int8)])
     |
     |      Viewing array data using a different type and dtype:
     |
     |      >>> nonneg = np.dtype([("a", np.uint8), ("b", np.uint8)])
     |      >>> y = x.view(dtype=nonneg, type=np.recarray)
     |      >>> x["a"]
     |      array([-1], dtype=int8)
     |      >>> y.a
     |      array([255], dtype=uint8)
     |
     |      Creating a view on a structured array so it can be used in calculations
     |
     |      >>> x = np.array([(1, 2),(3,4)], dtype=[('a', np.int8), ('b', np.int8)])
     |      >>> xv = x.view(dtype=np.int8).reshape(-1,2)
     |      >>> xv
     |      array([[1, 2],
     |             [3, 4]], dtype=int8)
     |      >>> xv.mean(0)
     |      array([2.,  3.])
     |
     |      Making changes to the view changes the underlying array
     |
     |      >>> xv[0,1] = 20
     |      >>> x
     |      array([(1, 20), (3,  4)], dtype=[('a', 'i1'), ('b', 'i1')])
     |
     |      Using a view to convert an array to a recarray:
     |
     |      >>> z = x.view(np.recarray)
     |      >>> z.a
     |      array([1, 3], dtype=int8)
     |
     |      Views share data:
     |
     |      >>> x[0] = (9, 10)
     |      >>> z[0]
     |      np.record((9, 10), dtype=[('a', 'i1'), ('b', 'i1')])
     |
     |      Views that change the dtype size (bytes per entry) should normally be
     |      avoided on arrays defined by slices, transposes, fortran-ordering, etc.:
     |
     |      >>> x = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.int16)
     |      >>> y = x[:, ::2]
     |      >>> y
     |      array([[1, 3],
     |             [4, 6]], dtype=int16)
     |      >>> y.view(dtype=[('width', np.int16), ('length', np.int16)])
     |      Traceback (most recent call last):
     |          ...
     |      ValueError: To change to a dtype of a different size, the last axis must be contiguous
     |      >>> z = y.copy()
     |      >>> z.view(dtype=[('width', np.int16), ('length', np.int16)])
     |      array([[(1, 3)],
     |             [(4, 6)]], dtype=[('width', '<i2'), ('length', '<i2')])
     |
     |      However, views that change dtype are totally fine for arrays with a
     |      contiguous last axis, even if the rest of the axes are not C-contiguous:
     |
     |      >>> x = np.arange(2 * 3 * 4, dtype=np.int8).reshape(2, 3, 4)
     |      >>> x.transpose(1, 0, 2).view(np.int16)
     |      array([[[ 256,  770],
     |              [3340, 3854]],
     |      <BLANKLINE>
     |             [[1284, 1798],
     |              [4368, 4882]],
     |      <BLANKLINE>
     |             [[2312, 2826],
     |              [5396, 5910]]], dtype=int16)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      a.__class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.ndarray` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.ndarray` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.ndarray[Any, np.dtype[Any]]
     |      numpy.ndarray[typing.Any, numpy.dtype[typing.Any]]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |      numpy.typing.NDArray : An ndarray alias :term:`generic <generic type>`
     |                          w.r.t. its `dtype.type <numpy.dtype.type>`.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  T
     |      View of the transposed array.
     |
     |      Same as ``self.transpose()``.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.T
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> a
     |      array([1, 2, 3, 4])
     |      >>> a.T
     |      array([1, 2, 3, 4])
     |
     |      See Also
     |      --------
     |      transpose
     |
     |  __array_interface__
     |      Array protocol: Python side.
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: C-struct side.
     |
     |  base
     |      Base object if memory is from some other object.
     |
     |      Examples
     |      --------
     |      The base of an array that owns its memory is None:
     |
     |      >>> import numpy as np
     |      >>> x = np.array([1,2,3,4])
     |      >>> x.base is None
     |      True
     |
     |      Slicing creates a view, whose memory is shared with x:
     |
     |      >>> y = x[2:]
     |      >>> y.base is x
     |      True
     |
     |  ctypes
     |      An object to simplify the interaction of the array with the ctypes
     |      module.
     |
     |      This attribute creates an object that makes it easier to use arrays
     |      when calling shared libraries with the ctypes module. The returned
     |      object has, among others, data, shape, and strides attributes (see
     |      Notes below) which themselves return ctypes objects that can be used
     |      as arguments to a shared library.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      c : Python object
     |          Possessing attributes data, shape, strides, etc.
     |
     |      See Also
     |      --------
     |      numpy.ctypeslib
     |
     |      Notes
     |      -----
     |      Below are the public attributes of this object which were documented
     |      in "Guide to NumPy" (we have omitted undocumented public attributes,
     |      as well as documented private attributes):
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.data
     |          :noindex:
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.shape
     |          :noindex:
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.strides
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.data_as
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.shape_as
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.strides_as
     |          :noindex:
     |
     |      If the ctypes module is not available, then the ctypes attribute
     |      of array objects still returns something useful, but ctypes objects
     |      are not returned and errors may be raised instead. In particular,
     |      the object will still have the ``as_parameter`` attribute which will
     |      return an integer equal to the data attribute.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> import ctypes
     |      >>> x = np.array([[0, 1], [2, 3]], dtype=np.int32)
     |      >>> x
     |      array([[0, 1],
     |             [2, 3]], dtype=int32)
     |      >>> x.ctypes.data
     |      31962608 # may vary
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint32))
     |      <__main__.LP_c_uint object at 0x7ff2fc1fc200> # may vary
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint32)).contents
     |      c_uint(0)
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint64)).contents
     |      c_ulong(4294967296)
     |      >>> x.ctypes.shape
     |      <numpy._core._internal.c_long_Array_2 object at 0x7ff2fc1fce60> # may vary
     |      >>> x.ctypes.strides
     |      <numpy._core._internal.c_long_Array_2 object at 0x7ff2fc1ff320> # may vary
     |
     |  data
     |      Python buffer object pointing to the start of the array's data.
     |
     |  device
     |
     |  dtype
     |      Data-type of the array's elements.
     |
     |      .. warning::
     |
     |          Setting ``arr.dtype`` is discouraged and may be deprecated in the
     |          future.  Setting will replace the ``dtype`` without modifying the
     |          memory (see also `ndarray.view` and `ndarray.astype`).
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      d : numpy dtype object
     |
     |      See Also
     |      --------
     |      ndarray.astype : Cast the values contained in the array to a new data-type.
     |      ndarray.view : Create a view of the same data but a different data-type.
     |      numpy.dtype
     |
     |      Examples
     |      --------
     |      >>> x
     |      array([[0, 1],
     |             [2, 3]])
     |      >>> x.dtype
     |      dtype('int32')
     |      >>> type(x.dtype)
     |      <type 'numpy.dtype'>
     |
     |  flags
     |      Information about the memory layout of the array.
     |
     |      Attributes
     |      ----------
     |      C_CONTIGUOUS (C)
     |          The data is in a single, C-style contiguous segment.
     |      F_CONTIGUOUS (F)
     |          The data is in a single, Fortran-style contiguous segment.
     |      OWNDATA (O)
     |          The array owns the memory it uses or borrows it from another object.
     |      WRITEABLE (W)
     |          The data area can be written to.  Setting this to False locks
     |          the data, making it read-only.  A view (slice, etc.) inherits WRITEABLE
     |          from its base array at creation time, but a view of a writeable
     |          array may be subsequently locked while the base array remains writeable.
     |          (The opposite is not true, in that a view of a locked array may not
     |          be made writeable.  However, currently, locking a base object does not
     |          lock any views that already reference it, so under that circumstance it
     |          is possible to alter the contents of a locked array via a previously
     |          created writeable view onto it.)  Attempting to change a non-writeable
     |          array raises a RuntimeError exception.
     |      ALIGNED (A)
     |          The data and all elements are aligned appropriately for the hardware.
     |      WRITEBACKIFCOPY (X)
     |          This array is a copy of some other array. The C-API function
     |          PyArray_ResolveWritebackIfCopy must be called before deallocating
     |          to the base array will be updated with the contents of this array.
     |      FNC
     |          F_CONTIGUOUS and not C_CONTIGUOUS.
     |      FORC
     |          F_CONTIGUOUS or C_CONTIGUOUS (one-segment test).
     |      BEHAVED (B)
     |          ALIGNED and WRITEABLE.
     |      CARRAY (CA)
     |          BEHAVED and C_CONTIGUOUS.
     |      FARRAY (FA)
     |          BEHAVED and F_CONTIGUOUS and not C_CONTIGUOUS.
     |
     |      Notes
     |      -----
     |      The `flags` object can be accessed dictionary-like (as in ``a.flags['WRITEABLE']``),
     |      or by using lowercased attribute names (as in ``a.flags.writeable``). Short flag
     |      names are only supported in dictionary access.
     |
     |      Only the WRITEBACKIFCOPY, WRITEABLE, and ALIGNED flags can be
     |      changed by the user, via direct assignment to the attribute or dictionary
     |      entry, or by calling `ndarray.setflags`.
     |
     |      The array flags cannot be set arbitrarily:
     |
     |      - WRITEBACKIFCOPY can only be set ``False``.
     |      - ALIGNED can only be set ``True`` if the data is truly aligned.
     |      - WRITEABLE can only be set ``True`` if the array owns its own memory
     |        or the ultimate owner of the memory exposes a writeable buffer
     |        interface or is a string.
     |
     |      Arrays can be both C-style and Fortran-style contiguous simultaneously.
     |      This is clear for 1-dimensional arrays, but can also be true for higher
     |      dimensional arrays.
     |
     |      Even for contiguous arrays a stride for a given dimension
     |      ``arr.strides[dim]`` may be *arbitrary* if ``arr.shape[dim] == 1``
     |      or the array has no elements.
     |      It does *not* generally hold that ``self.strides[-1] == self.itemsize``
     |      for C-style contiguous arrays or ``self.strides[0] == self.itemsize`` for
     |      Fortran-style contiguous arrays is true.
     |
     |  flat
     |      A 1-D iterator over the array.
     |
     |      This is a `numpy.flatiter` instance, which acts similarly to, but is not
     |      a subclass of, Python's built-in iterator object.
     |
     |      See Also
     |      --------
     |      flatten : Return a copy of the array collapsed into one dimension.
     |
     |      flatiter
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.arange(1, 7).reshape(2, 3)
     |      >>> x
     |      array([[1, 2, 3],
     |             [4, 5, 6]])
     |      >>> x.flat[3]
     |      4
     |      >>> x.T
     |      array([[1, 4],
     |             [2, 5],
     |             [3, 6]])
     |      >>> x.T.flat[3]
     |      5
     |      >>> type(x.flat)
     |      <class 'numpy.flatiter'>
     |
     |      An assignment example:
     |
     |      >>> x.flat = 3; x
     |      array([[3, 3, 3],
     |             [3, 3, 3]])
     |      >>> x.flat[[1,4]] = 1; x
     |      array([[3, 1, 3],
     |             [3, 1, 3]])
     |
     |  imag
     |      The imaginary part of the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.sqrt([1+0j, 0+1j])
     |      >>> x.imag
     |      array([ 0.        ,  0.70710678])
     |      >>> x.imag.dtype
     |      dtype('float64')
     |
     |  itemset
     |
     |  itemsize
     |      Length of one array element in bytes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1,2,3], dtype=np.float64)
     |      >>> x.itemsize
     |      8
     |      >>> x = np.array([1,2,3], dtype=np.complex128)
     |      >>> x.itemsize
     |      16
     |
     |  mT
     |      View of the matrix transposed array.
     |
     |      The matrix transpose is the transpose of the last two dimensions, even
     |      if the array is of higher dimension.
     |
     |      .. versionadded:: 2.0
     |
     |      Raises
     |      ------
     |      ValueError
     |          If the array is of dimension less than 2.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.mT
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.arange(8).reshape((2, 2, 2))
     |      >>> a
     |      array([[[0, 1],
     |              [2, 3]],
     |      <BLANKLINE>
     |             [[4, 5],
     |              [6, 7]]])
     |      >>> a.mT
     |      array([[[0, 2],
     |              [1, 3]],
     |      <BLANKLINE>
     |             [[4, 6],
     |              [5, 7]]])
     |
     |  nbytes
     |      Total bytes consumed by the elements of the array.
     |
     |      Notes
     |      -----
     |      Does not include memory consumed by non-element attributes of the
     |      array object.
     |
     |      See Also
     |      --------
     |      sys.getsizeof
     |          Memory consumed by the object itself without parents in case view.
     |          This does include memory consumed by non-element attributes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.zeros((3,5,2), dtype=np.complex128)
     |      >>> x.nbytes
     |      480
     |      >>> np.prod(x.shape) * x.itemsize
     |      480
     |
     |  ndim
     |      Number of array dimensions.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> x.ndim
     |      1
     |      >>> y = np.zeros((2, 3, 4))
     |      >>> y.ndim
     |      3
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.sqrt([1+0j, 0+1j])
     |      >>> x.real
     |      array([ 1.        ,  0.70710678])
     |      >>> x.real.dtype
     |      dtype('float64')
     |
     |      See Also
     |      --------
     |      numpy.real : equivalent function
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |      The shape property is usually used to get the current shape of an array,
     |      but may also be used to reshape the array in-place by assigning a tuple of
     |      array dimensions to it.  As with `numpy.reshape`, one of the new shape
     |      dimensions can be -1, in which case its value is inferred from the size of
     |      the array and the remaining dimensions. Reshaping an array in-place will
     |      fail if a copy is required.
     |
     |      .. warning::
     |
     |          Setting ``arr.shape`` is discouraged and may be deprecated in the
     |          future.  Using `ndarray.reshape` is the preferred approach.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3, 4])
     |      >>> x.shape
     |      (4,)
     |      >>> y = np.zeros((2, 3, 4))
     |      >>> y.shape
     |      (2, 3, 4)
     |      >>> y.shape = (3, 8)
     |      >>> y
     |      array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
     |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
     |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])
     |      >>> y.shape = (3, 6)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      ValueError: total size of new array must be unchanged
     |      >>> np.zeros((4,2))[::2].shape = (-1,)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      AttributeError: Incompatible shape for in-place modification. Use
     |      `.reshape()` to make a copy with the desired shape.
     |
     |      See Also
     |      --------
     |      numpy.shape : Equivalent getter function.
     |      numpy.reshape : Function similar to setting ``shape``.
     |      ndarray.reshape : Method similar to setting ``shape``.
     |
     |  size
     |      Number of elements in the array.
     |
     |      Equal to ``np.prod(a.shape)``, i.e., the product of the array's
     |      dimensions.
     |
     |      Notes
     |      -----
     |      `a.size` returns a standard arbitrary precision Python integer. This
     |      may not be the case with other methods of obtaining the same value
     |      (like the suggested ``np.prod(a.shape)``, which returns an instance
     |      of ``np.int_``), and may be relevant if the value is used further in
     |      calculations that may overflow a fixed size integer type.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.zeros((3, 5, 2), dtype=np.complex128)
     |      >>> x.size
     |      30
     |      >>> np.prod(x.shape)
     |      30
     |
     |  strides
     |      Tuple of bytes to step in each dimension when traversing an array.
     |
     |      The byte offset of element ``(i[0], i[1], ..., i[n])`` in an array `a`
     |      is::
     |
     |          offset = sum(np.array(i) * a.strides)
     |
     |      A more detailed explanation of strides can be found in
     |      :ref:`arrays.ndarray`.
     |
     |      .. warning::
     |
     |          Setting ``arr.strides`` is discouraged and may be deprecated in the
     |          future.  `numpy.lib.stride_tricks.as_strided` should be preferred
     |          to create a new view of the same data in a safer way.
     |
     |      Notes
     |      -----
     |      Imagine an array of 32-bit integers (each 4 bytes)::
     |
     |        x = np.array([[0, 1, 2, 3, 4],
     |                      [5, 6, 7, 8, 9]], dtype=np.int32)
     |
     |      This array is stored in memory as 40 bytes, one after the other
     |      (known as a contiguous block of memory).  The strides of an array tell
     |      us how many bytes we have to skip in memory to move to the next position
     |      along a certain axis.  For example, we have to skip 4 bytes (1 value) to
     |      move to the next column, but 20 bytes (5 values) to get to the same
     |      position in the next row.  As such, the strides for the array `x` will be
     |      ``(20, 4)``.
     |
     |      See Also
     |      --------
     |      numpy.lib.stride_tricks.as_strided
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> y = np.reshape(np.arange(2*3*4), (2,3,4))
     |      >>> y
     |      array([[[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]],
     |             [[12, 13, 14, 15],
     |              [16, 17, 18, 19],
     |              [20, 21, 22, 23]]])
     |      >>> y.strides
     |      (48, 16, 4)
     |      >>> y[1,1,1]
     |      17
     |      >>> offset=sum(y.strides * np.array((1,1,1)))
     |      >>> offset/y.itemsize
     |      17
     |
     |      >>> x = np.reshape(np.arange(5*6*7*8), (5,6,7,8)).transpose(2,3,1,0)
     |      >>> x.strides
     |      (32, 4, 224, 1344)
     |      >>> i = np.array([3,5,2,2])
     |      >>> offset = sum(i * x.strides)
     |      >>> x[3,5,2,2]
     |      813
     |      >>> offset / x.itemsize
     |      813
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None

    class ndenumerate(builtins.object)
     |  ndenumerate(arr)
     |
     |  Multidimensional index iterator.
     |
     |  Return an iterator yielding pairs of array coordinates and values.
     |
     |  Parameters
     |  ----------
     |  arr : ndarray
     |    Input array.
     |
     |  See Also
     |  --------
     |  ndindex, flatiter
     |
     |  Examples
     |  --------
     |  >>> import numpy as np
     |  >>> a = np.array([[1, 2], [3, 4]])
     |  >>> for index, x in np.ndenumerate(a):
     |  ...     print(index, x)
     |  (0, 0) 1
     |  (0, 1) 2
     |  (1, 0) 3
     |  (1, 1) 4
     |
     |  Methods defined here:
     |
     |  __init__(self, arr) from numpy.lib._index_tricks_impl.ndenumerate
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self) from numpy.lib._index_tricks_impl.ndenumerate
     |
     |  __next__(self) from numpy.lib._index_tricks_impl.ndenumerate
     |      Standard iterator method, returns the index tuple and array value.
     |
     |      Returns
     |      -------
     |      coords : tuple of ints
     |          The indices of the current iteration.
     |      val : scalar
     |          The array element of the current iteration.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ndindex(builtins.object)
     |  ndindex(*shape)
     |
     |  An N-dimensional iterator object to index arrays.
     |
     |  Given the shape of an array, an `ndindex` instance iterates over
     |  the N-dimensional index of the array. At each iteration a tuple
     |  of indices is returned, the last dimension is iterated over first.
     |
     |  Parameters
     |  ----------
     |  shape : ints, or a single tuple of ints
     |      The size of each dimension of the array can be passed as
     |      individual parameters or as the elements of a tuple.
     |
     |  See Also
     |  --------
     |  ndenumerate, flatiter
     |
     |  Examples
     |  --------
     |  >>> import numpy as np
     |
     |  Dimensions as individual arguments
     |
     |  >>> for index in np.ndindex(3, 2, 1):
     |  ...     print(index)
     |  (0, 0, 0)
     |  (0, 1, 0)
     |  (1, 0, 0)
     |  (1, 1, 0)
     |  (2, 0, 0)
     |  (2, 1, 0)
     |
     |  Same dimensions - but in a tuple ``(3, 2, 1)``
     |
     |  >>> for index in np.ndindex((3, 2, 1)):
     |  ...     print(index)
     |  (0, 0, 0)
     |  (0, 1, 0)
     |  (1, 0, 0)
     |  (1, 1, 0)
     |  (2, 0, 0)
     |  (2, 1, 0)
     |
     |  Methods defined here:
     |
     |  __init__(self, *shape) from numpy.lib._index_tricks_impl.ndindex
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self) from numpy.lib._index_tricks_impl.ndindex
     |
     |  __next__(self) from numpy.lib._index_tricks_impl.ndindex
     |      Standard iterator method, updates the index and returns the index
     |      tuple.
     |
     |      Returns
     |      -------
     |      val : tuple of ints
     |          Returns a tuple containing the indices of the current
     |          iteration.
     |
     |  ndincr(self) from numpy.lib._index_tricks_impl.ndindex
     |      Increment the multi-dimensional index by one.
     |
     |      This method is for backward compatibility only: do not use.
     |
     |      .. deprecated:: 1.20.0
     |          This method has been advised against since numpy 1.8.0, but only
     |          started emitting DeprecationWarning as of this version.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class nditer(builtins.object)
     |  nditer(op, flags=None, op_flags=None, op_dtypes=None, order='K',
     |      casting='safe', op_axes=None, itershape=None, buffersize=0)
     |
     |  Efficient multi-dimensional iterator object to iterate over arrays.
     |  To get started using this object, see the
     |  :ref:`introductory guide to array iteration <arrays.nditer>`.
     |
     |  Parameters
     |  ----------
     |  op : ndarray or sequence of array_like
     |      The array(s) to iterate over.
     |
     |  flags : sequence of str, optional
     |        Flags to control the behavior of the iterator.
     |
     |        * ``buffered`` enables buffering when required.
     |        * ``c_index`` causes a C-order index to be tracked.
     |        * ``f_index`` causes a Fortran-order index to be tracked.
     |        * ``multi_index`` causes a multi-index, or a tuple of indices
     |          with one per iteration dimension, to be tracked.
     |        * ``common_dtype`` causes all the operands to be converted to
     |          a common data type, with copying or buffering as necessary.
     |        * ``copy_if_overlap`` causes the iterator to determine if read
     |          operands have overlap with write operands, and make temporary
     |          copies as necessary to avoid overlap. False positives (needless
     |          copying) are possible in some cases.
     |        * ``delay_bufalloc`` delays allocation of the buffers until
     |          a reset() call is made. Allows ``allocate`` operands to
     |          be initialized before their values are copied into the buffers.
     |        * ``external_loop`` causes the ``values`` given to be
     |          one-dimensional arrays with multiple values instead of
     |          zero-dimensional arrays.
     |        * ``grow_inner`` allows the ``value`` array sizes to be made
     |          larger than the buffer size when both ``buffered`` and
     |          ``external_loop`` is used.
     |        * ``ranged`` allows the iterator to be restricted to a sub-range
     |          of the iterindex values.
     |        * ``refs_ok`` enables iteration of reference types, such as
     |          object arrays.
     |        * ``reduce_ok`` enables iteration of ``readwrite`` operands
     |          which are broadcasted, also known as reduction operands.
     |        * ``zerosize_ok`` allows `itersize` to be zero.
     |  op_flags : list of list of str, optional
     |        This is a list of flags for each operand. At minimum, one of
     |        ``readonly``, ``readwrite``, or ``writeonly`` must be specified.
     |
     |        * ``readonly`` indicates the operand will only be read from.
     |        * ``readwrite`` indicates the operand will be read from and written to.
     |        * ``writeonly`` indicates the operand will only be written to.
     |        * ``no_broadcast`` prevents the operand from being broadcasted.
     |        * ``contig`` forces the operand data to be contiguous.
     |        * ``aligned`` forces the operand data to be aligned.
     |        * ``nbo`` forces the operand data to be in native byte order.
     |        * ``copy`` allows a temporary read-only copy if required.
     |        * ``updateifcopy`` allows a temporary read-write copy if required.
     |        * ``allocate`` causes the array to be allocated if it is None
     |          in the ``op`` parameter.
     |        * ``no_subtype`` prevents an ``allocate`` operand from using a subtype.
     |        * ``arraymask`` indicates that this operand is the mask to use
     |          for selecting elements when writing to operands with the
     |          'writemasked' flag set. The iterator does not enforce this,
     |          but when writing from a buffer back to the array, it only
     |          copies those elements indicated by this mask.
     |        * ``writemasked`` indicates that only elements where the chosen
     |          ``arraymask`` operand is True will be written to.
     |        * ``overlap_assume_elementwise`` can be used to mark operands that are
     |          accessed only in the iterator order, to allow less conservative
     |          copying when ``copy_if_overlap`` is present.
     |  op_dtypes : dtype or tuple of dtype(s), optional
     |      The required data type(s) of the operands. If copying or buffering
     |      is enabled, the data will be converted to/from their original types.
     |  order : {'C', 'F', 'A', 'K'}, optional
     |      Controls the iteration order. 'C' means C order, 'F' means
     |      Fortran order, 'A' means 'F' order if all the arrays are Fortran
     |      contiguous, 'C' order otherwise, and 'K' means as close to the
     |      order the array elements appear in memory as possible. This also
     |      affects the element memory order of ``allocate`` operands, as they
     |      are allocated to be compatible with iteration order.
     |      Default is 'K'.
     |  casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
     |      Controls what kind of data casting may occur when making a copy
     |      or buffering.  Setting this to 'unsafe' is not recommended,
     |      as it can adversely affect accumulations.
     |
     |      * 'no' means the data types should not be cast at all.
     |      * 'equiv' means only byte-order changes are allowed.
     |      * 'safe' means only casts which can preserve values are allowed.
     |      * 'same_kind' means only safe casts or casts within a kind,
     |        like float64 to float32, are allowed.
     |      * 'unsafe' means any data conversions may be done.
     |  op_axes : list of list of ints, optional
     |      If provided, is a list of ints or None for each operands.
     |      The list of axes for an operand is a mapping from the dimensions
     |      of the iterator to the dimensions of the operand. A value of
     |      -1 can be placed for entries, causing that dimension to be
     |      treated as `newaxis`.
     |  itershape : tuple of ints, optional
     |      The desired shape of the iterator. This allows ``allocate`` operands
     |      with a dimension mapped by op_axes not corresponding to a dimension
     |      of a different operand to get a value not equal to 1 for that
     |      dimension.
     |  buffersize : int, optional
     |      When buffering is enabled, controls the size of the temporary
     |      buffers. Set to 0 for the default value.
     |
     |  Attributes
     |  ----------
     |  dtypes : tuple of dtype(s)
     |      The data types of the values provided in `value`. This may be
     |      different from the operand data types if buffering is enabled.
     |      Valid only before the iterator is closed.
     |  finished : bool
     |      Whether the iteration over the operands is finished or not.
     |  has_delayed_bufalloc : bool
     |      If True, the iterator was created with the ``delay_bufalloc`` flag,
     |      and no reset() function was called on it yet.
     |  has_index : bool
     |      If True, the iterator was created with either the ``c_index`` or
     |      the ``f_index`` flag, and the property `index` can be used to
     |      retrieve it.
     |  has_multi_index : bool
     |      If True, the iterator was created with the ``multi_index`` flag,
     |      and the property `multi_index` can be used to retrieve it.
     |  index
     |      When the ``c_index`` or ``f_index`` flag was used, this property
     |      provides access to the index. Raises a ValueError if accessed
     |      and ``has_index`` is False.
     |  iterationneedsapi : bool
     |      Whether iteration requires access to the Python API, for example
     |      if one of the operands is an object array.
     |  iterindex : int
     |      An index which matches the order of iteration.
     |  itersize : int
     |      Size of the iterator.
     |  itviews
     |      Structured view(s) of `operands` in memory, matching the reordered
     |      and optimized iterator access pattern. Valid only before the iterator
     |      is closed.
     |  multi_index
     |      When the ``multi_index`` flag was used, this property
     |      provides access to the index. Raises a ValueError if accessed
     |      accessed and ``has_multi_index`` is False.
     |  ndim : int
     |      The dimensions of the iterator.
     |  nop : int
     |      The number of iterator operands.
     |  operands : tuple of operand(s)
     |      The array(s) to be iterated over. Valid only before the iterator is
     |      closed.
     |  shape : tuple of ints
     |      Shape tuple, the shape of the iterator.
     |  value
     |      Value of ``operands`` at current iteration. Normally, this is a
     |      tuple of array scalars, but if the flag ``external_loop`` is used,
     |      it is a tuple of one dimensional arrays.
     |
     |  Notes
     |  -----
     |  `nditer` supersedes `flatiter`.  The iterator implementation behind
     |  `nditer` is also exposed by the NumPy C API.
     |
     |  The Python exposure supplies two iteration interfaces, one which follows
     |  the Python iterator protocol, and another which mirrors the C-style
     |  do-while pattern.  The native Python approach is better in most cases, but
     |  if you need the coordinates or index of an iterator, use the C-style pattern.
     |
     |  Examples
     |  --------
     |  Here is how we might write an ``iter_add`` function, using the
     |  Python iterator protocol:
     |
     |  >>> import numpy as np
     |
     |  >>> def iter_add_py(x, y, out=None):
     |  ...     addop = np.add
     |  ...     it = np.nditer([x, y, out], [],
     |  ...                 [['readonly'], ['readonly'], ['writeonly','allocate']])
     |  ...     with it:
     |  ...         for (a, b, c) in it:
     |  ...             addop(a, b, out=c)
     |  ...         return it.operands[2]
     |
     |  Here is the same function, but following the C-style pattern:
     |
     |  >>> def iter_add(x, y, out=None):
     |  ...    addop = np.add
     |  ...    it = np.nditer([x, y, out], [],
     |  ...                [['readonly'], ['readonly'], ['writeonly','allocate']])
     |  ...    with it:
     |  ...        while not it.finished:
     |  ...            addop(it[0], it[1], out=it[2])
     |  ...            it.iternext()
     |  ...        return it.operands[2]
     |
     |  Here is an example outer product function:
     |
     |  >>> def outer_it(x, y, out=None):
     |  ...     mulop = np.multiply
     |  ...     it = np.nditer([x, y, out], ['external_loop'],
     |  ...             [['readonly'], ['readonly'], ['writeonly', 'allocate']],
     |  ...             op_axes=[list(range(x.ndim)) + [-1] * y.ndim,
     |  ...                      [-1] * x.ndim + list(range(y.ndim)),
     |  ...                      None])
     |  ...     with it:
     |  ...         for (a, b, c) in it:
     |  ...             mulop(a, b, out=c)
     |  ...         return it.operands[2]
     |
     |  >>> a = np.arange(2)+1
     |  >>> b = np.arange(3)+1
     |  >>> outer_it(a,b)
     |  array([[1, 2, 3],
     |         [2, 4, 6]])
     |
     |  Here is an example function which operates like a "lambda" ufunc:
     |
     |  >>> def luf(lamdaexpr, *args, **kwargs):
     |  ...    '''luf(lambdaexpr, op1, ..., opn, out=None, order='K', casting='safe', buffersize=0)'''
     |  ...    nargs = len(args)
     |  ...    op = (kwargs.get('out',None),) + args
     |  ...    it = np.nditer(op, ['buffered','external_loop'],
     |  ...            [['writeonly','allocate','no_broadcast']] +
     |  ...                            [['readonly','nbo','aligned']]*nargs,
     |  ...            order=kwargs.get('order','K'),
     |  ...            casting=kwargs.get('casting','safe'),
     |  ...            buffersize=kwargs.get('buffersize',0))
     |  ...    while not it.finished:
     |  ...        it[0] = lamdaexpr(*it[1:])
     |  ...        it.iternext()
     |  ...    return it.operands[0]
     |
     |  >>> a = np.arange(5)
     |  >>> b = np.ones(5)
     |  >>> luf(lambda i,j:i*i + j/2, a, b)
     |  array([  0.5,   1.5,   4.5,   9.5,  16.5])
     |
     |  If operand flags ``"writeonly"`` or ``"readwrite"`` are used the
     |  operands may be views into the original data with the
     |  `WRITEBACKIFCOPY` flag. In this case `nditer` must be used as a
     |  context manager or the `nditer.close` method must be called before
     |  using the result. The temporary data will be written back to the
     |  original data when the :meth:`~object.__exit__` function is called
     |  but not before:
     |
     |  >>> a = np.arange(6, dtype='i4')[::-2]
     |  >>> with np.nditer(a, [],
     |  ...        [['writeonly', 'updateifcopy']],
     |  ...        casting='unsafe',
     |  ...        op_dtypes=[np.dtype('f4')]) as i:
     |  ...    x = i.operands[0]
     |  ...    x[:] = [-1, -2, -3]
     |  ...    # a still unchanged here
     |  >>> a, x
     |  (array([-1, -2, -3], dtype=int32), array([-1., -2., -3.], dtype=float32))
     |
     |  It is important to note that once the iterator is exited, dangling
     |  references (like `x` in the example) may or may not share data with
     |  the original data `a`. If writeback semantics were active, i.e. if
     |  `x.base.flags.writebackifcopy` is `True`, then exiting the iterator
     |  will sever the connection between `x` and `a`, writing to `x` will
     |  no longer write to `a`. If writeback semantics are not active, then
     |  `x.data` will still point at some part of `a.data`, and writing to
     |  one will affect the other.
     |
     |  Context management and the `close` method appeared in version 1.15.0.
     |
     |  Methods defined here:
     |
     |  __copy__(...)
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __enter__(...)
     |
     |  __exit__(...)
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __next__(self, /)
     |      Implement next(self).
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  close(...)
     |      close()
     |
     |      Resolve all writeback semantics in writeable operands.
     |
     |      .. versionadded:: 1.15.0
     |
     |      See Also
     |      --------
     |
     |      :ref:`nditer-context-manager`
     |
     |  copy(...)
     |      copy()
     |
     |      Get a copy of the iterator in its current state.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.arange(10)
     |      >>> y = x + 1
     |      >>> it = np.nditer([x, y])
     |      >>> next(it)
     |      (array(0), array(1))
     |      >>> it2 = it.copy()
     |      >>> next(it2)
     |      (array(1), array(2))
     |
     |  debug_print(...)
     |      debug_print()
     |
     |      Print the current state of the `nditer` instance and debug info to stdout.
     |
     |  enable_external_loop(...)
     |      enable_external_loop()
     |
     |      When the "external_loop" was not used during construction, but
     |      is desired, this modifies the iterator to behave as if the flag
     |      was specified.
     |
     |  iternext(...)
     |      iternext()
     |
     |      Check whether iterations are left, and perform a single internal iteration
     |      without returning the result.  Used in the C-style pattern do-while
     |      pattern.  For an example, see `nditer`.
     |
     |      Returns
     |      -------
     |      iternext : bool
     |          Whether or not there are iterations left.
     |
     |  remove_axis(...)
     |      remove_axis(i, /)
     |
     |      Removes axis `i` from the iterator. Requires that the flag "multi_index"
     |      be enabled.
     |
     |  remove_multi_index(...)
     |      remove_multi_index()
     |
     |      When the "multi_index" flag was specified, this removes it, allowing
     |      the internal iteration structure to be optimized further.
     |
     |  reset(...)
     |      reset()
     |
     |      Reset the iterator to its initial state.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  dtypes
     |
     |  finished
     |
     |  has_delayed_bufalloc
     |
     |  has_index
     |
     |  has_multi_index
     |
     |  index
     |
     |  iterationneedsapi
     |
     |  iterindex
     |
     |  iterrange
     |
     |  itersize
     |
     |  itviews
     |
     |  multi_index
     |
     |  ndim
     |
     |  nop
     |
     |  operands
     |      operands[`Slice`]
     |
     |      The array(s) to be iterated over. Valid only before the iterator is closed.
     |
     |  shape
     |
     |  value

    class number(generic)
     |  Abstract base class of all numeric scalar types.
     |
     |  Method resolution order:
     |      number
     |      generic
     |      builtins.object
     |
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from generic:
     |
     |  __hash__ = None

    class object_(generic)
     |  Any Python object.
     |
     |  :Character code: ``'O'``
     |
     |  Method resolution order:
     |      object_
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __call__(self, /, *args, **kwargs)
     |      Call self as a function.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __delattr__(self, name, /)
     |      Implement delattr(self, name).
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iadd__(self, value, /)
     |      Implement self+=value.
     |
     |  __imul__(self, value, /)
     |      Implement self*=value.
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __release_buffer__(self, buffer, /)
     |      Release the buffer object that exposes the underlying memory of the object.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __setattr__(self, name, value, /)
     |      Implement setattr(self, name, value).
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class poly1d(builtins.object)
     |  poly1d(c_or_r, r=False, variable=None)
     |
     |  A one-dimensional polynomial class.
     |
     |  .. note::
     |     This forms part of the old polynomial API. Since version 1.4, the
     |     new polynomial API defined in `numpy.polynomial` is preferred.
     |     A summary of the differences can be found in the
     |     :doc:`transition guide </reference/routines.polynomials>`.
     |
     |  A convenience class, used to encapsulate "natural" operations on
     |  polynomials so that said operations may take on their customary
     |  form in code (see Examples).
     |
     |  Parameters
     |  ----------
     |  c_or_r : array_like
     |      The polynomial's coefficients, in decreasing powers, or if
     |      the value of the second parameter is True, the polynomial's
     |      roots (values where the polynomial evaluates to 0).  For example,
     |      ``poly1d([1, 2, 3])`` returns an object that represents
     |      :math:`x^2 + 2x + 3`, whereas ``poly1d([1, 2, 3], True)`` returns
     |      one that represents :math:`(x-1)(x-2)(x-3) = x^3 - 6x^2 + 11x -6`.
     |  r : bool, optional
     |      If True, `c_or_r` specifies the polynomial's roots; the default
     |      is False.
     |  variable : str, optional
     |      Changes the variable used when printing `p` from `x` to `variable`
     |      (see Examples).
     |
     |  Examples
     |  --------
     |  Construct the polynomial :math:`x^2 + 2x + 3`:
     |
     |  >>> import numpy as np
     |
     |  >>> p = np.poly1d([1, 2, 3])
     |  >>> print(np.poly1d(p))
     |     2
     |  1 x + 2 x + 3
     |
     |  Evaluate the polynomial at :math:`x = 0.5`:
     |
     |  >>> p(0.5)
     |  4.25
     |
     |  Find the roots:
     |
     |  >>> p.r
     |  array([-1.+1.41421356j, -1.-1.41421356j])
     |  >>> p(p.r)
     |  array([ -4.44089210e-16+0.j,  -4.44089210e-16+0.j]) # may vary
     |
     |  These numbers in the previous line represent (0, 0) to machine precision
     |
     |  Show the coefficients:
     |
     |  >>> p.c
     |  array([1, 2, 3])
     |
     |  Display the order (the leading zero-coefficients are removed):
     |
     |  >>> p.order
     |  2
     |
     |  Show the coefficient of the k-th power in the polynomial
     |  (which is equivalent to ``p.c[-(i+1)]``):
     |
     |  >>> p[1]
     |  2
     |
     |  Polynomials can be added, subtracted, multiplied, and divided
     |  (returns quotient and remainder):
     |
     |  >>> p * p
     |  poly1d([ 1,  4, 10, 12,  9])
     |
     |  >>> (p**3 + 4) / p
     |  (poly1d([ 1.,  4., 10., 12.,  9.]), poly1d([4.]))
     |
     |  ``asarray(p)`` gives the coefficient array, so polynomials can be
     |  used in all functions that accept arrays:
     |
     |  >>> p**2 # square of polynomial
     |  poly1d([ 1,  4, 10, 12,  9])
     |
     |  >>> np.square(p) # square of individual coefficients
     |  array([1, 4, 9])
     |
     |  The variable used in the string representation of `p` can be modified,
     |  using the `variable` parameter:
     |
     |  >>> p = np.poly1d([1,2,3], variable='z')
     |  >>> print(p)
     |     2
     |  1 z + 2 z + 3
     |
     |  Construct a polynomial from its roots:
     |
     |  >>> np.poly1d([1, 2], True)
     |  poly1d([ 1., -3.,  2.])
     |
     |  This is the same polynomial as obtained by:
     |
     |  >>> np.poly1d([1, -1]) * np.poly1d([1, -2])
     |  poly1d([ 1, -3,  2])
     |
     |  Methods defined here:
     |
     |  __add__(self, other) from numpy.lib._polynomial_impl.poly1d
     |
     |  __array__(self, t=None, copy=None) from numpy.lib._polynomial_impl.poly1d
     |
     |  __call__(self, val) from numpy.lib._polynomial_impl.poly1d
     |      Call self as a function.
     |
     |  __div__(self, other) from numpy.lib._polynomial_impl.poly1d
     |
     |  __eq__(self, other) from numpy.lib._polynomial_impl.poly1d
     |      Return self==value.
     |
     |  __getitem__(self, val) from numpy.lib._polynomial_impl.poly1d
     |
     |  __init__(self, c_or_r, r=False, variable=None) from numpy.lib._polynomial_impl.poly1d
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __iter__(self) from numpy.lib._polynomial_impl.poly1d
     |
     |  __len__(self) from numpy.lib._polynomial_impl.poly1d
     |
     |  __mul__(self, other) from numpy.lib._polynomial_impl.poly1d
     |
     |  __ne__(self, other) from numpy.lib._polynomial_impl.poly1d
     |      Return self!=value.
     |
     |  __neg__(self) from numpy.lib._polynomial_impl.poly1d
     |
     |  __pos__(self) from numpy.lib._polynomial_impl.poly1d
     |
     |  __pow__(self, val) from numpy.lib._polynomial_impl.poly1d
     |
     |  __radd__(self, other) from numpy.lib._polynomial_impl.poly1d
     |
     |  __rdiv__(self, other) from numpy.lib._polynomial_impl.poly1d
     |
     |  __repr__(self) from numpy.lib._polynomial_impl.poly1d
     |      Return repr(self).
     |
     |  __rmul__(self, other) from numpy.lib._polynomial_impl.poly1d
     |
     |  __rsub__(self, other) from numpy.lib._polynomial_impl.poly1d
     |
     |  __rtruediv__ = __rdiv__(self, other)
     |
     |  __setitem__(self, key, val) from numpy.lib._polynomial_impl.poly1d
     |
     |  __str__(self) from numpy.lib._polynomial_impl.poly1d
     |      Return str(self).
     |
     |  __sub__(self, other) from numpy.lib._polynomial_impl.poly1d
     |
     |  __truediv__ = __div__(self, other)
     |
     |  deriv(self, m=1) from numpy.lib._polynomial_impl.poly1d
     |      Return a derivative of this polynomial.
     |
     |      Refer to `polyder` for full documentation.
     |
     |      See Also
     |      --------
     |      polyder : equivalent function
     |
     |  integ(self, m=1, k=0) from numpy.lib._polynomial_impl.poly1d
     |      Return an antiderivative (indefinite integral) of this polynomial.
     |
     |      Refer to `polyint` for full documentation.
     |
     |      See Also
     |      --------
     |      polyint : equivalent function
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  o
     |      The order or degree of the polynomial
     |
     |  order
     |      The order or degree of the polynomial
     |
     |  r
     |      The roots of the polynomial, where self(x) == 0
     |
     |  roots
     |      The roots of the polynomial, where self(x) == 0
     |
     |  variable
     |      The name of the polynomial variable
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  c
     |      The polynomial coefficients
     |
     |  coef
     |      The polynomial coefficients
     |
     |  coefficients
     |      The polynomial coefficients
     |
     |  coeffs
     |      The polynomial coefficients
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None

    class recarray(numpy.ndarray)
     |  recarray(shape, dtype=None, buf=None, offset=0, strides=None, formats=None, names=None, titles=None, byteorder=None, aligned=False, order='C')
     |
     |  Construct an ndarray that allows field access using attributes.
     |
     |  Arrays may have a data-types containing fields, analogous
     |  to columns in a spread sheet.  An example is ``[(x, int), (y, float)]``,
     |  where each entry in the array is a pair of ``(int, float)``.  Normally,
     |  these attributes are accessed using dictionary lookups such as ``arr['x']``
     |  and ``arr['y']``.  Record arrays allow the fields to be accessed as members
     |  of the array, using ``arr.x`` and ``arr.y``.
     |
     |  Parameters
     |  ----------
     |  shape : tuple
     |      Shape of output array.
     |  dtype : data-type, optional
     |      The desired data-type.  By default, the data-type is determined
     |      from `formats`, `names`, `titles`, `aligned` and `byteorder`.
     |  formats : list of data-types, optional
     |      A list containing the data-types for the different columns, e.g.
     |      ``['i4', 'f8', 'i4']``.  `formats` does *not* support the new
     |      convention of using types directly, i.e. ``(int, float, int)``.
     |      Note that `formats` must be a list, not a tuple.
     |      Given that `formats` is somewhat limited, we recommend specifying
     |      `dtype` instead.
     |  names : tuple of str, optional
     |      The name of each column, e.g. ``('x', 'y', 'z')``.
     |  buf : buffer, optional
     |      By default, a new array is created of the given shape and data-type.
     |      If `buf` is specified and is an object exposing the buffer interface,
     |      the array will use the memory from the existing buffer.  In this case,
     |      the `offset` and `strides` keywords are available.
     |
     |  Other Parameters
     |  ----------------
     |  titles : tuple of str, optional
     |      Aliases for column names.  For example, if `names` were
     |      ``('x', 'y', 'z')`` and `titles` is
     |      ``('x_coordinate', 'y_coordinate', 'z_coordinate')``, then
     |      ``arr['x']`` is equivalent to both ``arr.x`` and ``arr.x_coordinate``.
     |  byteorder : {'<', '>', '='}, optional
     |      Byte-order for all fields.
     |  aligned : bool, optional
     |      Align the fields in memory as the C-compiler would.
     |  strides : tuple of ints, optional
     |      Buffer (`buf`) is interpreted according to these strides (strides
     |      define how many bytes each array element, row, column, etc.
     |      occupy in memory).
     |  offset : int, optional
     |      Start reading buffer (`buf`) from this offset onwards.
     |  order : {'C', 'F'}, optional
     |      Row-major (C-style) or column-major (Fortran-style) order.
     |
     |  Returns
     |  -------
     |  rec : recarray
     |      Empty array of the given shape and type.
     |
     |  See Also
     |  --------
     |  numpy.rec.fromrecords : Construct a record array from data.
     |  numpy.record : fundamental data-type for `recarray`.
     |  numpy.rec.format_parser : determine data-type from formats, names, titles.
     |
     |  Notes
     |  -----
     |  This constructor can be compared to ``empty``: it creates a new record
     |  array but does not fill it with data.  To create a record array from data,
     |  use one of the following methods:
     |
     |  1. Create a standard ndarray and convert it to a record array,
     |     using ``arr.view(np.recarray)``
     |  2. Use the `buf` keyword.
     |  3. Use `np.rec.fromrecords`.
     |
     |  Examples
     |  --------
     |  Create an array with two fields, ``x`` and ``y``:
     |
     |  >>> import numpy as np
     |  >>> x = np.array([(1.0, 2), (3.0, 4)], dtype=[('x', '<f8'), ('y', '<i8')])
     |  >>> x
     |  array([(1., 2), (3., 4)], dtype=[('x', '<f8'), ('y', '<i8')])
     |
     |  >>> x['x']
     |  array([1., 3.])
     |
     |  View the array as a record array:
     |
     |  >>> x = x.view(np.recarray)
     |
     |  >>> x.x
     |  array([1., 3.])
     |
     |  >>> x.y
     |  array([2, 4])
     |
     |  Create a new, empty record array:
     |
     |  >>> np.recarray((2,),
     |  ... dtype=[('x', int), ('y', float), ('z', int)]) #doctest: +SKIP
     |  rec.array([(-1073741821, 1.2249118382103472e-301, 24547520),
     |         (3471280, 1.2134086255804012e-316, 0)],
     |        dtype=[('x', '<i4'), ('y', '<f8'), ('z', '<i4')])
     |
     |  Method resolution order:
     |      recarray
     |      numpy.ndarray
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __array_finalize__(self, obj) from numpy._core.records.recarray
     |      a.__array_finalize__(obj, /)
     |
     |      Present so subclasses can call super. Does nothing.
     |
     |  __getattribute__(self, attr) from numpy._core.records.recarray
     |      Return getattr(self, name).
     |
     |  __getitem__(self, indx) from numpy._core.records.recarray
     |      Return self[key].
     |
     |  __repr__(self) from numpy._core.records.recarray
     |      Return repr(self).
     |
     |  __setattr__(self, attr, val) from numpy._core.records.recarray
     |      Implement setattr(self, name, value).
     |
     |  field(self, attr, val=None) from numpy._core.records.recarray
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(subtype, shape, dtype=None, buf=None, offset=0, strides=None, formats=None, names=None, titles=None, byteorder=None, aligned=False, order='C') from numpy._core.records.recarray
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from numpy.ndarray:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      a.__array__([dtype], *, copy=None)
     |
     |      For ``dtype`` parameter it returns a new reference to self if
     |      ``dtype`` is not given or it matches array's data type.
     |      A new array of provided data type is returned if ``dtype``
     |      is different from the current data type of the array.
     |      For ``copy`` parameter it returns a new reference to self if
     |      ``copy=False`` or ``copy=None`` and copying isn't enforced by ``dtype``
     |      parameter. The method returns a new array for ``copy=True``, regardless of
     |      ``dtype`` parameter.
     |
     |      A more detailed explanation of the ``__array__`` interface
     |      can be found in :ref:`dunder_array.interface`.
     |
     |  __array_function__(...)
     |
     |  __array_namespace__(...)
     |
     |  __array_ufunc__(...)
     |
     |  __array_wrap__(...)
     |      a.__array_wrap__(array[, context], /)
     |
     |      Returns a view of `array` with the same type as self.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __complex__(...)
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __copy__(...)
     |      a.__copy__()
     |
     |      Used if :func:`copy.copy` is called on an array. Returns a copy of the array.
     |
     |      Equivalent to ``a.copy(order='K')``.
     |
     |  __deepcopy__(...)
     |      a.__deepcopy__(memo, /)
     |
     |      Used if :func:`copy.deepcopy` is called on an array.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __dlpack__(...)
     |      a.__dlpack__(*, stream=None, max_version=None, dl_device=None, copy=None)
     |
     |      DLPack Protocol: Part of the Array API.
     |
     |  __dlpack_device__(...)
     |      a.__dlpack_device__()
     |
     |      DLPack Protocol: Part of the Array API.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      Default object formatter.
     |
     |      Return str(self) if format_spec is empty. Raise TypeError otherwise.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __iadd__(self, value, /)
     |      Return self+=value.
     |
     |  __iand__(self, value, /)
     |      Return self&=value.
     |
     |  __ifloordiv__(self, value, /)
     |      Return self//=value.
     |
     |  __ilshift__(self, value, /)
     |      Return self<<=value.
     |
     |  __imatmul__(self, value, /)
     |      Return self@=value.
     |
     |  __imod__(self, value, /)
     |      Return self%=value.
     |
     |  __imul__(self, value, /)
     |      Return self*=value.
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __ipow__(self, value, /)
     |      Return self**=value.
     |
     |  __irshift__(self, value, /)
     |      Return self>>=value.
     |
     |  __isub__(self, value, /)
     |      Return self-=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __itruediv__(self, value, /)
     |      Return self/=value.
     |
     |  __ixor__(self, value, /)
     |      Return self^=value.
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __matmul__(self, value, /)
     |      Return self@value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      a.__reduce__()
     |
     |      For pickling.
     |
     |  __reduce_ex__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmatmul__(self, value, /)
     |      Return value@self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __setstate__(...)
     |      a.__setstate__(state, /)
     |
     |      For unpickling.
     |
     |      The `state` argument must be a sequence that contains the following
     |      elements:
     |
     |      Parameters
     |      ----------
     |      version : int
     |          optional pickle version. If omitted defaults to 0.
     |      shape : tuple
     |      dtype : data-type
     |      isFortran : bool
     |      rawdata : string or list
     |          a binary string with the data (or a list if 'a' is an object array)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      a.all(axis=None, out=None, keepdims=False, *, where=True)
     |
     |      Returns True if all elements evaluate to True.
     |
     |      Refer to `numpy.all` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.all : equivalent function
     |
     |  any(...)
     |      a.any(axis=None, out=None, keepdims=False, *, where=True)
     |
     |      Returns True if any of the elements of `a` evaluate to True.
     |
     |      Refer to `numpy.any` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.any : equivalent function
     |
     |  argmax(...)
     |      a.argmax(axis=None, out=None, *, keepdims=False)
     |
     |      Return indices of the maximum values along the given axis.
     |
     |      Refer to `numpy.argmax` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.argmax : equivalent function
     |
     |  argmin(...)
     |      a.argmin(axis=None, out=None, *, keepdims=False)
     |
     |      Return indices of the minimum values along the given axis.
     |
     |      Refer to `numpy.argmin` for detailed documentation.
     |
     |      See Also
     |      --------
     |      numpy.argmin : equivalent function
     |
     |  argpartition(...)
     |      a.argpartition(kth, axis=-1, kind='introselect', order=None)
     |
     |      Returns the indices that would partition this array.
     |
     |      Refer to `numpy.argpartition` for full documentation.
     |
     |      .. versionadded:: 1.8.0
     |
     |      See Also
     |      --------
     |      numpy.argpartition : equivalent function
     |
     |  argsort(...)
     |      a.argsort(axis=-1, kind=None, order=None)
     |
     |      Returns the indices that would sort this array.
     |
     |      Refer to `numpy.argsort` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.argsort : equivalent function
     |
     |  astype(...)
     |      a.astype(dtype, order='K', casting='unsafe', subok=True, copy=True)
     |
     |      Copy of the array, cast to a specified type.
     |
     |      Parameters
     |      ----------
     |      dtype : str or dtype
     |          Typecode or data-type to which the array is cast.
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          Controls the memory layout order of the result.
     |          'C' means C order, 'F' means Fortran order, 'A'
     |          means 'F' order if all the arrays are Fortran contiguous,
     |          'C' order otherwise, and 'K' means as close to the
     |          order the array elements appear in memory as possible.
     |          Default is 'K'.
     |      casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
     |          Controls what kind of data casting may occur. Defaults to 'unsafe'
     |          for backwards compatibility.
     |
     |          * 'no' means the data types should not be cast at all.
     |          * 'equiv' means only byte-order changes are allowed.
     |          * 'safe' means only casts which can preserve values are allowed.
     |          * 'same_kind' means only safe casts or casts within a kind,
     |            like float64 to float32, are allowed.
     |          * 'unsafe' means any data conversions may be done.
     |      subok : bool, optional
     |          If True, then sub-classes will be passed-through (default), otherwise
     |          the returned array will be forced to be a base-class array.
     |      copy : bool, optional
     |          By default, astype always returns a newly allocated array. If this
     |          is set to false, and the `dtype`, `order`, and `subok`
     |          requirements are satisfied, the input array is returned instead
     |          of a copy.
     |
     |      Returns
     |      -------
     |      arr_t : ndarray
     |          Unless `copy` is False and the other conditions for returning the input
     |          array are satisfied (see description for `copy` input parameter), `arr_t`
     |          is a new array of the same shape as the input array, with dtype, order
     |          given by `dtype`, `order`.
     |
     |      Notes
     |      -----
     |      .. versionchanged:: 1.17.0
     |         Casting between a simple data type and a structured one is possible only
     |         for "unsafe" casting.  Casting to multiple fields is allowed, but
     |         casting from multiple fields is not.
     |
     |      .. versionchanged:: 1.9.0
     |         Casting from numeric to string types in 'safe' casting mode requires
     |         that the string dtype length is long enough to store the max
     |         integer/float value converted.
     |
     |      Raises
     |      ------
     |      ComplexWarning
     |          When casting from complex to float or int. To avoid this,
     |          one should use ``a.real.astype(t)``.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 2.5])
     |      >>> x
     |      array([1. ,  2. ,  2.5])
     |
     |      >>> x.astype(int)
     |      array([1, 2, 2])
     |
     |  byteswap(...)
     |      a.byteswap(inplace=False)
     |
     |      Swap the bytes of the array elements
     |
     |      Toggle between low-endian and big-endian data representation by
     |      returning a byteswapped array, optionally swapped in-place.
     |      Arrays of byte-strings are not swapped. The real and imaginary
     |      parts of a complex number are swapped individually.
     |
     |      Parameters
     |      ----------
     |      inplace : bool, optional
     |          If ``True``, swap bytes in-place, default is ``False``.
     |
     |      Returns
     |      -------
     |      out : ndarray
     |          The byteswapped array. If `inplace` is ``True``, this is
     |          a view to self.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> A = np.array([1, 256, 8755], dtype=np.int16)
     |      >>> list(map(hex, A))
     |      ['0x1', '0x100', '0x2233']
     |      >>> A.byteswap(inplace=True)
     |      array([  256,     1, 13090], dtype=int16)
     |      >>> list(map(hex, A))
     |      ['0x100', '0x1', '0x3322']
     |
     |      Arrays of byte-strings are not swapped
     |
     |      >>> A = np.array([b'ceg', b'fac'])
     |      >>> A.byteswap()
     |      array([b'ceg', b'fac'], dtype='|S3')
     |
     |      ``A.view(A.dtype.newbyteorder()).byteswap()`` produces an array with
     |      the same values but different representation in memory
     |
     |      >>> A = np.array([1, 2, 3])
     |      >>> A.view(np.uint8)
     |      array([1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
     |             0, 0], dtype=uint8)
     |      >>> A.view(A.dtype.newbyteorder()).byteswap(inplace=True)
     |      array([1, 2, 3])
     |      >>> A.view(np.uint8)
     |      array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
     |             0, 3], dtype=uint8)
     |
     |  choose(...)
     |      a.choose(choices, out=None, mode='raise')
     |
     |      Use an index array to construct a new array from a set of choices.
     |
     |      Refer to `numpy.choose` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.choose : equivalent function
     |
     |  clip(...)
     |      a.clip(min=None, max=None, out=None, **kwargs)
     |
     |      Return an array whose values are limited to ``[min, max]``.
     |      One of max or min must be given.
     |
     |      Refer to `numpy.clip` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.clip : equivalent function
     |
     |  compress(...)
     |      a.compress(condition, axis=None, out=None)
     |
     |      Return selected slices of this array along given axis.
     |
     |      Refer to `numpy.compress` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.compress : equivalent function
     |
     |  conj(...)
     |      a.conj()
     |
     |      Complex-conjugate all elements.
     |
     |      Refer to `numpy.conjugate` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.conjugate : equivalent function
     |
     |  conjugate(...)
     |      a.conjugate()
     |
     |      Return the complex conjugate, element-wise.
     |
     |      Refer to `numpy.conjugate` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.conjugate : equivalent function
     |
     |  copy(...)
     |      a.copy(order='C')
     |
     |      Return a copy of the array.
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          Controls the memory layout of the copy. 'C' means C-order,
     |          'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
     |          'C' otherwise. 'K' means match the layout of `a` as closely
     |          as possible. (Note that this function and :func:`numpy.copy` are very
     |          similar but have different default values for their order=
     |          arguments, and this function always passes sub-classes through.)
     |
     |      See also
     |      --------
     |      numpy.copy : Similar function with different default behavior
     |      numpy.copyto
     |
     |      Notes
     |      -----
     |      This function is the preferred method for creating an array copy.  The
     |      function :func:`numpy.copy` is similar, but it defaults to using order 'K',
     |      and will not pass sub-classes through by default.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([[1,2,3],[4,5,6]], order='F')
     |
     |      >>> y = x.copy()
     |
     |      >>> x.fill(0)
     |
     |      >>> x
     |      array([[0, 0, 0],
     |             [0, 0, 0]])
     |
     |      >>> y
     |      array([[1, 2, 3],
     |             [4, 5, 6]])
     |
     |      >>> y.flags['C_CONTIGUOUS']
     |      True
     |
     |      For arrays containing Python objects (e.g. dtype=object),
     |      the copy is a shallow one. The new array will contain the
     |      same object which may lead to surprises if that object can
     |      be modified (is mutable):
     |
     |      >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object)
     |      >>> b = a.copy()
     |      >>> b[2][0] = 10
     |      >>> a
     |      array([1, 'm', list([10, 3, 4])], dtype=object)
     |
     |      To ensure all elements within an ``object`` array are copied,
     |      use `copy.deepcopy`:
     |
     |      >>> import copy
     |      >>> a = np.array([1, 'm', [2, 3, 4]], dtype=object)
     |      >>> c = copy.deepcopy(a)
     |      >>> c[2][0] = 10
     |      >>> c
     |      array([1, 'm', list([10, 3, 4])], dtype=object)
     |      >>> a
     |      array([1, 'm', list([2, 3, 4])], dtype=object)
     |
     |  cumprod(...)
     |      a.cumprod(axis=None, dtype=None, out=None)
     |
     |      Return the cumulative product of the elements along the given axis.
     |
     |      Refer to `numpy.cumprod` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.cumprod : equivalent function
     |
     |  cumsum(...)
     |      a.cumsum(axis=None, dtype=None, out=None)
     |
     |      Return the cumulative sum of the elements along the given axis.
     |
     |      Refer to `numpy.cumsum` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.cumsum : equivalent function
     |
     |  diagonal(...)
     |      a.diagonal(offset=0, axis1=0, axis2=1)
     |
     |      Return specified diagonals. In NumPy 1.9 the returned array is a
     |      read-only view instead of a copy as in previous NumPy versions.  In
     |      a future version the read-only restriction will be removed.
     |
     |      Refer to :func:`numpy.diagonal` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.diagonal : equivalent function
     |
     |  dot(...)
     |
     |  dump(...)
     |      a.dump(file)
     |
     |      Dump a pickle of the array to the specified file.
     |      The array can be read back with pickle.load or numpy.load.
     |
     |      Parameters
     |      ----------
     |      file : str or Path
     |          A string naming the dump file.
     |
     |          .. versionchanged:: 1.17.0
     |              `pathlib.Path` objects are now accepted.
     |
     |  dumps(...)
     |      a.dumps()
     |
     |      Returns the pickle of the array as a string.
     |      pickle.loads will convert the string back to an array.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |  fill(...)
     |      a.fill(value)
     |
     |      Fill the array with a scalar value.
     |
     |      Parameters
     |      ----------
     |      value : scalar
     |          All elements of `a` will be assigned this value.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([1, 2])
     |      >>> a.fill(0)
     |      >>> a
     |      array([0, 0])
     |      >>> a = np.empty(2)
     |      >>> a.fill(1)
     |      >>> a
     |      array([1.,  1.])
     |
     |      Fill expects a scalar value and always behaves the same as assigning
     |      to a single array element.  The following is a rare example where this
     |      distinction is important:
     |
     |      >>> a = np.array([None, None], dtype=object)
     |      >>> a[0] = np.array(3)
     |      >>> a
     |      array([array(3), None], dtype=object)
     |      >>> a.fill(np.array(3))
     |      >>> a
     |      array([array(3), array(3)], dtype=object)
     |
     |      Where other forms of assignments will unpack the array being assigned:
     |
     |      >>> a[...] = np.array(3)
     |      >>> a
     |      array([3, 3], dtype=object)
     |
     |  flatten(...)
     |      a.flatten(order='C')
     |
     |      Return a copy of the array collapsed into one dimension.
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A', 'K'}, optional
     |          'C' means to flatten in row-major (C-style) order.
     |          'F' means to flatten in column-major (Fortran-
     |          style) order. 'A' means to flatten in column-major
     |          order if `a` is Fortran *contiguous* in memory,
     |          row-major order otherwise. 'K' means to flatten
     |          `a` in the order the elements occur in memory.
     |          The default is 'C'.
     |
     |      Returns
     |      -------
     |      y : ndarray
     |          A copy of the input array, flattened to one dimension.
     |
     |      See Also
     |      --------
     |      ravel : Return a flattened array.
     |      flat : A 1-D flat iterator over the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1,2], [3,4]])
     |      >>> a.flatten()
     |      array([1, 2, 3, 4])
     |      >>> a.flatten('F')
     |      array([1, 3, 2, 4])
     |
     |  getfield(...)
     |      a.getfield(dtype, offset=0)
     |
     |      Returns a field of the given array as a certain type.
     |
     |      A field is a view of the array data with a given data-type. The values in
     |      the view are determined by the given type and the offset into the current
     |      array in bytes. The offset needs to be such that the view dtype fits in the
     |      array dtype; for example an array of dtype complex128 has 16-byte elements.
     |      If taking a view with a 32-bit integer (4 bytes), the offset needs to be
     |      between 0 and 12 bytes.
     |
     |      Parameters
     |      ----------
     |      dtype : str or dtype
     |          The data type of the view. The dtype size of the view can not be larger
     |          than that of the array itself.
     |      offset : int
     |          Number of bytes to skip before beginning the element view.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.diag([1.+1.j]*2)
     |      >>> x[1, 1] = 2 + 4.j
     |      >>> x
     |      array([[1.+1.j,  0.+0.j],
     |             [0.+0.j,  2.+4.j]])
     |      >>> x.getfield(np.float64)
     |      array([[1.,  0.],
     |             [0.,  2.]])
     |
     |      By choosing an offset of 8 bytes we can select the complex part of the
     |      array for our view:
     |
     |      >>> x.getfield(np.float64, offset=8)
     |      array([[1.,  0.],
     |             [0.,  4.]])
     |
     |  item(...)
     |      a.item(*args)
     |
     |      Copy an element of an array to a standard Python scalar and return it.
     |
     |      Parameters
     |      ----------
     |      \*args : Arguments (variable number and type)
     |
     |          * none: in this case, the method only works for arrays
     |            with one element (`a.size == 1`), which element is
     |            copied into a standard Python scalar object and returned.
     |
     |          * int_type: this argument is interpreted as a flat index into
     |            the array, specifying which element to copy and return.
     |
     |          * tuple of int_types: functions as does a single int_type argument,
     |            except that the argument is interpreted as an nd-index into the
     |            array.
     |
     |      Returns
     |      -------
     |      z : Standard Python scalar object
     |          A copy of the specified element of the array as a suitable
     |          Python scalar
     |
     |      Notes
     |      -----
     |      When the data type of `a` is longdouble or clongdouble, item() returns
     |      a scalar array object because there is no available Python scalar that
     |      would not lose information. Void arrays return a buffer object for item(),
     |      unless fields are defined, in which case a tuple is returned.
     |
     |      `item` is very similar to a[args], except, instead of an array scalar,
     |      a standard Python scalar is returned. This can be useful for speeding up
     |      access to elements of the array and doing arithmetic on elements of the
     |      array using Python's optimized math.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.random.seed(123)
     |      >>> x = np.random.randint(9, size=(3, 3))
     |      >>> x
     |      array([[2, 2, 6],
     |             [1, 3, 6],
     |             [1, 0, 1]])
     |      >>> x.item(3)
     |      1
     |      >>> x.item(7)
     |      0
     |      >>> x.item((0, 1))
     |      2
     |      >>> x.item((2, 2))
     |      1
     |
     |      For an array with object dtype, elements are returned as-is.
     |
     |      >>> a = np.array([np.int64(1)], dtype=object)
     |      >>> a.item() #return np.int64
     |      np.int64(1)
     |
     |  max(...)
     |      a.max(axis=None, out=None, keepdims=False, initial=<no value>, where=True)
     |
     |      Return the maximum along a given axis.
     |
     |      Refer to `numpy.amax` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.amax : equivalent function
     |
     |  mean(...)
     |      a.mean(axis=None, dtype=None, out=None, keepdims=False, *, where=True)
     |
     |      Returns the average of the array elements along given axis.
     |
     |      Refer to `numpy.mean` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.mean : equivalent function
     |
     |  min(...)
     |      a.min(axis=None, out=None, keepdims=False, initial=<no value>, where=True)
     |
     |      Return the minimum along a given axis.
     |
     |      Refer to `numpy.amin` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.amin : equivalent function
     |
     |  nonzero(...)
     |      a.nonzero()
     |
     |      Return the indices of the elements that are non-zero.
     |
     |      Refer to `numpy.nonzero` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.nonzero : equivalent function
     |
     |  partition(...)
     |      a.partition(kth, axis=-1, kind='introselect', order=None)
     |
     |      Partially sorts the elements in the array in such a way that the value of
     |      the element in k-th position is in the position it would be in a sorted
     |      array. In the output array, all elements smaller than the k-th element
     |      are located to the left of this element and all equal or greater are
     |      located to its right. The ordering of the elements in the two partitions
     |      on the either side of the k-th element in the output array is undefined.
     |
     |      .. versionadded:: 1.8.0
     |
     |      Parameters
     |      ----------
     |      kth : int or sequence of ints
     |          Element index to partition by. The kth element value will be in its
     |          final sorted position and all smaller elements will be moved before it
     |          and all equal or greater elements behind it.
     |          The order of all elements in the partitions is undefined.
     |          If provided with a sequence of kth it will partition all elements
     |          indexed by kth of them into their sorted position at once.
     |
     |          .. deprecated:: 1.22.0
     |              Passing booleans as index is deprecated.
     |      axis : int, optional
     |          Axis along which to sort. Default is -1, which means sort along the
     |          last axis.
     |      kind : {'introselect'}, optional
     |          Selection algorithm. Default is 'introselect'.
     |      order : str or list of str, optional
     |          When `a` is an array with fields defined, this argument specifies
     |          which fields to compare first, second, etc. A single field can
     |          be specified as a string, and not all fields need to be specified,
     |          but unspecified fields will still be used, in the order in which
     |          they come up in the dtype, to break ties.
     |
     |      See Also
     |      --------
     |      numpy.partition : Return a partitioned copy of an array.
     |      argpartition : Indirect partition.
     |      sort : Full sort.
     |
     |      Notes
     |      -----
     |      See ``np.partition`` for notes on the different algorithms.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([3, 4, 2, 1])
     |      >>> a.partition(3)
     |      >>> a
     |      array([2, 1, 3, 4]) # may vary
     |
     |      >>> a.partition((1, 3))
     |      >>> a
     |      array([1, 2, 3, 4])
     |
     |  prod(...)
     |      a.prod(axis=None, dtype=None, out=None, keepdims=False,
     |          initial=1, where=True)
     |
     |      Return the product of the array elements over the given axis
     |
     |      Refer to `numpy.prod` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.prod : equivalent function
     |
     |  put(...)
     |      a.put(indices, values, mode='raise')
     |
     |      Set ``a.flat[n] = values[n]`` for all `n` in indices.
     |
     |      Refer to `numpy.put` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.put : equivalent function
     |
     |  ravel(...)
     |      a.ravel([order])
     |
     |      Return a flattened array.
     |
     |      Refer to `numpy.ravel` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.ravel : equivalent function
     |
     |      ndarray.flat : a flat iterator on the array.
     |
     |  repeat(...)
     |      a.repeat(repeats, axis=None)
     |
     |      Repeat elements of an array.
     |
     |      Refer to `numpy.repeat` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.repeat : equivalent function
     |
     |  reshape(...)
     |      a.reshape(shape, /, *, order='C', copy=None)
     |
     |      Returns an array containing the same data with a new shape.
     |
     |      Refer to `numpy.reshape` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.reshape : equivalent function
     |
     |      Notes
     |      -----
     |      Unlike the free function `numpy.reshape`, this method on `ndarray` allows
     |      the elements of the shape parameter to be passed in as separate arguments.
     |      For example, ``a.reshape(10, 11)`` is equivalent to
     |      ``a.reshape((10, 11))``.
     |
     |  resize(...)
     |      a.resize(new_shape, refcheck=True)
     |
     |      Change shape and size of array in-place.
     |
     |      Parameters
     |      ----------
     |      new_shape : tuple of ints, or `n` ints
     |          Shape of resized array.
     |      refcheck : bool, optional
     |          If False, reference count will not be checked. Default is True.
     |
     |      Returns
     |      -------
     |      None
     |
     |      Raises
     |      ------
     |      ValueError
     |          If `a` does not own its own data or references or views to it exist,
     |          and the data memory must be changed.
     |          PyPy only: will always raise if the data memory must be changed, since
     |          there is no reliable way to determine if references or views to it
     |          exist.
     |
     |      SystemError
     |          If the `order` keyword argument is specified. This behaviour is a
     |          bug in NumPy.
     |
     |      See Also
     |      --------
     |      resize : Return a new array with the specified shape.
     |
     |      Notes
     |      -----
     |      This reallocates space for the data area if necessary.
     |
     |      Only contiguous arrays (data elements consecutive in memory) can be
     |      resized.
     |
     |      The purpose of the reference count check is to make sure you
     |      do not use this array as a buffer for another Python object and then
     |      reallocate the memory. However, reference counts can increase in
     |      other ways so if you are sure that you have not shared the memory
     |      for this array with another Python object, then you may safely set
     |      `refcheck` to False.
     |
     |      Examples
     |      --------
     |      Shrinking an array: array is flattened (in the order that the data are
     |      stored in memory), resized, and reshaped:
     |
     |      >>> import numpy as np
     |
     |      >>> a = np.array([[0, 1], [2, 3]], order='C')
     |      >>> a.resize((2, 1))
     |      >>> a
     |      array([[0],
     |             [1]])
     |
     |      >>> a = np.array([[0, 1], [2, 3]], order='F')
     |      >>> a.resize((2, 1))
     |      >>> a
     |      array([[0],
     |             [2]])
     |
     |      Enlarging an array: as above, but missing entries are filled with zeros:
     |
     |      >>> b = np.array([[0, 1], [2, 3]])
     |      >>> b.resize(2, 3) # new_shape parameter doesn't have to be a tuple
     |      >>> b
     |      array([[0, 1, 2],
     |             [3, 0, 0]])
     |
     |      Referencing an array prevents resizing...
     |
     |      >>> c = a
     |      >>> a.resize((1, 1))
     |      Traceback (most recent call last):
     |      ...
     |      ValueError: cannot resize an array that references or is referenced ...
     |
     |      Unless `refcheck` is False:
     |
     |      >>> a.resize((1, 1), refcheck=False)
     |      >>> a
     |      array([[0]])
     |      >>> c
     |      array([[0]])
     |
     |  round(...)
     |      a.round(decimals=0, out=None)
     |
     |      Return `a` with each element rounded to the given number of decimals.
     |
     |      Refer to `numpy.around` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.around : equivalent function
     |
     |  searchsorted(...)
     |      a.searchsorted(v, side='left', sorter=None)
     |
     |      Find indices where elements of v should be inserted in a to maintain order.
     |
     |      For full documentation, see `numpy.searchsorted`
     |
     |      See Also
     |      --------
     |      numpy.searchsorted : equivalent function
     |
     |  setfield(...)
     |      a.setfield(val, dtype, offset=0)
     |
     |      Put a value into a specified place in a field defined by a data-type.
     |
     |      Place `val` into `a`'s field defined by `dtype` and beginning `offset`
     |      bytes into the field.
     |
     |      Parameters
     |      ----------
     |      val : object
     |          Value to be placed in field.
     |      dtype : dtype object
     |          Data-type of the field in which to place `val`.
     |      offset : int, optional
     |          The number of bytes into the field at which to place `val`.
     |
     |      Returns
     |      -------
     |      None
     |
     |      See Also
     |      --------
     |      getfield
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.eye(3)
     |      >>> x.getfield(np.float64)
     |      array([[1.,  0.,  0.],
     |             [0.,  1.,  0.],
     |             [0.,  0.,  1.]])
     |      >>> x.setfield(3, np.int32)
     |      >>> x.getfield(np.int32)
     |      array([[3, 3, 3],
     |             [3, 3, 3],
     |             [3, 3, 3]], dtype=int32)
     |      >>> x
     |      array([[1.0e+000, 1.5e-323, 1.5e-323],
     |             [1.5e-323, 1.0e+000, 1.5e-323],
     |             [1.5e-323, 1.5e-323, 1.0e+000]])
     |      >>> x.setfield(np.eye(3), np.int32)
     |      >>> x
     |      array([[1.,  0.,  0.],
     |             [0.,  1.,  0.],
     |             [0.,  0.,  1.]])
     |
     |  setflags(...)
     |      a.setflags(write=None, align=None, uic=None)
     |
     |      Set array flags WRITEABLE, ALIGNED, WRITEBACKIFCOPY,
     |      respectively.
     |
     |      These Boolean-valued flags affect how numpy interprets the memory
     |      area used by `a` (see Notes below). The ALIGNED flag can only
     |      be set to True if the data is actually aligned according to the type.
     |      The WRITEBACKIFCOPY flag can never be set
     |      to True. The flag WRITEABLE can only be set to True if the array owns its
     |      own memory, or the ultimate owner of the memory exposes a writeable buffer
     |      interface, or is a string. (The exception for string is made so that
     |      unpickling can be done without copying memory.)
     |
     |      Parameters
     |      ----------
     |      write : bool, optional
     |          Describes whether or not `a` can be written to.
     |      align : bool, optional
     |          Describes whether or not `a` is aligned properly for its type.
     |      uic : bool, optional
     |          Describes whether or not `a` is a copy of another "base" array.
     |
     |      Notes
     |      -----
     |      Array flags provide information about how the memory area used
     |      for the array is to be interpreted. There are 7 Boolean flags
     |      in use, only three of which can be changed by the user:
     |      WRITEBACKIFCOPY, WRITEABLE, and ALIGNED.
     |
     |      WRITEABLE (W) the data area can be written to;
     |
     |      ALIGNED (A) the data and strides are aligned appropriately for the hardware
     |      (as determined by the compiler);
     |
     |      WRITEBACKIFCOPY (X) this array is a copy of some other array (referenced
     |      by .base). When the C-API function PyArray_ResolveWritebackIfCopy is
     |      called, the base array will be updated with the contents of this array.
     |
     |      All flags can be accessed using the single (upper case) letter as well
     |      as the full name.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> y = np.array([[3, 1, 7],
     |      ...               [2, 0, 0],
     |      ...               [8, 5, 9]])
     |      >>> y
     |      array([[3, 1, 7],
     |             [2, 0, 0],
     |             [8, 5, 9]])
     |      >>> y.flags
     |        C_CONTIGUOUS : True
     |        F_CONTIGUOUS : False
     |        OWNDATA : True
     |        WRITEABLE : True
     |        ALIGNED : True
     |        WRITEBACKIFCOPY : False
     |      >>> y.setflags(write=0, align=0)
     |      >>> y.flags
     |        C_CONTIGUOUS : True
     |        F_CONTIGUOUS : False
     |        OWNDATA : True
     |        WRITEABLE : False
     |        ALIGNED : False
     |        WRITEBACKIFCOPY : False
     |      >>> y.setflags(uic=1)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      ValueError: cannot set WRITEBACKIFCOPY flag to True
     |
     |  sort(...)
     |      a.sort(axis=-1, kind=None, order=None)
     |
     |      Sort an array in-place. Refer to `numpy.sort` for full documentation.
     |
     |      Parameters
     |      ----------
     |      axis : int, optional
     |          Axis along which to sort. Default is -1, which means sort along the
     |          last axis.
     |      kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional
     |          Sorting algorithm. The default is 'quicksort'. Note that both 'stable'
     |          and 'mergesort' use timsort under the covers and, in general, the
     |          actual implementation will vary with datatype. The 'mergesort' option
     |          is retained for backwards compatibility.
     |
     |          .. versionchanged:: 1.15.0
     |             The 'stable' option was added.
     |
     |      order : str or list of str, optional
     |          When `a` is an array with fields defined, this argument specifies
     |          which fields to compare first, second, etc.  A single field can
     |          be specified as a string, and not all fields need be specified,
     |          but unspecified fields will still be used, in the order in which
     |          they come up in the dtype, to break ties.
     |
     |      See Also
     |      --------
     |      numpy.sort : Return a sorted copy of an array.
     |      numpy.argsort : Indirect sort.
     |      numpy.lexsort : Indirect stable sort on multiple keys.
     |      numpy.searchsorted : Find elements in sorted array.
     |      numpy.partition: Partial sort.
     |
     |      Notes
     |      -----
     |      See `numpy.sort` for notes on the different sorting algorithms.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1,4], [3,1]])
     |      >>> a.sort(axis=1)
     |      >>> a
     |      array([[1, 4],
     |             [1, 3]])
     |      >>> a.sort(axis=0)
     |      >>> a
     |      array([[1, 3],
     |             [1, 4]])
     |
     |      Use the `order` keyword to specify a field to use when sorting a
     |      structured array:
     |
     |      >>> a = np.array([('a', 2), ('c', 1)], dtype=[('x', 'S1'), ('y', int)])
     |      >>> a.sort(order='y')
     |      >>> a
     |      array([(b'c', 1), (b'a', 2)],
     |            dtype=[('x', 'S1'), ('y', '<i8')])
     |
     |  squeeze(...)
     |      a.squeeze(axis=None)
     |
     |      Remove axes of length one from `a`.
     |
     |      Refer to `numpy.squeeze` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.squeeze : equivalent function
     |
     |  std(...)
     |      a.std(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
     |
     |      Returns the standard deviation of the array elements along given axis.
     |
     |      Refer to `numpy.std` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.std : equivalent function
     |
     |  sum(...)
     |      a.sum(axis=None, dtype=None, out=None, keepdims=False, initial=0, where=True)
     |
     |      Return the sum of the array elements over the given axis.
     |
     |      Refer to `numpy.sum` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.sum : equivalent function
     |
     |  swapaxes(...)
     |      a.swapaxes(axis1, axis2)
     |
     |      Return a view of the array with `axis1` and `axis2` interchanged.
     |
     |      Refer to `numpy.swapaxes` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.swapaxes : equivalent function
     |
     |  take(...)
     |      a.take(indices, axis=None, out=None, mode='raise')
     |
     |      Return an array formed from the elements of `a` at the given indices.
     |
     |      Refer to `numpy.take` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.take : equivalent function
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |      a.tobytes(order='C')
     |
     |      Construct Python bytes containing the raw data bytes in the array.
     |
     |      Constructs Python bytes showing a copy of the raw contents of
     |      data memory. The bytes object is produced in C-order by default.
     |      This behavior is controlled by the ``order`` parameter.
     |
     |      .. versionadded:: 1.9.0
     |
     |      Parameters
     |      ----------
     |      order : {'C', 'F', 'A'}, optional
     |          Controls the memory layout of the bytes object. 'C' means C-order,
     |          'F' means F-order, 'A' (short for *Any*) means 'F' if `a` is
     |          Fortran contiguous, 'C' otherwise. Default is 'C'.
     |
     |      Returns
     |      -------
     |      s : bytes
     |          Python bytes exhibiting a copy of `a`'s raw data.
     |
     |      See also
     |      --------
     |      frombuffer
     |          Inverse of this operation, construct a 1-dimensional array from Python
     |          bytes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([[0, 1], [2, 3]], dtype='<u2')
     |      >>> x.tobytes()
     |      b'\x00\x00\x01\x00\x02\x00\x03\x00'
     |      >>> x.tobytes('C') == x.tobytes()
     |      True
     |      >>> x.tobytes('F')
     |      b'\x00\x00\x02\x00\x01\x00\x03\x00'
     |
     |  tofile(...)
     |      a.tofile(fid, sep="", format="%s")
     |
     |      Write array to a file as text or binary (default).
     |
     |      Data is always written in 'C' order, independent of the order of `a`.
     |      The data produced by this method can be recovered using the function
     |      fromfile().
     |
     |      Parameters
     |      ----------
     |      fid : file or str or Path
     |          An open file object, or a string containing a filename.
     |
     |          .. versionchanged:: 1.17.0
     |              `pathlib.Path` objects are now accepted.
     |
     |      sep : str
     |          Separator between array items for text output.
     |          If "" (empty), a binary file is written, equivalent to
     |          ``file.write(a.tobytes())``.
     |      format : str
     |          Format string for text file output.
     |          Each entry in the array is formatted to text by first converting
     |          it to the closest Python type, and then using "format" % item.
     |
     |      Notes
     |      -----
     |      This is a convenience function for quick storage of array data.
     |      Information on endianness and precision is lost, so this method is not a
     |      good choice for files intended to archive data or transport data between
     |      machines with different endianness. Some of these problems can be overcome
     |      by outputting the data as text files, at the expense of speed and file
     |      size.
     |
     |      When fid is a file object, array contents are directly written to the
     |      file, bypassing the file object's ``write`` method. As a result, tofile
     |      cannot be used with files objects supporting compression (e.g., GzipFile)
     |      or file-like objects that do not support ``fileno()`` (e.g., BytesIO).
     |
     |  tolist(...)
     |      a.tolist()
     |
     |      Return the array as an ``a.ndim``-levels deep nested list of Python scalars.
     |
     |      Return a copy of the array data as a (nested) Python list.
     |      Data items are converted to the nearest compatible builtin Python type, via
     |      the `~numpy.ndarray.item` function.
     |
     |      If ``a.ndim`` is 0, then since the depth of the nested list is 0, it will
     |      not be a list at all, but a simple Python scalar.
     |
     |      Parameters
     |      ----------
     |      none
     |
     |      Returns
     |      -------
     |      y : object, or list of object, or list of list of object, or ...
     |          The possibly nested list of array elements.
     |
     |      Notes
     |      -----
     |      The array may be recreated via ``a = np.array(a.tolist())``, although this
     |      may sometimes lose precision.
     |
     |      Examples
     |      --------
     |      For a 1D array, ``a.tolist()`` is almost the same as ``list(a)``,
     |      except that ``tolist`` changes numpy scalars to Python scalars:
     |
     |      >>> import numpy as np
     |      >>> a = np.uint32([1, 2])
     |      >>> a_list = list(a)
     |      >>> a_list
     |      [1, 2]
     |      >>> type(a_list[0])
     |      <class 'numpy.uint32'>
     |      >>> a_tolist = a.tolist()
     |      >>> a_tolist
     |      [1, 2]
     |      >>> type(a_tolist[0])
     |      <class 'int'>
     |
     |      Additionally, for a 2D array, ``tolist`` applies recursively:
     |
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> list(a)
     |      [array([1, 2]), array([3, 4])]
     |      >>> a.tolist()
     |      [[1, 2], [3, 4]]
     |
     |      The base case for this recursion is a 0D array:
     |
     |      >>> a = np.array(1)
     |      >>> list(a)
     |      Traceback (most recent call last):
     |        ...
     |      TypeError: iteration over a 0-d array
     |      >>> a.tolist()
     |      1
     |
     |  tostring(...)
     |      a.tostring(order='C')
     |
     |      A compatibility alias for `~ndarray.tobytes`, with exactly the same
     |      behavior.
     |
     |      Despite its name, it returns :class:`bytes` not :class:`str`\ s.
     |
     |      .. deprecated:: 1.19.0
     |
     |  trace(...)
     |      a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)
     |
     |      Return the sum along diagonals of the array.
     |
     |      Refer to `numpy.trace` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.trace : equivalent function
     |
     |  transpose(...)
     |      a.transpose(*axes)
     |
     |      Returns a view of the array with axes transposed.
     |
     |      Refer to `numpy.transpose` for full documentation.
     |
     |      Parameters
     |      ----------
     |      axes : None, tuple of ints, or `n` ints
     |
     |       * None or no argument: reverses the order of the axes.
     |
     |       * tuple of ints: `i` in the `j`-th place in the tuple means that the
     |         array's `i`-th axis becomes the transposed array's `j`-th axis.
     |
     |       * `n` ints: same as an n-tuple of the same ints (this form is
     |         intended simply as a "convenience" alternative to the tuple form).
     |
     |      Returns
     |      -------
     |      p : ndarray
     |          View of the array with its axes suitably permuted.
     |
     |      See Also
     |      --------
     |      transpose : Equivalent function.
     |      ndarray.T : Array property returning the array transposed.
     |      ndarray.reshape : Give a new shape to an array without changing its data.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.transpose()
     |      array([[1, 3],
     |             [2, 4]])
     |      >>> a.transpose((1, 0))
     |      array([[1, 3],
     |             [2, 4]])
     |      >>> a.transpose(1, 0)
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> a
     |      array([1, 2, 3, 4])
     |      >>> a.transpose()
     |      array([1, 2, 3, 4])
     |
     |  var(...)
     |      a.var(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
     |
     |      Returns the variance of the array elements, along given axis.
     |
     |      Refer to `numpy.var` for full documentation.
     |
     |      See Also
     |      --------
     |      numpy.var : equivalent function
     |
     |  view(...)
     |      a.view([dtype][, type])
     |
     |      New view of array with the same data.
     |
     |      .. note::
     |          Passing None for ``dtype`` is different from omitting the parameter,
     |          since the former invokes ``dtype(None)`` which is an alias for
     |          ``dtype('float64')``.
     |
     |      Parameters
     |      ----------
     |      dtype : data-type or ndarray sub-class, optional
     |          Data-type descriptor of the returned view, e.g., float32 or int16.
     |          Omitting it results in the view having the same data-type as `a`.
     |          This argument can also be specified as an ndarray sub-class, which
     |          then specifies the type of the returned object (this is equivalent to
     |          setting the ``type`` parameter).
     |      type : Python type, optional
     |          Type of the returned view, e.g., ndarray or matrix.  Again, omission
     |          of the parameter results in type preservation.
     |
     |      Notes
     |      -----
     |      ``a.view()`` is used two different ways:
     |
     |      ``a.view(some_dtype)`` or ``a.view(dtype=some_dtype)`` constructs a view
     |      of the array's memory with a different data-type.  This can cause a
     |      reinterpretation of the bytes of memory.
     |
     |      ``a.view(ndarray_subclass)`` or ``a.view(type=ndarray_subclass)`` just
     |      returns an instance of `ndarray_subclass` that looks at the same array
     |      (same shape, dtype, etc.)  This does not cause a reinterpretation of the
     |      memory.
     |
     |      For ``a.view(some_dtype)``, if ``some_dtype`` has a different number of
     |      bytes per entry than the previous dtype (for example, converting a regular
     |      array to a structured array), then the last axis of ``a`` must be
     |      contiguous. This axis will be resized in the result.
     |
     |      .. versionchanged:: 1.23.0
     |         Only the last axis needs to be contiguous. Previously, the entire array
     |         had to be C-contiguous.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([(-1, 2)], dtype=[('a', np.int8), ('b', np.int8)])
     |
     |      Viewing array data using a different type and dtype:
     |
     |      >>> nonneg = np.dtype([("a", np.uint8), ("b", np.uint8)])
     |      >>> y = x.view(dtype=nonneg, type=np.recarray)
     |      >>> x["a"]
     |      array([-1], dtype=int8)
     |      >>> y.a
     |      array([255], dtype=uint8)
     |
     |      Creating a view on a structured array so it can be used in calculations
     |
     |      >>> x = np.array([(1, 2),(3,4)], dtype=[('a', np.int8), ('b', np.int8)])
     |      >>> xv = x.view(dtype=np.int8).reshape(-1,2)
     |      >>> xv
     |      array([[1, 2],
     |             [3, 4]], dtype=int8)
     |      >>> xv.mean(0)
     |      array([2.,  3.])
     |
     |      Making changes to the view changes the underlying array
     |
     |      >>> xv[0,1] = 20
     |      >>> x
     |      array([(1, 20), (3,  4)], dtype=[('a', 'i1'), ('b', 'i1')])
     |
     |      Using a view to convert an array to a recarray:
     |
     |      >>> z = x.view(np.recarray)
     |      >>> z.a
     |      array([1, 3], dtype=int8)
     |
     |      Views share data:
     |
     |      >>> x[0] = (9, 10)
     |      >>> z[0]
     |      np.record((9, 10), dtype=[('a', 'i1'), ('b', 'i1')])
     |
     |      Views that change the dtype size (bytes per entry) should normally be
     |      avoided on arrays defined by slices, transposes, fortran-ordering, etc.:
     |
     |      >>> x = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.int16)
     |      >>> y = x[:, ::2]
     |      >>> y
     |      array([[1, 3],
     |             [4, 6]], dtype=int16)
     |      >>> y.view(dtype=[('width', np.int16), ('length', np.int16)])
     |      Traceback (most recent call last):
     |          ...
     |      ValueError: To change to a dtype of a different size, the last axis must be contiguous
     |      >>> z = y.copy()
     |      >>> z.view(dtype=[('width', np.int16), ('length', np.int16)])
     |      array([[(1, 3)],
     |             [(4, 6)]], dtype=[('width', '<i2'), ('length', '<i2')])
     |
     |      However, views that change dtype are totally fine for arrays with a
     |      contiguous last axis, even if the rest of the axes are not C-contiguous:
     |
     |      >>> x = np.arange(2 * 3 * 4, dtype=np.int8).reshape(2, 3, 4)
     |      >>> x.transpose(1, 0, 2).view(np.int16)
     |      array([[[ 256,  770],
     |              [3340, 3854]],
     |      <BLANKLINE>
     |             [[1284, 1798],
     |              [4368, 4882]],
     |      <BLANKLINE>
     |             [[2312, 2826],
     |              [5396, 5910]]], dtype=int16)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from numpy.ndarray:
     |
     |  __class_getitem__(...)
     |      a.__class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.ndarray` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.ndarray` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.ndarray[Any, np.dtype[Any]]
     |      numpy.ndarray[typing.Any, numpy.dtype[typing.Any]]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |      numpy.typing.NDArray : An ndarray alias :term:`generic <generic type>`
     |                          w.r.t. its `dtype.type <numpy.dtype.type>`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from numpy.ndarray:
     |
     |  T
     |      View of the transposed array.
     |
     |      Same as ``self.transpose()``.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.T
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> a
     |      array([1, 2, 3, 4])
     |      >>> a.T
     |      array([1, 2, 3, 4])
     |
     |      See Also
     |      --------
     |      transpose
     |
     |  __array_interface__
     |      Array protocol: Python side.
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: C-struct side.
     |
     |  base
     |      Base object if memory is from some other object.
     |
     |      Examples
     |      --------
     |      The base of an array that owns its memory is None:
     |
     |      >>> import numpy as np
     |      >>> x = np.array([1,2,3,4])
     |      >>> x.base is None
     |      True
     |
     |      Slicing creates a view, whose memory is shared with x:
     |
     |      >>> y = x[2:]
     |      >>> y.base is x
     |      True
     |
     |  ctypes
     |      An object to simplify the interaction of the array with the ctypes
     |      module.
     |
     |      This attribute creates an object that makes it easier to use arrays
     |      when calling shared libraries with the ctypes module. The returned
     |      object has, among others, data, shape, and strides attributes (see
     |      Notes below) which themselves return ctypes objects that can be used
     |      as arguments to a shared library.
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      c : Python object
     |          Possessing attributes data, shape, strides, etc.
     |
     |      See Also
     |      --------
     |      numpy.ctypeslib
     |
     |      Notes
     |      -----
     |      Below are the public attributes of this object which were documented
     |      in "Guide to NumPy" (we have omitted undocumented public attributes,
     |      as well as documented private attributes):
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.data
     |          :noindex:
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.shape
     |          :noindex:
     |
     |      .. autoattribute:: numpy._core._internal._ctypes.strides
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.data_as
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.shape_as
     |          :noindex:
     |
     |      .. automethod:: numpy._core._internal._ctypes.strides_as
     |          :noindex:
     |
     |      If the ctypes module is not available, then the ctypes attribute
     |      of array objects still returns something useful, but ctypes objects
     |      are not returned and errors may be raised instead. In particular,
     |      the object will still have the ``as_parameter`` attribute which will
     |      return an integer equal to the data attribute.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> import ctypes
     |      >>> x = np.array([[0, 1], [2, 3]], dtype=np.int32)
     |      >>> x
     |      array([[0, 1],
     |             [2, 3]], dtype=int32)
     |      >>> x.ctypes.data
     |      31962608 # may vary
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint32))
     |      <__main__.LP_c_uint object at 0x7ff2fc1fc200> # may vary
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint32)).contents
     |      c_uint(0)
     |      >>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_uint64)).contents
     |      c_ulong(4294967296)
     |      >>> x.ctypes.shape
     |      <numpy._core._internal.c_long_Array_2 object at 0x7ff2fc1fce60> # may vary
     |      >>> x.ctypes.strides
     |      <numpy._core._internal.c_long_Array_2 object at 0x7ff2fc1ff320> # may vary
     |
     |  data
     |      Python buffer object pointing to the start of the array's data.
     |
     |  device
     |
     |  dtype
     |      Data-type of the array's elements.
     |
     |      .. warning::
     |
     |          Setting ``arr.dtype`` is discouraged and may be deprecated in the
     |          future.  Setting will replace the ``dtype`` without modifying the
     |          memory (see also `ndarray.view` and `ndarray.astype`).
     |
     |      Parameters
     |      ----------
     |      None
     |
     |      Returns
     |      -------
     |      d : numpy dtype object
     |
     |      See Also
     |      --------
     |      ndarray.astype : Cast the values contained in the array to a new data-type.
     |      ndarray.view : Create a view of the same data but a different data-type.
     |      numpy.dtype
     |
     |      Examples
     |      --------
     |      >>> x
     |      array([[0, 1],
     |             [2, 3]])
     |      >>> x.dtype
     |      dtype('int32')
     |      >>> type(x.dtype)
     |      <type 'numpy.dtype'>
     |
     |  flags
     |      Information about the memory layout of the array.
     |
     |      Attributes
     |      ----------
     |      C_CONTIGUOUS (C)
     |          The data is in a single, C-style contiguous segment.
     |      F_CONTIGUOUS (F)
     |          The data is in a single, Fortran-style contiguous segment.
     |      OWNDATA (O)
     |          The array owns the memory it uses or borrows it from another object.
     |      WRITEABLE (W)
     |          The data area can be written to.  Setting this to False locks
     |          the data, making it read-only.  A view (slice, etc.) inherits WRITEABLE
     |          from its base array at creation time, but a view of a writeable
     |          array may be subsequently locked while the base array remains writeable.
     |          (The opposite is not true, in that a view of a locked array may not
     |          be made writeable.  However, currently, locking a base object does not
     |          lock any views that already reference it, so under that circumstance it
     |          is possible to alter the contents of a locked array via a previously
     |          created writeable view onto it.)  Attempting to change a non-writeable
     |          array raises a RuntimeError exception.
     |      ALIGNED (A)
     |          The data and all elements are aligned appropriately for the hardware.
     |      WRITEBACKIFCOPY (X)
     |          This array is a copy of some other array. The C-API function
     |          PyArray_ResolveWritebackIfCopy must be called before deallocating
     |          to the base array will be updated with the contents of this array.
     |      FNC
     |          F_CONTIGUOUS and not C_CONTIGUOUS.
     |      FORC
     |          F_CONTIGUOUS or C_CONTIGUOUS (one-segment test).
     |      BEHAVED (B)
     |          ALIGNED and WRITEABLE.
     |      CARRAY (CA)
     |          BEHAVED and C_CONTIGUOUS.
     |      FARRAY (FA)
     |          BEHAVED and F_CONTIGUOUS and not C_CONTIGUOUS.
     |
     |      Notes
     |      -----
     |      The `flags` object can be accessed dictionary-like (as in ``a.flags['WRITEABLE']``),
     |      or by using lowercased attribute names (as in ``a.flags.writeable``). Short flag
     |      names are only supported in dictionary access.
     |
     |      Only the WRITEBACKIFCOPY, WRITEABLE, and ALIGNED flags can be
     |      changed by the user, via direct assignment to the attribute or dictionary
     |      entry, or by calling `ndarray.setflags`.
     |
     |      The array flags cannot be set arbitrarily:
     |
     |      - WRITEBACKIFCOPY can only be set ``False``.
     |      - ALIGNED can only be set ``True`` if the data is truly aligned.
     |      - WRITEABLE can only be set ``True`` if the array owns its own memory
     |        or the ultimate owner of the memory exposes a writeable buffer
     |        interface or is a string.
     |
     |      Arrays can be both C-style and Fortran-style contiguous simultaneously.
     |      This is clear for 1-dimensional arrays, but can also be true for higher
     |      dimensional arrays.
     |
     |      Even for contiguous arrays a stride for a given dimension
     |      ``arr.strides[dim]`` may be *arbitrary* if ``arr.shape[dim] == 1``
     |      or the array has no elements.
     |      It does *not* generally hold that ``self.strides[-1] == self.itemsize``
     |      for C-style contiguous arrays or ``self.strides[0] == self.itemsize`` for
     |      Fortran-style contiguous arrays is true.
     |
     |  flat
     |      A 1-D iterator over the array.
     |
     |      This is a `numpy.flatiter` instance, which acts similarly to, but is not
     |      a subclass of, Python's built-in iterator object.
     |
     |      See Also
     |      --------
     |      flatten : Return a copy of the array collapsed into one dimension.
     |
     |      flatiter
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.arange(1, 7).reshape(2, 3)
     |      >>> x
     |      array([[1, 2, 3],
     |             [4, 5, 6]])
     |      >>> x.flat[3]
     |      4
     |      >>> x.T
     |      array([[1, 4],
     |             [2, 5],
     |             [3, 6]])
     |      >>> x.T.flat[3]
     |      5
     |      >>> type(x.flat)
     |      <class 'numpy.flatiter'>
     |
     |      An assignment example:
     |
     |      >>> x.flat = 3; x
     |      array([[3, 3, 3],
     |             [3, 3, 3]])
     |      >>> x.flat[[1,4]] = 1; x
     |      array([[3, 1, 3],
     |             [3, 1, 3]])
     |
     |  imag
     |      The imaginary part of the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.sqrt([1+0j, 0+1j])
     |      >>> x.imag
     |      array([ 0.        ,  0.70710678])
     |      >>> x.imag.dtype
     |      dtype('float64')
     |
     |  itemset
     |
     |  itemsize
     |      Length of one array element in bytes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1,2,3], dtype=np.float64)
     |      >>> x.itemsize
     |      8
     |      >>> x = np.array([1,2,3], dtype=np.complex128)
     |      >>> x.itemsize
     |      16
     |
     |  mT
     |      View of the matrix transposed array.
     |
     |      The matrix transpose is the transpose of the last two dimensions, even
     |      if the array is of higher dimension.
     |
     |      .. versionadded:: 2.0
     |
     |      Raises
     |      ------
     |      ValueError
     |          If the array is of dimension less than 2.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> a = np.array([[1, 2], [3, 4]])
     |      >>> a
     |      array([[1, 2],
     |             [3, 4]])
     |      >>> a.mT
     |      array([[1, 3],
     |             [2, 4]])
     |
     |      >>> a = np.arange(8).reshape((2, 2, 2))
     |      >>> a
     |      array([[[0, 1],
     |              [2, 3]],
     |      <BLANKLINE>
     |             [[4, 5],
     |              [6, 7]]])
     |      >>> a.mT
     |      array([[[0, 2],
     |              [1, 3]],
     |      <BLANKLINE>
     |             [[4, 6],
     |              [5, 7]]])
     |
     |  nbytes
     |      Total bytes consumed by the elements of the array.
     |
     |      Notes
     |      -----
     |      Does not include memory consumed by non-element attributes of the
     |      array object.
     |
     |      See Also
     |      --------
     |      sys.getsizeof
     |          Memory consumed by the object itself without parents in case view.
     |          This does include memory consumed by non-element attributes.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.zeros((3,5,2), dtype=np.complex128)
     |      >>> x.nbytes
     |      480
     |      >>> np.prod(x.shape) * x.itemsize
     |      480
     |
     |  ndim
     |      Number of array dimensions.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3])
     |      >>> x.ndim
     |      1
     |      >>> y = np.zeros((2, 3, 4))
     |      >>> y.ndim
     |      3
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the array.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.sqrt([1+0j, 0+1j])
     |      >>> x.real
     |      array([ 1.        ,  0.70710678])
     |      >>> x.real.dtype
     |      dtype('float64')
     |
     |      See Also
     |      --------
     |      numpy.real : equivalent function
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |      The shape property is usually used to get the current shape of an array,
     |      but may also be used to reshape the array in-place by assigning a tuple of
     |      array dimensions to it.  As with `numpy.reshape`, one of the new shape
     |      dimensions can be -1, in which case its value is inferred from the size of
     |      the array and the remaining dimensions. Reshaping an array in-place will
     |      fail if a copy is required.
     |
     |      .. warning::
     |
     |          Setting ``arr.shape`` is discouraged and may be deprecated in the
     |          future.  Using `ndarray.reshape` is the preferred approach.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.array([1, 2, 3, 4])
     |      >>> x.shape
     |      (4,)
     |      >>> y = np.zeros((2, 3, 4))
     |      >>> y.shape
     |      (2, 3, 4)
     |      >>> y.shape = (3, 8)
     |      >>> y
     |      array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
     |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
     |             [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])
     |      >>> y.shape = (3, 6)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      ValueError: total size of new array must be unchanged
     |      >>> np.zeros((4,2))[::2].shape = (-1,)
     |      Traceback (most recent call last):
     |        File "<stdin>", line 1, in <module>
     |      AttributeError: Incompatible shape for in-place modification. Use
     |      `.reshape()` to make a copy with the desired shape.
     |
     |      See Also
     |      --------
     |      numpy.shape : Equivalent getter function.
     |      numpy.reshape : Function similar to setting ``shape``.
     |      ndarray.reshape : Method similar to setting ``shape``.
     |
     |  size
     |      Number of elements in the array.
     |
     |      Equal to ``np.prod(a.shape)``, i.e., the product of the array's
     |      dimensions.
     |
     |      Notes
     |      -----
     |      `a.size` returns a standard arbitrary precision Python integer. This
     |      may not be the case with other methods of obtaining the same value
     |      (like the suggested ``np.prod(a.shape)``, which returns an instance
     |      of ``np.int_``), and may be relevant if the value is used further in
     |      calculations that may overflow a fixed size integer type.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> x = np.zeros((3, 5, 2), dtype=np.complex128)
     |      >>> x.size
     |      30
     |      >>> np.prod(x.shape)
     |      30
     |
     |  strides
     |      Tuple of bytes to step in each dimension when traversing an array.
     |
     |      The byte offset of element ``(i[0], i[1], ..., i[n])`` in an array `a`
     |      is::
     |
     |          offset = sum(np.array(i) * a.strides)
     |
     |      A more detailed explanation of strides can be found in
     |      :ref:`arrays.ndarray`.
     |
     |      .. warning::
     |
     |          Setting ``arr.strides`` is discouraged and may be deprecated in the
     |          future.  `numpy.lib.stride_tricks.as_strided` should be preferred
     |          to create a new view of the same data in a safer way.
     |
     |      Notes
     |      -----
     |      Imagine an array of 32-bit integers (each 4 bytes)::
     |
     |        x = np.array([[0, 1, 2, 3, 4],
     |                      [5, 6, 7, 8, 9]], dtype=np.int32)
     |
     |      This array is stored in memory as 40 bytes, one after the other
     |      (known as a contiguous block of memory).  The strides of an array tell
     |      us how many bytes we have to skip in memory to move to the next position
     |      along a certain axis.  For example, we have to skip 4 bytes (1 value) to
     |      move to the next column, but 20 bytes (5 values) to get to the same
     |      position in the next row.  As such, the strides for the array `x` will be
     |      ``(20, 4)``.
     |
     |      See Also
     |      --------
     |      numpy.lib.stride_tricks.as_strided
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> y = np.reshape(np.arange(2*3*4), (2,3,4))
     |      >>> y
     |      array([[[ 0,  1,  2,  3],
     |              [ 4,  5,  6,  7],
     |              [ 8,  9, 10, 11]],
     |             [[12, 13, 14, 15],
     |              [16, 17, 18, 19],
     |              [20, 21, 22, 23]]])
     |      >>> y.strides
     |      (48, 16, 4)
     |      >>> y[1,1,1]
     |      17
     |      >>> offset=sum(y.strides * np.array((1,1,1)))
     |      >>> offset/y.itemsize
     |      17
     |
     |      >>> x = np.reshape(np.arange(5*6*7*8), (5,6,7,8)).transpose(2,3,1,0)
     |      >>> x.strides
     |      (32, 4, 224, 1344)
     |      >>> i = np.array([3,5,2,2])
     |      >>> offset = sum(i * x.strides)
     |      >>> x[3,5,2,2]
     |      813
     |      >>> offset / x.itemsize
     |      813
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from numpy.ndarray:
     |
     |  __hash__ = None

    class record(void)
     |  A data-type scalar that allows field access as attribute lookup.
     |
     |  Method resolution order:
     |      record
     |      void
     |      flexible
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __getattribute__(self, attr) from numpy._core.records.record
     |      Return getattr(self, name).
     |
     |  __getitem__(self, indx) from numpy._core.records.record
     |      Return self[key].
     |
     |  __repr__(self) from numpy._core.records.record
     |      Return repr(self).
     |
     |  __setattr__(self, attr, val) from numpy._core.records.record
     |      Implement setattr(self, name, value).
     |
     |  __str__(self) from numpy._core.records.record
     |      Return str(self).
     |
     |  pprint(self) from numpy._core.records.record
     |      Pretty-print all fields.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from void:
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from void:
     |
     |  __new__(*args, **kwargs) class method of void
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from void:
     |
     |  base
     |      base object
     |
     |  dtype
     |      dtype object
     |
     |  flags
     |      integer value of flags
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    short = class int16(signedinteger)
     |  Signed integer type, compatible with C ``short``.
     |
     |  :Character code: ``'h'``
     |  :Canonical name: `numpy.short`
     |  :Alias on this platform (win32 AMD64): `numpy.int16`: 16-bit signed integer (``-32_768`` to ``32_767``).
     |
     |  Method resolution order:
     |      int16
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      int16.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.int16(127).bit_count()
     |      7
     |      >>> np.int16(-127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class signedinteger(integer)
     |  Abstract base class of all signed integer scalar types.
     |
     |  Method resolution order:
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from number:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from generic:
     |
     |  __hash__ = None

    single = class float32(floating)
     |  Single-precision floating-point number type, compatible with C ``float``.
     |
     |  :Character code: ``'f'``
     |  :Canonical name: `numpy.single`
     |  :Alias on this platform (win32 AMD64): `numpy.float32`: 32-bit-precision floating-point number type: sign bit, 8 bits exponent, 23 bits mantissa.
     |
     |  Method resolution order:
     |      float32
     |      floating
     |      inexact
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  as_integer_ratio(...)
     |      single.as_integer_ratio() -> (int, int)
     |
     |      Return a pair of integers, whose ratio is exactly equal to the original
     |      floating point number, and with a positive denominator.
     |      Raise `OverflowError` on infinities and a `ValueError` on NaNs.
     |
     |      >>> np.single(10.0).as_integer_ratio()
     |      (10, 1)
     |      >>> np.single(0.0).as_integer_ratio()
     |      (0, 1)
     |      >>> np.single(-.25).as_integer_ratio()
     |      (-1, 4)
     |
     |  is_integer(...)
     |      single.is_integer() -> bool
     |
     |      Return ``True`` if the floating point number is finite with integral
     |      value, and ``False`` otherwise.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> np.single(-2.0).is_integer()
     |      True
     |      >>> np.single(3.2).is_integer()
     |      False
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from floating:
     |
     |  __round__(...)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class str_(builtins.str, character)
     |  A unicode string.
     |
     |  This type strips trailing null codepoints.
     |
     |  >>> s = np.str_("abc\x00")
     |  >>> s
     |  'abc'
     |
     |  Unlike the builtin :class:`str`, this supports the
     |  :ref:`python:bufferobjects`, exposing its contents as UCS4:
     |
     |  >>> m = memoryview(np.str_("abc"))
     |  >>> m.format
     |  '3w'
     |  >>> m.tobytes()
     |  b'a\x00\x00\x00b\x00\x00\x00c\x00\x00\x00'
     |
     |  :Character code: ``'U'``
     |
     |  Method resolution order:
     |      str_
     |      builtins.str
     |      character
     |      flexible
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.str:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __format__(self, format_spec, /)
     |      Return a formatted version of the string as described by format_spec.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(...)
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __sizeof__(self, /)
     |      Return the size of the string in memory, in bytes.
     |
     |  capitalize(self, /)
     |      Return a capitalized version of the string.
     |
     |      More specifically, make the first character have upper case and the rest lower
     |      case.
     |
     |  casefold(self, /)
     |      Return a version of the string suitable for caseless comparisons.
     |
     |  center(self, width, fillchar=' ', /)
     |      Return a centered string of length width.
     |
     |      Padding is done using the specified fill character (default is a space).
     |
     |  count(...)
     |      S.count(sub[, start[, end]]) -> int
     |
     |      Return the number of non-overlapping occurrences of substring sub in
     |      string S[start:end].  Optional arguments start and end are
     |      interpreted as in slice notation.
     |
     |  encode(self, /, encoding='utf-8', errors='strict')
     |      Encode the string using the codec registered for encoding.
     |
     |      encoding
     |        The encoding in which to encode the string.
     |      errors
     |        The error handling scheme to use for encoding errors.
     |        The default is 'strict' meaning that encoding errors raise a
     |        UnicodeEncodeError.  Other possible values are 'ignore', 'replace' and
     |        'xmlcharrefreplace' as well as any other name registered with
     |        codecs.register_error that can handle UnicodeEncodeErrors.
     |
     |  endswith(...)
     |      S.endswith(suffix[, start[, end]]) -> bool
     |
     |      Return True if S ends with the specified suffix, False otherwise.
     |      With optional start, test S beginning at that position.
     |      With optional end, stop comparing S at that position.
     |      suffix can also be a tuple of strings to try.
     |
     |  expandtabs(self, /, tabsize=8)
     |      Return a copy where all tab characters are expanded using spaces.
     |
     |      If tabsize is not given, a tab size of 8 characters is assumed.
     |
     |  find(...)
     |      S.find(sub[, start[, end]]) -> int
     |
     |      Return the lowest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Return -1 on failure.
     |
     |  format(...)
     |      S.format(*args, **kwargs) -> str
     |
     |      Return a formatted version of S, using substitutions from args and kwargs.
     |      The substitutions are identified by braces ('{' and '}').
     |
     |  format_map(...)
     |      S.format_map(mapping) -> str
     |
     |      Return a formatted version of S, using substitutions from mapping.
     |      The substitutions are identified by braces ('{' and '}').
     |
     |  index(...)
     |      S.index(sub[, start[, end]]) -> int
     |
     |      Return the lowest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Raises ValueError when the substring is not found.
     |
     |  isalnum(self, /)
     |      Return True if the string is an alpha-numeric string, False otherwise.
     |
     |      A string is alpha-numeric if all characters in the string are alpha-numeric and
     |      there is at least one character in the string.
     |
     |  isalpha(self, /)
     |      Return True if the string is an alphabetic string, False otherwise.
     |
     |      A string is alphabetic if all characters in the string are alphabetic and there
     |      is at least one character in the string.
     |
     |  isascii(self, /)
     |      Return True if all characters in the string are ASCII, False otherwise.
     |
     |      ASCII characters have code points in the range U+0000-U+007F.
     |      Empty string is ASCII too.
     |
     |  isdecimal(self, /)
     |      Return True if the string is a decimal string, False otherwise.
     |
     |      A string is a decimal string if all characters in the string are decimal and
     |      there is at least one character in the string.
     |
     |  isdigit(self, /)
     |      Return True if the string is a digit string, False otherwise.
     |
     |      A string is a digit string if all characters in the string are digits and there
     |      is at least one character in the string.
     |
     |  isidentifier(self, /)
     |      Return True if the string is a valid Python identifier, False otherwise.
     |
     |      Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
     |      such as "def" or "class".
     |
     |  islower(self, /)
     |      Return True if the string is a lowercase string, False otherwise.
     |
     |      A string is lowercase if all cased characters in the string are lowercase and
     |      there is at least one cased character in the string.
     |
     |  isnumeric(self, /)
     |      Return True if the string is a numeric string, False otherwise.
     |
     |      A string is numeric if all characters in the string are numeric and there is at
     |      least one character in the string.
     |
     |  isprintable(self, /)
     |      Return True if the string is printable, False otherwise.
     |
     |      A string is printable if all of its characters are considered printable in
     |      repr() or if it is empty.
     |
     |  isspace(self, /)
     |      Return True if the string is a whitespace string, False otherwise.
     |
     |      A string is whitespace if all characters in the string are whitespace and there
     |      is at least one character in the string.
     |
     |  istitle(self, /)
     |      Return True if the string is a title-cased string, False otherwise.
     |
     |      In a title-cased string, upper- and title-case characters may only
     |      follow uncased characters and lowercase characters only cased ones.
     |
     |  isupper(self, /)
     |      Return True if the string is an uppercase string, False otherwise.
     |
     |      A string is uppercase if all cased characters in the string are uppercase and
     |      there is at least one cased character in the string.
     |
     |  join(self, iterable, /)
     |      Concatenate any number of strings.
     |
     |      The string whose method is called is inserted in between each given string.
     |      The result is returned as a new string.
     |
     |      Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
     |
     |  ljust(self, width, fillchar=' ', /)
     |      Return a left-justified string of length width.
     |
     |      Padding is done using the specified fill character (default is a space).
     |
     |  lower(self, /)
     |      Return a copy of the string converted to lowercase.
     |
     |  lstrip(self, chars=None, /)
     |      Return a copy of the string with leading whitespace removed.
     |
     |      If chars is given and not None, remove characters in chars instead.
     |
     |  partition(self, sep, /)
     |      Partition the string into three parts using the given separator.
     |
     |      This will search for the separator in the string.  If the separator is found,
     |      returns a 3-tuple containing the part before the separator, the separator
     |      itself, and the part after it.
     |
     |      If the separator is not found, returns a 3-tuple containing the original string
     |      and two empty strings.
     |
     |  removeprefix(self, prefix, /)
     |      Return a str with the given prefix string removed if present.
     |
     |      If the string starts with the prefix string, return string[len(prefix):].
     |      Otherwise, return a copy of the original string.
     |
     |  removesuffix(self, suffix, /)
     |      Return a str with the given suffix string removed if present.
     |
     |      If the string ends with the suffix string and that suffix is not empty,
     |      return string[:-len(suffix)]. Otherwise, return a copy of the original
     |      string.
     |
     |  replace(self, old, new, count=-1, /)
     |      Return a copy with all occurrences of substring old replaced by new.
     |
     |        count
     |          Maximum number of occurrences to replace.
     |          -1 (the default value) means replace all occurrences.
     |
     |      If the optional argument count is given, only the first count occurrences are
     |      replaced.
     |
     |  rfind(...)
     |      S.rfind(sub[, start[, end]]) -> int
     |
     |      Return the highest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Return -1 on failure.
     |
     |  rindex(...)
     |      S.rindex(sub[, start[, end]]) -> int
     |
     |      Return the highest index in S where substring sub is found,
     |      such that sub is contained within S[start:end].  Optional
     |      arguments start and end are interpreted as in slice notation.
     |
     |      Raises ValueError when the substring is not found.
     |
     |  rjust(self, width, fillchar=' ', /)
     |      Return a right-justified string of length width.
     |
     |      Padding is done using the specified fill character (default is a space).
     |
     |  rpartition(self, sep, /)
     |      Partition the string into three parts using the given separator.
     |
     |      This will search for the separator in the string, starting at the end. If
     |      the separator is found, returns a 3-tuple containing the part before the
     |      separator, the separator itself, and the part after it.
     |
     |      If the separator is not found, returns a 3-tuple containing two empty strings
     |      and the original string.
     |
     |  rsplit(self, /, sep=None, maxsplit=-1)
     |      Return a list of the substrings in the string, using sep as the separator string.
     |
     |        sep
     |          The separator used to split the string.
     |
     |          When set to None (the default value), will split on any whitespace
     |          character (including \n \r \t \f and spaces) and will discard
     |          empty strings from the result.
     |        maxsplit
     |          Maximum number of splits.
     |          -1 (the default value) means no limit.
     |
     |      Splitting starts at the end of the string and works to the front.
     |
     |  rstrip(self, chars=None, /)
     |      Return a copy of the string with trailing whitespace removed.
     |
     |      If chars is given and not None, remove characters in chars instead.
     |
     |  split(self, /, sep=None, maxsplit=-1)
     |      Return a list of the substrings in the string, using sep as the separator string.
     |
     |        sep
     |          The separator used to split the string.
     |
     |          When set to None (the default value), will split on any whitespace
     |          character (including \n \r \t \f and spaces) and will discard
     |          empty strings from the result.
     |        maxsplit
     |          Maximum number of splits.
     |          -1 (the default value) means no limit.
     |
     |      Splitting starts at the front of the string and works to the end.
     |
     |      Note, str.split() is mainly useful for data that has been intentionally
     |      delimited.  With natural text that includes punctuation, consider using
     |      the regular expression module.
     |
     |  splitlines(self, /, keepends=False)
     |      Return a list of the lines in the string, breaking at line boundaries.
     |
     |      Line breaks are not included in the resulting list unless keepends is given and
     |      true.
     |
     |  startswith(...)
     |      S.startswith(prefix[, start[, end]]) -> bool
     |
     |      Return True if S starts with the specified prefix, False otherwise.
     |      With optional start, test S beginning at that position.
     |      With optional end, stop comparing S at that position.
     |      prefix can also be a tuple of strings to try.
     |
     |  strip(self, chars=None, /)
     |      Return a copy of the string with leading and trailing whitespace removed.
     |
     |      If chars is given and not None, remove characters in chars instead.
     |
     |  swapcase(self, /)
     |      Convert uppercase characters to lowercase and lowercase characters to uppercase.
     |
     |  title(self, /)
     |      Return a version of the string where each word is titlecased.
     |
     |      More specifically, words start with uppercased characters and all remaining
     |      cased characters have lower case.
     |
     |  translate(self, table, /)
     |      Replace each character in the string using the given translation table.
     |
     |        table
     |          Translation table, which must be a mapping of Unicode ordinals to
     |          Unicode ordinals, strings, or None.
     |
     |      The table must implement lookup/indexing via __getitem__, for instance a
     |      dictionary or list.  If this operation raises LookupError, the character is
     |      left untouched.  Characters mapped to None are deleted.
     |
     |  upper(self, /)
     |      Return a copy of the string converted to uppercase.
     |
     |  zfill(self, width, /)
     |      Pad a numeric string with zeros on the left, to fill a field of the given width.
     |
     |      The string is never truncated.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.str:
     |
     |  maketrans(...)
     |      Return a translation table usable for str.translate().
     |
     |      If there is only one argument, it must be a dictionary mapping Unicode
     |      ordinals (integers) or characters to Unicode ordinals, strings or None.
     |      Character keys will be then converted to ordinals.
     |      If there are two arguments, they must be strings of equal length, and
     |      in the resulting dictionary, each character in x will be mapped to the
     |      character at the same position in y. If there is a third argument, it
     |      must be a string, whose characters will be mapped to None in the result.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class timedelta64(signedinteger)
     |  A timedelta stored as a 64-bit integer.
     |
     |  See :ref:`arrays.datetime` for more information.
     |
     |  :Character code: ``'m'``
     |
     |  Method resolution order:
     |      timedelta64
     |      signedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    ubyte = class uint8(unsignedinteger)
     |  Unsigned integer type, compatible with C ``unsigned char``.
     |
     |  :Character code: ``'B'``
     |  :Canonical name: `numpy.ubyte`
     |  :Alias on this platform (win32 AMD64): `numpy.uint8`: 8-bit unsigned integer (``0`` to ``255``).
     |
     |  Method resolution order:
     |      uint8
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint8.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint8(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class ufunc(builtins.object)
     |  Functions that operate element by element on whole arrays.
     |
     |  To see the documentation for a specific ufunc, use `info`.  For
     |  example, ``np.info(np.sin)``.  Because ufuncs are written in C
     |  (for speed) and linked into Python with NumPy's ufunc facility,
     |  Python's help() function finds this page whenever help() is called
     |  on a ufunc.
     |
     |  A detailed explanation of ufuncs can be found in the docs for :ref:`ufuncs`.
     |
     |  **Calling ufuncs:** ``op(*x[, out], where=True, **kwargs)``
     |
     |  Apply `op` to the arguments `*x` elementwise, broadcasting the arguments.
     |
     |  The broadcasting rules are:
     |
     |  * Dimensions of length 1 may be prepended to either array.
     |  * Arrays may be repeated along dimensions of length 1.
     |
     |  Parameters
     |  ----------
     |  *x : array_like
     |      Input arrays.
     |  out : ndarray, None, or tuple of ndarray and None, optional
     |      Alternate array object(s) in which to put the result; if provided, it
     |      must have a shape that the inputs broadcast to. A tuple of arrays
     |      (possible only as a keyword argument) must have length equal to the
     |      number of outputs; use None for uninitialized outputs to be
     |      allocated by the ufunc.
     |  where : array_like, optional
     |      This condition is broadcast over the input. At locations where the
     |      condition is True, the `out` array will be set to the ufunc result.
     |      Elsewhere, the `out` array will retain its original value.
     |      Note that if an uninitialized `out` array is created via the default
     |      ``out=None``, locations within it where the condition is False will
     |      remain uninitialized.
     |  **kwargs
     |      For other keyword-only arguments, see the :ref:`ufunc docs <ufuncs.kwargs>`.
     |
     |  Returns
     |  -------
     |  r : ndarray or tuple of ndarray
     |      `r` will have the shape that the arrays in `x` broadcast to; if `out` is
     |      provided, it will be returned. If not, `r` will be allocated and
     |      may contain uninitialized values. If the function has more than one
     |      output, then the result will be a tuple of arrays.
     |
     |  Methods defined here:
     |
     |  __call__(self, /, *args, **kwargs)
     |      Call self as a function.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  accumulate(...)
     |      accumulate(array, axis=0, dtype=None, out=None)
     |
     |      Accumulate the result of applying the operator to all elements.
     |
     |      For a one-dimensional array, accumulate produces results equivalent to::
     |
     |        r = np.empty(len(A))
     |        t = op.identity        # op = the ufunc being applied to A's  elements
     |        for i in range(len(A)):
     |            t = op(t, A[i])
     |            r[i] = t
     |        return r
     |
     |      For example, add.accumulate() is equivalent to np.cumsum().
     |
     |      For a multi-dimensional array, accumulate is applied along only one
     |      axis (axis zero by default; see Examples below) so repeated use is
     |      necessary if one wants to accumulate over multiple axes.
     |
     |      Parameters
     |      ----------
     |      array : array_like
     |          The array to act on.
     |      axis : int, optional
     |          The axis along which to apply the accumulation; default is zero.
     |      dtype : data-type code, optional
     |          The data-type used to represent the intermediate results. Defaults
     |          to the data-type of the output array if such is provided, or the
     |          data-type of the input array if no output array is provided.
     |      out : ndarray, None, or tuple of ndarray and None, optional
     |          A location into which the result is stored. If not provided or None,
     |          a freshly-allocated array is returned. For consistency with
     |          ``ufunc.__call__``, if given as a keyword, this may be wrapped in a
     |          1-element tuple.
     |
     |          .. versionchanged:: 1.13.0
     |             Tuples are allowed for keyword argument.
     |
     |      Returns
     |      -------
     |      r : ndarray
     |          The accumulated values. If `out` was supplied, `r` is a reference to
     |          `out`.
     |
     |      Examples
     |      --------
     |      1-D array examples:
     |
     |      >>> import numpy as np
     |      >>> np.add.accumulate([2, 3, 5])
     |      array([ 2,  5, 10])
     |      >>> np.multiply.accumulate([2, 3, 5])
     |      array([ 2,  6, 30])
     |
     |      2-D array examples:
     |
     |      >>> I = np.eye(2)
     |      >>> I
     |      array([[1.,  0.],
     |             [0.,  1.]])
     |
     |      Accumulate along axis 0 (rows), down columns:
     |
     |      >>> np.add.accumulate(I, 0)
     |      array([[1.,  0.],
     |             [1.,  1.]])
     |      >>> np.add.accumulate(I) # no axis specified = axis zero
     |      array([[1.,  0.],
     |             [1.,  1.]])
     |
     |      Accumulate along axis 1 (columns), through rows:
     |
     |      >>> np.add.accumulate(I, 1)
     |      array([[1.,  1.],
     |             [0.,  1.]])
     |
     |  at(...)
     |      at(a, indices, b=None, /)
     |
     |      Performs unbuffered in place operation on operand 'a' for elements
     |      specified by 'indices'. For addition ufunc, this method is equivalent to
     |      ``a[indices] += b``, except that results are accumulated for elements that
     |      are indexed more than once. For example, ``a[[0,0]] += 1`` will only
     |      increment the first element once because of buffering, whereas
     |      ``add.at(a, [0,0], 1)`` will increment the first element twice.
     |
     |      .. versionadded:: 1.8.0
     |
     |      Parameters
     |      ----------
     |      a : array_like
     |          The array to perform in place operation on.
     |      indices : array_like or tuple
     |          Array like index object or slice object for indexing into first
     |          operand. If first operand has multiple dimensions, indices can be a
     |          tuple of array like index objects or slice objects.
     |      b : array_like
     |          Second operand for ufuncs requiring two operands. Operand must be
     |          broadcastable over first operand after indexing or slicing.
     |
     |      Examples
     |      --------
     |      Set items 0 and 1 to their negative values:
     |
     |      >>> import numpy as np
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> np.negative.at(a, [0, 1])
     |      >>> a
     |      array([-1, -2,  3,  4])
     |
     |      Increment items 0 and 1, and increment item 2 twice:
     |
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> np.add.at(a, [0, 1, 2, 2], 1)
     |      >>> a
     |      array([2, 3, 5, 4])
     |
     |      Add items 0 and 1 in first array to second array,
     |      and store results in first array:
     |
     |      >>> a = np.array([1, 2, 3, 4])
     |      >>> b = np.array([1, 2])
     |      >>> np.add.at(a, [0, 1], b)
     |      >>> a
     |      array([2, 4, 3, 4])
     |
     |  outer(...)
     |      outer(A, B, /, **kwargs)
     |
     |      Apply the ufunc `op` to all pairs (a, b) with a in `A` and b in `B`.
     |
     |      Let ``M = A.ndim``, ``N = B.ndim``. Then the result, `C`, of
     |      ``op.outer(A, B)`` is an array of dimension M + N such that:
     |
     |      .. math:: C[i_0, ..., i_{M-1}, j_0, ..., j_{N-1}] =
     |         op(A[i_0, ..., i_{M-1}], B[j_0, ..., j_{N-1}])
     |
     |      For `A` and `B` one-dimensional, this is equivalent to::
     |
     |        r = empty(len(A),len(B))
     |        for i in range(len(A)):
     |            for j in range(len(B)):
     |                r[i,j] = op(A[i], B[j])  # op = ufunc in question
     |
     |      Parameters
     |      ----------
     |      A : array_like
     |          First array
     |      B : array_like
     |          Second array
     |      kwargs : any
     |          Arguments to pass on to the ufunc. Typically `dtype` or `out`.
     |          See `ufunc` for a comprehensive overview of all available arguments.
     |
     |      Returns
     |      -------
     |      r : ndarray
     |          Output array
     |
     |      See Also
     |      --------
     |      numpy.outer : A less powerful version of ``np.multiply.outer``
     |                    that `ravel`\ s all inputs to 1D. This exists
     |                    primarily for compatibility with old code.
     |
     |      tensordot : ``np.tensordot(a, b, axes=((), ()))`` and
     |                  ``np.multiply.outer(a, b)`` behave same for all
     |                  dimensions of a and b.
     |
     |      Examples
     |      --------
     |      >>> np.multiply.outer([1, 2, 3], [4, 5, 6])
     |      array([[ 4,  5,  6],
     |             [ 8, 10, 12],
     |             [12, 15, 18]])
     |
     |      A multi-dimensional example:
     |
     |      >>> A = np.array([[1, 2, 3], [4, 5, 6]])
     |      >>> A.shape
     |      (2, 3)
     |      >>> B = np.array([[1, 2, 3, 4]])
     |      >>> B.shape
     |      (1, 4)
     |      >>> C = np.multiply.outer(A, B)
     |      >>> C.shape; C
     |      (2, 3, 1, 4)
     |      array([[[[ 1,  2,  3,  4]],
     |              [[ 2,  4,  6,  8]],
     |              [[ 3,  6,  9, 12]]],
     |             [[[ 4,  8, 12, 16]],
     |              [[ 5, 10, 15, 20]],
     |              [[ 6, 12, 18, 24]]]])
     |
     |  reduce(...)
     |      reduce(array, axis=0, dtype=None, out=None, keepdims=False, initial=<no value>, where=True)
     |
     |      Reduces `array`'s dimension by one, by applying ufunc along one axis.
     |
     |      Let :math:`array.shape = (N_0, ..., N_i, ..., N_{M-1})`.  Then
     |      :math:`ufunc.reduce(array, axis=i)[k_0, ..,k_{i-1}, k_{i+1}, .., k_{M-1}]` =
     |      the result of iterating `j` over :math:`range(N_i)`, cumulatively applying
     |      ufunc to each :math:`array[k_0, ..,k_{i-1}, j, k_{i+1}, .., k_{M-1}]`.
     |      For a one-dimensional array, reduce produces results equivalent to:
     |      ::
     |
     |       r = op.identity # op = ufunc
     |       for i in range(len(A)):
     |         r = op(r, A[i])
     |       return r
     |
     |      For example, add.reduce() is equivalent to sum().
     |
     |      Parameters
     |      ----------
     |      array : array_like
     |          The array to act on.
     |      axis : None or int or tuple of ints, optional
     |          Axis or axes along which a reduction is performed.
     |          The default (`axis` = 0) is perform a reduction over the first
     |          dimension of the input array. `axis` may be negative, in
     |          which case it counts from the last to the first axis.
     |
     |          .. versionadded:: 1.7.0
     |
     |          If this is None, a reduction is performed over all the axes.
     |          If this is a tuple of ints, a reduction is performed on multiple
     |          axes, instead of a single axis or all the axes as before.
     |
     |          For operations which are either not commutative or not associative,
     |          doing a reduction over multiple axes is not well-defined. The
     |          ufuncs do not currently raise an exception in this case, but will
     |          likely do so in the future.
     |      dtype : data-type code, optional
     |          The data type used to perform the operation. Defaults to that of
     |          ``out`` if given, and the data type of ``array`` otherwise (though
     |          upcast to conserve precision for some cases, such as
     |          ``numpy.add.reduce`` for integer or boolean input).
     |      out : ndarray, None, or tuple of ndarray and None, optional
     |          A location into which the result is stored. If not provided or None,
     |          a freshly-allocated array is returned. For consistency with
     |          ``ufunc.__call__``, if given as a keyword, this may be wrapped in a
     |          1-element tuple.
     |
     |          .. versionchanged:: 1.13.0
     |             Tuples are allowed for keyword argument.
     |      keepdims : bool, optional
     |          If this is set to True, the axes which are reduced are left
     |          in the result as dimensions with size one. With this option,
     |          the result will broadcast correctly against the original `array`.
     |
     |          .. versionadded:: 1.7.0
     |      initial : scalar, optional
     |          The value with which to start the reduction.
     |          If the ufunc has no identity or the dtype is object, this defaults
     |          to None - otherwise it defaults to ufunc.identity.
     |          If ``None`` is given, the first element of the reduction is used,
     |          and an error is thrown if the reduction is empty.
     |
     |          .. versionadded:: 1.15.0
     |
     |      where : array_like of bool, optional
     |          A boolean array which is broadcasted to match the dimensions
     |          of `array`, and selects elements to include in the reduction. Note
     |          that for ufuncs like ``minimum`` that do not have an identity
     |          defined, one has to pass in also ``initial``.
     |
     |          .. versionadded:: 1.17.0
     |
     |      Returns
     |      -------
     |      r : ndarray
     |          The reduced array. If `out` was supplied, `r` is a reference to it.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.multiply.reduce([2,3,5])
     |      30
     |
     |      A multi-dimensional array example:
     |
     |      >>> X = np.arange(8).reshape((2,2,2))
     |      >>> X
     |      array([[[0, 1],
     |              [2, 3]],
     |             [[4, 5],
     |              [6, 7]]])
     |      >>> np.add.reduce(X, 0)
     |      array([[ 4,  6],
     |             [ 8, 10]])
     |      >>> np.add.reduce(X) # confirm: default axis value is 0
     |      array([[ 4,  6],
     |             [ 8, 10]])
     |      >>> np.add.reduce(X, 1)
     |      array([[ 2,  4],
     |             [10, 12]])
     |      >>> np.add.reduce(X, 2)
     |      array([[ 1,  5],
     |             [ 9, 13]])
     |
     |      You can use the ``initial`` keyword argument to initialize the reduction
     |      with a different value, and ``where`` to select specific elements to include:
     |
     |      >>> np.add.reduce([10], initial=5)
     |      15
     |      >>> np.add.reduce(np.ones((2, 2, 2)), axis=(0, 2), initial=10)
     |      array([14., 14.])
     |      >>> a = np.array([10., np.nan, 10])
     |      >>> np.add.reduce(a, where=~np.isnan(a))
     |      20.0
     |
     |      Allows reductions of empty arrays where they would normally fail, i.e.
     |      for ufuncs without an identity.
     |
     |      >>> np.minimum.reduce([], initial=np.inf)
     |      inf
     |      >>> np.minimum.reduce([[1., 2.], [3., 4.]], initial=10., where=[True, False])
     |      array([ 1., 10.])
     |      >>> np.minimum.reduce([])
     |      Traceback (most recent call last):
     |          ...
     |      ValueError: zero-size array to reduction operation minimum which has no identity
     |
     |  reduceat(...)
     |      reduceat(array, indices, axis=0, dtype=None, out=None)
     |
     |      Performs a (local) reduce with specified slices over a single axis.
     |
     |      For i in ``range(len(indices))``, `reduceat` computes
     |      ``ufunc.reduce(array[indices[i]:indices[i+1]])``, which becomes the i-th
     |      generalized "row" parallel to `axis` in the final result (i.e., in a
     |      2-D array, for example, if `axis = 0`, it becomes the i-th row, but if
     |      `axis = 1`, it becomes the i-th column).  There are three exceptions to this:
     |
     |      * when ``i = len(indices) - 1`` (so for the last index),
     |        ``indices[i+1] = array.shape[axis]``.
     |      * if ``indices[i] >= indices[i + 1]``, the i-th generalized "row" is
     |        simply ``array[indices[i]]``.
     |      * if ``indices[i] >= len(array)`` or ``indices[i] < 0``, an error is raised.
     |
     |      The shape of the output depends on the size of `indices`, and may be
     |      larger than `array` (this happens if ``len(indices) > array.shape[axis]``).
     |
     |      Parameters
     |      ----------
     |      array : array_like
     |          The array to act on.
     |      indices : array_like
     |          Paired indices, comma separated (not colon), specifying slices to
     |          reduce.
     |      axis : int, optional
     |          The axis along which to apply the reduceat.
     |      dtype : data-type code, optional
     |          The data type used to perform the operation. Defaults to that of
     |          ``out`` if given, and the data type of ``array`` otherwise (though
     |          upcast to conserve precision for some cases, such as
     |          ``numpy.add.reduce`` for integer or boolean input).
     |      out : ndarray, None, or tuple of ndarray and None, optional
     |          A location into which the result is stored. If not provided or None,
     |          a freshly-allocated array is returned. For consistency with
     |          ``ufunc.__call__``, if given as a keyword, this may be wrapped in a
     |          1-element tuple.
     |
     |          .. versionchanged:: 1.13.0
     |             Tuples are allowed for keyword argument.
     |
     |      Returns
     |      -------
     |      r : ndarray
     |          The reduced values. If `out` was supplied, `r` is a reference to
     |          `out`.
     |
     |      Notes
     |      -----
     |      A descriptive example:
     |
     |      If `array` is 1-D, the function `ufunc.accumulate(array)` is the same as
     |      ``ufunc.reduceat(array, indices)[::2]`` where `indices` is
     |      ``range(len(array) - 1)`` with a zero placed
     |      in every other element:
     |      ``indices = zeros(2 * len(array) - 1)``,
     |      ``indices[1::2] = range(1, len(array))``.
     |
     |      Don't be fooled by this attribute's name: `reduceat(array)` is not
     |      necessarily smaller than `array`.
     |
     |      Examples
     |      --------
     |      To take the running sum of four successive values:
     |
     |      >>> import numpy as np
     |      >>> np.add.reduceat(np.arange(8),[0,4, 1,5, 2,6, 3,7])[::2]
     |      array([ 6, 10, 14, 18])
     |
     |      A 2-D example:
     |
     |      >>> x = np.linspace(0, 15, 16).reshape(4,4)
     |      >>> x
     |      array([[ 0.,   1.,   2.,   3.],
     |             [ 4.,   5.,   6.,   7.],
     |             [ 8.,   9.,  10.,  11.],
     |             [12.,  13.,  14.,  15.]])
     |
     |      ::
     |
     |       # reduce such that the result has the following five rows:
     |       # [row1 + row2 + row3]
     |       # [row4]
     |       # [row2]
     |       # [row3]
     |       # [row1 + row2 + row3 + row4]
     |
     |      >>> np.add.reduceat(x, [0, 3, 1, 2, 0])
     |      array([[12.,  15.,  18.,  21.],
     |             [12.,  13.,  14.,  15.],
     |             [ 4.,   5.,   6.,   7.],
     |             [ 8.,   9.,  10.,  11.],
     |             [24.,  28.,  32.,  36.]])
     |
     |      ::
     |
     |       # reduce such that result has the following two columns:
     |       # [col1 * col2 * col3, col4]
     |
     |      >>> np.multiply.reduceat(x, [0, 3], 1)
     |      array([[   0.,     3.],
     |             [ 120.,     7.],
     |             [ 720.,    11.],
     |             [2184.,    15.]])
     |
     |  resolve_dtypes(...)
     |      resolve_dtypes(dtypes, *, signature=None, casting=None, reduction=False)
     |
     |      Find the dtypes NumPy will use for the operation.  Both input and
     |      output dtypes are returned and may differ from those provided.
     |
     |      .. note::
     |
     |          This function always applies NEP 50 rules since it is not provided
     |          any actual values.  The Python types ``int``, ``float``, and
     |          ``complex`` thus behave weak and should be passed for "untyped"
     |          Python input.
     |
     |      Parameters
     |      ----------
     |      dtypes : tuple of dtypes, None, or literal int, float, complex
     |          The input dtypes for each operand.  Output operands can be
     |          None, indicating that the dtype must be found.
     |      signature : tuple of DTypes or None, optional
     |          If given, enforces exact DType (classes) of the specific operand.
     |          The ufunc ``dtype`` argument is equivalent to passing a tuple with
     |          only output dtypes set.
     |      casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
     |          The casting mode when casting is necessary.  This is identical to
     |          the ufunc call casting modes.
     |      reduction : boolean
     |          If given, the resolution assumes a reduce operation is happening
     |          which slightly changes the promotion and type resolution rules.
     |          `dtypes` is usually something like ``(None, np.dtype("i2"), None)``
     |          for reductions (first input is also the output).
     |
     |          .. note::
     |
     |              The default casting mode is "same_kind", however, as of
     |              NumPy 1.24, NumPy uses "unsafe" for reductions.
     |
     |      Returns
     |      -------
     |      dtypes : tuple of dtypes
     |          The dtypes which NumPy would use for the calculation.  Note that
     |          dtypes may not match the passed in ones (casting is necessary).
     |
     |
     |      Examples
     |      --------
     |      This API requires passing dtypes, define them for convenience:
     |
     |      >>> import numpy as np
     |      >>> int32 = np.dtype("int32")
     |      >>> float32 = np.dtype("float32")
     |
     |      The typical ufunc call does not pass an output dtype.  `numpy.add` has two
     |      inputs and one output, so leave the output as ``None`` (not provided):
     |
     |      >>> np.add.resolve_dtypes((int32, float32, None))
     |      (dtype('float64'), dtype('float64'), dtype('float64'))
     |
     |      The loop found uses "float64" for all operands (including the output), the
     |      first input would be cast.
     |
     |      ``resolve_dtypes`` supports "weak" handling for Python scalars by passing
     |      ``int``, ``float``, or ``complex``:
     |
     |      >>> np.add.resolve_dtypes((float32, float, None))
     |      (dtype('float32'), dtype('float32'), dtype('float32'))
     |
     |      Where the Python ``float`` behaves samilar to a Python value ``0.0``
     |      in a ufunc call.  (See :ref:`NEP 50 <NEP50>` for details.)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  identity
     |      The identity value.
     |
     |      Data attribute containing the identity element for the ufunc,
     |      if it has one. If it does not, the attribute value is None.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.add.identity
     |      0
     |      >>> np.multiply.identity
     |      1
     |      >>> np.power.identity
     |      1
     |      >>> print(np.exp.identity)
     |      None
     |
     |  nargs
     |      The number of arguments.
     |
     |      Data attribute containing the number of arguments the ufunc takes, including
     |      optional ones.
     |
     |      Notes
     |      -----
     |      Typically this value will be one more than what you might expect
     |      because all ufuncs take  the optional "out" argument.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.add.nargs
     |      3
     |      >>> np.multiply.nargs
     |      3
     |      >>> np.power.nargs
     |      3
     |      >>> np.exp.nargs
     |      2
     |
     |  nin
     |      The number of inputs.
     |
     |      Data attribute containing the number of arguments the ufunc treats as input.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.add.nin
     |      2
     |      >>> np.multiply.nin
     |      2
     |      >>> np.power.nin
     |      2
     |      >>> np.exp.nin
     |      1
     |
     |  nout
     |      The number of outputs.
     |
     |      Data attribute containing the number of arguments the ufunc treats as output.
     |
     |      Notes
     |      -----
     |      Since all ufuncs can take output arguments, this will always be at least 1.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.add.nout
     |      1
     |      >>> np.multiply.nout
     |      1
     |      >>> np.power.nout
     |      1
     |      >>> np.exp.nout
     |      1
     |
     |  ntypes
     |      The number of types.
     |
     |      The number of numerical NumPy types - of which there are 18 total - on which
     |      the ufunc can operate.
     |
     |      See Also
     |      --------
     |      numpy.ufunc.types
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.add.ntypes
     |      18
     |      >>> np.multiply.ntypes
     |      18
     |      >>> np.power.ntypes
     |      17
     |      >>> np.exp.ntypes
     |      7
     |      >>> np.remainder.ntypes
     |      14
     |
     |  signature
     |      Definition of the core elements a generalized ufunc operates on.
     |
     |      The signature determines how the dimensions of each input/output array
     |      are split into core and loop dimensions:
     |
     |      1. Each dimension in the signature is matched to a dimension of the
     |         corresponding passed-in array, starting from the end of the shape tuple.
     |      2. Core dimensions assigned to the same label in the signature must have
     |         exactly matching sizes, no broadcasting is performed.
     |      3. The core dimensions are removed from all inputs and the remaining
     |         dimensions are broadcast together, defining the loop dimensions.
     |
     |      Notes
     |      -----
     |      Generalized ufuncs are used internally in many linalg functions, and in
     |      the testing suite; the examples below are taken from these.
     |      For ufuncs that operate on scalars, the signature is None, which is
     |      equivalent to '()' for every argument.
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.linalg._umath_linalg.det.signature
     |      '(m,m)->()'
     |      >>> np.matmul.signature
     |      '(n?,k),(k,m?)->(n?,m?)'
     |      >>> np.add.signature is None
     |      True  # equivalent to '(),()->()'
     |
     |  types
     |      Returns a list with types grouped input->output.
     |
     |      Data attribute listing the data-type "Domain-Range" groupings the ufunc can
     |      deliver. The data-types are given using the character codes.
     |
     |      See Also
     |      --------
     |      numpy.ufunc.ntypes
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.add.types
     |      ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l',
     |      'LL->L', 'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'FF->F', 'DD->D',
     |      'GG->G', 'OO->O']
     |
     |      >>> np.multiply.types
     |      ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l',
     |      'LL->L', 'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'FF->F', 'DD->D',
     |      'GG->G', 'OO->O']
     |
     |      >>> np.power.types
     |      ['bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',
     |      'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'FF->F', 'DD->D', 'GG->G',
     |      'OO->O']
     |
     |      >>> np.exp.types
     |      ['f->f', 'd->d', 'g->g', 'F->F', 'D->D', 'G->G', 'O->O']
     |
     |      >>> np.remainder.types
     |      ['bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',
     |      'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'OO->O']

    uint = class uint64(unsignedinteger)
     |  Unsigned signed integer type, 64bit on 64bit systems and 32bit on 32bit
     |  systems.
     |
     |  :Character code: ``'Q'``
     |  :Canonical name: `numpy.uint`
     |  :Alias on this platform (win32 AMD64): `numpy.uint64`: 64-bit unsigned integer (``0`` to ``18_446_744_073_709_551_615``).
     |  :Alias on this platform (win32 AMD64): `numpy.uintp`: Unsigned integer large enough to fit pointer, compatible with C ``uintptr_t``.
     |
     |  Method resolution order:
     |      uint64
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint64.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint64(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class uint16(unsignedinteger)
     |  Unsigned integer type, compatible with C ``unsigned short``.
     |
     |  :Character code: ``'H'``
     |  :Canonical name: `numpy.ushort`
     |  :Alias on this platform (win32 AMD64): `numpy.uint16`: 16-bit unsigned integer (``0`` to ``65_535``).
     |
     |  Method resolution order:
     |      uint16
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint16.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint16(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class uint32(unsignedinteger)
     |  Method resolution order:
     |      uint32
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint32.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint32(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class uint64(unsignedinteger)
     |  Unsigned signed integer type, 64bit on 64bit systems and 32bit on 32bit
     |  systems.
     |
     |  :Character code: ``'Q'``
     |  :Canonical name: `numpy.uint`
     |  :Alias on this platform (win32 AMD64): `numpy.uint64`: 64-bit unsigned integer (``0`` to ``18_446_744_073_709_551_615``).
     |  :Alias on this platform (win32 AMD64): `numpy.uintp`: Unsigned integer large enough to fit pointer, compatible with C ``uintptr_t``.
     |
     |  Method resolution order:
     |      uint64
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint64.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint64(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class uint8(unsignedinteger)
     |  Unsigned integer type, compatible with C ``unsigned char``.
     |
     |  :Character code: ``'B'``
     |  :Canonical name: `numpy.ubyte`
     |  :Alias on this platform (win32 AMD64): `numpy.uint8`: 8-bit unsigned integer (``0`` to ``255``).
     |
     |  Method resolution order:
     |      uint8
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint8.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint8(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class uintc(unsignedinteger)
     |  Unsigned integer type, compatible with C ``unsigned int``.
     |
     |  :Character code: ``'I'``
     |
     |  Method resolution order:
     |      uintc
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    uintp = class uint64(unsignedinteger)
     |  Unsigned signed integer type, 64bit on 64bit systems and 32bit on 32bit
     |  systems.
     |
     |  :Character code: ``'Q'``
     |  :Canonical name: `numpy.uint`
     |  :Alias on this platform (win32 AMD64): `numpy.uint64`: 64-bit unsigned integer (``0`` to ``18_446_744_073_709_551_615``).
     |  :Alias on this platform (win32 AMD64): `numpy.uintp`: Unsigned integer large enough to fit pointer, compatible with C ``uintptr_t``.
     |
     |  Method resolution order:
     |      uint64
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint64.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint64(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    ulong = class uint32(unsignedinteger)
     |  Method resolution order:
     |      uint32
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint32.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint32(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    ulonglong = class uint64(unsignedinteger)
     |  Unsigned signed integer type, 64bit on 64bit systems and 32bit on 32bit
     |  systems.
     |
     |  :Character code: ``'Q'``
     |  :Canonical name: `numpy.uint`
     |  :Alias on this platform (win32 AMD64): `numpy.uint64`: 64-bit unsigned integer (``0`` to ``18_446_744_073_709_551_615``).
     |  :Alias on this platform (win32 AMD64): `numpy.uintp`: Unsigned integer large enough to fit pointer, compatible with C ``uintptr_t``.
     |
     |  Method resolution order:
     |      uint64
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint64.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint64(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class unsignedinteger(integer)
     |  Abstract base class of all unsigned integer scalar types.
     |
     |  Method resolution order:
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from number:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from generic:
     |
     |  __hash__ = None

    ushort = class uint16(unsignedinteger)
     |  Unsigned integer type, compatible with C ``unsigned short``.
     |
     |  :Character code: ``'H'``
     |  :Canonical name: `numpy.ushort`
     |  :Alias on this platform (win32 AMD64): `numpy.uint16`: 16-bit unsigned integer (``0`` to ``65_535``).
     |
     |  Method resolution order:
     |      uint16
     |      unsignedinteger
     |      integer
     |      number
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  bit_count(...)
     |      uint16.bit_count() -> int
     |
     |      Computes the number of 1-bits in the absolute value of the input.
     |      Analogous to the builtin `int.bit_count` or ``popcount`` in C++.
     |
     |      Examples
     |      --------
     |      >>> np.uint16(127).bit_count()
     |      7
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      __class_getitem__(item, /)
     |
     |      Return a parametrized wrapper around the `~numpy.number` type.
     |
     |      .. versionadded:: 1.22
     |
     |      Returns
     |      -------
     |      alias : types.GenericAlias
     |          A parametrized `~numpy.number` type.
     |
     |      Examples
     |      --------
     |      >>> from typing import Any
     |      >>> import numpy as np
     |
     |      >>> np.signedinteger[Any]
     |      numpy.signedinteger[typing.Any]
     |
     |      See Also
     |      --------
     |      :pep:`585` : Type hinting generics in standard collections.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from integer:
     |
     |  __round__(...)
     |
     |  is_integer(...)
     |      integer.is_integer() -> bool
     |
     |      Return ``True`` if the number is finite with integral value.
     |
     |      .. versionadded:: 1.22
     |
     |      Examples
     |      --------
     |      >>> import numpy as np
     |      >>> np.int64(-2).is_integer()
     |      True
     |      >>> np.uint32(5).is_integer()
     |      True
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from integer:
     |
     |  denominator
     |      denominator of value (1)
     |
     |  numerator
     |      numerator of value (the value itself)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  base
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.base`.
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  dtype
     |      Get array data-descriptor.
     |
     |  flags
     |      The integer value of flags.
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

    class vectorize(builtins.object)
     |  vectorize(pyfunc=<no value>, otypes=None, doc=None, excluded=None, cache=False, signature=None)
     |
     |  vectorize(pyfunc=np._NoValue, otypes=None, doc=None, excluded=None,
     |  cache=False, signature=None)
     |
     |  Returns an object that acts like pyfunc, but takes arrays as input.
     |
     |  Define a vectorized function which takes a nested sequence of objects or
     |  numpy arrays as inputs and returns a single numpy array or a tuple of numpy
     |  arrays. The vectorized function evaluates `pyfunc` over successive tuples
     |  of the input arrays like the python map function, except it uses the
     |  broadcasting rules of numpy.
     |
     |  The data type of the output of `vectorized` is determined by calling
     |  the function with the first element of the input.  This can be avoided
     |  by specifying the `otypes` argument.
     |
     |  Parameters
     |  ----------
     |  pyfunc : callable, optional
     |      A python function or method.
     |      Can be omitted to produce a decorator with keyword arguments.
     |  otypes : str or list of dtypes, optional
     |      The output data type. It must be specified as either a string of
     |      typecode characters or a list of data type specifiers. There should
     |      be one data type specifier for each output.
     |  doc : str, optional
     |      The docstring for the function. If None, the docstring will be the
     |      ``pyfunc.__doc__``.
     |  excluded : set, optional
     |      Set of strings or integers representing the positional or keyword
     |      arguments for which the function will not be vectorized.  These will be
     |      passed directly to `pyfunc` unmodified.
     |
     |      .. versionadded:: 1.7.0
     |
     |  cache : bool, optional
     |      If `True`, then cache the first function call that determines the number
     |      of outputs if `otypes` is not provided.
     |
     |      .. versionadded:: 1.7.0
     |
     |  signature : string, optional
     |      Generalized universal function signature, e.g., ``(m,n),(n)->(m)`` for
     |      vectorized matrix-vector multiplication. If provided, ``pyfunc`` will
     |      be called with (and expected to return) arrays with shapes given by the
     |      size of corresponding core dimensions. By default, ``pyfunc`` is
     |      assumed to take scalars as input and output.
     |
     |      .. versionadded:: 1.12.0
     |
     |  Returns
     |  -------
     |  out : callable
     |      A vectorized function if ``pyfunc`` was provided,
     |      a decorator otherwise.
     |
     |  See Also
     |  --------
     |  frompyfunc : Takes an arbitrary Python function and returns a ufunc
     |
     |  Notes
     |  -----
     |  The `vectorize` function is provided primarily for convenience, not for
     |  performance. The implementation is essentially a for loop.
     |
     |  If `otypes` is not specified, then a call to the function with the
     |  first argument will be used to determine the number of outputs.  The
     |  results of this call will be cached if `cache` is `True` to prevent
     |  calling the function twice.  However, to implement the cache, the
     |  original function must be wrapped which will slow down subsequent
     |  calls, so only do this if your function is expensive.
     |
     |  The new keyword argument interface and `excluded` argument support
     |  further degrades performance.
     |
     |  References
     |  ----------
     |  .. [1] :doc:`/reference/c-api/generalized-ufuncs`
     |
     |  Examples
     |  --------
     |  >>> import numpy as np
     |  >>> def myfunc(a, b):
     |  ...     "Return a-b if a>b, otherwise return a+b"
     |  ...     if a > b:
     |  ...         return a - b
     |  ...     else:
     |  ...         return a + b
     |
     |  >>> vfunc = np.vectorize(myfunc)
     |  >>> vfunc([1, 2, 3, 4], 2)
     |  array([3, 4, 1, 2])
     |
     |  The docstring is taken from the input function to `vectorize` unless it
     |  is specified:
     |
     |  >>> vfunc.__doc__
     |  'Return a-b if a>b, otherwise return a+b'
     |  >>> vfunc = np.vectorize(myfunc, doc='Vectorized `myfunc`')
     |  >>> vfunc.__doc__
     |  'Vectorized `myfunc`'
     |
     |  The output type is determined by evaluating the first element of the input,
     |  unless it is specified:
     |
     |  >>> out = vfunc([1, 2, 3, 4], 2)
     |  >>> type(out[0])
     |  <class 'numpy.int64'>
     |  >>> vfunc = np.vectorize(myfunc, otypes=[float])
     |  >>> out = vfunc([1, 2, 3, 4], 2)
     |  >>> type(out[0])
     |  <class 'numpy.float64'>
     |
     |  The `excluded` argument can be used to prevent vectorizing over certain
     |  arguments.  This can be useful for array-like arguments of a fixed length
     |  such as the coefficients for a polynomial as in `polyval`:
     |
     |  >>> def mypolyval(p, x):
     |  ...     _p = list(p)
     |  ...     res = _p.pop(0)
     |  ...     while _p:
     |  ...         res = res*x + _p.pop(0)
     |  ...     return res
     |  >>> vpolyval = np.vectorize(mypolyval, excluded=['p'])
     |  >>> vpolyval(p=[1, 2, 3], x=[0, 1])
     |  array([3, 6])
     |
     |  Positional arguments may also be excluded by specifying their position:
     |
     |  >>> vpolyval.excluded.add(0)
     |  >>> vpolyval([1, 2, 3], x=[0, 1])
     |  array([3, 6])
     |
     |  The `signature` argument allows for vectorizing functions that act on
     |  non-scalar arrays of fixed length. For example, you can use it for a
     |  vectorized calculation of Pearson correlation coefficient and its p-value:
     |
     |  >>> import scipy.stats
     |  >>> pearsonr = np.vectorize(scipy.stats.pearsonr,
     |  ...                 signature='(n),(n)->(),()')
     |  >>> pearsonr([[0, 1, 2, 3]], [[1, 2, 3, 4], [4, 3, 2, 1]])
     |  (array([ 1., -1.]), array([ 0.,  0.]))
     |
     |  Or for a vectorized convolution:
     |
     |  >>> convolve = np.vectorize(np.convolve, signature='(n),(m)->(k)')
     |  >>> convolve(np.eye(4), [1, 2, 1])
     |  array([[1., 2., 1., 0., 0., 0.],
     |         [0., 1., 2., 1., 0., 0.],
     |         [0., 0., 1., 2., 1., 0.],
     |         [0., 0., 0., 1., 2., 1.]])
     |
     |  Decorator syntax is supported.  The decorator can be called as
     |  a function to provide keyword arguments:
     |
     |  >>> @np.vectorize
     |  ... def identity(x):
     |  ...     return x
     |  ...
     |  >>> identity([0, 1, 2])
     |  array([0, 1, 2])
     |  >>> @np.vectorize(otypes=[float])
     |  ... def as_float(x):
     |  ...     return x
     |  ...
     |  >>> as_float([0, 1, 2])
     |  array([0., 1., 2.])
     |
     |  Methods defined here:
     |
     |  __call__(self, *args, **kwargs) from numpy.lib._function_base_impl.vectorize
     |      Call self as a function.
     |
     |  __init__(self, pyfunc=<no value>, otypes=None, doc=None, excluded=None, cache=False, signature=None) from numpy.lib._function_base_impl.vectorize
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class void(flexible)
     |  np.void(length_or_data, /, dtype=None)
     |
     |  Create a new structured or unstructured void scalar.
     |
     |  Parameters
     |  ----------
     |  length_or_data : int, array-like, bytes-like, object
     |     One of multiple meanings (see notes).  The length or
     |     bytes data of an unstructured void.  Or alternatively,
     |     the data to be stored in the new scalar when `dtype`
     |     is provided.
     |     This can be an array-like, in which case an array may
     |     be returned.
     |  dtype : dtype, optional
     |     If provided the dtype of the new scalar.  This dtype must
     |     be "void" dtype (i.e. a structured or unstructured void,
     |     see also :ref:`defining-structured-types`).
     |
     |     .. versionadded:: 1.24
     |
     |  Notes
     |  -----
     |  For historical reasons and because void scalars can represent both
     |  arbitrary byte data and structured dtypes, the void constructor
     |  has three calling conventions:
     |
     |  1. ``np.void(5)`` creates a ``dtype="V5"`` scalar filled with five
     |     ``\0`` bytes.  The 5 can be a Python or NumPy integer.
     |  2. ``np.void(b"bytes-like")`` creates a void scalar from the byte string.
     |     The dtype itemsize will match the byte string length, here ``"V10"``.
     |  3. When a ``dtype=`` is passed the call is roughly the same as an
     |     array creation.  However, a void scalar rather than array is returned.
     |
     |  Please see the examples which show all three different conventions.
     |
     |  Examples
     |  --------
     |  >>> np.void(5)
     |  np.void(b'\x00\x00\x00\x00\x00')
     |  >>> np.void(b'abcd')
     |  np.void(b'\x61\x62\x63\x64')
     |  >>> np.void((3.2, b'eggs'), dtype="d,S5")
     |  np.void((3.2, b'eggs'), dtype=[('f0', '<f8'), ('f1', 'S5')])
     |  >>> np.void(3, dtype=[('x', np.int8), ('y', np.int8)])
     |  np.void((3, 3), dtype=[('x', 'i1'), ('y', 'i1')])
     |
     |  :Character code: ``'V'``
     |
     |  Method resolution order:
     |      void
     |      flexible
     |      generic
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __buffer__(self, flags, /)
     |      Return a buffer object that exposes the underlying memory of the object.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  getfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.getfield`.
     |
     |  setfield(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setfield`.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  base
     |      base object
     |
     |  dtype
     |      dtype object
     |
     |  flags
     |      integer value of flags
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from generic:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __and__(self, value, /)
     |      Return self&value.
     |
     |  __array__(...)
     |      sc.__array__(dtype) return 0-dim array from scalar with specified dtype
     |
     |  __array_namespace__(...)
     |
     |  __array_wrap__(...)
     |      sc.__array_wrap__(obj) return scalar from array
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __copy__(...)
     |
     |  __deepcopy__(...)
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __format__(...)
     |      NumPy array scalar formatter
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __invert__(self, /)
     |      ~self
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rand__(self, value, /)
     |      Return value&self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __rxor__(self, value, /)
     |      Return value^self.
     |
     |  __setstate__(...)
     |
     |  __sizeof__(...)
     |      Size of object in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __xor__(self, value, /)
     |      Return self^value.
     |
     |  all(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.all`.
     |
     |  any(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.any`.
     |
     |  argmax(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmax`.
     |
     |  argmin(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argmin`.
     |
     |  argsort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.argsort`.
     |
     |  astype(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.astype`.
     |
     |  byteswap(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.byteswap`.
     |
     |  choose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.choose`.
     |
     |  clip(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.clip`.
     |
     |  compress(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.compress`.
     |
     |  conj(...)
     |
     |  conjugate(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.conjugate`.
     |
     |  copy(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.copy`.
     |
     |  cumprod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumprod`.
     |
     |  cumsum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.cumsum`.
     |
     |  diagonal(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.diagonal`.
     |
     |  dump(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dump`.
     |
     |  dumps(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.dumps`.
     |
     |  fill(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.fill`.
     |
     |  flatten(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.flatten`.
     |
     |  item(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.item`.
     |
     |  max(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.max`.
     |
     |  mean(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.mean`.
     |
     |  min(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.min`.
     |
     |  nonzero(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.nonzero`.
     |
     |  prod(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.prod`.
     |
     |  put(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.put`.
     |
     |  ravel(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.ravel`.
     |
     |  repeat(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.repeat`.
     |
     |  reshape(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.reshape`.
     |
     |  resize(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.resize`.
     |
     |  round(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.round`.
     |
     |  searchsorted(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.searchsorted`.
     |
     |  setflags(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.setflags`.
     |
     |  sort(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sort`.
     |
     |  squeeze(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.squeeze`.
     |
     |  std(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.std`.
     |
     |  sum(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.sum`.
     |
     |  swapaxes(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.swapaxes`.
     |
     |  take(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.take`.
     |
     |  to_device(...)
     |
     |  tobytes(...)
     |
     |  tofile(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tofile`.
     |
     |  tolist(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tolist`.
     |
     |  tostring(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.tostring`.
     |
     |  trace(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.trace`.
     |
     |  transpose(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.transpose`.
     |
     |  var(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.var`.
     |
     |  view(...)
     |      Scalar method identical to the corresponding array attribute.
     |
     |      Please see `ndarray.view`.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from generic:
     |
     |  T
     |      Scalar attribute identical to the corresponding array attribute.
     |
     |      Please see `ndarray.T`.
     |
     |  __array_interface__
     |      Array protocol: Python side
     |
     |  __array_priority__
     |      Array priority.
     |
     |  __array_struct__
     |      Array protocol: struct
     |
     |  data
     |      Pointer to start of data.
     |
     |  device
     |
     |  flat
     |      A 1-D view of the scalar.
     |
     |  imag
     |      The imaginary part of the scalar.
     |
     |  itemset
     |
     |  itemsize
     |      The length of one element in bytes.
     |
     |  nbytes
     |
     |  ndim
     |      The number of array dimensions.
     |
     |  newbyteorder
     |
     |  ptp
     |
     |  real
     |      The real part of the scalar.
     |
     |  shape
     |      Tuple of array dimensions.
     |
     |  size
     |      The number of elements in the gentype.
     |
     |  strides
     |      Tuple of bytes steps in each dimension.

FUNCTIONS
    __dir__()

    __getattr__(attr)

    _get_promotion_state(...)
        Get the current NEP 50 promotion state.

    _no_nep50_warning()
        Context manager to disable NEP 50 warnings.  This context manager is
        only relevant if the NEP 50 warnings are enabled globally (which is not
        thread/context safe).

        This warning context manager itself is fully safe, however.

    _set_promotion_state(...)
        Set the NEP 50 promotion state.  This is not thread-safe.
        The optional warnings can be safely silenced using the
        `np._no_nep50_warning()` context manager.

    all(a, axis=None, out=None, keepdims=<no value>, *, where=<no value>)
        Test whether all array elements along a given axis evaluate to True.

        Parameters
        ----------
        a : array_like
            Input array or object that can be converted to an array.
        axis : None or int or tuple of ints, optional
            Axis or axes along which a logical AND reduction is performed.
            The default (``axis=None``) is to perform a logical AND over all
            the dimensions of the input array. `axis` may be negative, in
            which case it counts from the last to the first axis.

            .. versionadded:: 1.7.0

            If this is a tuple of ints, a reduction is performed on multiple
            axes, instead of a single axis or all the axes as before.
        out : ndarray, optional
            Alternate output array in which to place the result.
            It must have the same shape as the expected output and its
            type is preserved (e.g., if ``dtype(out)`` is float, the result
            will consist of 0.0's and 1.0's). See :ref:`ufuncs-output-type`
            for more details.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the `all` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.

        where : array_like of bool, optional
            Elements to include in checking for all `True` values.
            See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.20.0

        Returns
        -------
        all : ndarray, bool
            A new boolean or array is returned unless `out` is specified,
            in which case a reference to `out` is returned.

        See Also
        --------
        ndarray.all : equivalent method

        any : Test whether any element along a given axis evaluates to True.

        Notes
        -----
        Not a Number (NaN), positive infinity and negative infinity
        evaluate to `True` because these are not equal to zero.

        .. versionchanged:: 2.0
           Before NumPy 2.0, ``all`` did not return booleans for object dtype
           input arrays.
           This behavior is still available via ``np.logical_and.reduce``.

        Examples
        --------
        >>> import numpy as np
        >>> np.all([[True,False],[True,True]])
        False

        >>> np.all([[True,False],[True,True]], axis=0)
        array([ True, False])

        >>> np.all([-1, 4, 5])
        True

        >>> np.all([1.0, np.nan])
        True

        >>> np.all([[True, True], [False, True]], where=[[True], [False]])
        True

        >>> o=np.array(False)
        >>> z=np.all([-1, 4, 5], out=o)
        >>> id(z), id(o), z
        (28293632, 28293632, array(True)) # may vary

    allclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False)
        Returns True if two arrays are element-wise equal within a tolerance.

        The tolerance values are positive, typically very small numbers.  The
        relative difference (`rtol` * abs(`b`)) and the absolute difference
        `atol` are added together to compare against the absolute difference
        between `a` and `b`.

        .. warning:: The default `atol` is not appropriate for comparing numbers
                     with magnitudes much smaller than one (see Notes).

        NaNs are treated as equal if they are in the same place and if
        ``equal_nan=True``.  Infs are treated as equal if they are in the same
        place and of the same sign in both arrays.

        Parameters
        ----------
        a, b : array_like
            Input arrays to compare.
        rtol : array_like
            The relative tolerance parameter (see Notes).
        atol : array_like
            The absolute tolerance parameter (see Notes).
        equal_nan : bool
            Whether to compare NaN's as equal.  If True, NaN's in `a` will be
            considered equal to NaN's in `b` in the output array.

            .. versionadded:: 1.10.0

        Returns
        -------
        allclose : bool
            Returns True if the two arrays are equal within the given
            tolerance; False otherwise.

        See Also
        --------
        isclose, all, any, equal

        Notes
        -----
        If the following equation is element-wise True, then allclose returns
        True.::

         absolute(a - b) <= (atol + rtol * absolute(b))

        The above equation is not symmetric in `a` and `b`, so that
        ``allclose(a, b)`` might be different from ``allclose(b, a)`` in
        some rare cases.

        The default value of `atol` is not appropriate when the reference value
        `b` has magnitude smaller than one. For example, it is unlikely that
        ``a = 1e-9`` and ``b = 2e-9`` should be considered "close", yet
        ``allclose(1e-9, 2e-9)`` is ``True`` with default settings. Be sure
        to select `atol` for the use case at hand, especially for defining the
        threshold below which a non-zero value in `a` will be considered "close"
        to a very small or zero value in `b`.

        The comparison of `a` and `b` uses standard broadcasting, which
        means that `a` and `b` need not have the same shape in order for
        ``allclose(a, b)`` to evaluate to True.  The same is true for
        `equal` but not `array_equal`.

        `allclose` is not defined for non-numeric data types.
        `bool` is considered a numeric data-type for this purpose.

        Examples
        --------
        >>> import numpy as np
        >>> np.allclose([1e10,1e-7], [1.00001e10,1e-8])
        False

        >>> np.allclose([1e10,1e-8], [1.00001e10,1e-9])
        True

        >>> np.allclose([1e10,1e-8], [1.0001e10,1e-9])
        False

        >>> np.allclose([1.0, np.nan], [1.0, np.nan])
        False

        >>> np.allclose([1.0, np.nan], [1.0, np.nan], equal_nan=True)
        True

    amax(a, axis=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Return the maximum of an array or maximum along an axis.

        `amax` is an alias of `~numpy.max`.

        See Also
        --------
        max : alias of this function
        ndarray.max : equivalent method

    amin(a, axis=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Return the minimum of an array or minimum along an axis.

        `amin` is an alias of `~numpy.min`.

        See Also
        --------
        min : alias of this function
        ndarray.min : equivalent method

    angle(z, deg=False)
        Return the angle of the complex argument.

        Parameters
        ----------
        z : array_like
            A complex number or sequence of complex numbers.
        deg : bool, optional
            Return angle in degrees if True, radians if False (default).

        Returns
        -------
        angle : ndarray or scalar
            The counterclockwise angle from the positive real axis on the complex
            plane in the range ``(-pi, pi]``, with dtype as numpy.float64.

            .. versionchanged:: 1.16.0
                This function works on subclasses of ndarray like `ma.array`.

        See Also
        --------
        arctan2
        absolute

        Notes
        -----
        This function passes the imaginary and real parts of the argument to
        `arctan2` to compute the result; consequently, it follows the convention
        of `arctan2` when the magnitude of the argument is zero. See example.

        Examples
        --------
        >>> import numpy as np
        >>> np.angle([1.0, 1.0j, 1+1j])               # in radians
        array([ 0.        ,  1.57079633,  0.78539816]) # may vary
        >>> np.angle(1+1j, deg=True)                  # in degrees
        45.0
        >>> np.angle([0., -0., complex(0., -0.), complex(-0., -0.)])  # convention
        array([ 0.        ,  3.14159265, -0.        , -3.14159265])

    any(a, axis=None, out=None, keepdims=<no value>, *, where=<no value>)
        Test whether any array element along a given axis evaluates to True.

        Returns single boolean if `axis` is ``None``

        Parameters
        ----------
        a : array_like
            Input array or object that can be converted to an array.
        axis : None or int or tuple of ints, optional
            Axis or axes along which a logical OR reduction is performed.
            The default (``axis=None``) is to perform a logical OR over all
            the dimensions of the input array. `axis` may be negative, in
            which case it counts from the last to the first axis.

            .. versionadded:: 1.7.0

            If this is a tuple of ints, a reduction is performed on multiple
            axes, instead of a single axis or all the axes as before.
        out : ndarray, optional
            Alternate output array in which to place the result.  It must have
            the same shape as the expected output and its type is preserved
            (e.g., if it is of type float, then it will remain so, returning
            1.0 for True and 0.0 for False, regardless of the type of `a`).
            See :ref:`ufuncs-output-type` for more details.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the `any` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.

        where : array_like of bool, optional
            Elements to include in checking for any `True` values.
            See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.20.0

        Returns
        -------
        any : bool or ndarray
            A new boolean or `ndarray` is returned unless `out` is specified,
            in which case a reference to `out` is returned.

        See Also
        --------
        ndarray.any : equivalent method

        all : Test whether all elements along a given axis evaluate to True.

        Notes
        -----
        Not a Number (NaN), positive infinity and negative infinity evaluate
        to `True` because these are not equal to zero.

        .. versionchanged:: 2.0
           Before NumPy 2.0, ``any`` did not return booleans for object dtype
           input arrays.
           This behavior is still available via ``np.logical_or.reduce``.

        Examples
        --------
        >>> import numpy as np
        >>> np.any([[True, False], [True, True]])
        True

        >>> np.any([[True,  False, True ],
        ...         [False, False, False]], axis=0)
        array([ True, False, True])

        >>> np.any([-1, 0, 5])
        True

        >>> np.any([[np.nan], [np.inf]], axis=1, keepdims=True)
        array([[ True],
               [ True]])

        >>> np.any([[True, False], [False, False]], where=[[False], [True]])
        False

        >>> a = np.array([[1, 0, 0],
        ...               [0, 0, 1],
        ...               [0, 0, 0]])
        >>> np.any(a, axis=0)
        array([ True, False,  True])
        >>> np.any(a, axis=1)
        array([ True,  True, False])

        >>> o=np.array(False)
        >>> z=np.any([-1, 4, 5], out=o)
        >>> z, o
        (array(True), array(True))
        >>> # Check now that z is a reference to o
        >>> z is o
        True
        >>> id(z), id(o) # identity of z and o              # doctest: +SKIP
        (191614240, 191614240)

    append(arr, values, axis=None)
        Append values to the end of an array.

        Parameters
        ----------
        arr : array_like
            Values are appended to a copy of this array.
        values : array_like
            These values are appended to a copy of `arr`.  It must be of the
            correct shape (the same shape as `arr`, excluding `axis`).  If
            `axis` is not specified, `values` can be any shape and will be
            flattened before use.
        axis : int, optional
            The axis along which `values` are appended.  If `axis` is not
            given, both `arr` and `values` are flattened before use.

        Returns
        -------
        append : ndarray
            A copy of `arr` with `values` appended to `axis`.  Note that
            `append` does not occur in-place: a new array is allocated and
            filled.  If `axis` is None, `out` is a flattened array.

        See Also
        --------
        insert : Insert elements into an array.
        delete : Delete elements from an array.

        Examples
        --------
        >>> import numpy as np
        >>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]])
        array([1, 2, 3, ..., 7, 8, 9])

        When `axis` is specified, `values` must have the correct shape.

        >>> np.append([[1, 2, 3], [4, 5, 6]], [[7, 8, 9]], axis=0)
        array([[1, 2, 3],
               [4, 5, 6],
               [7, 8, 9]])

        >>> np.append([[1, 2, 3], [4, 5, 6]], [7, 8, 9], axis=0)
        Traceback (most recent call last):
            ...
        ValueError: all the input arrays must have same number of dimensions, but
        the array at index 0 has 2 dimension(s) and the array at index 1 has 1
        dimension(s)

        >>> a = np.array([1, 2], dtype=int)
        >>> c = np.append(a, [])
        >>> c
        array([1., 2.])
        >>> c.dtype
        float64

        Default dtype for empty ndarrays is `float64` thus making the output of dtype
        `float64` when appended with dtype `int64`

    apply_along_axis(func1d, axis, arr, *args, **kwargs)
        Apply a function to 1-D slices along the given axis.

        Execute `func1d(a, *args, **kwargs)` where `func1d` operates on 1-D arrays
        and `a` is a 1-D slice of `arr` along `axis`.

        This is equivalent to (but faster than) the following use of `ndindex` and
        `s_`, which sets each of ``ii``, ``jj``, and ``kk`` to a tuple of indices::

            Ni, Nk = a.shape[:axis], a.shape[axis+1:]
            for ii in ndindex(Ni):
                for kk in ndindex(Nk):
                    f = func1d(arr[ii + s_[:,] + kk])
                    Nj = f.shape
                    for jj in ndindex(Nj):
                        out[ii + jj + kk] = f[jj]

        Equivalently, eliminating the inner loop, this can be expressed as::

            Ni, Nk = a.shape[:axis], a.shape[axis+1:]
            for ii in ndindex(Ni):
                for kk in ndindex(Nk):
                    out[ii + s_[...,] + kk] = func1d(arr[ii + s_[:,] + kk])

        Parameters
        ----------
        func1d : function (M,) -> (Nj...)
            This function should accept 1-D arrays. It is applied to 1-D
            slices of `arr` along the specified axis.
        axis : integer
            Axis along which `arr` is sliced.
        arr : ndarray (Ni..., M, Nk...)
            Input array.
        args : any
            Additional arguments to `func1d`.
        kwargs : any
            Additional named arguments to `func1d`.

            .. versionadded:: 1.9.0


        Returns
        -------
        out : ndarray  (Ni..., Nj..., Nk...)
            The output array. The shape of `out` is identical to the shape of
            `arr`, except along the `axis` dimension. This axis is removed, and
            replaced with new dimensions equal to the shape of the return value
            of `func1d`. So if `func1d` returns a scalar `out` will have one
            fewer dimensions than `arr`.

        See Also
        --------
        apply_over_axes : Apply a function repeatedly over multiple axes.

        Examples
        --------
        >>> import numpy as np
        >>> def my_func(a):
        ...     """Average first and last element of a 1-D array"""
        ...     return (a[0] + a[-1]) * 0.5
        >>> b = np.array([[1,2,3], [4,5,6], [7,8,9]])
        >>> np.apply_along_axis(my_func, 0, b)
        array([4., 5., 6.])
        >>> np.apply_along_axis(my_func, 1, b)
        array([2.,  5.,  8.])

        For a function that returns a 1D array, the number of dimensions in
        `outarr` is the same as `arr`.

        >>> b = np.array([[8,1,7], [4,3,9], [5,2,6]])
        >>> np.apply_along_axis(sorted, 1, b)
        array([[1, 7, 8],
               [3, 4, 9],
               [2, 5, 6]])

        For a function that returns a higher dimensional array, those dimensions
        are inserted in place of the `axis` dimension.

        >>> b = np.array([[1,2,3], [4,5,6], [7,8,9]])
        >>> np.apply_along_axis(np.diag, -1, b)
        array([[[1, 0, 0],
                [0, 2, 0],
                [0, 0, 3]],
               [[4, 0, 0],
                [0, 5, 0],
                [0, 0, 6]],
               [[7, 0, 0],
                [0, 8, 0],
                [0, 0, 9]]])

    apply_over_axes(func, a, axes)
        Apply a function repeatedly over multiple axes.

        `func` is called as `res = func(a, axis)`, where `axis` is the first
        element of `axes`.  The result `res` of the function call must have
        either the same dimensions as `a` or one less dimension.  If `res`
        has one less dimension than `a`, a dimension is inserted before
        `axis`.  The call to `func` is then repeated for each axis in `axes`,
        with `res` as the first argument.

        Parameters
        ----------
        func : function
            This function must take two arguments, `func(a, axis)`.
        a : array_like
            Input array.
        axes : array_like
            Axes over which `func` is applied; the elements must be integers.

        Returns
        -------
        apply_over_axis : ndarray
            The output array.  The number of dimensions is the same as `a`,
            but the shape can be different.  This depends on whether `func`
            changes the shape of its output with respect to its input.

        See Also
        --------
        apply_along_axis :
            Apply a function to 1-D slices of an array along the given axis.

        Notes
        -----
        This function is equivalent to tuple axis arguments to reorderable ufuncs
        with keepdims=True. Tuple axis arguments to ufuncs have been available since
        version 1.7.0.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(24).reshape(2,3,4)
        >>> a
        array([[[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]],
               [[12, 13, 14, 15],
                [16, 17, 18, 19],
                [20, 21, 22, 23]]])

        Sum over axes 0 and 2. The result has same number of dimensions
        as the original array:

        >>> np.apply_over_axes(np.sum, a, [0,2])
        array([[[ 60],
                [ 92],
                [124]]])

        Tuple axis arguments to ufuncs are equivalent:

        >>> np.sum(a, axis=(0,2), keepdims=True)
        array([[[ 60],
                [ 92],
                [124]]])

    arange(...)
        arange([start,] stop[, step,], dtype=None, *, device=None, like=None)

        Return evenly spaced values within a given interval.

        ``arange`` can be called with a varying number of positional arguments:

        * ``arange(stop)``: Values are generated within the half-open interval
          ``[0, stop)`` (in other words, the interval including `start` but
          excluding `stop`).
        * ``arange(start, stop)``: Values are generated within the half-open
          interval ``[start, stop)``.
        * ``arange(start, stop, step)`` Values are generated within the half-open
          interval ``[start, stop)``, with spacing between values given by
          ``step``.

        For integer arguments the function is roughly equivalent to the Python
        built-in :py:class:`range`, but returns an ndarray rather than a ``range``
        instance.

        When using a non-integer step, such as 0.1, it is often better to use
        `numpy.linspace`.

        See the Warning sections below for more information.

        Parameters
        ----------
        start : integer or real, optional
            Start of interval.  The interval includes this value.  The default
            start value is 0.
        stop : integer or real
            End of interval.  The interval does not include this value, except
            in some cases where `step` is not an integer and floating point
            round-off affects the length of `out`.
        step : integer or real, optional
            Spacing between values.  For any output `out`, this is the distance
            between two adjacent values, ``out[i+1] - out[i]``.  The default
            step size is 1.  If `step` is specified as a position argument,
            `start` must also be given.
        dtype : dtype, optional
            The type of the output array.  If `dtype` is not given, infer the data
            type from the other input arguments.
        device : str, optional
            The device on which to place the created array. Default: ``None``.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        arange : ndarray
            Array of evenly spaced values.

            For floating point arguments, the length of the result is
            ``ceil((stop - start)/step)``.  Because of floating point overflow,
            this rule may result in the last element of `out` being greater
            than `stop`.

        Warnings
        --------
        The length of the output might not be numerically stable.

        Another stability issue is due to the internal implementation of
        `numpy.arange`.
        The actual step value used to populate the array is
        ``dtype(start + step) - dtype(start)`` and not `step`. Precision loss
        can occur here, due to casting or due to using floating points when
        `start` is much larger than `step`. This can lead to unexpected
        behaviour. For example::

          >>> np.arange(0, 5, 0.5, dtype=int)
          array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
          >>> np.arange(-3, 3, 0.5, dtype=int)
          array([-3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  8])

        In such cases, the use of `numpy.linspace` should be preferred.

        The built-in :py:class:`range` generates :std:doc:`Python built-in integers
        that have arbitrary size <python:c-api/long>`, while `numpy.arange`
        produces `numpy.int32` or `numpy.int64` numbers. This may result in
        incorrect results for large integer values::

          >>> power = 40
          >>> modulo = 10000
          >>> x1 = [(n ** power) % modulo for n in range(8)]
          >>> x2 = [(n ** power) % modulo for n in np.arange(8)]
          >>> print(x1)
          [0, 1, 7776, 8801, 6176, 625, 6576, 4001]  # correct
          >>> print(x2)
          [0, 1, 7776, 7185, 0, 5969, 4816, 3361]  # incorrect

        See Also
        --------
        numpy.linspace : Evenly spaced numbers with careful handling of endpoints.
        numpy.ogrid: Arrays of evenly spaced numbers in N-dimensions.
        numpy.mgrid: Grid-shaped arrays of evenly spaced numbers in N-dimensions.
        :ref:`how-to-partition`

        Examples
        --------
        >>> import numpy as np
        >>> np.arange(3)
        array([0, 1, 2])
        >>> np.arange(3.0)
        array([ 0.,  1.,  2.])
        >>> np.arange(3,7)
        array([3, 4, 5, 6])
        >>> np.arange(3,7,2)
        array([3, 5])

    argmax(a, axis=None, out=None, *, keepdims=<no value>)
        Returns the indices of the maximum values along an axis.

        Parameters
        ----------
        a : array_like
            Input array.
        axis : int, optional
            By default, the index is into the flattened array, otherwise
            along the specified axis.
        out : array, optional
            If provided, the result will be inserted into this array. It should
            be of the appropriate shape and dtype.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the array.

            .. versionadded:: 1.22.0

        Returns
        -------
        index_array : ndarray of ints
            Array of indices into the array. It has the same shape as ``a.shape``
            with the dimension along `axis` removed. If `keepdims` is set to True,
            then the size of `axis` will be 1 with the resulting array having same
            shape as ``a.shape``.

        See Also
        --------
        ndarray.argmax, argmin
        amax : The maximum value along a given axis.
        unravel_index : Convert a flat index into an index tuple.
        take_along_axis : Apply ``np.expand_dims(index_array, axis)``
                          from argmax to an array as if by calling max.

        Notes
        -----
        In case of multiple occurrences of the maximum values, the indices
        corresponding to the first occurrence are returned.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(6).reshape(2,3) + 10
        >>> a
        array([[10, 11, 12],
               [13, 14, 15]])
        >>> np.argmax(a)
        5
        >>> np.argmax(a, axis=0)
        array([1, 1, 1])
        >>> np.argmax(a, axis=1)
        array([2, 2])

        Indexes of the maximal elements of a N-dimensional array:

        >>> ind = np.unravel_index(np.argmax(a, axis=None), a.shape)
        >>> ind
        (1, 2)
        >>> a[ind]
        15

        >>> b = np.arange(6)
        >>> b[1] = 5
        >>> b
        array([0, 5, 2, 3, 4, 5])
        >>> np.argmax(b)  # Only the first occurrence is returned.
        1

        >>> x = np.array([[4,2,3], [1,0,3]])
        >>> index_array = np.argmax(x, axis=-1)
        >>> # Same as np.amax(x, axis=-1, keepdims=True)
        >>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1)
        array([[4],
               [3]])
        >>> # Same as np.amax(x, axis=-1)
        >>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1),
        ...     axis=-1).squeeze(axis=-1)
        array([4, 3])

        Setting `keepdims` to `True`,

        >>> x = np.arange(24).reshape((2, 3, 4))
        >>> res = np.argmax(x, axis=1, keepdims=True)
        >>> res.shape
        (2, 1, 4)

    argmin(a, axis=None, out=None, *, keepdims=<no value>)
        Returns the indices of the minimum values along an axis.

        Parameters
        ----------
        a : array_like
            Input array.
        axis : int, optional
            By default, the index is into the flattened array, otherwise
            along the specified axis.
        out : array, optional
            If provided, the result will be inserted into this array. It should
            be of the appropriate shape and dtype.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the array.

            .. versionadded:: 1.22.0

        Returns
        -------
        index_array : ndarray of ints
            Array of indices into the array. It has the same shape as `a.shape`
            with the dimension along `axis` removed. If `keepdims` is set to True,
            then the size of `axis` will be 1 with the resulting array having same
            shape as `a.shape`.

        See Also
        --------
        ndarray.argmin, argmax
        amin : The minimum value along a given axis.
        unravel_index : Convert a flat index into an index tuple.
        take_along_axis : Apply ``np.expand_dims(index_array, axis)``
                          from argmin to an array as if by calling min.

        Notes
        -----
        In case of multiple occurrences of the minimum values, the indices
        corresponding to the first occurrence are returned.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(6).reshape(2,3) + 10
        >>> a
        array([[10, 11, 12],
               [13, 14, 15]])
        >>> np.argmin(a)
        0
        >>> np.argmin(a, axis=0)
        array([0, 0, 0])
        >>> np.argmin(a, axis=1)
        array([0, 0])

        Indices of the minimum elements of a N-dimensional array:

        >>> ind = np.unravel_index(np.argmin(a, axis=None), a.shape)
        >>> ind
        (0, 0)
        >>> a[ind]
        10

        >>> b = np.arange(6) + 10
        >>> b[4] = 10
        >>> b
        array([10, 11, 12, 13, 10, 15])
        >>> np.argmin(b)  # Only the first occurrence is returned.
        0

        >>> x = np.array([[4,2,3], [1,0,3]])
        >>> index_array = np.argmin(x, axis=-1)
        >>> # Same as np.amin(x, axis=-1, keepdims=True)
        >>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1)
        array([[2],
               [0]])
        >>> # Same as np.amax(x, axis=-1)
        >>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1),
        ...     axis=-1).squeeze(axis=-1)
        array([2, 0])

        Setting `keepdims` to `True`,

        >>> x = np.arange(24).reshape((2, 3, 4))
        >>> res = np.argmin(x, axis=1, keepdims=True)
        >>> res.shape
        (2, 1, 4)

    argpartition(a, kth, axis=-1, kind='introselect', order=None)
        Perform an indirect partition along the given axis using the
        algorithm specified by the `kind` keyword. It returns an array of
        indices of the same shape as `a` that index data along the given
        axis in partitioned order.

        .. versionadded:: 1.8.0

        Parameters
        ----------
        a : array_like
            Array to sort.
        kth : int or sequence of ints
            Element index to partition by. The k-th element will be in its
            final sorted position and all smaller elements will be moved
            before it and all larger elements behind it. The order of all
            elements in the partitions is undefined. If provided with a
            sequence of k-th it will partition all of them into their sorted
            position at once.

            .. deprecated:: 1.22.0
                Passing booleans as index is deprecated.
        axis : int or None, optional
            Axis along which to sort. The default is -1 (the last axis). If
            None, the flattened array is used.
        kind : {'introselect'}, optional
            Selection algorithm. Default is 'introselect'
        order : str or list of str, optional
            When `a` is an array with fields defined, this argument
            specifies which fields to compare first, second, etc. A single
            field can be specified as a string, and not all fields need be
            specified, but unspecified fields will still be used, in the
            order in which they come up in the dtype, to break ties.

        Returns
        -------
        index_array : ndarray, int
            Array of indices that partition `a` along the specified axis.
            If `a` is one-dimensional, ``a[index_array]`` yields a partitioned `a`.
            More generally, ``np.take_along_axis(a, index_array, axis=axis)``
            always yields the partitioned `a`, irrespective of dimensionality.

        See Also
        --------
        partition : Describes partition algorithms used.
        ndarray.partition : Inplace partition.
        argsort : Full indirect sort.
        take_along_axis : Apply ``index_array`` from argpartition
                          to an array as if by calling partition.

        Notes
        -----
        The returned indices are not guaranteed to be sorted according to
        the values. Furthermore, the default selection algorithm ``introselect``
        is unstable, and hence the returned indices are not guaranteed
        to be the earliest/latest occurrence of the element.

        `argpartition` works for real/complex inputs with nan values,
        see `partition` for notes on the enhanced sort order and
        different selection algorithms.

        Examples
        --------
        One dimensional array:

        >>> import numpy as np
        >>> x = np.array([3, 4, 2, 1])
        >>> x[np.argpartition(x, 3)]
        array([2, 1, 3, 4]) # may vary
        >>> x[np.argpartition(x, (1, 3))]
        array([1, 2, 3, 4]) # may vary

        >>> x = [3, 4, 2, 1]
        >>> np.array(x)[np.argpartition(x, 3)]
        array([2, 1, 3, 4]) # may vary

        Multi-dimensional array:

        >>> x = np.array([[3, 4, 2], [1, 3, 1]])
        >>> index_array = np.argpartition(x, kth=1, axis=-1)
        >>> # below is the same as np.partition(x, kth=1)
        >>> np.take_along_axis(x, index_array, axis=-1)
        array([[2, 3, 4],
               [1, 1, 3]])

    argsort(a, axis=-1, kind=None, order=None, *, stable=None)
        Returns the indices that would sort an array.

        Perform an indirect sort along the given axis using the algorithm specified
        by the `kind` keyword. It returns an array of indices of the same shape as
        `a` that index data along the given axis in sorted order.

        Parameters
        ----------
        a : array_like
            Array to sort.
        axis : int or None, optional
            Axis along which to sort.  The default is -1 (the last axis). If None,
            the flattened array is used.
        kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional
            Sorting algorithm. The default is 'quicksort'. Note that both 'stable'
            and 'mergesort' use timsort under the covers and, in general, the
            actual implementation will vary with data type. The 'mergesort' option
            is retained for backwards compatibility.

            .. versionchanged:: 1.15.0.
               The 'stable' option was added.
        order : str or list of str, optional
            When `a` is an array with fields defined, this argument specifies
            which fields to compare first, second, etc.  A single field can
            be specified as a string, and not all fields need be specified,
            but unspecified fields will still be used, in the order in which
            they come up in the dtype, to break ties.
        stable : bool, optional
            Sort stability. If ``True``, the returned array will maintain
            the relative order of ``a`` values which compare as equal.
            If ``False`` or ``None``, this is not guaranteed. Internally,
            this option selects ``kind='stable'``. Default: ``None``.

            .. versionadded:: 2.0.0

        Returns
        -------
        index_array : ndarray, int
            Array of indices that sort `a` along the specified `axis`.
            If `a` is one-dimensional, ``a[index_array]`` yields a sorted `a`.
            More generally, ``np.take_along_axis(a, index_array, axis=axis)``
            always yields the sorted `a`, irrespective of dimensionality.

        See Also
        --------
        sort : Describes sorting algorithms used.
        lexsort : Indirect stable sort with multiple keys.
        ndarray.sort : Inplace sort.
        argpartition : Indirect partial sort.
        take_along_axis : Apply ``index_array`` from argsort
                          to an array as if by calling sort.

        Notes
        -----
        See `sort` for notes on the different sorting algorithms.

        As of NumPy 1.4.0 `argsort` works with real/complex arrays containing
        nan values. The enhanced sort order is documented in `sort`.

        Examples
        --------
        One dimensional array:

        >>> import numpy as np
        >>> x = np.array([3, 1, 2])
        >>> np.argsort(x)
        array([1, 2, 0])

        Two-dimensional array:

        >>> x = np.array([[0, 3], [2, 2]])
        >>> x
        array([[0, 3],
               [2, 2]])

        >>> ind = np.argsort(x, axis=0)  # sorts along first axis (down)
        >>> ind
        array([[0, 1],
               [1, 0]])
        >>> np.take_along_axis(x, ind, axis=0)  # same as np.sort(x, axis=0)
        array([[0, 2],
               [2, 3]])

        >>> ind = np.argsort(x, axis=1)  # sorts along last axis (across)
        >>> ind
        array([[0, 1],
               [0, 1]])
        >>> np.take_along_axis(x, ind, axis=1)  # same as np.sort(x, axis=1)
        array([[0, 3],
               [2, 2]])

        Indices of the sorted elements of a N-dimensional array:

        >>> ind = np.unravel_index(np.argsort(x, axis=None), x.shape)
        >>> ind
        (array([0, 1, 1, 0]), array([0, 0, 1, 1]))
        >>> x[ind]  # same as np.sort(x, axis=None)
        array([0, 2, 2, 3])

        Sorting with keys:

        >>> x = np.array([(1, 0), (0, 1)], dtype=[('x', '<i4'), ('y', '<i4')])
        >>> x
        array([(1, 0), (0, 1)],
              dtype=[('x', '<i4'), ('y', '<i4')])

        >>> np.argsort(x, order=('x','y'))
        array([1, 0])

        >>> np.argsort(x, order=('y','x'))
        array([0, 1])

    argwhere(a)
        Find the indices of array elements that are non-zero, grouped by element.

        Parameters
        ----------
        a : array_like
            Input data.

        Returns
        -------
        index_array : (N, a.ndim) ndarray
            Indices of elements that are non-zero. Indices are grouped by element.
            This array will have shape ``(N, a.ndim)`` where ``N`` is the number of
            non-zero items.

        See Also
        --------
        where, nonzero

        Notes
        -----
        ``np.argwhere(a)`` is almost the same as ``np.transpose(np.nonzero(a))``,
        but produces a result of the correct shape for a 0D array.

        The output of ``argwhere`` is not suitable for indexing arrays.
        For this purpose use ``nonzero(a)`` instead.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(6).reshape(2,3)
        >>> x
        array([[0, 1, 2],
               [3, 4, 5]])
        >>> np.argwhere(x>1)
        array([[0, 2],
               [1, 0],
               [1, 1],
               [1, 2]])

    around(a, decimals=0, out=None)
        Round an array to the given number of decimals.

        `around` is an alias of `~numpy.round`.

        See Also
        --------
        ndarray.round : equivalent method
        round : alias for this function
        ceil, fix, floor, rint, trunc

    array(...)
        array(object, dtype=None, *, copy=True, order='K', subok=False, ndmin=0,
              like=None)

        Create an array.

        Parameters
        ----------
        object : array_like
            An array, any object exposing the array interface, an object whose
            ``__array__`` method returns an array, or any (nested) sequence.
            If object is a scalar, a 0-dimensional array containing object is
            returned.
        dtype : data-type, optional
            The desired data-type for the array. If not given, NumPy will try to use
            a default ``dtype`` that can represent the values (by applying promotion
            rules when necessary.)
        copy : bool, optional
            If ``True`` (default), then the array data is copied. If ``None``,
            a copy will only be made if ``__array__`` returns a copy, if obj is
            a nested sequence, or if a copy is needed to satisfy any of the other
            requirements (``dtype``, ``order``, etc.). Note that any copy of
            the data is shallow, i.e., for arrays with object dtype, the new
            array will point to the same objects. See Examples for `ndarray.copy`.
            For ``False`` it raises a ``ValueError`` if a copy cannot be avoided.
            Default: ``True``.
        order : {'K', 'A', 'C', 'F'}, optional
            Specify the memory layout of the array. If object is not an array, the
            newly created array will be in C order (row major) unless 'F' is
            specified, in which case it will be in Fortran order (column major).
            If object is an array the following holds.

            ===== ========= ===================================================
            order  no copy                     copy=True
            ===== ========= ===================================================
            'K'   unchanged F & C order preserved, otherwise most similar order
            'A'   unchanged F order if input is F and not C, otherwise C order
            'C'   C order   C order
            'F'   F order   F order
            ===== ========= ===================================================

            When ``copy=None`` and a copy is made for other reasons, the result is
            the same as if ``copy=True``, with some exceptions for 'A', see the
            Notes section. The default order is 'K'.
        subok : bool, optional
            If True, then sub-classes will be passed-through, otherwise
            the returned array will be forced to be a base-class array (default).
        ndmin : int, optional
            Specifies the minimum number of dimensions that the resulting
            array should have.  Ones will be prepended to the shape as
            needed to meet this requirement.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            An array object satisfying the specified requirements.

        See Also
        --------
        empty_like : Return an empty array with shape and type of input.
        ones_like : Return an array of ones with shape and type of input.
        zeros_like : Return an array of zeros with shape and type of input.
        full_like : Return a new array with shape of input filled with value.
        empty : Return a new uninitialized array.
        ones : Return a new array setting values to one.
        zeros : Return a new array setting values to zero.
        full : Return a new array of given shape filled with value.
        copy: Return an array copy of the given object.


        Notes
        -----
        When order is 'A' and ``object`` is an array in neither 'C' nor 'F' order,
        and a copy is forced by a change in dtype, then the order of the result is
        not necessarily 'C' as expected. This is likely a bug.

        Examples
        --------
        >>> import numpy as np
        >>> np.array([1, 2, 3])
        array([1, 2, 3])

        Upcasting:

        >>> np.array([1, 2, 3.0])
        array([ 1.,  2.,  3.])

        More than one dimension:

        >>> np.array([[1, 2], [3, 4]])
        array([[1, 2],
               [3, 4]])

        Minimum dimensions 2:

        >>> np.array([1, 2, 3], ndmin=2)
        array([[1, 2, 3]])

        Type provided:

        >>> np.array([1, 2, 3], dtype=complex)
        array([ 1.+0.j,  2.+0.j,  3.+0.j])

        Data-type consisting of more than one element:

        >>> x = np.array([(1,2),(3,4)],dtype=[('a','<i4'),('b','<i4')])
        >>> x['a']
        array([1, 3])

        Creating an array from sub-classes:

        >>> np.array(np.asmatrix('1 2; 3 4'))
        array([[1, 2],
               [3, 4]])

        >>> np.array(np.asmatrix('1 2; 3 4'), subok=True)
        matrix([[1, 2],
                [3, 4]])

    array2string(a, max_line_width=None, precision=None, suppress_small=None, separator=' ', prefix='', style=<no value>, formatter=None, threshold=None, edgeitems=None, sign=None, floatmode=None, suffix='', *, legacy=None)
        Return a string representation of an array.

        Parameters
        ----------
        a : ndarray
            Input array.
        max_line_width : int, optional
            Inserts newlines if text is longer than `max_line_width`.
            Defaults to ``numpy.get_printoptions()['linewidth']``.
        precision : int or None, optional
            Floating point precision.
            Defaults to ``numpy.get_printoptions()['precision']``.
        suppress_small : bool, optional
            Represent numbers "very close" to zero as zero; default is False.
            Very close is defined by precision: if the precision is 8, e.g.,
            numbers smaller (in absolute value) than 5e-9 are represented as
            zero.
            Defaults to ``numpy.get_printoptions()['suppress']``.
        separator : str, optional
            Inserted between elements.
        prefix : str, optional
        suffix : str, optional
            The length of the prefix and suffix strings are used to respectively
            align and wrap the output. An array is typically printed as::

              prefix + array2string(a) + suffix

            The output is left-padded by the length of the prefix string, and
            wrapping is forced at the column ``max_line_width - len(suffix)``.
            It should be noted that the content of prefix and suffix strings are
            not included in the output.
        style : _NoValue, optional
            Has no effect, do not use.

            .. deprecated:: 1.14.0
        formatter : dict of callables, optional
            If not None, the keys should indicate the type(s) that the respective
            formatting function applies to.  Callables should return a string.
            Types that are not specified (by their corresponding keys) are handled
            by the default formatters.  Individual types for which a formatter
            can be set are:

            - 'bool'
            - 'int'
            - 'timedelta' : a `numpy.timedelta64`
            - 'datetime' : a `numpy.datetime64`
            - 'float'
            - 'longfloat' : 128-bit floats
            - 'complexfloat'
            - 'longcomplexfloat' : composed of two 128-bit floats
            - 'void' : type `numpy.void`
            - 'numpystr' : types `numpy.bytes_` and `numpy.str_`

            Other keys that can be used to set a group of types at once are:

            - 'all' : sets all types
            - 'int_kind' : sets 'int'
            - 'float_kind' : sets 'float' and 'longfloat'
            - 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat'
            - 'str_kind' : sets 'numpystr'
        threshold : int, optional
            Total number of array elements which trigger summarization
            rather than full repr.
            Defaults to ``numpy.get_printoptions()['threshold']``.
        edgeitems : int, optional
            Number of array items in summary at beginning and end of
            each dimension.
            Defaults to ``numpy.get_printoptions()['edgeitems']``.
        sign : string, either '-', '+', or ' ', optional
            Controls printing of the sign of floating-point types. If '+', always
            print the sign of positive values. If ' ', always prints a space
            (whitespace character) in the sign position of positive values.  If
            '-', omit the sign character of positive values.
            Defaults to ``numpy.get_printoptions()['sign']``.

            .. versionchanged:: 2.0
                 The sign parameter can now be an integer type, previously
                 types were floating-point types.

        floatmode : str, optional
            Controls the interpretation of the `precision` option for
            floating-point types.
            Defaults to ``numpy.get_printoptions()['floatmode']``.
            Can take the following values:

            - 'fixed': Always print exactly `precision` fractional digits,
              even if this would print more or fewer digits than
              necessary to specify the value uniquely.
            - 'unique': Print the minimum number of fractional digits necessary
              to represent each value uniquely. Different elements may
              have a different number of digits.  The value of the
              `precision` option is ignored.
            - 'maxprec': Print at most `precision` fractional digits, but if
              an element can be uniquely represented with fewer digits
              only print it with that many.
            - 'maxprec_equal': Print at most `precision` fractional digits,
              but if every element in the array can be uniquely
              represented with an equal number of fewer digits, use that
              many digits for all elements.
        legacy : string or `False`, optional
            If set to the string ``'1.13'`` enables 1.13 legacy printing mode. This
            approximates numpy 1.13 print output by including a space in the sign
            position of floats and different behavior for 0d arrays. If set to
            `False`, disables legacy mode. Unrecognized strings will be ignored
            with a warning for forward compatibility.

            .. versionadded:: 1.14.0

        Returns
        -------
        array_str : str
            String representation of the array.

        Raises
        ------
        TypeError
            if a callable in `formatter` does not return a string.

        See Also
        --------
        array_str, array_repr, set_printoptions, get_printoptions

        Notes
        -----
        If a formatter is specified for a certain type, the `precision` keyword is
        ignored for that type.

        This is a very flexible function; `array_repr` and `array_str` are using
        `array2string` internally so keywords with the same name should work
        identically in all three functions.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([1e-16,1,2,3])
        >>> np.array2string(x, precision=2, separator=',',
        ...                       suppress_small=True)
        '[0.,1.,2.,3.]'

        >>> x  = np.arange(3.)
        >>> np.array2string(x, formatter={'float_kind':lambda x: "%.2f" % x})
        '[0.00 1.00 2.00]'

        >>> x  = np.arange(3)
        >>> np.array2string(x, formatter={'int':lambda x: hex(x)})
        '[0x0 0x1 0x2]'

    array_equal(a1, a2, equal_nan=False)
        True if two arrays have the same shape and elements, False otherwise.

        Parameters
        ----------
        a1, a2 : array_like
            Input arrays.
        equal_nan : bool
            Whether to compare NaN's as equal. If the dtype of a1 and a2 is
            complex, values will be considered equal if either the real or the
            imaginary component of a given value is ``nan``.

            .. versionadded:: 1.19.0

        Returns
        -------
        b : bool
            Returns True if the arrays are equal.

        See Also
        --------
        allclose: Returns True if two arrays are element-wise equal within a
                  tolerance.
        array_equiv: Returns True if input arrays are shape consistent and all
                     elements equal.

        Examples
        --------
        >>> import numpy as np

        >>> np.array_equal([1, 2], [1, 2])
        True

        >>> np.array_equal(np.array([1, 2]), np.array([1, 2]))
        True

        >>> np.array_equal([1, 2], [1, 2, 3])
        False

        >>> np.array_equal([1, 2], [1, 4])
        False

        >>> a = np.array([1, np.nan])
        >>> np.array_equal(a, a)
        False

        >>> np.array_equal(a, a, equal_nan=True)
        True

        When ``equal_nan`` is True, complex values with nan components are
        considered equal if either the real *or* the imaginary components are nan.

        >>> a = np.array([1 + 1j])
        >>> b = a.copy()
        >>> a.real = np.nan
        >>> b.imag = np.nan
        >>> np.array_equal(a, b, equal_nan=True)
        True

    array_equiv(a1, a2)
        Returns True if input arrays are shape consistent and all elements equal.

        Shape consistent means they are either the same shape, or one input array
        can be broadcasted to create the same shape as the other one.

        Parameters
        ----------
        a1, a2 : array_like
            Input arrays.

        Returns
        -------
        out : bool
            True if equivalent, False otherwise.

        Examples
        --------
        >>> import numpy as np
        >>> np.array_equiv([1, 2], [1, 2])
        True
        >>> np.array_equiv([1, 2], [1, 3])
        False

        Showing the shape equivalence:

        >>> np.array_equiv([1, 2], [[1, 2], [1, 2]])
        True
        >>> np.array_equiv([1, 2], [[1, 2, 1, 2], [1, 2, 1, 2]])
        False

        >>> np.array_equiv([1, 2], [[1, 2], [1, 3]])
        False

    array_repr(arr, max_line_width=None, precision=None, suppress_small=None)
        Return the string representation of an array.

        Parameters
        ----------
        arr : ndarray
            Input array.
        max_line_width : int, optional
            Inserts newlines if text is longer than `max_line_width`.
            Defaults to ``numpy.get_printoptions()['linewidth']``.
        precision : int, optional
            Floating point precision.
            Defaults to ``numpy.get_printoptions()['precision']``.
        suppress_small : bool, optional
            Represent numbers "very close" to zero as zero; default is False.
            Very close is defined by precision: if the precision is 8, e.g.,
            numbers smaller (in absolute value) than 5e-9 are represented as
            zero.
            Defaults to ``numpy.get_printoptions()['suppress']``.

        Returns
        -------
        string : str
          The string representation of an array.

        See Also
        --------
        array_str, array2string, set_printoptions

        Examples
        --------
        >>> import numpy as np
        >>> np.array_repr(np.array([1,2]))
        'array([1, 2])'
        >>> np.array_repr(np.ma.array([0.]))
        'MaskedArray([0.])'
        >>> np.array_repr(np.array([], np.int32))
        'array([], dtype=int32)'

        >>> x = np.array([1e-6, 4e-7, 2, 3])
        >>> np.array_repr(x, precision=6, suppress_small=True)
        'array([0.000001,  0.      ,  2.      ,  3.      ])'

    array_split(ary, indices_or_sections, axis=0)
        Split an array into multiple sub-arrays.

        Please refer to the ``split`` documentation.  The only difference
        between these functions is that ``array_split`` allows
        `indices_or_sections` to be an integer that does *not* equally
        divide the axis. For an array of length l that should be split
        into n sections, it returns l % n sub-arrays of size l//n + 1
        and the rest of size l//n.

        See Also
        --------
        split : Split array into multiple sub-arrays of equal size.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(8.0)
        >>> np.array_split(x, 3)
        [array([0.,  1.,  2.]), array([3.,  4.,  5.]), array([6.,  7.])]

        >>> x = np.arange(9)
        >>> np.array_split(x, 4)
        [array([0, 1, 2]), array([3, 4]), array([5, 6]), array([7, 8])]

    array_str(a, max_line_width=None, precision=None, suppress_small=None)
        Return a string representation of the data in an array.

        The data in the array is returned as a single string.  This function is
        similar to `array_repr`, the difference being that `array_repr` also
        returns information on the kind of array and its data type.

        Parameters
        ----------
        a : ndarray
            Input array.
        max_line_width : int, optional
            Inserts newlines if text is longer than `max_line_width`.
            Defaults to ``numpy.get_printoptions()['linewidth']``.
        precision : int, optional
            Floating point precision.
            Defaults to ``numpy.get_printoptions()['precision']``.
        suppress_small : bool, optional
            Represent numbers "very close" to zero as zero; default is False.
            Very close is defined by precision: if the precision is 8, e.g.,
            numbers smaller (in absolute value) than 5e-9 are represented as
            zero.
            Defaults to ``numpy.get_printoptions()['suppress']``.

        See Also
        --------
        array2string, array_repr, set_printoptions

        Examples
        --------
        >>> import numpy as np
        >>> np.array_str(np.arange(3))
        '[0 1 2]'

    asanyarray(...)
        asanyarray(a, dtype=None, order=None, *, like=None)

        Convert the input to an ndarray, but pass ndarray subclasses through.

        Parameters
        ----------
        a : array_like
            Input data, in any form that can be converted to an array.  This
            includes scalars, lists, lists of tuples, tuples, tuples of tuples,
            tuples of lists, and ndarrays.
        dtype : data-type, optional
            By default, the data-type is inferred from the input data.
        order : {'C', 'F', 'A', 'K'}, optional
            Memory layout.  'A' and 'K' depend on the order of input array a.
            'C' row-major (C-style),
            'F' column-major (Fortran-style) memory representation.
            'A' (any) means 'F' if `a` is Fortran contiguous, 'C' otherwise
            'K' (keep) preserve input order
            Defaults to 'C'.
        device : str, optional
            The device on which to place the created array. Default: ``None``.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.1.0

        copy : bool, optional
            If ``True``, then the object is copied. If ``None`` then the object is
            copied only if needed, i.e. if ``__array__`` returns a copy, if obj
            is a nested sequence, or if a copy is needed to satisfy any of
            the other requirements (``dtype``, ``order``, etc.).
            For ``False`` it raises a ``ValueError`` if a copy cannot be avoided.
            Default: ``None``.

            .. versionadded:: 2.1.0

        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray or an ndarray subclass
            Array interpretation of `a`.  If `a` is an ndarray or a subclass
            of ndarray, it is returned as-is and no copy is performed.

        See Also
        --------
        asarray : Similar function which always returns ndarrays.
        ascontiguousarray : Convert input to a contiguous array.
        asfortranarray : Convert input to an ndarray with column-major
                         memory order.
        asarray_chkfinite : Similar function which checks input for NaNs and
                            Infs.
        fromiter : Create an array from an iterator.
        fromfunction : Construct an array by executing a function on grid
                       positions.

        Examples
        --------
        Convert a list into an array:

        >>> a = [1, 2]
        >>> import numpy as np
        >>> np.asanyarray(a)
        array([1, 2])

        Instances of `ndarray` subclasses are passed through as-is:

        >>> a = np.array([(1., 2), (3., 4)], dtype='f4,i4').view(np.recarray)
        >>> np.asanyarray(a) is a
        True

    asarray(...)
        asarray(a, dtype=None, order=None, *, device=None, copy=None, like=None)

        Convert the input to an array.

        Parameters
        ----------
        a : array_like
            Input data, in any form that can be converted to an array.  This
            includes lists, lists of tuples, tuples, tuples of tuples, tuples
            of lists and ndarrays.
        dtype : data-type, optional
            By default, the data-type is inferred from the input data.
        order : {'C', 'F', 'A', 'K'}, optional
            Memory layout.  'A' and 'K' depend on the order of input array a.
            'C' row-major (C-style),
            'F' column-major (Fortran-style) memory representation.
            'A' (any) means 'F' if `a` is Fortran contiguous, 'C' otherwise
            'K' (keep) preserve input order
            Defaults to 'K'.
        device : str, optional
            The device on which to place the created array. Default: ``None``.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0
        copy : bool, optional
            If ``True``, then the object is copied. If ``None`` then the object is
            copied only if needed, i.e. if ``__array__`` returns a copy, if obj
            is a nested sequence, or if a copy is needed to satisfy any of
            the other requirements (``dtype``, ``order``, etc.).
            For ``False`` it raises a ``ValueError`` if a copy cannot be avoided.
            Default: ``None``.

            .. versionadded:: 2.0.0
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            Array interpretation of ``a``.  No copy is performed if the input
            is already an ndarray with matching dtype and order.  If ``a`` is a
            subclass of ndarray, a base class ndarray is returned.

        See Also
        --------
        asanyarray : Similar function which passes through subclasses.
        ascontiguousarray : Convert input to a contiguous array.
        asfortranarray : Convert input to an ndarray with column-major
                         memory order.
        asarray_chkfinite : Similar function which checks input for NaNs and Infs.
        fromiter : Create an array from an iterator.
        fromfunction : Construct an array by executing a function on grid
                       positions.

        Examples
        --------
        Convert a list into an array:

        >>> a = [1, 2]
        >>> import numpy as np
        >>> np.asarray(a)
        array([1, 2])

        Existing arrays are not copied:

        >>> a = np.array([1, 2])
        >>> np.asarray(a) is a
        True

        If `dtype` is set, array is copied only if dtype does not match:

        >>> a = np.array([1, 2], dtype=np.float32)
        >>> np.shares_memory(np.asarray(a, dtype=np.float32), a)
        True
        >>> np.shares_memory(np.asarray(a, dtype=np.float64), a)
        False

        Contrary to `asanyarray`, ndarray subclasses are not passed through:

        >>> issubclass(np.recarray, np.ndarray)
        True
        >>> a = np.array([(1., 2), (3., 4)], dtype='f4,i4').view(np.recarray)
        >>> np.asarray(a) is a
        False
        >>> np.asanyarray(a) is a
        True

    asarray_chkfinite(a, dtype=None, order=None)
        Convert the input to an array, checking for NaNs or Infs.

        Parameters
        ----------
        a : array_like
            Input data, in any form that can be converted to an array.  This
            includes lists, lists of tuples, tuples, tuples of tuples, tuples
            of lists and ndarrays.  Success requires no NaNs or Infs.
        dtype : data-type, optional
            By default, the data-type is inferred from the input data.
        order : {'C', 'F', 'A', 'K'}, optional
            Memory layout.  'A' and 'K' depend on the order of input array a.
            'C' row-major (C-style),
            'F' column-major (Fortran-style) memory representation.
            'A' (any) means 'F' if `a` is Fortran contiguous, 'C' otherwise
            'K' (keep) preserve input order
            Defaults to 'C'.

        Returns
        -------
        out : ndarray
            Array interpretation of `a`.  No copy is performed if the input
            is already an ndarray.  If `a` is a subclass of ndarray, a base
            class ndarray is returned.

        Raises
        ------
        ValueError
            Raises ValueError if `a` contains NaN (Not a Number) or Inf (Infinity).

        See Also
        --------
        asarray : Create and array.
        asanyarray : Similar function which passes through subclasses.
        ascontiguousarray : Convert input to a contiguous array.
        asfortranarray : Convert input to an ndarray with column-major
                         memory order.
        fromiter : Create an array from an iterator.
        fromfunction : Construct an array by executing a function on grid
                       positions.

        Examples
        --------
        >>> import numpy as np

        Convert a list into an array. If all elements are finite, then
        ``asarray_chkfinite`` is identical to ``asarray``.

        >>> a = [1, 2]
        >>> np.asarray_chkfinite(a, dtype=float)
        array([1., 2.])

        Raises ValueError if array_like contains Nans or Infs.

        >>> a = [1, 2, np.inf]
        >>> try:
        ...     np.asarray_chkfinite(a)
        ... except ValueError:
        ...     print('ValueError')
        ...
        ValueError

    ascontiguousarray(...)
        ascontiguousarray(a, dtype=None, *, like=None)

        Return a contiguous array (ndim >= 1) in memory (C order).

        Parameters
        ----------
        a : array_like
            Input array.
        dtype : str or dtype object, optional
            Data-type of returned array.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            Contiguous array of same shape and content as `a`, with type `dtype`
            if specified.

        See Also
        --------
        asfortranarray : Convert input to an ndarray with column-major
                         memory order.
        require : Return an ndarray that satisfies requirements.
        ndarray.flags : Information about the memory layout of the array.

        Examples
        --------
        Starting with a Fortran-contiguous array:

        >>> import numpy as np
        >>> x = np.ones((2, 3), order='F')
        >>> x.flags['F_CONTIGUOUS']
        True

        Calling ``ascontiguousarray`` makes a C-contiguous copy:

        >>> y = np.ascontiguousarray(x)
        >>> y.flags['C_CONTIGUOUS']
        True
        >>> np.may_share_memory(x, y)
        False

        Now, starting with a C-contiguous array:

        >>> x = np.ones((2, 3), order='C')
        >>> x.flags['C_CONTIGUOUS']
        True

        Then, calling ``ascontiguousarray`` returns the same object:

        >>> y = np.ascontiguousarray(x)
        >>> x is y
        True

        Note: This function returns an array with at least one-dimension (1-d)
        so it will not preserve 0-d arrays.

    asfortranarray(...)
        asfortranarray(a, dtype=None, *, like=None)

        Return an array (ndim >= 1) laid out in Fortran order in memory.

        Parameters
        ----------
        a : array_like
            Input array.
        dtype : str or dtype object, optional
            By default, the data-type is inferred from the input data.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            The input `a` in Fortran, or column-major, order.

        See Also
        --------
        ascontiguousarray : Convert input to a contiguous (C order) array.
        asanyarray : Convert input to an ndarray with either row or
            column-major memory order.
        require : Return an ndarray that satisfies requirements.
        ndarray.flags : Information about the memory layout of the array.

        Examples
        --------
        Starting with a C-contiguous array:

        >>> import numpy as np
        >>> x = np.ones((2, 3), order='C')
        >>> x.flags['C_CONTIGUOUS']
        True

        Calling ``asfortranarray`` makes a Fortran-contiguous copy:

        >>> y = np.asfortranarray(x)
        >>> y.flags['F_CONTIGUOUS']
        True
        >>> np.may_share_memory(x, y)
        False

        Now, starting with a Fortran-contiguous array:

        >>> x = np.ones((2, 3), order='F')
        >>> x.flags['F_CONTIGUOUS']
        True

        Then, calling ``asfortranarray`` returns the same object:

        >>> y = np.asfortranarray(x)
        >>> x is y
        True

        Note: This function returns an array with at least one-dimension (1-d)
        so it will not preserve 0-d arrays.

    asmatrix(data, dtype=None)
        Interpret the input as a matrix.

        Unlike `matrix`, `asmatrix` does not make a copy if the input is already
        a matrix or an ndarray.  Equivalent to ``matrix(data, copy=False)``.

        Parameters
        ----------
        data : array_like
            Input data.
        dtype : data-type
           Data-type of the output matrix.

        Returns
        -------
        mat : matrix
            `data` interpreted as a matrix.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([[1, 2], [3, 4]])

        >>> m = np.asmatrix(x)

        >>> x[0,0] = 5

        >>> m
        matrix([[5, 2],
                [3, 4]])

    astype(x, dtype, /, *, copy=True, device=None)
        Copies an array to a specified data type.

        This function is an Array API compatible alternative to
        `numpy.ndarray.astype`.

        Parameters
        ----------
        x : ndarray
            Input NumPy array to cast. ``array_likes`` are explicitly not
            supported here.
        dtype : dtype
            Data type of the result.
        copy : bool, optional
            Specifies whether to copy an array when the specified dtype matches
            the data type of the input array ``x``. If ``True``, a newly allocated
            array must always be returned. If ``False`` and the specified dtype
            matches the data type of the input array, the input array must be
            returned; otherwise, a newly allocated array must be returned.
            Defaults to ``True``.
        device : str, optional
            The device on which to place the returned array. Default: None.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.1.0

        Returns
        -------
        out : ndarray
            An array having the specified data type.

        See Also
        --------
        ndarray.astype

        Examples
        --------
        >>> import numpy as np
        >>> arr = np.array([1, 2, 3]); arr
        array([1, 2, 3])
        >>> np.astype(arr, np.float64)
        array([1., 2., 3.])

        Non-copy case:

        >>> arr = np.array([1, 2, 3])
        >>> arr_noncpy = np.astype(arr, arr.dtype, copy=False)
        >>> np.shares_memory(arr, arr_noncpy)
        True

    atleast_1d(*arys)
        Convert inputs to arrays with at least one dimension.

        Scalar inputs are converted to 1-dimensional arrays, whilst
        higher-dimensional inputs are preserved.

        Parameters
        ----------
        arys1, arys2, ... : array_like
            One or more input arrays.

        Returns
        -------
        ret : ndarray
            An array, or tuple of arrays, each with ``a.ndim >= 1``.
            Copies are made only if necessary.

        See Also
        --------
        atleast_2d, atleast_3d

        Examples
        --------
        >>> import numpy as np
        >>> np.atleast_1d(1.0)
        array([1.])

        >>> x = np.arange(9.0).reshape(3,3)
        >>> np.atleast_1d(x)
        array([[0., 1., 2.],
               [3., 4., 5.],
               [6., 7., 8.]])
        >>> np.atleast_1d(x) is x
        True

        >>> np.atleast_1d(1, [3, 4])
        (array([1]), array([3, 4]))

    atleast_2d(*arys)
        View inputs as arrays with at least two dimensions.

        Parameters
        ----------
        arys1, arys2, ... : array_like
            One or more array-like sequences.  Non-array inputs are converted
            to arrays.  Arrays that already have two or more dimensions are
            preserved.

        Returns
        -------
        res, res2, ... : ndarray
            An array, or tuple of arrays, each with ``a.ndim >= 2``.
            Copies are avoided where possible, and views with two or more
            dimensions are returned.

        See Also
        --------
        atleast_1d, atleast_3d

        Examples
        --------
        >>> import numpy as np
        >>> np.atleast_2d(3.0)
        array([[3.]])

        >>> x = np.arange(3.0)
        >>> np.atleast_2d(x)
        array([[0., 1., 2.]])
        >>> np.atleast_2d(x).base is x
        True

        >>> np.atleast_2d(1, [1, 2], [[1, 2]])
        (array([[1]]), array([[1, 2]]), array([[1, 2]]))

    atleast_3d(*arys)
        View inputs as arrays with at least three dimensions.

        Parameters
        ----------
        arys1, arys2, ... : array_like
            One or more array-like sequences.  Non-array inputs are converted to
            arrays.  Arrays that already have three or more dimensions are
            preserved.

        Returns
        -------
        res1, res2, ... : ndarray
            An array, or tuple of arrays, each with ``a.ndim >= 3``.  Copies are
            avoided where possible, and views with three or more dimensions are
            returned.  For example, a 1-D array of shape ``(N,)`` becomes a view
            of shape ``(1, N, 1)``, and a 2-D array of shape ``(M, N)`` becomes a
            view of shape ``(M, N, 1)``.

        See Also
        --------
        atleast_1d, atleast_2d

        Examples
        --------
        >>> import numpy as np
        >>> np.atleast_3d(3.0)
        array([[[3.]]])

        >>> x = np.arange(3.0)
        >>> np.atleast_3d(x).shape
        (1, 3, 1)

        >>> x = np.arange(12.0).reshape(4,3)
        >>> np.atleast_3d(x).shape
        (4, 3, 1)
        >>> np.atleast_3d(x).base is x.base  # x is a reshape, so not base itself
        True

        >>> for arr in np.atleast_3d([1, 2], [[1, 2]], [[[1, 2]]]):
        ...     print(arr, arr.shape) # doctest: +SKIP
        ...
        [[[1]
          [2]]] (1, 2, 1)
        [[[1]
          [2]]] (1, 2, 1)
        [[[1 2]]] (1, 1, 2)

    average(a, axis=None, weights=None, returned=False, *, keepdims=<no value>)
        Compute the weighted average along the specified axis.

        Parameters
        ----------
        a : array_like
            Array containing data to be averaged. If `a` is not an array, a
            conversion is attempted.
        axis : None or int or tuple of ints, optional
            Axis or axes along which to average `a`.  The default,
            `axis=None`, will average over all of the elements of the input array.
            If axis is negative it counts from the last to the first axis.

            .. versionadded:: 1.7.0

            If axis is a tuple of ints, averaging is performed on all of the axes
            specified in the tuple instead of a single axis or all the axes as
            before.
        weights : array_like, optional
            An array of weights associated with the values in `a`. Each value in
            `a` contributes to the average according to its associated weight.
            The array of weights must be the same shape as `a` if no axis is
            specified, otherwise the weights must have dimensions and shape
            consistent with `a` along the specified axis.
            If `weights=None`, then all data in `a` are assumed to have a
            weight equal to one.
            The calculation is::

                avg = sum(a * weights) / sum(weights)

            where the sum is over all included elements.
            The only constraint on the values of `weights` is that `sum(weights)`
            must not be 0.
        returned : bool, optional
            Default is `False`. If `True`, the tuple (`average`, `sum_of_weights`)
            is returned, otherwise only the average is returned.
            If `weights=None`, `sum_of_weights` is equivalent to the number of
            elements over which the average is taken.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the original `a`.
            *Note:* `keepdims` will not work with instances of `numpy.matrix`
            or other classes whose methods do not support `keepdims`.

            .. versionadded:: 1.23.0

        Returns
        -------
        retval, [sum_of_weights] : array_type or double
            Return the average along the specified axis. When `returned` is `True`,
            return a tuple with the average as the first element and the sum
            of the weights as the second element. `sum_of_weights` is of the
            same type as `retval`. The result dtype follows a general pattern.
            If `weights` is None, the result dtype will be that of `a` , or ``float64``
            if `a` is integral. Otherwise, if `weights` is not None and `a` is non-
            integral, the result type will be the type of lowest precision capable of
            representing values of both `a` and `weights`. If `a` happens to be
            integral, the previous rules still applies but the result dtype will
            at least be ``float64``.

        Raises
        ------
        ZeroDivisionError
            When all weights along axis are zero. See `numpy.ma.average` for a
            version robust to this type of error.
        TypeError
            When `weights` does not have the same shape as `a`, and `axis=None`.
        ValueError
            When `weights` does not have dimensions and shape consistent with `a`
            along specified `axis`.

        See Also
        --------
        mean

        ma.average : average for masked arrays -- useful if your data contains
                     "missing" values
        numpy.result_type : Returns the type that results from applying the
                            numpy type promotion rules to the arguments.

        Examples
        --------
        >>> import numpy as np
        >>> data = np.arange(1, 5)
        >>> data
        array([1, 2, 3, 4])
        >>> np.average(data)
        2.5
        >>> np.average(np.arange(1, 11), weights=np.arange(10, 0, -1))
        4.0

        >>> data = np.arange(6).reshape((3, 2))
        >>> data
        array([[0, 1],
               [2, 3],
               [4, 5]])
        >>> np.average(data, axis=1, weights=[1./4, 3./4])
        array([0.75, 2.75, 4.75])
        >>> np.average(data, weights=[1./4, 3./4])
        Traceback (most recent call last):
            ...
        TypeError: Axis must be specified when shapes of a and weights differ.

        With ``keepdims=True``, the following result has shape (3, 1).

        >>> np.average(data, axis=1, keepdims=True)
        array([[0.5],
               [2.5],
               [4.5]])

        >>> data = np.arange(8).reshape((2, 2, 2))
        >>> data
        array([[[0, 1],
                [2, 3]],
               [[4, 5],
                [6, 7]]])
        >>> np.average(data, axis=(0, 1), weights=[[1./4, 3./4], [1., 1./2]])
        array([3.4, 4.4])
        >>> np.average(data, axis=0, weights=[[1./4, 3./4], [1., 1./2]])
        Traceback (most recent call last):
            ...
        ValueError: Shape of weights must be consistent
        with shape of a along specified axis.

    bartlett(M)
        Return the Bartlett window.

        The Bartlett window is very similar to a triangular window, except
        that the end points are at zero.  It is often used in signal
        processing for tapering a signal, without generating too much
        ripple in the frequency domain.

        Parameters
        ----------
        M : int
            Number of points in the output window. If zero or less, an
            empty array is returned.

        Returns
        -------
        out : array
            The triangular window, with the maximum value normalized to one
            (the value one appears only if the number of samples is odd), with
            the first and last samples equal to zero.

        See Also
        --------
        blackman, hamming, hanning, kaiser

        Notes
        -----
        The Bartlett window is defined as

        .. math:: w(n) = \frac{2}{M-1} \left(
                  \frac{M-1}{2} - \left|n - \frac{M-1}{2}\right|
                  \right)

        Most references to the Bartlett window come from the signal processing
        literature, where it is used as one of many windowing functions for
        smoothing values.  Note that convolution with this window produces linear
        interpolation.  It is also known as an apodization (which means "removing
        the foot", i.e. smoothing discontinuities at the beginning and end of the
        sampled signal) or tapering function. The Fourier transform of the
        Bartlett window is the product of two sinc functions. Note the excellent
        discussion in Kanasewich [2]_.

        References
        ----------
        .. [1] M.S. Bartlett, "Periodogram Analysis and Continuous Spectra",
               Biometrika 37, 1-16, 1950.
        .. [2] E.R. Kanasewich, "Time Sequence Analysis in Geophysics",
               The University of Alberta Press, 1975, pp. 109-110.
        .. [3] A.V. Oppenheim and R.W. Schafer, "Discrete-Time Signal
               Processing", Prentice-Hall, 1999, pp. 468-471.
        .. [4] Wikipedia, "Window function",
               https://en.wikipedia.org/wiki/Window_function
        .. [5] W.H. Press,  B.P. Flannery, S.A. Teukolsky, and W.T. Vetterling,
               "Numerical Recipes", Cambridge University Press, 1986, page 429.

        Examples
        --------
        >>> import numpy as np
        >>> import matplotlib.pyplot as plt
        >>> np.bartlett(12)
        array([ 0.        ,  0.18181818,  0.36363636,  0.54545455,  0.72727273, # may vary
                0.90909091,  0.90909091,  0.72727273,  0.54545455,  0.36363636,
                0.18181818,  0.        ])

        Plot the window and its frequency response (requires SciPy and matplotlib).

        .. plot::
            :include-source:

            import matplotlib.pyplot as plt
            from numpy.fft import fft, fftshift
            window = np.bartlett(51)
            plt.plot(window)
            plt.title("Bartlett window")
            plt.ylabel("Amplitude")
            plt.xlabel("Sample")
            plt.show()
            plt.figure()
            A = fft(window, 2048) / 25.5
            mag = np.abs(fftshift(A))
            freq = np.linspace(-0.5, 0.5, len(A))
            with np.errstate(divide='ignore', invalid='ignore'):
                response = 20 * np.log10(mag)
            response = np.clip(response, -100, 100)
            plt.plot(freq, response)
            plt.title("Frequency response of Bartlett window")
            plt.ylabel("Magnitude [dB]")
            plt.xlabel("Normalized frequency [cycles per sample]")
            plt.axis('tight')
            plt.show()

    base_repr(number, base=2, padding=0)
        Return a string representation of a number in the given base system.

        Parameters
        ----------
        number : int
            The value to convert. Positive and negative values are handled.
        base : int, optional
            Convert `number` to the `base` number system. The valid range is 2-36,
            the default value is 2.
        padding : int, optional
            Number of zeros padded on the left. Default is 0 (no padding).

        Returns
        -------
        out : str
            String representation of `number` in `base` system.

        See Also
        --------
        binary_repr : Faster version of `base_repr` for base 2.

        Examples
        --------
        >>> import numpy as np
        >>> np.base_repr(5)
        '101'
        >>> np.base_repr(6, 5)
        '11'
        >>> np.base_repr(7, base=5, padding=3)
        '00012'

        >>> np.base_repr(10, base=16)
        'A'
        >>> np.base_repr(32, base=16)
        '20'

    binary_repr(num, width=None)
        Return the binary representation of the input number as a string.

        For negative numbers, if width is not given, a minus sign is added to the
        front. If width is given, the two's complement of the number is
        returned, with respect to that width.

        In a two's-complement system negative numbers are represented by the two's
        complement of the absolute value. This is the most common method of
        representing signed integers on computers [1]_. A N-bit two's-complement
        system can represent every integer in the range
        :math:`-2^{N-1}` to :math:`+2^{N-1}-1`.

        Parameters
        ----------
        num : int
            Only an integer decimal number can be used.
        width : int, optional
            The length of the returned string if `num` is positive, or the length
            of the two's complement if `num` is negative, provided that `width` is
            at least a sufficient number of bits for `num` to be represented in
            the designated form. If the `width` value is insufficient, an error is
            raised.

        Returns
        -------
        bin : str
            Binary representation of `num` or two's complement of `num`.

        See Also
        --------
        base_repr: Return a string representation of a number in the given base
                   system.
        bin: Python's built-in binary representation generator of an integer.

        Notes
        -----
        `binary_repr` is equivalent to using `base_repr` with base 2, but about 25x
        faster.

        References
        ----------
        .. [1] Wikipedia, "Two's complement",
            https://en.wikipedia.org/wiki/Two's_complement

        Examples
        --------
        >>> import numpy as np
        >>> np.binary_repr(3)
        '11'
        >>> np.binary_repr(-3)
        '-11'
        >>> np.binary_repr(3, width=4)
        '0011'

        The two's complement is returned when the input number is negative and
        width is specified:

        >>> np.binary_repr(-3, width=3)
        '101'
        >>> np.binary_repr(-3, width=5)
        '11101'

    bincount(...)
        bincount(x, /, weights=None, minlength=0)

        Count number of occurrences of each value in array of non-negative ints.

        The number of bins (of size 1) is one larger than the largest value in
        `x`. If `minlength` is specified, there will be at least this number
        of bins in the output array (though it will be longer if necessary,
        depending on the contents of `x`).
        Each bin gives the number of occurrences of its index value in `x`.
        If `weights` is specified the input array is weighted by it, i.e. if a
        value ``n`` is found at position ``i``, ``out[n] += weight[i]`` instead
        of ``out[n] += 1``.

        Parameters
        ----------
        x : array_like, 1 dimension, nonnegative ints
            Input array.
        weights : array_like, optional
            Weights, array of the same shape as `x`.
        minlength : int, optional
            A minimum number of bins for the output array.

            .. versionadded:: 1.6.0

        Returns
        -------
        out : ndarray of ints
            The result of binning the input array.
            The length of `out` is equal to ``np.amax(x)+1``.

        Raises
        ------
        ValueError
            If the input is not 1-dimensional, or contains elements with negative
            values, or if `minlength` is negative.
        TypeError
            If the type of the input is float or complex.

        See Also
        --------
        histogram, digitize, unique

        Examples
        --------
        >>> import numpy as np
        >>> np.bincount(np.arange(5))
        array([1, 1, 1, 1, 1])
        >>> np.bincount(np.array([0, 1, 1, 3, 2, 1, 7]))
        array([1, 3, 1, 1, 0, 0, 0, 1])

        >>> x = np.array([0, 1, 1, 3, 2, 1, 7, 23])
        >>> np.bincount(x).size == np.amax(x)+1
        True

        The input array needs to be of integer dtype, otherwise a
        TypeError is raised:

        >>> np.bincount(np.arange(5, dtype=float))
        Traceback (most recent call last):
          ...
        TypeError: Cannot cast array data from dtype('float64') to dtype('int64')
        according to the rule 'safe'

        A possible use of ``bincount`` is to perform sums over
        variable-size chunks of an array, using the ``weights`` keyword.

        >>> w = np.array([0.3, 0.5, 0.2, 0.7, 1., -0.6]) # weights
        >>> x = np.array([0, 1, 1, 2, 2, 2])
        >>> np.bincount(x,  weights=w)
        array([ 0.3,  0.7,  1.1])

    blackman(M)
        Return the Blackman window.

        The Blackman window is a taper formed by using the first three
        terms of a summation of cosines. It was designed to have close to the
        minimal leakage possible.  It is close to optimal, only slightly worse
        than a Kaiser window.

        Parameters
        ----------
        M : int
            Number of points in the output window. If zero or less, an empty
            array is returned.

        Returns
        -------
        out : ndarray
            The window, with the maximum value normalized to one (the value one
            appears only if the number of samples is odd).

        See Also
        --------
        bartlett, hamming, hanning, kaiser

        Notes
        -----
        The Blackman window is defined as

        .. math::  w(n) = 0.42 - 0.5 \cos(2\pi n/M) + 0.08 \cos(4\pi n/M)

        Most references to the Blackman window come from the signal processing
        literature, where it is used as one of many windowing functions for
        smoothing values.  It is also known as an apodization (which means
        "removing the foot", i.e. smoothing discontinuities at the beginning
        and end of the sampled signal) or tapering function. It is known as a
        "near optimal" tapering function, almost as good (by some measures)
        as the kaiser window.

        References
        ----------
        Blackman, R.B. and Tukey, J.W., (1958) The measurement of power spectra,
        Dover Publications, New York.

        Oppenheim, A.V., and R.W. Schafer. Discrete-Time Signal Processing.
        Upper Saddle River, NJ: Prentice-Hall, 1999, pp. 468-471.

        Examples
        --------
        >>> import numpy as np
        >>> import matplotlib.pyplot as plt
        >>> np.blackman(12)
        array([-1.38777878e-17,   3.26064346e-02,   1.59903635e-01, # may vary
                4.14397981e-01,   7.36045180e-01,   9.67046769e-01,
                9.67046769e-01,   7.36045180e-01,   4.14397981e-01,
                1.59903635e-01,   3.26064346e-02,  -1.38777878e-17])

        Plot the window and the frequency response.

        .. plot::
            :include-source:

            import matplotlib.pyplot as plt
            from numpy.fft import fft, fftshift
            window = np.blackman(51)
            plt.plot(window)
            plt.title("Blackman window")
            plt.ylabel("Amplitude")
            plt.xlabel("Sample")
            plt.show()  # doctest: +SKIP

            plt.figure()
            A = fft(window, 2048) / 25.5
            mag = np.abs(fftshift(A))
            freq = np.linspace(-0.5, 0.5, len(A))
            with np.errstate(divide='ignore', invalid='ignore'):
                response = 20 * np.log10(mag)
            response = np.clip(response, -100, 100)
            plt.plot(freq, response)
            plt.title("Frequency response of Blackman window")
            plt.ylabel("Magnitude [dB]")
            plt.xlabel("Normalized frequency [cycles per sample]")
            plt.axis('tight')
            plt.show()

    block(arrays)
        Assemble an nd-array from nested lists of blocks.

        Blocks in the innermost lists are concatenated (see `concatenate`) along
        the last dimension (-1), then these are concatenated along the
        second-last dimension (-2), and so on until the outermost list is reached.

        Blocks can be of any dimension, but will not be broadcasted using
        the normal rules. Instead, leading axes of size 1 are inserted,
        to make ``block.ndim`` the same for all blocks. This is primarily useful
        for working with scalars, and means that code like ``np.block([v, 1])``
        is valid, where ``v.ndim == 1``.

        When the nested list is two levels deep, this allows block matrices to be
        constructed from their components.

        .. versionadded:: 1.13.0

        Parameters
        ----------
        arrays : nested list of array_like or scalars (but not tuples)
            If passed a single ndarray or scalar (a nested list of depth 0), this
            is returned unmodified (and not copied).

            Elements shapes must match along the appropriate axes (without
            broadcasting), but leading 1s will be prepended to the shape as
            necessary to make the dimensions match.

        Returns
        -------
        block_array : ndarray
            The array assembled from the given blocks.

            The dimensionality of the output is equal to the greatest of:

            * the dimensionality of all the inputs
            * the depth to which the input list is nested

        Raises
        ------
        ValueError
            * If list depths are mismatched - for instance, ``[[a, b], c]`` is
              illegal, and should be spelt ``[[a, b], [c]]``
            * If lists are empty - for instance, ``[[a, b], []]``

        See Also
        --------
        concatenate : Join a sequence of arrays along an existing axis.
        stack : Join a sequence of arrays along a new axis.
        vstack : Stack arrays in sequence vertically (row wise).
        hstack : Stack arrays in sequence horizontally (column wise).
        dstack : Stack arrays in sequence depth wise (along third axis).
        column_stack : Stack 1-D arrays as columns into a 2-D array.
        vsplit : Split an array into multiple sub-arrays vertically (row-wise).
        unstack : Split an array into a tuple of sub-arrays along an axis.

        Notes
        -----

        When called with only scalars, ``np.block`` is equivalent to an ndarray
        call. So ``np.block([[1, 2], [3, 4]])`` is equivalent to
        ``np.array([[1, 2], [3, 4]])``.

        This function does not enforce that the blocks lie on a fixed grid.
        ``np.block([[a, b], [c, d]])`` is not restricted to arrays of the form::

            AAAbb
            AAAbb
            cccDD

        But is also allowed to produce, for some ``a, b, c, d``::

            AAAbb
            AAAbb
            cDDDD

        Since concatenation happens along the last axis first, `block` is *not*
        capable of producing the following directly::

            AAAbb
            cccbb
            cccDD

        Matlab's "square bracket stacking", ``[A, B, ...; p, q, ...]``, is
        equivalent to ``np.block([[A, B, ...], [p, q, ...]])``.

        Examples
        --------
        The most common use of this function is to build a block matrix:

        >>> import numpy as np
        >>> A = np.eye(2) * 2
        >>> B = np.eye(3) * 3
        >>> np.block([
        ...     [A,               np.zeros((2, 3))],
        ...     [np.ones((3, 2)), B               ]
        ... ])
        array([[2., 0., 0., 0., 0.],
               [0., 2., 0., 0., 0.],
               [1., 1., 3., 0., 0.],
               [1., 1., 0., 3., 0.],
               [1., 1., 0., 0., 3.]])

        With a list of depth 1, `block` can be used as `hstack`:

        >>> np.block([1, 2, 3])              # hstack([1, 2, 3])
        array([1, 2, 3])

        >>> a = np.array([1, 2, 3])
        >>> b = np.array([4, 5, 6])
        >>> np.block([a, b, 10])             # hstack([a, b, 10])
        array([ 1,  2,  3,  4,  5,  6, 10])

        >>> A = np.ones((2, 2), int)
        >>> B = 2 * A
        >>> np.block([A, B])                 # hstack([A, B])
        array([[1, 1, 2, 2],
               [1, 1, 2, 2]])

        With a list of depth 2, `block` can be used in place of `vstack`:

        >>> a = np.array([1, 2, 3])
        >>> b = np.array([4, 5, 6])
        >>> np.block([[a], [b]])             # vstack([a, b])
        array([[1, 2, 3],
               [4, 5, 6]])

        >>> A = np.ones((2, 2), int)
        >>> B = 2 * A
        >>> np.block([[A], [B]])             # vstack([A, B])
        array([[1, 1],
               [1, 1],
               [2, 2],
               [2, 2]])

        It can also be used in place of `atleast_1d` and `atleast_2d`:

        >>> a = np.array(0)
        >>> b = np.array([1])
        >>> np.block([a])                    # atleast_1d(a)
        array([0])
        >>> np.block([b])                    # atleast_1d(b)
        array([1])

        >>> np.block([[a]])                  # atleast_2d(a)
        array([[0]])
        >>> np.block([[b]])                  # atleast_2d(b)
        array([[1]])

    bmat(obj, ldict=None, gdict=None)
        Build a matrix object from a string, nested sequence, or array.

        Parameters
        ----------
        obj : str or array_like
            Input data. If a string, variables in the current scope may be
            referenced by name.
        ldict : dict, optional
            A dictionary that replaces local operands in current frame.
            Ignored if `obj` is not a string or `gdict` is None.
        gdict : dict, optional
            A dictionary that replaces global operands in current frame.
            Ignored if `obj` is not a string.

        Returns
        -------
        out : matrix
            Returns a matrix object, which is a specialized 2-D array.

        See Also
        --------
        block :
            A generalization of this function for N-d arrays, that returns normal
            ndarrays.

        Examples
        --------
        >>> import numpy as np
        >>> A = np.asmatrix('1 1; 1 1')
        >>> B = np.asmatrix('2 2; 2 2')
        >>> C = np.asmatrix('3 4; 5 6')
        >>> D = np.asmatrix('7 8; 9 0')

        All the following expressions construct the same block matrix:

        >>> np.bmat([[A, B], [C, D]])
        matrix([[1, 1, 2, 2],
                [1, 1, 2, 2],
                [3, 4, 7, 8],
                [5, 6, 9, 0]])
        >>> np.bmat(np.r_[np.c_[A, B], np.c_[C, D]])
        matrix([[1, 1, 2, 2],
                [1, 1, 2, 2],
                [3, 4, 7, 8],
                [5, 6, 9, 0]])
        >>> np.bmat('A,B; C,D')
        matrix([[1, 1, 2, 2],
                [1, 1, 2, 2],
                [3, 4, 7, 8],
                [5, 6, 9, 0]])

    broadcast_arrays(*args, subok=False)
        Broadcast any number of arrays against each other.

        Parameters
        ----------
        *args : array_likes
            The arrays to broadcast.

        subok : bool, optional
            If True, then sub-classes will be passed-through, otherwise
            the returned arrays will be forced to be a base-class array (default).

        Returns
        -------
        broadcasted : tuple of arrays
            These arrays are views on the original arrays.  They are typically
            not contiguous.  Furthermore, more than one element of a
            broadcasted array may refer to a single memory location. If you need
            to write to the arrays, make copies first. While you can set the
            ``writable`` flag True, writing to a single output value may end up
            changing more than one location in the output array.

            .. deprecated:: 1.17
                The output is currently marked so that if written to, a deprecation
                warning will be emitted. A future version will set the
                ``writable`` flag False so writing to it will raise an error.

        See Also
        --------
        broadcast
        broadcast_to
        broadcast_shapes

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([[1,2,3]])
        >>> y = np.array([[4],[5]])
        >>> np.broadcast_arrays(x, y)
        (array([[1, 2, 3],
                [1, 2, 3]]),
         array([[4, 4, 4],
                [5, 5, 5]]))

        Here is a useful idiom for getting contiguous copies instead of
        non-contiguous views.

        >>> [np.array(a) for a in np.broadcast_arrays(x, y)]
        [array([[1, 2, 3],
                [1, 2, 3]]),
         array([[4, 4, 4],
                [5, 5, 5]])]

    broadcast_shapes(*args)
        Broadcast the input shapes into a single shape.

        :ref:`Learn more about broadcasting here <basics.broadcasting>`.

        .. versionadded:: 1.20.0

        Parameters
        ----------
        *args : tuples of ints, or ints
            The shapes to be broadcast against each other.

        Returns
        -------
        tuple
            Broadcasted shape.

        Raises
        ------
        ValueError
            If the shapes are not compatible and cannot be broadcast according
            to NumPy's broadcasting rules.

        See Also
        --------
        broadcast
        broadcast_arrays
        broadcast_to

        Examples
        --------
        >>> import numpy as np
        >>> np.broadcast_shapes((1, 2), (3, 1), (3, 2))
        (3, 2)

        >>> np.broadcast_shapes((6, 7), (5, 6, 1), (7,), (5, 1, 7))
        (5, 6, 7)

    broadcast_to(array, shape, subok=False)
        Broadcast an array to a new shape.

        Parameters
        ----------
        array : array_like
            The array to broadcast.
        shape : tuple or int
            The shape of the desired array. A single integer ``i`` is interpreted
            as ``(i,)``.
        subok : bool, optional
            If True, then sub-classes will be passed-through, otherwise
            the returned array will be forced to be a base-class array (default).

        Returns
        -------
        broadcast : array
            A readonly view on the original array with the given shape. It is
            typically not contiguous. Furthermore, more than one element of a
            broadcasted array may refer to a single memory location.

        Raises
        ------
        ValueError
            If the array is not compatible with the new shape according to NumPy's
            broadcasting rules.

        See Also
        --------
        broadcast
        broadcast_arrays
        broadcast_shapes

        Notes
        -----
        .. versionadded:: 1.10.0

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([1, 2, 3])
        >>> np.broadcast_to(x, (3, 3))
        array([[1, 2, 3],
               [1, 2, 3],
               [1, 2, 3]])

    busday_count(...)
        busday_count(
            begindates,
            enddates,
            weekmask='1111100',
            holidays=[],
            busdaycal=None,
            out=None
        )

        Counts the number of valid days between `begindates` and
        `enddates`, not including the day of `enddates`.

        If ``enddates`` specifies a date value that is earlier than the
        corresponding ``begindates`` date value, the count will be negative.

        .. versionadded:: 1.7.0

        Parameters
        ----------
        begindates : array_like of datetime64[D]
            The array of the first dates for counting.
        enddates : array_like of datetime64[D]
            The array of the end dates for counting, which are excluded
            from the count themselves.
        weekmask : str or array_like of bool, optional
            A seven-element array indicating which of Monday through Sunday are
            valid days. May be specified as a length-seven list or array, like
            [1,1,1,1,1,0,0]; a length-seven string, like '1111100'; or a string
            like "Mon Tue Wed Thu Fri", made up of 3-character abbreviations for
            weekdays, optionally separated by white space. Valid abbreviations
            are: Mon Tue Wed Thu Fri Sat Sun
        holidays : array_like of datetime64[D], optional
            An array of dates to consider as invalid dates.  They may be
            specified in any order, and NaT (not-a-time) dates are ignored.
            This list is saved in a normalized form that is suited for
            fast calculations of valid days.
        busdaycal : busdaycalendar, optional
            A `busdaycalendar` object which specifies the valid days. If this
            parameter is provided, neither weekmask nor holidays may be
            provided.
        out : array of int, optional
            If provided, this array is filled with the result.

        Returns
        -------
        out : array of int
            An array with a shape from broadcasting ``begindates`` and ``enddates``
            together, containing the number of valid days between
            the begin and end dates.

        See Also
        --------
        busdaycalendar : An object that specifies a custom set of valid days.
        is_busday : Returns a boolean array indicating valid days.
        busday_offset : Applies an offset counted in valid days.

        Examples
        --------
        >>> import numpy as np
        >>> # Number of weekdays in January 2011
        ... np.busday_count('2011-01', '2011-02')
        21
        >>> # Number of weekdays in 2011
        >>> np.busday_count('2011', '2012')
        260
        >>> # Number of Saturdays in 2011
        ... np.busday_count('2011', '2012', weekmask='Sat')
        53

    busday_offset(...)
        busday_offset(
            dates,
            offsets,
            roll='raise',
            weekmask='1111100',
            holidays=None,
            busdaycal=None,
            out=None
        )

        First adjusts the date to fall on a valid day according to
        the ``roll`` rule, then applies offsets to the given dates
        counted in valid days.

        .. versionadded:: 1.7.0

        Parameters
        ----------
        dates : array_like of datetime64[D]
            The array of dates to process.
        offsets : array_like of int
            The array of offsets, which is broadcast with ``dates``.
        roll : {'raise', 'nat', 'forward', 'following', 'backward', 'preceding',         'modifiedfollowing', 'modifiedpreceding'}, optional
            How to treat dates that do not fall on a valid day. The default
            is 'raise'.

            * 'raise' means to raise an exception for an invalid day.
            * 'nat' means to return a NaT (not-a-time) for an invalid day.
            * 'forward' and 'following' mean to take the first valid day
              later in time.
            * 'backward' and 'preceding' mean to take the first valid day
              earlier in time.
            * 'modifiedfollowing' means to take the first valid day
              later in time unless it is across a Month boundary, in which
              case to take the first valid day earlier in time.
            * 'modifiedpreceding' means to take the first valid day
              earlier in time unless it is across a Month boundary, in which
              case to take the first valid day later in time.
        weekmask : str or array_like of bool, optional
            A seven-element array indicating which of Monday through Sunday are
            valid days. May be specified as a length-seven list or array, like
            [1,1,1,1,1,0,0]; a length-seven string, like '1111100'; or a string
            like "Mon Tue Wed Thu Fri", made up of 3-character abbreviations for
            weekdays, optionally separated by white space. Valid abbreviations
            are: Mon Tue Wed Thu Fri Sat Sun
        holidays : array_like of datetime64[D], optional
            An array of dates to consider as invalid dates.  They may be
            specified in any order, and NaT (not-a-time) dates are ignored.
            This list is saved in a normalized form that is suited for
            fast calculations of valid days.
        busdaycal : busdaycalendar, optional
            A `busdaycalendar` object which specifies the valid days. If this
            parameter is provided, neither weekmask nor holidays may be
            provided.
        out : array of datetime64[D], optional
            If provided, this array is filled with the result.

        Returns
        -------
        out : array of datetime64[D]
            An array with a shape from broadcasting ``dates`` and ``offsets``
            together, containing the dates with offsets applied.

        See Also
        --------
        busdaycalendar : An object that specifies a custom set of valid days.
        is_busday : Returns a boolean array indicating valid days.
        busday_count : Counts how many valid days are in a half-open date range.

        Examples
        --------
        >>> import numpy as np
        >>> # First business day in October 2011 (not accounting for holidays)
        ... np.busday_offset('2011-10', 0, roll='forward')
        np.datetime64('2011-10-03')
        >>> # Last business day in February 2012 (not accounting for holidays)
        ... np.busday_offset('2012-03', -1, roll='forward')
        np.datetime64('2012-02-29')
        >>> # Third Wednesday in January 2011
        ... np.busday_offset('2011-01', 2, roll='forward', weekmask='Wed')
        np.datetime64('2011-01-19')
        >>> # 2012 Mother's Day in Canada and the U.S.
        ... np.busday_offset('2012-05', 1, roll='forward', weekmask='Sun')
        np.datetime64('2012-05-13')

        >>> # First business day on or after a date
        ... np.busday_offset('2011-03-20', 0, roll='forward')
        np.datetime64('2011-03-21')
        >>> np.busday_offset('2011-03-22', 0, roll='forward')
        np.datetime64('2011-03-22')
        >>> # First business day after a date
        ... np.busday_offset('2011-03-20', 1, roll='backward')
        np.datetime64('2011-03-21')
        >>> np.busday_offset('2011-03-22', 1, roll='backward')
        np.datetime64('2011-03-23')

    can_cast(...)
        can_cast(from_, to, casting='safe')

        Returns True if cast between data types can occur according to the
        casting rule.

        Parameters
        ----------
        from_ : dtype, dtype specifier, NumPy scalar, or array
            Data type, NumPy scalar, or array to cast from.
        to : dtype or dtype specifier
            Data type to cast to.
        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
            Controls what kind of data casting may occur.

            * 'no' means the data types should not be cast at all.
            * 'equiv' means only byte-order changes are allowed.
            * 'safe' means only casts which can preserve values are allowed.
            * 'same_kind' means only safe casts or casts within a kind,
              like float64 to float32, are allowed.
            * 'unsafe' means any data conversions may be done.

        Returns
        -------
        out : bool
            True if cast can occur according to the casting rule.

        Notes
        -----
        .. versionchanged:: 1.17.0
           Casting between a simple data type and a structured one is possible only
           for "unsafe" casting.  Casting to multiple fields is allowed, but
           casting from multiple fields is not.

        .. versionchanged:: 1.9.0
           Casting from numeric to string types in 'safe' casting mode requires
           that the string dtype length is long enough to store the maximum
           integer/float value converted.

        .. versionchanged:: 2.0
           This function does not support Python scalars anymore and does not
           apply any value-based logic for 0-D arrays and NumPy scalars.

        See also
        --------
        dtype, result_type

        Examples
        --------
        Basic examples

        >>> import numpy as np
        >>> np.can_cast(np.int32, np.int64)
        True
        >>> np.can_cast(np.float64, complex)
        True
        >>> np.can_cast(complex, float)
        False

        >>> np.can_cast('i8', 'f8')
        True
        >>> np.can_cast('i8', 'f4')
        False
        >>> np.can_cast('i4', 'S4')
        False

    choose(a, choices, out=None, mode='raise')
        Construct an array from an index array and a list of arrays to choose from.

        First of all, if confused or uncertain, definitely look at the Examples -
        in its full generality, this function is less simple than it might
        seem from the following code description (below ndi =
        `numpy.lib.index_tricks`):

        ``np.choose(a,c) == np.array([c[a[I]][I] for I in ndi.ndindex(a.shape)])``.

        But this omits some subtleties.  Here is a fully general summary:

        Given an "index" array (`a`) of integers and a sequence of ``n`` arrays
        (`choices`), `a` and each choice array are first broadcast, as necessary,
        to arrays of a common shape; calling these *Ba* and *Bchoices[i], i =
        0,...,n-1* we have that, necessarily, ``Ba.shape == Bchoices[i].shape``
        for each ``i``.  Then, a new array with shape ``Ba.shape`` is created as
        follows:

        * if ``mode='raise'`` (the default), then, first of all, each element of
          ``a`` (and thus ``Ba``) must be in the range ``[0, n-1]``; now, suppose
          that ``i`` (in that range) is the value at the ``(j0, j1, ..., jm)``
          position in ``Ba`` - then the value at the same position in the new array
          is the value in ``Bchoices[i]`` at that same position;

        * if ``mode='wrap'``, values in `a` (and thus `Ba`) may be any (signed)
          integer; modular arithmetic is used to map integers outside the range
          `[0, n-1]` back into that range; and then the new array is constructed
          as above;

        * if ``mode='clip'``, values in `a` (and thus ``Ba``) may be any (signed)
          integer; negative integers are mapped to 0; values greater than ``n-1``
          are mapped to ``n-1``; and then the new array is constructed as above.

        Parameters
        ----------
        a : int array
            This array must contain integers in ``[0, n-1]``, where ``n`` is the
            number of choices, unless ``mode=wrap`` or ``mode=clip``, in which
            cases any integers are permissible.
        choices : sequence of arrays
            Choice arrays. `a` and all of the choices must be broadcastable to the
            same shape.  If `choices` is itself an array (not recommended), then
            its outermost dimension (i.e., the one corresponding to
            ``choices.shape[0]``) is taken as defining the "sequence".
        out : array, optional
            If provided, the result will be inserted into this array. It should
            be of the appropriate shape and dtype. Note that `out` is always
            buffered if ``mode='raise'``; use other modes for better performance.
        mode : {'raise' (default), 'wrap', 'clip'}, optional
            Specifies how indices outside ``[0, n-1]`` will be treated:

            * 'raise' : an exception is raised
            * 'wrap' : value becomes value mod ``n``
            * 'clip' : values < 0 are mapped to 0, values > n-1 are mapped to n-1

        Returns
        -------
        merged_array : array
            The merged result.

        Raises
        ------
        ValueError: shape mismatch
            If `a` and each choice array are not all broadcastable to the same
            shape.

        See Also
        --------
        ndarray.choose : equivalent method
        numpy.take_along_axis : Preferable if `choices` is an array

        Notes
        -----
        To reduce the chance of misinterpretation, even though the following
        "abuse" is nominally supported, `choices` should neither be, nor be
        thought of as, a single array, i.e., the outermost sequence-like container
        should be either a list or a tuple.

        Examples
        --------

        >>> import numpy as np
        >>> choices = [[0, 1, 2, 3], [10, 11, 12, 13],
        ...   [20, 21, 22, 23], [30, 31, 32, 33]]
        >>> np.choose([2, 3, 1, 0], choices
        ... # the first element of the result will be the first element of the
        ... # third (2+1) "array" in choices, namely, 20; the second element
        ... # will be the second element of the fourth (3+1) choice array, i.e.,
        ... # 31, etc.
        ... )
        array([20, 31, 12,  3])
        >>> np.choose([2, 4, 1, 0], choices, mode='clip') # 4 goes to 3 (4-1)
        array([20, 31, 12,  3])
        >>> # because there are 4 choice arrays
        >>> np.choose([2, 4, 1, 0], choices, mode='wrap') # 4 goes to (4 mod 4)
        array([20,  1, 12,  3])
        >>> # i.e., 0

        A couple examples illustrating how choose broadcasts:

        >>> a = [[1, 0, 1], [0, 1, 0], [1, 0, 1]]
        >>> choices = [-10, 10]
        >>> np.choose(a, choices)
        array([[ 10, -10,  10],
               [-10,  10, -10],
               [ 10, -10,  10]])

        >>> # With thanks to Anne Archibald
        >>> a = np.array([0, 1]).reshape((2,1,1))
        >>> c1 = np.array([1, 2, 3]).reshape((1,3,1))
        >>> c2 = np.array([-1, -2, -3, -4, -5]).reshape((1,1,5))
        >>> np.choose(a, (c1, c2)) # result is 2x3x5, res[0,:,:]=c1, res[1,:,:]=c2
        array([[[ 1,  1,  1,  1,  1],
                [ 2,  2,  2,  2,  2],
                [ 3,  3,  3,  3,  3]],
               [[-1, -2, -3, -4, -5],
                [-1, -2, -3, -4, -5],
                [-1, -2, -3, -4, -5]]])

    clip(a, a_min=<no value>, a_max=<no value>, out=None, *, min=<no value>, max=<no value>, **kwargs)
        Clip (limit) the values in an array.

        Given an interval, values outside the interval are clipped to
        the interval edges.  For example, if an interval of ``[0, 1]``
        is specified, values smaller than 0 become 0, and values larger
        than 1 become 1.

        Equivalent to but faster than ``np.minimum(a_max, np.maximum(a, a_min))``.

        No check is performed to ensure ``a_min < a_max``.

        Parameters
        ----------
        a : array_like
            Array containing elements to clip.
        a_min, a_max : array_like or None
            Minimum and maximum value. If ``None``, clipping is not performed on
            the corresponding edge. If both ``a_min`` and ``a_max`` are ``None``,
            the elements of the returned array stay the same. Both are broadcasted
            against ``a``.
        out : ndarray, optional
            The results will be placed in this array. It may be the input
            array for in-place clipping.  `out` must be of the right shape
            to hold the output.  Its type is preserved.
        min, max : array_like or None
            Array API compatible alternatives for ``a_min`` and ``a_max``
            arguments. Either ``a_min`` and ``a_max`` or ``min`` and ``max``
            can be passed at the same time. Default: ``None``.

            .. versionadded:: 2.1.0
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

            .. versionadded:: 1.17.0

        Returns
        -------
        clipped_array : ndarray
            An array with the elements of `a`, but where values
            < `a_min` are replaced with `a_min`, and those > `a_max`
            with `a_max`.

        See Also
        --------
        :ref:`ufuncs-output-type`

        Notes
        -----
        When `a_min` is greater than `a_max`, `clip` returns an
        array in which all values are equal to `a_max`,
        as shown in the second example.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(10)
        >>> a
        array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
        >>> np.clip(a, 1, 8)
        array([1, 1, 2, 3, 4, 5, 6, 7, 8, 8])
        >>> np.clip(a, 8, 1)
        array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
        >>> np.clip(a, 3, 6, out=a)
        array([3, 3, 3, 3, 4, 5, 6, 6, 6, 6])
        >>> a
        array([3, 3, 3, 3, 4, 5, 6, 6, 6, 6])
        >>> a = np.arange(10)
        >>> a
        array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
        >>> np.clip(a, [3, 4, 1, 1, 1, 4, 4, 4, 4, 4], 8)
        array([3, 4, 2, 3, 4, 5, 6, 7, 8, 8])

    column_stack(tup)
        Stack 1-D arrays as columns into a 2-D array.

        Take a sequence of 1-D arrays and stack them as columns
        to make a single 2-D array. 2-D arrays are stacked as-is,
        just like with `hstack`.  1-D arrays are turned into 2-D columns
        first.

        Parameters
        ----------
        tup : sequence of 1-D or 2-D arrays.
            Arrays to stack. All of them must have the same first dimension.

        Returns
        -------
        stacked : 2-D array
            The array formed by stacking the given arrays.

        See Also
        --------
        stack, hstack, vstack, concatenate

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array((1,2,3))
        >>> b = np.array((2,3,4))
        >>> np.column_stack((a,b))
        array([[1, 2],
               [2, 3],
               [3, 4]])

    common_type(*arrays)
        Return a scalar type which is common to the input arrays.

        The return type will always be an inexact (i.e. floating point) scalar
        type, even if all the arrays are integer arrays. If one of the inputs is
        an integer array, the minimum precision type that is returned is a
        64-bit floating point dtype.

        All input arrays except int64 and uint64 can be safely cast to the
        returned dtype without loss of information.

        Parameters
        ----------
        array1, array2, ... : ndarrays
            Input arrays.

        Returns
        -------
        out : data type code
            Data type code.

        See Also
        --------
        dtype, mintypecode

        Examples
        --------
        >>> np.common_type(np.arange(2, dtype=np.float32))
        <class 'numpy.float32'>
        >>> np.common_type(np.arange(2, dtype=np.float32), np.arange(2))
        <class 'numpy.float64'>
        >>> np.common_type(np.arange(4), np.array([45, 6.j]), np.array([45.0]))
        <class 'numpy.complex128'>

    compress(condition, a, axis=None, out=None)
        Return selected slices of an array along given axis.

        When working along a given axis, a slice along that axis is returned in
        `output` for each index where `condition` evaluates to True. When
        working on a 1-D array, `compress` is equivalent to `extract`.

        Parameters
        ----------
        condition : 1-D array of bools
            Array that selects which entries to return. If len(condition)
            is less than the size of `a` along the given axis, then output is
            truncated to the length of the condition array.
        a : array_like
            Array from which to extract a part.
        axis : int, optional
            Axis along which to take slices. If None (default), work on the
            flattened array.
        out : ndarray, optional
            Output array.  Its type is preserved and it must be of the right
            shape to hold the output.

        Returns
        -------
        compressed_array : ndarray
            A copy of `a` without the slices along axis for which `condition`
            is false.

        See Also
        --------
        take, choose, diag, diagonal, select
        ndarray.compress : Equivalent method in ndarray
        extract : Equivalent method when working on 1-D arrays
        :ref:`ufuncs-output-type`

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, 4], [5, 6]])
        >>> a
        array([[1, 2],
               [3, 4],
               [5, 6]])
        >>> np.compress([0, 1], a, axis=0)
        array([[3, 4]])
        >>> np.compress([False, True, True], a, axis=0)
        array([[3, 4],
               [5, 6]])
        >>> np.compress([False, True], a, axis=1)
        array([[2],
               [4],
               [6]])

        Working on the flattened array does not return slices along an axis but
        selects elements.

        >>> np.compress([False, True], a)
        array([2])

    concat = concatenate(...)
        concatenate(
            (a1, a2, ...),
            axis=0,
            out=None,
            dtype=None,
            casting="same_kind"
        )

        Join a sequence of arrays along an existing axis.

        Parameters
        ----------
        a1, a2, ... : sequence of array_like
            The arrays must have the same shape, except in the dimension
            corresponding to `axis` (the first, by default).
        axis : int, optional
            The axis along which the arrays will be joined.  If axis is None,
            arrays are flattened before use.  Default is 0.
        out : ndarray, optional
            If provided, the destination to place the result. The shape must be
            correct, matching that of what concatenate would have returned if no
            out argument were specified.
        dtype : str or dtype
            If provided, the destination array will have this dtype. Cannot be
            provided together with `out`.

            .. versionadded:: 1.20.0

        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
            Controls what kind of data casting may occur. Defaults to 'same_kind'.
            For a description of the options, please see :term:`casting`.

            .. versionadded:: 1.20.0

        Returns
        -------
        res : ndarray
            The concatenated array.

        See Also
        --------
        ma.concatenate : Concatenate function that preserves input masks.
        array_split : Split an array into multiple sub-arrays of equal or
                      near-equal size.
        split : Split array into a list of multiple sub-arrays of equal size.
        hsplit : Split array into multiple sub-arrays horizontally (column wise).
        vsplit : Split array into multiple sub-arrays vertically (row wise).
        dsplit : Split array into multiple sub-arrays along the 3rd axis (depth).
        stack : Stack a sequence of arrays along a new axis.
        block : Assemble arrays from blocks.
        hstack : Stack arrays in sequence horizontally (column wise).
        vstack : Stack arrays in sequence vertically (row wise).
        dstack : Stack arrays in sequence depth wise (along third dimension).
        column_stack : Stack 1-D arrays as columns into a 2-D array.

        Notes
        -----
        When one or more of the arrays to be concatenated is a MaskedArray,
        this function will return a MaskedArray object instead of an ndarray,
        but the input masks are *not* preserved. In cases where a MaskedArray
        is expected as input, use the ma.concatenate function from the masked
        array module instead.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, 4]])
        >>> b = np.array([[5, 6]])
        >>> np.concatenate((a, b), axis=0)
        array([[1, 2],
               [3, 4],
               [5, 6]])
        >>> np.concatenate((a, b.T), axis=1)
        array([[1, 2, 5],
               [3, 4, 6]])
        >>> np.concatenate((a, b), axis=None)
        array([1, 2, 3, 4, 5, 6])

        This function will not preserve masking of MaskedArray inputs.

        >>> a = np.ma.arange(3)
        >>> a[1] = np.ma.masked
        >>> b = np.arange(2, 5)
        >>> a
        masked_array(data=[0, --, 2],
                     mask=[False,  True, False],
               fill_value=999999)
        >>> b
        array([2, 3, 4])
        >>> np.concatenate([a, b])
        masked_array(data=[0, 1, 2, 2, 3, 4],
                     mask=False,
               fill_value=999999)
        >>> np.ma.concatenate([a, b])
        masked_array(data=[0, --, 2, 2, 3, 4],
                     mask=[False,  True, False, False, False, False],
               fill_value=999999)

    concatenate(...)
        concatenate(
            (a1, a2, ...),
            axis=0,
            out=None,
            dtype=None,
            casting="same_kind"
        )

        Join a sequence of arrays along an existing axis.

        Parameters
        ----------
        a1, a2, ... : sequence of array_like
            The arrays must have the same shape, except in the dimension
            corresponding to `axis` (the first, by default).
        axis : int, optional
            The axis along which the arrays will be joined.  If axis is None,
            arrays are flattened before use.  Default is 0.
        out : ndarray, optional
            If provided, the destination to place the result. The shape must be
            correct, matching that of what concatenate would have returned if no
            out argument were specified.
        dtype : str or dtype
            If provided, the destination array will have this dtype. Cannot be
            provided together with `out`.

            .. versionadded:: 1.20.0

        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
            Controls what kind of data casting may occur. Defaults to 'same_kind'.
            For a description of the options, please see :term:`casting`.

            .. versionadded:: 1.20.0

        Returns
        -------
        res : ndarray
            The concatenated array.

        See Also
        --------
        ma.concatenate : Concatenate function that preserves input masks.
        array_split : Split an array into multiple sub-arrays of equal or
                      near-equal size.
        split : Split array into a list of multiple sub-arrays of equal size.
        hsplit : Split array into multiple sub-arrays horizontally (column wise).
        vsplit : Split array into multiple sub-arrays vertically (row wise).
        dsplit : Split array into multiple sub-arrays along the 3rd axis (depth).
        stack : Stack a sequence of arrays along a new axis.
        block : Assemble arrays from blocks.
        hstack : Stack arrays in sequence horizontally (column wise).
        vstack : Stack arrays in sequence vertically (row wise).
        dstack : Stack arrays in sequence depth wise (along third dimension).
        column_stack : Stack 1-D arrays as columns into a 2-D array.

        Notes
        -----
        When one or more of the arrays to be concatenated is a MaskedArray,
        this function will return a MaskedArray object instead of an ndarray,
        but the input masks are *not* preserved. In cases where a MaskedArray
        is expected as input, use the ma.concatenate function from the masked
        array module instead.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, 4]])
        >>> b = np.array([[5, 6]])
        >>> np.concatenate((a, b), axis=0)
        array([[1, 2],
               [3, 4],
               [5, 6]])
        >>> np.concatenate((a, b.T), axis=1)
        array([[1, 2, 5],
               [3, 4, 6]])
        >>> np.concatenate((a, b), axis=None)
        array([1, 2, 3, 4, 5, 6])

        This function will not preserve masking of MaskedArray inputs.

        >>> a = np.ma.arange(3)
        >>> a[1] = np.ma.masked
        >>> b = np.arange(2, 5)
        >>> a
        masked_array(data=[0, --, 2],
                     mask=[False,  True, False],
               fill_value=999999)
        >>> b
        array([2, 3, 4])
        >>> np.concatenate([a, b])
        masked_array(data=[0, 1, 2, 2, 3, 4],
                     mask=False,
               fill_value=999999)
        >>> np.ma.concatenate([a, b])
        masked_array(data=[0, --, 2, 2, 3, 4],
                     mask=[False,  True, False, False, False, False],
               fill_value=999999)

    convolve(a, v, mode='full')
        Returns the discrete, linear convolution of two one-dimensional sequences.

        The convolution operator is often seen in signal processing, where it
        models the effect of a linear time-invariant system on a signal [1]_.  In
        probability theory, the sum of two independent random variables is
        distributed according to the convolution of their individual
        distributions.

        If `v` is longer than `a`, the arrays are swapped before computation.

        Parameters
        ----------
        a : (N,) array_like
            First one-dimensional input array.
        v : (M,) array_like
            Second one-dimensional input array.
        mode : {'full', 'valid', 'same'}, optional
            'full':
              By default, mode is 'full'.  This returns the convolution
              at each point of overlap, with an output shape of (N+M-1,). At
              the end-points of the convolution, the signals do not overlap
              completely, and boundary effects may be seen.

            'same':
              Mode 'same' returns output of length ``max(M, N)``.  Boundary
              effects are still visible.

            'valid':
              Mode 'valid' returns output of length
              ``max(M, N) - min(M, N) + 1``.  The convolution product is only given
              for points where the signals overlap completely.  Values outside
              the signal boundary have no effect.

        Returns
        -------
        out : ndarray
            Discrete, linear convolution of `a` and `v`.

        See Also
        --------
        scipy.signal.fftconvolve : Convolve two arrays using the Fast Fourier
                                   Transform.
        scipy.linalg.toeplitz : Used to construct the convolution operator.
        polymul : Polynomial multiplication. Same output as convolve, but also
                  accepts poly1d objects as input.

        Notes
        -----
        The discrete convolution operation is defined as

        .. math:: (a * v)_n = \sum_{m = -\infty}^{\infty} a_m v_{n - m}

        It can be shown that a convolution :math:`x(t) * y(t)` in time/space
        is equivalent to the multiplication :math:`X(f) Y(f)` in the Fourier
        domain, after appropriate padding (padding is necessary to prevent
        circular convolution).  Since multiplication is more efficient (faster)
        than convolution, the function `scipy.signal.fftconvolve` exploits the
        FFT to calculate the convolution of large data-sets.

        References
        ----------
        .. [1] Wikipedia, "Convolution",
            https://en.wikipedia.org/wiki/Convolution

        Examples
        --------
        Note how the convolution operator flips the second array
        before "sliding" the two across one another:

        >>> import numpy as np
        >>> np.convolve([1, 2, 3], [0, 1, 0.5])
        array([0. , 1. , 2.5, 4. , 1.5])

        Only return the middle values of the convolution.
        Contains boundary effects, where zeros are taken
        into account:

        >>> np.convolve([1,2,3],[0,1,0.5], 'same')
        array([1. ,  2.5,  4. ])

        The two arrays are of the same length, so there
        is only one position where they completely overlap:

        >>> np.convolve([1,2,3],[0,1,0.5], 'valid')
        array([2.5])

    copy(a, order='K', subok=False)
        Return an array copy of the given object.

        Parameters
        ----------
        a : array_like
            Input data.
        order : {'C', 'F', 'A', 'K'}, optional
            Controls the memory layout of the copy. 'C' means C-order,
            'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
            'C' otherwise. 'K' means match the layout of `a` as closely
            as possible. (Note that this function and :meth:`ndarray.copy` are very
            similar, but have different default values for their order=
            arguments.)
        subok : bool, optional
            If True, then sub-classes will be passed-through, otherwise the
            returned array will be forced to be a base-class array (defaults to False).

            .. versionadded:: 1.19.0

        Returns
        -------
        arr : ndarray
            Array interpretation of `a`.

        See Also
        --------
        ndarray.copy : Preferred method for creating an array copy

        Notes
        -----
        This is equivalent to:

        >>> np.array(a, copy=True)  #doctest: +SKIP

        The copy made of the data is shallow, i.e., for arrays with object dtype,
        the new array will point to the same objects.
        See Examples from `ndarray.copy`.

        Examples
        --------
        >>> import numpy as np

        Create an array x, with a reference y and a copy z:

        >>> x = np.array([1, 2, 3])
        >>> y = x
        >>> z = np.copy(x)

        Note that, when we modify x, y changes, but not z:

        >>> x[0] = 10
        >>> x[0] == y[0]
        True
        >>> x[0] == z[0]
        False

        Note that, np.copy clears previously set WRITEABLE=False flag.

        >>> a = np.array([1, 2, 3])
        >>> a.flags["WRITEABLE"] = False
        >>> b = np.copy(a)
        >>> b.flags["WRITEABLE"]
        True
        >>> b[0] = 3
        >>> b
        array([3, 2, 3])

    copyto(...)
        copyto(dst, src, casting='same_kind', where=True)

        Copies values from one array to another, broadcasting as necessary.

        Raises a TypeError if the `casting` rule is violated, and if
        `where` is provided, it selects which elements to copy.

        .. versionadded:: 1.7.0

        Parameters
        ----------
        dst : ndarray
            The array into which values are copied.
        src : array_like
            The array from which values are copied.
        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
            Controls what kind of data casting may occur when copying.

            * 'no' means the data types should not be cast at all.
            * 'equiv' means only byte-order changes are allowed.
            * 'safe' means only casts which can preserve values are allowed.
            * 'same_kind' means only safe casts or casts within a kind,
              like float64 to float32, are allowed.
            * 'unsafe' means any data conversions may be done.
        where : array_like of bool, optional
            A boolean array which is broadcasted to match the dimensions
            of `dst`, and selects elements to copy from `src` to `dst`
            wherever it contains the value True.

        Examples
        --------
        >>> import numpy as np
        >>> A = np.array([4, 5, 6])
        >>> B = [1, 2, 3]
        >>> np.copyto(A, B)
        >>> A
        array([1, 2, 3])

        >>> A = np.array([[1, 2, 3], [4, 5, 6]])
        >>> B = [[4, 5, 6], [7, 8, 9]]
        >>> np.copyto(A, B)
        >>> A
        array([[4, 5, 6],
               [7, 8, 9]])

    corrcoef(x, y=None, rowvar=True, bias=<no value>, ddof=<no value>, *, dtype=None)
        Return Pearson product-moment correlation coefficients.

        Please refer to the documentation for `cov` for more detail.  The
        relationship between the correlation coefficient matrix, `R`, and the
        covariance matrix, `C`, is

        .. math:: R_{ij} = \frac{ C_{ij} } { \sqrt{ C_{ii} C_{jj} } }

        The values of `R` are between -1 and 1, inclusive.

        Parameters
        ----------
        x : array_like
            A 1-D or 2-D array containing multiple variables and observations.
            Each row of `x` represents a variable, and each column a single
            observation of all those variables. Also see `rowvar` below.
        y : array_like, optional
            An additional set of variables and observations. `y` has the same
            shape as `x`.
        rowvar : bool, optional
            If `rowvar` is True (default), then each row represents a
            variable, with observations in the columns. Otherwise, the relationship
            is transposed: each column represents a variable, while the rows
            contain observations.
        bias : _NoValue, optional
            Has no effect, do not use.

            .. deprecated:: 1.10.0
        ddof : _NoValue, optional
            Has no effect, do not use.

            .. deprecated:: 1.10.0
        dtype : data-type, optional
            Data-type of the result. By default, the return data-type will have
            at least `numpy.float64` precision.

            .. versionadded:: 1.20

        Returns
        -------
        R : ndarray
            The correlation coefficient matrix of the variables.

        See Also
        --------
        cov : Covariance matrix

        Notes
        -----
        Due to floating point rounding the resulting array may not be Hermitian,
        the diagonal elements may not be 1, and the elements may not satisfy the
        inequality abs(a) <= 1. The real and imaginary parts are clipped to the
        interval [-1,  1] in an attempt to improve on that situation but is not
        much help in the complex case.

        This function accepts but discards arguments `bias` and `ddof`.  This is
        for backwards compatibility with previous versions of this function.  These
        arguments had no effect on the return values of the function and can be
        safely ignored in this and previous versions of numpy.

        Examples
        --------
        >>> import numpy as np

        In this example we generate two random arrays, ``xarr`` and ``yarr``, and
        compute the row-wise and column-wise Pearson correlation coefficients,
        ``R``. Since ``rowvar`` is  true by  default, we first find the row-wise
        Pearson correlation coefficients between the variables of ``xarr``.

        >>> import numpy as np
        >>> rng = np.random.default_rng(seed=42)
        >>> xarr = rng.random((3, 3))
        >>> xarr
        array([[0.77395605, 0.43887844, 0.85859792],
               [0.69736803, 0.09417735, 0.97562235],
               [0.7611397 , 0.78606431, 0.12811363]])
        >>> R1 = np.corrcoef(xarr)
        >>> R1
        array([[ 1.        ,  0.99256089, -0.68080986],
               [ 0.99256089,  1.        , -0.76492172],
               [-0.68080986, -0.76492172,  1.        ]])

        If we add another set of variables and observations ``yarr``, we can
        compute the row-wise Pearson correlation coefficients between the
        variables in ``xarr`` and ``yarr``.

        >>> yarr = rng.random((3, 3))
        >>> yarr
        array([[0.45038594, 0.37079802, 0.92676499],
               [0.64386512, 0.82276161, 0.4434142 ],
               [0.22723872, 0.55458479, 0.06381726]])
        >>> R2 = np.corrcoef(xarr, yarr)
        >>> R2
        array([[ 1.        ,  0.99256089, -0.68080986,  0.75008178, -0.934284  ,
                -0.99004057],
               [ 0.99256089,  1.        , -0.76492172,  0.82502011, -0.97074098,
                -0.99981569],
               [-0.68080986, -0.76492172,  1.        , -0.99507202,  0.89721355,
                 0.77714685],
               [ 0.75008178,  0.82502011, -0.99507202,  1.        , -0.93657855,
                -0.83571711],
               [-0.934284  , -0.97074098,  0.89721355, -0.93657855,  1.        ,
                 0.97517215],
               [-0.99004057, -0.99981569,  0.77714685, -0.83571711,  0.97517215,
                 1.        ]])

        Finally if we use the option ``rowvar=False``, the columns are now
        being treated as the variables and we will find the column-wise Pearson
        correlation coefficients between variables in ``xarr`` and ``yarr``.

        >>> R3 = np.corrcoef(xarr, yarr, rowvar=False)
        >>> R3
        array([[ 1.        ,  0.77598074, -0.47458546, -0.75078643, -0.9665554 ,
                 0.22423734],
               [ 0.77598074,  1.        , -0.92346708, -0.99923895, -0.58826587,
                -0.44069024],
               [-0.47458546, -0.92346708,  1.        ,  0.93773029,  0.23297648,
                 0.75137473],
               [-0.75078643, -0.99923895,  0.93773029,  1.        ,  0.55627469,
                 0.47536961],
               [-0.9665554 , -0.58826587,  0.23297648,  0.55627469,  1.        ,
                -0.46666491],
               [ 0.22423734, -0.44069024,  0.75137473,  0.47536961, -0.46666491,
                 1.        ]])

    correlate(a, v, mode='valid')
        Cross-correlation of two 1-dimensional sequences.

        This function computes the correlation as generally defined in signal
        processing texts [1]_:

        .. math:: c_k = \sum_n a_{n+k} \cdot \overline{v}_n

        with a and v sequences being zero-padded where necessary and
        :math:`\overline v` denoting complex conjugation.

        Parameters
        ----------
        a, v : array_like
            Input sequences.
        mode : {'valid', 'same', 'full'}, optional
            Refer to the `convolve` docstring.  Note that the default
            is 'valid', unlike `convolve`, which uses 'full'.

        Returns
        -------
        out : ndarray
            Discrete cross-correlation of `a` and `v`.

        See Also
        --------
        convolve : Discrete, linear convolution of two one-dimensional sequences.
        scipy.signal.correlate : uses FFT which has superior performance
            on large arrays.

        Notes
        -----
        The definition of correlation above is not unique and sometimes
        correlation may be defined differently. Another common definition is [1]_:

        .. math:: c'_k = \sum_n a_{n} \cdot \overline{v_{n+k}}

        which is related to :math:`c_k` by :math:`c'_k = c_{-k}`.

        `numpy.correlate` may perform slowly in large arrays (i.e. n = 1e5)
        because it does not use the FFT to compute the convolution; in that case,
        `scipy.signal.correlate` might be preferable.

        References
        ----------
        .. [1] Wikipedia, "Cross-correlation",
               https://en.wikipedia.org/wiki/Cross-correlation

        Examples
        --------
        >>> import numpy as np
        >>> np.correlate([1, 2, 3], [0, 1, 0.5])
        array([3.5])
        >>> np.correlate([1, 2, 3], [0, 1, 0.5], "same")
        array([2. ,  3.5,  3. ])
        >>> np.correlate([1, 2, 3], [0, 1, 0.5], "full")
        array([0.5,  2. ,  3.5,  3. ,  0. ])

        Using complex sequences:

        >>> np.correlate([1+1j, 2, 3-1j], [0, 1, 0.5j], 'full')
        array([ 0.5-0.5j,  1.0+0.j ,  1.5-1.5j,  3.0-1.j ,  0.0+0.j ])

        Note that you get the time reversed, complex conjugated result
        (:math:`\overline{c_{-k}}`) when the two input sequences a and v change
        places:

        >>> np.correlate([0, 1, 0.5j], [1+1j, 2, 3-1j], 'full')
        array([ 0.0+0.j ,  3.0+1.j ,  1.5+1.5j,  1.0+0.j ,  0.5+0.5j])

    count_nonzero(a, axis=None, *, keepdims=False)
        Counts the number of non-zero values in the array ``a``.

        The word "non-zero" is in reference to the Python 2.x
        built-in method ``__nonzero__()`` (renamed ``__bool__()``
        in Python 3.x) of Python objects that tests an object's
        "truthfulness". For example, any number is considered
        truthful if it is nonzero, whereas any string is considered
        truthful if it is not the empty string. Thus, this function
        (recursively) counts how many elements in ``a`` (and in
        sub-arrays thereof) have their ``__nonzero__()`` or ``__bool__()``
        method evaluated to ``True``.

        Parameters
        ----------
        a : array_like
            The array for which to count non-zeros.
        axis : int or tuple, optional
            Axis or tuple of axes along which to count non-zeros.
            Default is None, meaning that non-zeros will be counted
            along a flattened version of ``a``.

            .. versionadded:: 1.12.0

        keepdims : bool, optional
            If this is set to True, the axes that are counted are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            .. versionadded:: 1.19.0

        Returns
        -------
        count : int or array of int
            Number of non-zero values in the array along a given axis.
            Otherwise, the total number of non-zero values in the array
            is returned.

        See Also
        --------
        nonzero : Return the coordinates of all the non-zero values.

        Examples
        --------
        >>> import numpy as np
        >>> np.count_nonzero(np.eye(4))
        4
        >>> a = np.array([[0, 1, 7, 0],
        ...               [3, 0, 2, 19]])
        >>> np.count_nonzero(a)
        5
        >>> np.count_nonzero(a, axis=0)
        array([1, 1, 2, 1])
        >>> np.count_nonzero(a, axis=1)
        array([2, 3])
        >>> np.count_nonzero(a, axis=1, keepdims=True)
        array([[2],
               [3]])

    cov(m, y=None, rowvar=True, bias=False, ddof=None, fweights=None, aweights=None, *, dtype=None)
        Estimate a covariance matrix, given data and weights.

        Covariance indicates the level to which two variables vary together.
        If we examine N-dimensional samples, :math:`X = [x_1, x_2, ... x_N]^T`,
        then the covariance matrix element :math:`C_{ij}` is the covariance of
        :math:`x_i` and :math:`x_j`. The element :math:`C_{ii}` is the variance
        of :math:`x_i`.

        See the notes for an outline of the algorithm.

        Parameters
        ----------
        m : array_like
            A 1-D or 2-D array containing multiple variables and observations.
            Each row of `m` represents a variable, and each column a single
            observation of all those variables. Also see `rowvar` below.
        y : array_like, optional
            An additional set of variables and observations. `y` has the same form
            as that of `m`.
        rowvar : bool, optional
            If `rowvar` is True (default), then each row represents a
            variable, with observations in the columns. Otherwise, the relationship
            is transposed: each column represents a variable, while the rows
            contain observations.
        bias : bool, optional
            Default normalization (False) is by ``(N - 1)``, where ``N`` is the
            number of observations given (unbiased estimate). If `bias` is True,
            then normalization is by ``N``. These values can be overridden by using
            the keyword ``ddof`` in numpy versions >= 1.5.
        ddof : int, optional
            If not ``None`` the default value implied by `bias` is overridden.
            Note that ``ddof=1`` will return the unbiased estimate, even if both
            `fweights` and `aweights` are specified, and ``ddof=0`` will return
            the simple average. See the notes for the details. The default value
            is ``None``.

            .. versionadded:: 1.5
        fweights : array_like, int, optional
            1-D array of integer frequency weights; the number of times each
            observation vector should be repeated.

            .. versionadded:: 1.10
        aweights : array_like, optional
            1-D array of observation vector weights. These relative weights are
            typically large for observations considered "important" and smaller for
            observations considered less "important". If ``ddof=0`` the array of
            weights can be used to assign probabilities to observation vectors.

            .. versionadded:: 1.10
        dtype : data-type, optional
            Data-type of the result. By default, the return data-type will have
            at least `numpy.float64` precision.

            .. versionadded:: 1.20

        Returns
        -------
        out : ndarray
            The covariance matrix of the variables.

        See Also
        --------
        corrcoef : Normalized covariance matrix

        Notes
        -----
        Assume that the observations are in the columns of the observation
        array `m` and let ``f = fweights`` and ``a = aweights`` for brevity. The
        steps to compute the weighted covariance are as follows::

            >>> m = np.arange(10, dtype=np.float64)
            >>> f = np.arange(10) * 2
            >>> a = np.arange(10) ** 2.
            >>> ddof = 1
            >>> w = f * a
            >>> v1 = np.sum(w)
            >>> v2 = np.sum(w * a)
            >>> m -= np.sum(m * w, axis=None, keepdims=True) / v1
            >>> cov = np.dot(m * w, m.T) * v1 / (v1**2 - ddof * v2)

        Note that when ``a == 1``, the normalization factor
        ``v1 / (v1**2 - ddof * v2)`` goes over to ``1 / (np.sum(f) - ddof)``
        as it should.

        Examples
        --------
        >>> import numpy as np

        Consider two variables, :math:`x_0` and :math:`x_1`, which
        correlate perfectly, but in opposite directions:

        >>> x = np.array([[0, 2], [1, 1], [2, 0]]).T
        >>> x
        array([[0, 1, 2],
               [2, 1, 0]])

        Note how :math:`x_0` increases while :math:`x_1` decreases. The covariance
        matrix shows this clearly:

        >>> np.cov(x)
        array([[ 1., -1.],
               [-1.,  1.]])

        Note that element :math:`C_{0,1}`, which shows the correlation between
        :math:`x_0` and :math:`x_1`, is negative.

        Further, note how `x` and `y` are combined:

        >>> x = [-2.1, -1,  4.3]
        >>> y = [3,  1.1,  0.12]
        >>> X = np.stack((x, y), axis=0)
        >>> np.cov(X)
        array([[11.71      , -4.286     ], # may vary
               [-4.286     ,  2.144133]])
        >>> np.cov(x, y)
        array([[11.71      , -4.286     ], # may vary
               [-4.286     ,  2.144133]])
        >>> np.cov(x)
        array(11.71)

    cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None)
        Return the cross product of two (arrays of) vectors.

        The cross product of `a` and `b` in :math:`R^3` is a vector perpendicular
        to both `a` and `b`.  If `a` and `b` are arrays of vectors, the vectors
        are defined by the last axis of `a` and `b` by default, and these axes
        can have dimensions 2 or 3.  Where the dimension of either `a` or `b` is
        2, the third component of the input vector is assumed to be zero and the
        cross product calculated accordingly.  In cases where both input vectors
        have dimension 2, the z-component of the cross product is returned.

        Parameters
        ----------
        a : array_like
            Components of the first vector(s).
        b : array_like
            Components of the second vector(s).
        axisa : int, optional
            Axis of `a` that defines the vector(s).  By default, the last axis.
        axisb : int, optional
            Axis of `b` that defines the vector(s).  By default, the last axis.
        axisc : int, optional
            Axis of `c` containing the cross product vector(s).  Ignored if
            both input vectors have dimension 2, as the return is scalar.
            By default, the last axis.
        axis : int, optional
            If defined, the axis of `a`, `b` and `c` that defines the vector(s)
            and cross product(s).  Overrides `axisa`, `axisb` and `axisc`.

        Returns
        -------
        c : ndarray
            Vector cross product(s).

        Raises
        ------
        ValueError
            When the dimension of the vector(s) in `a` and/or `b` does not
            equal 2 or 3.

        See Also
        --------
        inner : Inner product
        outer : Outer product.
        linalg.cross : An Array API compatible variation of ``np.cross``,
                       which accepts (arrays of) 3-element vectors only.
        ix_ : Construct index arrays.

        Notes
        -----
        .. versionadded:: 1.9.0

        Supports full broadcasting of the inputs.

        Dimension-2 input arrays were deprecated in 2.0.0. If you do need this
        functionality, you can use::

            def cross2d(x, y):
                return x[..., 0] * y[..., 1] - x[..., 1] * y[..., 0]

        Examples
        --------
        Vector cross-product.

        >>> import numpy as np
        >>> x = [1, 2, 3]
        >>> y = [4, 5, 6]
        >>> np.cross(x, y)
        array([-3,  6, -3])

        One vector with dimension 2.

        >>> x = [1, 2]
        >>> y = [4, 5, 6]
        >>> np.cross(x, y)
        array([12, -6, -3])

        Equivalently:

        >>> x = [1, 2, 0]
        >>> y = [4, 5, 6]
        >>> np.cross(x, y)
        array([12, -6, -3])

        Both vectors with dimension 2.

        >>> x = [1,2]
        >>> y = [4,5]
        >>> np.cross(x, y)
        array(-3)

        Multiple vector cross-products. Note that the direction of the cross
        product vector is defined by the *right-hand rule*.

        >>> x = np.array([[1,2,3], [4,5,6]])
        >>> y = np.array([[4,5,6], [1,2,3]])
        >>> np.cross(x, y)
        array([[-3,  6, -3],
               [ 3, -6,  3]])

        The orientation of `c` can be changed using the `axisc` keyword.

        >>> np.cross(x, y, axisc=0)
        array([[-3,  3],
               [ 6, -6],
               [-3,  3]])

        Change the vector definition of `x` and `y` using `axisa` and `axisb`.

        >>> x = np.array([[1,2,3], [4,5,6], [7, 8, 9]])
        >>> y = np.array([[7, 8, 9], [4,5,6], [1,2,3]])
        >>> np.cross(x, y)
        array([[ -6,  12,  -6],
               [  0,   0,   0],
               [  6, -12,   6]])
        >>> np.cross(x, y, axisa=0, axisb=0)
        array([[-24,  48, -24],
               [-30,  60, -30],
               [-36,  72, -36]])

    cumprod(a, axis=None, dtype=None, out=None)
        Return the cumulative product of elements along a given axis.

        Parameters
        ----------
        a : array_like
            Input array.
        axis : int, optional
            Axis along which the cumulative product is computed.  By default
            the input is flattened.
        dtype : dtype, optional
            Type of the returned array, as well as of the accumulator in which
            the elements are multiplied.  If *dtype* is not specified, it
            defaults to the dtype of `a`, unless `a` has an integer dtype with
            a precision less than that of the default platform integer.  In
            that case, the default platform integer is used instead.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type of the resulting values will be cast if necessary.

        Returns
        -------
        cumprod : ndarray
            A new array holding the result is returned unless `out` is
            specified, in which case a reference to out is returned.

        See Also
        --------
        cumulative_prod : Array API compatible alternative for ``cumprod``.
        :ref:`ufuncs-output-type`

        Notes
        -----
        Arithmetic is modular when using integer types, and no error is
        raised on overflow.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([1,2,3])
        >>> np.cumprod(a) # intermediate results 1, 1*2
        ...               # total product 1*2*3 = 6
        array([1, 2, 6])
        >>> a = np.array([[1, 2, 3], [4, 5, 6]])
        >>> np.cumprod(a, dtype=float) # specify type of output
        array([   1.,    2.,    6.,   24.,  120.,  720.])

        The cumulative product for each column (i.e., over the rows) of `a`:

        >>> np.cumprod(a, axis=0)
        array([[ 1,  2,  3],
               [ 4, 10, 18]])

        The cumulative product for each row (i.e. over the columns) of `a`:

        >>> np.cumprod(a,axis=1)
        array([[  1,   2,   6],
               [  4,  20, 120]])

    cumsum(a, axis=None, dtype=None, out=None)
        Return the cumulative sum of the elements along a given axis.

        Parameters
        ----------
        a : array_like
            Input array.
        axis : int, optional
            Axis along which the cumulative sum is computed. The default
            (None) is to compute the cumsum over the flattened array.
        dtype : dtype, optional
            Type of the returned array and of the accumulator in which the
            elements are summed.  If `dtype` is not specified, it defaults
            to the dtype of `a`, unless `a` has an integer dtype with a
            precision less than that of the default platform integer.  In
            that case, the default platform integer is used.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type will be cast if necessary. See :ref:`ufuncs-output-type`
            for more details.

        Returns
        -------
        cumsum_along_axis : ndarray.
            A new array holding the result is returned unless `out` is
            specified, in which case a reference to `out` is returned. The
            result has the same size as `a`, and the same shape as `a` if
            `axis` is not None or `a` is a 1-d array.

        See Also
        --------
        cumulative_sum : Array API compatible alternative for ``cumsum``.
        sum : Sum array elements.
        trapezoid : Integration of array values using composite trapezoidal rule.
        diff : Calculate the n-th discrete difference along given axis.

        Notes
        -----
        Arithmetic is modular when using integer types, and no error is
        raised on overflow.

        ``cumsum(a)[-1]`` may not be equal to ``sum(a)`` for floating-point
        values since ``sum`` may use a pairwise summation routine, reducing
        the roundoff-error. See `sum` for more information.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1,2,3], [4,5,6]])
        >>> a
        array([[1, 2, 3],
               [4, 5, 6]])
        >>> np.cumsum(a)
        array([ 1,  3,  6, 10, 15, 21])
        >>> np.cumsum(a, dtype=float)     # specifies type of output value(s)
        array([  1.,   3.,   6.,  10.,  15.,  21.])

        >>> np.cumsum(a,axis=0)      # sum over rows for each of the 3 columns
        array([[1, 2, 3],
               [5, 7, 9]])
        >>> np.cumsum(a,axis=1)      # sum over columns for each of the 2 rows
        array([[ 1,  3,  6],
               [ 4,  9, 15]])

        ``cumsum(b)[-1]`` may not be equal to ``sum(b)``

        >>> b = np.array([1, 2e-9, 3e-9] * 1000000)
        >>> b.cumsum()[-1]
        1000000.0050045159
        >>> b.sum()
        1000000.0050000029

    cumulative_prod(x, /, *, axis=None, dtype=None, out=None, include_initial=False)
        Return the cumulative product of elements along a given axis.

        This function is an Array API compatible alternative to `numpy.cumprod`.

        Parameters
        ----------
        x : array_like
            Input array.
        axis : int, optional
            Axis along which the cumulative product is computed. The default
            (None) is only allowed for one-dimensional arrays. For arrays
            with more than one dimension ``axis`` is required.
        dtype : dtype, optional
            Type of the returned array, as well as of the accumulator in which
            the elements are multiplied.  If ``dtype`` is not specified, it
            defaults to the dtype of ``x``, unless ``x`` has an integer dtype
            with a precision less than that of the default platform integer.
            In that case, the default platform integer is used instead.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type of the resulting values will be cast if necessary.
            See :ref:`ufuncs-output-type` for more details.
        include_initial : bool, optional
            Boolean indicating whether to include the initial value (ones) as
            the first value in the output. With ``include_initial=True``
            the shape of the output is different than the shape of the input.
            Default: ``False``.

        Returns
        -------
        cumulative_prod_along_axis : ndarray
            A new array holding the result is returned unless ``out`` is
            specified, in which case a reference to ``out`` is returned. The
            result has the same shape as ``x`` if ``include_initial=False``.

        Notes
        -----
        Arithmetic is modular when using integer types, and no error is
        raised on overflow.

        Examples
        --------
        >>> a = np.array([1, 2, 3])
        >>> np.cumulative_prod(a)  # intermediate results 1, 1*2
        ...                        # total product 1*2*3 = 6
        array([1, 2, 6])
        >>> a = np.array([1, 2, 3, 4, 5, 6])
        >>> np.cumulative_prod(a, dtype=float) # specify type of output
        array([   1.,    2.,    6.,   24.,  120.,  720.])

        The cumulative product for each column (i.e., over the rows) of ``b``:

        >>> b = np.array([[1, 2, 3], [4, 5, 6]])
        >>> np.cumulative_prod(b, axis=0)
        array([[ 1,  2,  3],
               [ 4, 10, 18]])

        The cumulative product for each row (i.e. over the columns) of ``b``:

        >>> np.cumulative_prod(b, axis=1)
        array([[  1,   2,   6],
               [  4,  20, 120]])

    cumulative_sum(x, /, *, axis=None, dtype=None, out=None, include_initial=False)
        Return the cumulative sum of the elements along a given axis.

        This function is an Array API compatible alternative to `numpy.cumsum`.

        Parameters
        ----------
        x : array_like
            Input array.
        axis : int, optional
            Axis along which the cumulative sum is computed. The default
            (None) is only allowed for one-dimensional arrays. For arrays
            with more than one dimension ``axis`` is required.
        dtype : dtype, optional
            Type of the returned array and of the accumulator in which the
            elements are summed.  If ``dtype`` is not specified, it defaults
            to the dtype of ``x``, unless ``x`` has an integer dtype with
            a precision less than that of the default platform integer.
            In that case, the default platform integer is used.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type will be cast if necessary. See :ref:`ufuncs-output-type`
            for more details.
        include_initial : bool, optional
            Boolean indicating whether to include the initial value (ones) as
            the first value in the output. With ``include_initial=True``
            the shape of the output is different than the shape of the input.
            Default: ``False``.

        Returns
        -------
        cumulative_sum_along_axis : ndarray
            A new array holding the result is returned unless ``out`` is
            specified, in which case a reference to ``out`` is returned. The
            result has the same shape as ``x`` if ``include_initial=False``.

        See Also
        --------
        sum : Sum array elements.
        trapezoid : Integration of array values using composite trapezoidal rule.
        diff : Calculate the n-th discrete difference along given axis.

        Notes
        -----
        Arithmetic is modular when using integer types, and no error is
        raised on overflow.

        ``cumulative_sum(a)[-1]`` may not be equal to ``sum(a)`` for
        floating-point values since ``sum`` may use a pairwise summation routine,
        reducing the roundoff-error. See `sum` for more information.

        Examples
        --------
        >>> a = np.array([1, 2, 3, 4, 5, 6])
        >>> a
        array([1, 2, 3, 4, 5, 6])
        >>> np.cumulative_sum(a)
        array([ 1,  3,  6, 10, 15, 21])
        >>> np.cumulative_sum(a, dtype=float)  # specifies type of output value(s)
        array([  1.,   3.,   6.,  10.,  15.,  21.])

        >>> b = np.array([[1, 2, 3], [4, 5, 6]])
        >>> np.cumulative_sum(b,axis=0)  # sum over rows for each of the 3 columns
        array([[1, 2, 3],
               [5, 7, 9]])
        >>> np.cumulative_sum(b,axis=1)  # sum over columns for each of the 2 rows
        array([[ 1,  3,  6],
               [ 4,  9, 15]])

        ``cumulative_sum(c)[-1]`` may not be equal to ``sum(c)``

        >>> c = np.array([1, 2e-9, 3e-9] * 1000000)
        >>> np.cumulative_sum(c)[-1]
        1000000.0050045159
        >>> c.sum()
        1000000.0050000029

    datetime_as_string(...)
        datetime_as_string(arr, unit=None, timezone='naive', casting='same_kind')

        Convert an array of datetimes into an array of strings.

        Parameters
        ----------
        arr : array_like of datetime64
            The array of UTC timestamps to format.
        unit : str
            One of None, 'auto', or
            a :ref:`datetime unit <arrays.dtypes.dateunits>`.
        timezone : {'naive', 'UTC', 'local'} or tzinfo
            Timezone information to use when displaying the datetime. If 'UTC',
            end with a Z to indicate UTC time. If 'local', convert to the local
            timezone first, and suffix with a +-#### timezone offset. If a tzinfo
            object, then do as with 'local', but use the specified timezone.
        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}
            Casting to allow when changing between datetime units.

        Returns
        -------
        str_arr : ndarray
            An array of strings the same shape as `arr`.

        Examples
        --------
        >>> import numpy as np
        >>> import pytz
        >>> d = np.arange('2002-10-27T04:30', 4*60, 60, dtype='M8[m]')
        >>> d
        array(['2002-10-27T04:30', '2002-10-27T05:30', '2002-10-27T06:30',
               '2002-10-27T07:30'], dtype='datetime64[m]')

        Setting the timezone to UTC shows the same information, but with a Z suffix

        >>> np.datetime_as_string(d, timezone='UTC')
        array(['2002-10-27T04:30Z', '2002-10-27T05:30Z', '2002-10-27T06:30Z',
               '2002-10-27T07:30Z'], dtype='<U35')

        Note that we picked datetimes that cross a DST boundary. Passing in a
        ``pytz`` timezone object will print the appropriate offset

        >>> np.datetime_as_string(d, timezone=pytz.timezone('US/Eastern'))
        array(['2002-10-27T00:30-0400', '2002-10-27T01:30-0400',
               '2002-10-27T01:30-0500', '2002-10-27T02:30-0500'], dtype='<U39')

        Passing in a unit will change the precision

        >>> np.datetime_as_string(d, unit='h')
        array(['2002-10-27T04', '2002-10-27T05', '2002-10-27T06', '2002-10-27T07'],
              dtype='<U32')
        >>> np.datetime_as_string(d, unit='s')
        array(['2002-10-27T04:30:00', '2002-10-27T05:30:00', '2002-10-27T06:30:00',
               '2002-10-27T07:30:00'], dtype='<U38')

        'casting' can be used to specify whether precision can be changed

        >>> np.datetime_as_string(d, unit='h', casting='safe')
        Traceback (most recent call last):
            ...
        TypeError: Cannot create a datetime string as units 'h' from a NumPy
        datetime with units 'm' according to the rule 'safe'

    datetime_data(...)
        datetime_data(dtype, /)

        Get information about the step size of a date or time type.

        The returned tuple can be passed as the second argument of `numpy.datetime64` and
        `numpy.timedelta64`.

        Parameters
        ----------
        dtype : dtype
            The dtype object, which must be a `datetime64` or `timedelta64` type.

        Returns
        -------
        unit : str
            The :ref:`datetime unit <arrays.dtypes.dateunits>` on which this dtype
            is based.
        count : int
            The number of base units in a step.

        Examples
        --------
        >>> import numpy as np
        >>> dt_25s = np.dtype('timedelta64[25s]')
        >>> np.datetime_data(dt_25s)
        ('s', 25)
        >>> np.array(10, dt_25s).astype('timedelta64[s]')
        array(250, dtype='timedelta64[s]')

        The result can be used to construct a datetime that uses the same units
        as a timedelta

        >>> np.datetime64('2010', np.datetime_data(dt_25s))
        np.datetime64('2010-01-01T00:00:00','25s')

    delete(arr, obj, axis=None)
        Return a new array with sub-arrays along an axis deleted. For a one
        dimensional array, this returns those entries not returned by
        `arr[obj]`.

        Parameters
        ----------
        arr : array_like
            Input array.
        obj : slice, int or array of ints
            Indicate indices of sub-arrays to remove along the specified axis.

            .. versionchanged:: 1.19.0
                Boolean indices are now treated as a mask of elements to remove,
                rather than being cast to the integers 0 and 1.

        axis : int, optional
            The axis along which to delete the subarray defined by `obj`.
            If `axis` is None, `obj` is applied to the flattened array.

        Returns
        -------
        out : ndarray
            A copy of `arr` with the elements specified by `obj` removed. Note
            that `delete` does not occur in-place. If `axis` is None, `out` is
            a flattened array.

        See Also
        --------
        insert : Insert elements into an array.
        append : Append elements at the end of an array.

        Notes
        -----
        Often it is preferable to use a boolean mask. For example:

        >>> arr = np.arange(12) + 1
        >>> mask = np.ones(len(arr), dtype=bool)
        >>> mask[[0,2,4]] = False
        >>> result = arr[mask,...]

        Is equivalent to ``np.delete(arr, [0,2,4], axis=0)``, but allows further
        use of `mask`.

        Examples
        --------
        >>> import numpy as np
        >>> arr = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]])
        >>> arr
        array([[ 1,  2,  3,  4],
               [ 5,  6,  7,  8],
               [ 9, 10, 11, 12]])
        >>> np.delete(arr, 1, 0)
        array([[ 1,  2,  3,  4],
               [ 9, 10, 11, 12]])

        >>> np.delete(arr, np.s_[::2], 1)
        array([[ 2,  4],
               [ 6,  8],
               [10, 12]])
        >>> np.delete(arr, [1,3,5], None)
        array([ 1,  3,  5,  7,  8,  9, 10, 11, 12])

    diag(v, k=0)
        Extract a diagonal or construct a diagonal array.

        See the more detailed documentation for ``numpy.diagonal`` if you use this
        function to extract a diagonal and wish to write to the resulting array;
        whether it returns a copy or a view depends on what version of numpy you
        are using.

        Parameters
        ----------
        v : array_like
            If `v` is a 2-D array, return a copy of its `k`-th diagonal.
            If `v` is a 1-D array, return a 2-D array with `v` on the `k`-th
            diagonal.
        k : int, optional
            Diagonal in question. The default is 0. Use `k>0` for diagonals
            above the main diagonal, and `k<0` for diagonals below the main
            diagonal.

        Returns
        -------
        out : ndarray
            The extracted diagonal or constructed diagonal array.

        See Also
        --------
        diagonal : Return specified diagonals.
        diagflat : Create a 2-D array with the flattened input as a diagonal.
        trace : Sum along diagonals.
        triu : Upper triangle of an array.
        tril : Lower triangle of an array.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(9).reshape((3,3))
        >>> x
        array([[0, 1, 2],
               [3, 4, 5],
               [6, 7, 8]])

        >>> np.diag(x)
        array([0, 4, 8])
        >>> np.diag(x, k=1)
        array([1, 5])
        >>> np.diag(x, k=-1)
        array([3, 7])

        >>> np.diag(np.diag(x))
        array([[0, 0, 0],
               [0, 4, 0],
               [0, 0, 8]])

    diag_indices(n, ndim=2)
        Return the indices to access the main diagonal of an array.

        This returns a tuple of indices that can be used to access the main
        diagonal of an array `a` with ``a.ndim >= 2`` dimensions and shape
        (n, n, ..., n). For ``a.ndim = 2`` this is the usual diagonal, for
        ``a.ndim > 2`` this is the set of indices to access ``a[i, i, ..., i]``
        for ``i = [0..n-1]``.

        Parameters
        ----------
        n : int
          The size, along each dimension, of the arrays for which the returned
          indices can be used.

        ndim : int, optional
          The number of dimensions.

        See Also
        --------
        diag_indices_from

        Notes
        -----
        .. versionadded:: 1.4.0

        Examples
        --------
        >>> import numpy as np

        Create a set of indices to access the diagonal of a (4, 4) array:

        >>> di = np.diag_indices(4)
        >>> di
        (array([0, 1, 2, 3]), array([0, 1, 2, 3]))
        >>> a = np.arange(16).reshape(4, 4)
        >>> a
        array([[ 0,  1,  2,  3],
               [ 4,  5,  6,  7],
               [ 8,  9, 10, 11],
               [12, 13, 14, 15]])
        >>> a[di] = 100
        >>> a
        array([[100,   1,   2,   3],
               [  4, 100,   6,   7],
               [  8,   9, 100,  11],
               [ 12,  13,  14, 100]])

        Now, we create indices to manipulate a 3-D array:

        >>> d3 = np.diag_indices(2, 3)
        >>> d3
        (array([0, 1]), array([0, 1]), array([0, 1]))

        And use it to set the diagonal of an array of zeros to 1:

        >>> a = np.zeros((2, 2, 2), dtype=int)
        >>> a[d3] = 1
        >>> a
        array([[[1, 0],
                [0, 0]],
               [[0, 0],
                [0, 1]]])

    diag_indices_from(arr)
        Return the indices to access the main diagonal of an n-dimensional array.

        See `diag_indices` for full details.

        Parameters
        ----------
        arr : array, at least 2-D

        See Also
        --------
        diag_indices

        Notes
        -----
        .. versionadded:: 1.4.0

        Examples
        --------
        >>> import numpy as np

        Create a 4 by 4 array.

        >>> a = np.arange(16).reshape(4, 4)
        >>> a
        array([[ 0,  1,  2,  3],
               [ 4,  5,  6,  7],
               [ 8,  9, 10, 11],
               [12, 13, 14, 15]])

        Get the indices of the diagonal elements.

        >>> di = np.diag_indices_from(a)
        >>> di
        (array([0, 1, 2, 3]), array([0, 1, 2, 3]))

        >>> a[di]
        array([ 0,  5, 10, 15])

        This is simply syntactic sugar for diag_indices.

        >>> np.diag_indices(a.shape[0])
        (array([0, 1, 2, 3]), array([0, 1, 2, 3]))

    diagflat(v, k=0)
        Create a two-dimensional array with the flattened input as a diagonal.

        Parameters
        ----------
        v : array_like
            Input data, which is flattened and set as the `k`-th
            diagonal of the output.
        k : int, optional
            Diagonal to set; 0, the default, corresponds to the "main" diagonal,
            a positive (negative) `k` giving the number of the diagonal above
            (below) the main.

        Returns
        -------
        out : ndarray
            The 2-D output array.

        See Also
        --------
        diag : MATLAB work-alike for 1-D and 2-D arrays.
        diagonal : Return specified diagonals.
        trace : Sum along diagonals.

        Examples
        --------
        >>> import numpy as np
        >>> np.diagflat([[1,2], [3,4]])
        array([[1, 0, 0, 0],
               [0, 2, 0, 0],
               [0, 0, 3, 0],
               [0, 0, 0, 4]])

        >>> np.diagflat([1,2], 1)
        array([[0, 1, 0],
               [0, 0, 2],
               [0, 0, 0]])

    diagonal(a, offset=0, axis1=0, axis2=1)
        Return specified diagonals.

        If `a` is 2-D, returns the diagonal of `a` with the given offset,
        i.e., the collection of elements of the form ``a[i, i+offset]``.  If
        `a` has more than two dimensions, then the axes specified by `axis1`
        and `axis2` are used to determine the 2-D sub-array whose diagonal is
        returned.  The shape of the resulting array can be determined by
        removing `axis1` and `axis2` and appending an index to the right equal
        to the size of the resulting diagonals.

        In versions of NumPy prior to 1.7, this function always returned a new,
        independent array containing a copy of the values in the diagonal.

        In NumPy 1.7 and 1.8, it continues to return a copy of the diagonal,
        but depending on this fact is deprecated. Writing to the resulting
        array continues to work as it used to, but a FutureWarning is issued.

        Starting in NumPy 1.9 it returns a read-only view on the original array.
        Attempting to write to the resulting array will produce an error.

        In some future release, it will return a read/write view and writing to
        the returned array will alter your original array.  The returned array
        will have the same type as the input array.

        If you don't write to the array returned by this function, then you can
        just ignore all of the above.

        If you depend on the current behavior, then we suggest copying the
        returned array explicitly, i.e., use ``np.diagonal(a).copy()`` instead
        of just ``np.diagonal(a)``. This will work with both past and future
        versions of NumPy.

        Parameters
        ----------
        a : array_like
            Array from which the diagonals are taken.
        offset : int, optional
            Offset of the diagonal from the main diagonal.  Can be positive or
            negative.  Defaults to main diagonal (0).
        axis1 : int, optional
            Axis to be used as the first axis of the 2-D sub-arrays from which
            the diagonals should be taken.  Defaults to first axis (0).
        axis2 : int, optional
            Axis to be used as the second axis of the 2-D sub-arrays from
            which the diagonals should be taken. Defaults to second axis (1).

        Returns
        -------
        array_of_diagonals : ndarray
            If `a` is 2-D, then a 1-D array containing the diagonal and of the
            same type as `a` is returned unless `a` is a `matrix`, in which case
            a 1-D array rather than a (2-D) `matrix` is returned in order to
            maintain backward compatibility.

            If ``a.ndim > 2``, then the dimensions specified by `axis1` and `axis2`
            are removed, and a new axis inserted at the end corresponding to the
            diagonal.

        Raises
        ------
        ValueError
            If the dimension of `a` is less than 2.

        See Also
        --------
        diag : MATLAB work-a-like for 1-D and 2-D arrays.
        diagflat : Create diagonal arrays.
        trace : Sum along diagonals.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(4).reshape(2,2)
        >>> a
        array([[0, 1],
               [2, 3]])
        >>> a.diagonal()
        array([0, 3])
        >>> a.diagonal(1)
        array([1])

        A 3-D example:

        >>> a = np.arange(8).reshape(2,2,2); a
        array([[[0, 1],
                [2, 3]],
               [[4, 5],
                [6, 7]]])
        >>> a.diagonal(0,  # Main diagonals of two arrays created by skipping
        ...            0,  # across the outer(left)-most axis last and
        ...            1)  # the "middle" (row) axis first.
        array([[0, 6],
               [1, 7]])

        The sub-arrays whose main diagonals we just obtained; note that each
        corresponds to fixing the right-most (column) axis, and that the
        diagonals are "packed" in rows.

        >>> a[:,:,0]  # main diagonal is [0 6]
        array([[0, 2],
               [4, 6]])
        >>> a[:,:,1]  # main diagonal is [1 7]
        array([[1, 3],
               [5, 7]])

        The anti-diagonal can be obtained by reversing the order of elements
        using either `numpy.flipud` or `numpy.fliplr`.

        >>> a = np.arange(9).reshape(3, 3)
        >>> a
        array([[0, 1, 2],
               [3, 4, 5],
               [6, 7, 8]])
        >>> np.fliplr(a).diagonal()  # Horizontal flip
        array([2, 4, 6])
        >>> np.flipud(a).diagonal()  # Vertical flip
        array([6, 4, 2])

        Note that the order in which the diagonal is retrieved varies depending
        on the flip function.

    diff(a, n=1, axis=-1, prepend=<no value>, append=<no value>)
        Calculate the n-th discrete difference along the given axis.

        The first difference is given by ``out[i] = a[i+1] - a[i]`` along
        the given axis, higher differences are calculated by using `diff`
        recursively.

        Parameters
        ----------
        a : array_like
            Input array
        n : int, optional
            The number of times values are differenced. If zero, the input
            is returned as-is.
        axis : int, optional
            The axis along which the difference is taken, default is the
            last axis.
        prepend, append : array_like, optional
            Values to prepend or append to `a` along axis prior to
            performing the difference.  Scalar values are expanded to
            arrays with length 1 in the direction of axis and the shape
            of the input array in along all other axes.  Otherwise the
            dimension and shape must match `a` except along axis.

            .. versionadded:: 1.16.0

        Returns
        -------
        diff : ndarray
            The n-th differences. The shape of the output is the same as `a`
            except along `axis` where the dimension is smaller by `n`. The
            type of the output is the same as the type of the difference
            between any two elements of `a`. This is the same as the type of
            `a` in most cases. A notable exception is `datetime64`, which
            results in a `timedelta64` output array.

        See Also
        --------
        gradient, ediff1d, cumsum

        Notes
        -----
        Type is preserved for boolean arrays, so the result will contain
        `False` when consecutive elements are the same and `True` when they
        differ.

        For unsigned integer arrays, the results will also be unsigned. This
        should not be surprising, as the result is consistent with
        calculating the difference directly:

        >>> u8_arr = np.array([1, 0], dtype=np.uint8)
        >>> np.diff(u8_arr)
        array([255], dtype=uint8)
        >>> u8_arr[1,...] - u8_arr[0,...]
        255

        If this is not desirable, then the array should be cast to a larger
        integer type first:

        >>> i16_arr = u8_arr.astype(np.int16)
        >>> np.diff(i16_arr)
        array([-1], dtype=int16)

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([1, 2, 4, 7, 0])
        >>> np.diff(x)
        array([ 1,  2,  3, -7])
        >>> np.diff(x, n=2)
        array([  1,   1, -10])

        >>> x = np.array([[1, 3, 6, 10], [0, 5, 6, 8]])
        >>> np.diff(x)
        array([[2, 3, 4],
               [5, 1, 2]])
        >>> np.diff(x, axis=0)
        array([[-1,  2,  0, -2]])

        >>> x = np.arange('1066-10-13', '1066-10-16', dtype=np.datetime64)
        >>> np.diff(x)
        array([1, 1], dtype='timedelta64[D]')

    digitize(x, bins, right=False)
        Return the indices of the bins to which each value in input array belongs.

        =========  =============  ============================
        `right`    order of bins  returned index `i` satisfies
        =========  =============  ============================
        ``False``  increasing     ``bins[i-1] <= x < bins[i]``
        ``True``   increasing     ``bins[i-1] < x <= bins[i]``
        ``False``  decreasing     ``bins[i-1] > x >= bins[i]``
        ``True``   decreasing     ``bins[i-1] >= x > bins[i]``
        =========  =============  ============================

        If values in `x` are beyond the bounds of `bins`, 0 or ``len(bins)`` is
        returned as appropriate.

        Parameters
        ----------
        x : array_like
            Input array to be binned. Prior to NumPy 1.10.0, this array had to
            be 1-dimensional, but can now have any shape.
        bins : array_like
            Array of bins. It has to be 1-dimensional and monotonic.
        right : bool, optional
            Indicating whether the intervals include the right or the left bin
            edge. Default behavior is (right==False) indicating that the interval
            does not include the right edge. The left bin end is open in this
            case, i.e., bins[i-1] <= x < bins[i] is the default behavior for
            monotonically increasing bins.

        Returns
        -------
        indices : ndarray of ints
            Output array of indices, of same shape as `x`.

        Raises
        ------
        ValueError
            If `bins` is not monotonic.
        TypeError
            If the type of the input is complex.

        See Also
        --------
        bincount, histogram, unique, searchsorted

        Notes
        -----
        If values in `x` are such that they fall outside the bin range,
        attempting to index `bins` with the indices that `digitize` returns
        will result in an IndexError.

        .. versionadded:: 1.10.0

        `numpy.digitize` is  implemented in terms of `numpy.searchsorted`.
        This means that a binary search is used to bin the values, which scales
        much better for larger number of bins than the previous linear search.
        It also removes the requirement for the input array to be 1-dimensional.

        For monotonically *increasing* `bins`, the following are equivalent::

            np.digitize(x, bins, right=True)
            np.searchsorted(bins, x, side='left')

        Note that as the order of the arguments are reversed, the side must be too.
        The `searchsorted` call is marginally faster, as it does not do any
        monotonicity checks. Perhaps more importantly, it supports all dtypes.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([0.2, 6.4, 3.0, 1.6])
        >>> bins = np.array([0.0, 1.0, 2.5, 4.0, 10.0])
        >>> inds = np.digitize(x, bins)
        >>> inds
        array([1, 4, 3, 2])
        >>> for n in range(x.size):
        ...   print(bins[inds[n]-1], "<=", x[n], "<", bins[inds[n]])
        ...
        0.0 <= 0.2 < 1.0
        4.0 <= 6.4 < 10.0
        2.5 <= 3.0 < 4.0
        1.0 <= 1.6 < 2.5

        >>> x = np.array([1.2, 10.0, 12.4, 15.5, 20.])
        >>> bins = np.array([0, 5, 10, 15, 20])
        >>> np.digitize(x,bins,right=True)
        array([1, 2, 3, 4, 4])
        >>> np.digitize(x,bins,right=False)
        array([1, 3, 3, 4, 5])

    dot(...)
        dot(a, b, out=None)

        Dot product of two arrays. Specifically,

        - If both `a` and `b` are 1-D arrays, it is inner product of vectors
          (without complex conjugation).

        - If both `a` and `b` are 2-D arrays, it is matrix multiplication,
          but using :func:`matmul` or ``a @ b`` is preferred.

        - If either `a` or `b` is 0-D (scalar), it is equivalent to
          :func:`multiply` and using ``numpy.multiply(a, b)`` or ``a * b`` is
          preferred.

        - If `a` is an N-D array and `b` is a 1-D array, it is a sum product over
          the last axis of `a` and `b`.

        - If `a` is an N-D array and `b` is an M-D array (where ``M>=2``), it is a
          sum product over the last axis of `a` and the second-to-last axis of
          `b`::

            dot(a, b)[i,j,k,m] = sum(a[i,j,:] * b[k,:,m])

        It uses an optimized BLAS library when possible (see `numpy.linalg`).

        Parameters
        ----------
        a : array_like
            First argument.
        b : array_like
            Second argument.
        out : ndarray, optional
            Output argument. This must have the exact kind that would be returned
            if it was not used. In particular, it must have the right type, must be
            C-contiguous, and its dtype must be the dtype that would be returned
            for `dot(a,b)`. This is a performance feature. Therefore, if these
            conditions are not met, an exception is raised, instead of attempting
            to be flexible.

        Returns
        -------
        output : ndarray
            Returns the dot product of `a` and `b`.  If `a` and `b` are both
            scalars or both 1-D arrays then a scalar is returned; otherwise
            an array is returned.
            If `out` is given, then it is returned.

        Raises
        ------
        ValueError
            If the last dimension of `a` is not the same size as
            the second-to-last dimension of `b`.

        See Also
        --------
        vdot : Complex-conjugating dot product.
        tensordot : Sum products over arbitrary axes.
        einsum : Einstein summation convention.
        matmul : '@' operator as method with out parameter.
        linalg.multi_dot : Chained dot product.

        Examples
        --------
        >>> import numpy as np
        >>> np.dot(3, 4)
        12

        Neither argument is complex-conjugated:

        >>> np.dot([2j, 3j], [2j, 3j])
        (-13+0j)

        For 2-D arrays it is the matrix product:

        >>> a = [[1, 0], [0, 1]]
        >>> b = [[4, 1], [2, 2]]
        >>> np.dot(a, b)
        array([[4, 1],
               [2, 2]])

        >>> a = np.arange(3*4*5*6).reshape((3,4,5,6))
        >>> b = np.arange(3*4*5*6)[::-1].reshape((5,4,6,3))
        >>> np.dot(a, b)[2,3,2,1,2,2]
        499128
        >>> sum(a[2,3,2,:] * b[1,2,:,2])
        499128

    dsplit(ary, indices_or_sections)
        Split array into multiple sub-arrays along the 3rd axis (depth).

        Please refer to the `split` documentation.  `dsplit` is equivalent
        to `split` with ``axis=2``, the array is always split along the third
        axis provided the array dimension is greater than or equal to 3.

        See Also
        --------
        split : Split an array into multiple sub-arrays of equal size.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(16.0).reshape(2, 2, 4)
        >>> x
        array([[[ 0.,   1.,   2.,   3.],
                [ 4.,   5.,   6.,   7.]],
               [[ 8.,   9.,  10.,  11.],
                [12.,  13.,  14.,  15.]]])
        >>> np.dsplit(x, 2)
        [array([[[ 0.,  1.],
                [ 4.,  5.]],
               [[ 8.,  9.],
                [12., 13.]]]), array([[[ 2.,  3.],
                [ 6.,  7.]],
               [[10., 11.],
                [14., 15.]]])]
        >>> np.dsplit(x, np.array([3, 6]))
        [array([[[ 0.,   1.,   2.],
                [ 4.,   5.,   6.]],
               [[ 8.,   9.,  10.],
                [12.,  13.,  14.]]]),
         array([[[ 3.],
                [ 7.]],
               [[11.],
                [15.]]]),
        array([], shape=(2, 2, 0), dtype=float64)]

    dstack(tup)
        Stack arrays in sequence depth wise (along third axis).

        This is equivalent to concatenation along the third axis after 2-D arrays
        of shape `(M,N)` have been reshaped to `(M,N,1)` and 1-D arrays of shape
        `(N,)` have been reshaped to `(1,N,1)`. Rebuilds arrays divided by
        `dsplit`.

        This function makes most sense for arrays with up to 3 dimensions. For
        instance, for pixel-data with a height (first axis), width (second axis),
        and r/g/b channels (third axis). The functions `concatenate`, `stack` and
        `block` provide more general stacking and concatenation operations.

        Parameters
        ----------
        tup : sequence of arrays
            The arrays must have the same shape along all but the third axis.
            1-D or 2-D arrays must have the same shape.

        Returns
        -------
        stacked : ndarray
            The array formed by stacking the given arrays, will be at least 3-D.

        See Also
        --------
        concatenate : Join a sequence of arrays along an existing axis.
        stack : Join a sequence of arrays along a new axis.
        block : Assemble an nd-array from nested lists of blocks.
        vstack : Stack arrays in sequence vertically (row wise).
        hstack : Stack arrays in sequence horizontally (column wise).
        column_stack : Stack 1-D arrays as columns into a 2-D array.
        dsplit : Split array along third axis.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array((1,2,3))
        >>> b = np.array((2,3,4))
        >>> np.dstack((a,b))
        array([[[1, 2],
                [2, 3],
                [3, 4]]])

        >>> a = np.array([[1],[2],[3]])
        >>> b = np.array([[2],[3],[4]])
        >>> np.dstack((a,b))
        array([[[1, 2]],
               [[2, 3]],
               [[3, 4]]])

    ediff1d(ary, to_end=None, to_begin=None)
        The differences between consecutive elements of an array.

        Parameters
        ----------
        ary : array_like
            If necessary, will be flattened before the differences are taken.
        to_end : array_like, optional
            Number(s) to append at the end of the returned differences.
        to_begin : array_like, optional
            Number(s) to prepend at the beginning of the returned differences.

        Returns
        -------
        ediff1d : ndarray
            The differences. Loosely, this is ``ary.flat[1:] - ary.flat[:-1]``.

        See Also
        --------
        diff, gradient

        Notes
        -----
        When applied to masked arrays, this function drops the mask information
        if the `to_begin` and/or `to_end` parameters are used.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([1, 2, 4, 7, 0])
        >>> np.ediff1d(x)
        array([ 1,  2,  3, -7])

        >>> np.ediff1d(x, to_begin=-99, to_end=np.array([88, 99]))
        array([-99,   1,   2, ...,  -7,  88,  99])

        The returned array is always 1D.

        >>> y = [[1, 2, 4], [1, 6, 24]]
        >>> np.ediff1d(y)
        array([ 1,  2, -3,  5, 18])

    einsum(*operands, out=None, optimize=False, **kwargs)
        einsum(subscripts, *operands, out=None, dtype=None, order='K',
               casting='safe', optimize=False)

        Evaluates the Einstein summation convention on the operands.

        Using the Einstein summation convention, many common multi-dimensional,
        linear algebraic array operations can be represented in a simple fashion.
        In *implicit* mode `einsum` computes these values.

        In *explicit* mode, `einsum` provides further flexibility to compute
        other array operations that might not be considered classical Einstein
        summation operations, by disabling, or forcing summation over specified
        subscript labels.

        See the notes and examples for clarification.

        Parameters
        ----------
        subscripts : str
            Specifies the subscripts for summation as comma separated list of
            subscript labels. An implicit (classical Einstein summation)
            calculation is performed unless the explicit indicator '->' is
            included as well as subscript labels of the precise output form.
        operands : list of array_like
            These are the arrays for the operation.
        out : ndarray, optional
            If provided, the calculation is done into this array.
        dtype : {data-type, None}, optional
            If provided, forces the calculation to use the data type specified.
            Note that you may have to also give a more liberal `casting`
            parameter to allow the conversions. Default is None.
        order : {'C', 'F', 'A', 'K'}, optional
            Controls the memory layout of the output. 'C' means it should
            be C contiguous. 'F' means it should be Fortran contiguous,
            'A' means it should be 'F' if the inputs are all 'F', 'C' otherwise.
            'K' means it should be as close to the layout as the inputs as
            is possible, including arbitrarily permuted axes.
            Default is 'K'.
        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
            Controls what kind of data casting may occur.  Setting this to
            'unsafe' is not recommended, as it can adversely affect accumulations.

            * 'no' means the data types should not be cast at all.
            * 'equiv' means only byte-order changes are allowed.
            * 'safe' means only casts which can preserve values are allowed.
            * 'same_kind' means only safe casts or casts within a kind,
              like float64 to float32, are allowed.
            * 'unsafe' means any data conversions may be done.

            Default is 'safe'.
        optimize : {False, True, 'greedy', 'optimal'}, optional
            Controls if intermediate optimization should occur. No optimization
            will occur if False and True will default to the 'greedy' algorithm.
            Also accepts an explicit contraction list from the ``np.einsum_path``
            function. See ``np.einsum_path`` for more details. Defaults to False.

        Returns
        -------
        output : ndarray
            The calculation based on the Einstein summation convention.

        See Also
        --------
        einsum_path, dot, inner, outer, tensordot, linalg.multi_dot
        einsum:
            Similar verbose interface is provided by the
            `einops <https://github.com/arogozhnikov/einops>`_ package to cover
            additional operations: transpose, reshape/flatten, repeat/tile,
            squeeze/unsqueeze and reductions.
            The `opt_einsum <https://optimized-einsum.readthedocs.io/en/stable/>`_
            optimizes contraction order for einsum-like expressions
            in backend-agnostic manner.

        Notes
        -----
        .. versionadded:: 1.6.0

        The Einstein summation convention can be used to compute
        many multi-dimensional, linear algebraic array operations. `einsum`
        provides a succinct way of representing these.

        A non-exhaustive list of these operations,
        which can be computed by `einsum`, is shown below along with examples:

        * Trace of an array, :py:func:`numpy.trace`.
        * Return a diagonal, :py:func:`numpy.diag`.
        * Array axis summations, :py:func:`numpy.sum`.
        * Transpositions and permutations, :py:func:`numpy.transpose`.
        * Matrix multiplication and dot product, :py:func:`numpy.matmul`
            :py:func:`numpy.dot`.
        * Vector inner and outer products, :py:func:`numpy.inner`
            :py:func:`numpy.outer`.
        * Broadcasting, element-wise and scalar multiplication,
            :py:func:`numpy.multiply`.
        * Tensor contractions, :py:func:`numpy.tensordot`.
        * Chained array operations, in efficient calculation order,
            :py:func:`numpy.einsum_path`.

        The subscripts string is a comma-separated list of subscript labels,
        where each label refers to a dimension of the corresponding operand.
        Whenever a label is repeated it is summed, so ``np.einsum('i,i', a, b)``
        is equivalent to :py:func:`np.inner(a,b) <numpy.inner>`. If a label
        appears only once, it is not summed, so ``np.einsum('i', a)``
        produces a view of ``a`` with no changes. A further example
        ``np.einsum('ij,jk', a, b)`` describes traditional matrix multiplication
        and is equivalent to :py:func:`np.matmul(a,b) <numpy.matmul>`.
        Repeated subscript labels in one operand take the diagonal.
        For example, ``np.einsum('ii', a)`` is equivalent to
        :py:func:`np.trace(a) <numpy.trace>`.

        In *implicit mode*, the chosen subscripts are important
        since the axes of the output are reordered alphabetically.  This
        means that ``np.einsum('ij', a)`` doesn't affect a 2D array, while
        ``np.einsum('ji', a)`` takes its transpose. Additionally,
        ``np.einsum('ij,jk', a, b)`` returns a matrix multiplication, while,
        ``np.einsum('ij,jh', a, b)`` returns the transpose of the
        multiplication since subscript 'h' precedes subscript 'i'.

        In *explicit mode* the output can be directly controlled by
        specifying output subscript labels.  This requires the
        identifier '->' as well as the list of output subscript labels.
        This feature increases the flexibility of the function since
        summing can be disabled or forced when required. The call
        ``np.einsum('i->', a)`` is like :py:func:`np.sum(a) <numpy.sum>`
        if ``a`` is a 1-D array, and ``np.einsum('ii->i', a)``
        is like :py:func:`np.diag(a) <numpy.diag>` if ``a`` is a square 2-D array.
        The difference is that `einsum` does not allow broadcasting by default.
        Additionally ``np.einsum('ij,jh->ih', a, b)`` directly specifies the
        order of the output subscript labels and therefore returns matrix
        multiplication, unlike the example above in implicit mode.

        To enable and control broadcasting, use an ellipsis.  Default
        NumPy-style broadcasting is done by adding an ellipsis
        to the left of each term, like ``np.einsum('...ii->...i', a)``.
        ``np.einsum('...i->...', a)`` is like
        :py:func:`np.sum(a, axis=-1) <numpy.sum>` for array ``a`` of any shape.
        To take the trace along the first and last axes,
        you can do ``np.einsum('i...i', a)``, or to do a matrix-matrix
        product with the left-most indices instead of rightmost, one can do
        ``np.einsum('ij...,jk...->ik...', a, b)``.

        When there is only one operand, no axes are summed, and no output
        parameter is provided, a view into the operand is returned instead
        of a new array.  Thus, taking the diagonal as ``np.einsum('ii->i', a)``
        produces a view (changed in version 1.10.0).

        `einsum` also provides an alternative way to provide the subscripts and
        operands as ``einsum(op0, sublist0, op1, sublist1, ..., [sublistout])``.
        If the output shape is not provided in this format `einsum` will be
        calculated in implicit mode, otherwise it will be performed explicitly.
        The examples below have corresponding `einsum` calls with the two
        parameter methods.

        .. versionadded:: 1.10.0

        Views returned from einsum are now writeable whenever the input array
        is writeable. For example, ``np.einsum('ijk...->kji...', a)`` will now
        have the same effect as :py:func:`np.swapaxes(a, 0, 2) <numpy.swapaxes>`
        and ``np.einsum('ii->i', a)`` will return a writeable view of the diagonal
        of a 2D array.

        .. versionadded:: 1.12.0

        Added the ``optimize`` argument which will optimize the contraction order
        of an einsum expression. For a contraction with three or more operands
        this can greatly increase the computational efficiency at the cost of
        a larger memory footprint during computation.

        Typically a 'greedy' algorithm is applied which empirical tests have shown
        returns the optimal path in the majority of cases. In some cases 'optimal'
        will return the superlative path through a more expensive, exhaustive
        search. For iterative calculations it may be advisable to calculate
        the optimal path once and reuse that path by supplying it as an argument.
        An example is given below.

        See :py:func:`numpy.einsum_path` for more details.

        Examples
        --------
        >>> a = np.arange(25).reshape(5,5)
        >>> b = np.arange(5)
        >>> c = np.arange(6).reshape(2,3)

        Trace of a matrix:

        >>> np.einsum('ii', a)
        60
        >>> np.einsum(a, [0,0])
        60
        >>> np.trace(a)
        60

        Extract the diagonal (requires explicit form):

        >>> np.einsum('ii->i', a)
        array([ 0,  6, 12, 18, 24])
        >>> np.einsum(a, [0,0], [0])
        array([ 0,  6, 12, 18, 24])
        >>> np.diag(a)
        array([ 0,  6, 12, 18, 24])

        Sum over an axis (requires explicit form):

        >>> np.einsum('ij->i', a)
        array([ 10,  35,  60,  85, 110])
        >>> np.einsum(a, [0,1], [0])
        array([ 10,  35,  60,  85, 110])
        >>> np.sum(a, axis=1)
        array([ 10,  35,  60,  85, 110])

        For higher dimensional arrays summing a single axis can be done
        with ellipsis:

        >>> np.einsum('...j->...', a)
        array([ 10,  35,  60,  85, 110])
        >>> np.einsum(a, [Ellipsis,1], [Ellipsis])
        array([ 10,  35,  60,  85, 110])

        Compute a matrix transpose, or reorder any number of axes:

        >>> np.einsum('ji', c)
        array([[0, 3],
               [1, 4],
               [2, 5]])
        >>> np.einsum('ij->ji', c)
        array([[0, 3],
               [1, 4],
               [2, 5]])
        >>> np.einsum(c, [1,0])
        array([[0, 3],
               [1, 4],
               [2, 5]])
        >>> np.transpose(c)
        array([[0, 3],
               [1, 4],
               [2, 5]])

        Vector inner products:

        >>> np.einsum('i,i', b, b)
        30
        >>> np.einsum(b, [0], b, [0])
        30
        >>> np.inner(b,b)
        30

        Matrix vector multiplication:

        >>> np.einsum('ij,j', a, b)
        array([ 30,  80, 130, 180, 230])
        >>> np.einsum(a, [0,1], b, [1])
        array([ 30,  80, 130, 180, 230])
        >>> np.dot(a, b)
        array([ 30,  80, 130, 180, 230])
        >>> np.einsum('...j,j', a, b)
        array([ 30,  80, 130, 180, 230])

        Broadcasting and scalar multiplication:

        >>> np.einsum('..., ...', 3, c)
        array([[ 0,  3,  6],
               [ 9, 12, 15]])
        >>> np.einsum(',ij', 3, c)
        array([[ 0,  3,  6],
               [ 9, 12, 15]])
        >>> np.einsum(3, [Ellipsis], c, [Ellipsis])
        array([[ 0,  3,  6],
               [ 9, 12, 15]])
        >>> np.multiply(3, c)
        array([[ 0,  3,  6],
               [ 9, 12, 15]])

        Vector outer product:

        >>> np.einsum('i,j', np.arange(2)+1, b)
        array([[0, 1, 2, 3, 4],
               [0, 2, 4, 6, 8]])
        >>> np.einsum(np.arange(2)+1, [0], b, [1])
        array([[0, 1, 2, 3, 4],
               [0, 2, 4, 6, 8]])
        >>> np.outer(np.arange(2)+1, b)
        array([[0, 1, 2, 3, 4],
               [0, 2, 4, 6, 8]])

        Tensor contraction:

        >>> a = np.arange(60.).reshape(3,4,5)
        >>> b = np.arange(24.).reshape(4,3,2)
        >>> np.einsum('ijk,jil->kl', a, b)
        array([[4400., 4730.],
               [4532., 4874.],
               [4664., 5018.],
               [4796., 5162.],
               [4928., 5306.]])
        >>> np.einsum(a, [0,1,2], b, [1,0,3], [2,3])
        array([[4400., 4730.],
               [4532., 4874.],
               [4664., 5018.],
               [4796., 5162.],
               [4928., 5306.]])
        >>> np.tensordot(a,b, axes=([1,0],[0,1]))
        array([[4400., 4730.],
               [4532., 4874.],
               [4664., 5018.],
               [4796., 5162.],
               [4928., 5306.]])

        Writeable returned arrays (since version 1.10.0):

        >>> a = np.zeros((3, 3))
        >>> np.einsum('ii->i', a)[:] = 1
        >>> a
        array([[1., 0., 0.],
               [0., 1., 0.],
               [0., 0., 1.]])

        Example of ellipsis use:

        >>> a = np.arange(6).reshape((3,2))
        >>> b = np.arange(12).reshape((4,3))
        >>> np.einsum('ki,jk->ij', a, b)
        array([[10, 28, 46, 64],
               [13, 40, 67, 94]])
        >>> np.einsum('ki,...k->i...', a, b)
        array([[10, 28, 46, 64],
               [13, 40, 67, 94]])
        >>> np.einsum('k...,jk', a, b)
        array([[10, 28, 46, 64],
               [13, 40, 67, 94]])

        Chained array operations. For more complicated contractions, speed ups
        might be achieved by repeatedly computing a 'greedy' path or pre-computing
        the 'optimal' path and repeatedly applying it, using an `einsum_path`
        insertion (since version 1.12.0). Performance improvements can be
        particularly significant with larger arrays:

        >>> a = np.ones(64).reshape(2,4,8)

        Basic `einsum`: ~1520ms  (benchmarked on 3.1GHz Intel i5.)

        >>> for iteration in range(500):
        ...     _ = np.einsum('ijk,ilm,njm,nlk,abc->',a,a,a,a,a)

        Sub-optimal `einsum` (due to repeated path calculation time): ~330ms

        >>> for iteration in range(500):
        ...     _ = np.einsum('ijk,ilm,njm,nlk,abc->',a,a,a,a,a,
        ...         optimize='optimal')

        Greedy `einsum` (faster optimal path approximation): ~160ms

        >>> for iteration in range(500):
        ...     _ = np.einsum('ijk,ilm,njm,nlk,abc->',a,a,a,a,a, optimize='greedy')

        Optimal `einsum` (best usage pattern in some use cases): ~110ms

        >>> path = np.einsum_path('ijk,ilm,njm,nlk,abc->',a,a,a,a,a,
        ...     optimize='optimal')[0]
        >>> for iteration in range(500):
        ...     _ = np.einsum('ijk,ilm,njm,nlk,abc->',a,a,a,a,a, optimize=path)

    einsum_path(*operands, optimize='greedy', einsum_call=False)
        einsum_path(subscripts, *operands, optimize='greedy')

        Evaluates the lowest cost contraction order for an einsum expression by
        considering the creation of intermediate arrays.

        Parameters
        ----------
        subscripts : str
            Specifies the subscripts for summation.
        *operands : list of array_like
            These are the arrays for the operation.
        optimize : {bool, list, tuple, 'greedy', 'optimal'}
            Choose the type of path. If a tuple is provided, the second argument is
            assumed to be the maximum intermediate size created. If only a single
            argument is provided the largest input or output array size is used
            as a maximum intermediate size.

            * if a list is given that starts with ``einsum_path``, uses this as the
              contraction path
            * if False no optimization is taken
            * if True defaults to the 'greedy' algorithm
            * 'optimal' An algorithm that combinatorially explores all possible
              ways of contracting the listed tensors and chooses the least costly
              path. Scales exponentially with the number of terms in the
              contraction.
            * 'greedy' An algorithm that chooses the best pair contraction
              at each step. Effectively, this algorithm searches the largest inner,
              Hadamard, and then outer products at each step. Scales cubically with
              the number of terms in the contraction. Equivalent to the 'optimal'
              path for most contractions.

            Default is 'greedy'.

        Returns
        -------
        path : list of tuples
            A list representation of the einsum path.
        string_repr : str
            A printable representation of the einsum path.

        Notes
        -----
        The resulting path indicates which terms of the input contraction should be
        contracted first, the result of this contraction is then appended to the
        end of the contraction list. This list can then be iterated over until all
        intermediate contractions are complete.

        See Also
        --------
        einsum, linalg.multi_dot

        Examples
        --------

        We can begin with a chain dot example. In this case, it is optimal to
        contract the ``b`` and ``c`` tensors first as represented by the first
        element of the path ``(1, 2)``. The resulting tensor is added to the end
        of the contraction and the remaining contraction ``(0, 1)`` is then
        completed.

        >>> np.random.seed(123)
        >>> a = np.random.rand(2, 2)
        >>> b = np.random.rand(2, 5)
        >>> c = np.random.rand(5, 2)
        >>> path_info = np.einsum_path('ij,jk,kl->il', a, b, c, optimize='greedy')
        >>> print(path_info[0])
        ['einsum_path', (1, 2), (0, 1)]
        >>> print(path_info[1])
          Complete contraction:  ij,jk,kl->il # may vary
                 Naive scaling:  4
             Optimized scaling:  3
              Naive FLOP count:  1.600e+02
          Optimized FLOP count:  5.600e+01
           Theoretical speedup:  2.857
          Largest intermediate:  4.000e+00 elements
        -------------------------------------------------------------------------
        scaling                  current                                remaining
        -------------------------------------------------------------------------
           3                   kl,jk->jl                                ij,jl->il
           3                   jl,ij->il                                   il->il


        A more complex index transformation example.

        >>> I = np.random.rand(10, 10, 10, 10)
        >>> C = np.random.rand(10, 10)
        >>> path_info = np.einsum_path('ea,fb,abcd,gc,hd->efgh', C, C, I, C, C,
        ...                            optimize='greedy')

        >>> print(path_info[0])
        ['einsum_path', (0, 2), (0, 3), (0, 2), (0, 1)]
        >>> print(path_info[1])
          Complete contraction:  ea,fb,abcd,gc,hd->efgh # may vary
                 Naive scaling:  8
             Optimized scaling:  5
              Naive FLOP count:  8.000e+08
          Optimized FLOP count:  8.000e+05
           Theoretical speedup:  1000.000
          Largest intermediate:  1.000e+04 elements
        --------------------------------------------------------------------------
        scaling                  current                                remaining
        --------------------------------------------------------------------------
           5               abcd,ea->bcde                      fb,gc,hd,bcde->efgh
           5               bcde,fb->cdef                         gc,hd,cdef->efgh
           5               cdef,gc->defg                            hd,defg->efgh
           5               defg,hd->efgh                               efgh->efgh

    empty(...)
        empty(shape, dtype=float, order='C', *, device=None, like=None)

        Return a new array of given shape and type, without initializing entries.

        Parameters
        ----------
        shape : int or tuple of int
            Shape of the empty array, e.g., ``(2, 3)`` or ``2``.
        dtype : data-type, optional
            Desired output data-type for the array, e.g, `numpy.int8`. Default is
            `numpy.float64`.
        order : {'C', 'F'}, optional, default: 'C'
            Whether to store multi-dimensional data in row-major
            (C-style) or column-major (Fortran-style) order in
            memory.
        device : str, optional
            The device on which to place the created array. Default: ``None``.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            Array of uninitialized (arbitrary) data of the given shape, dtype, and
            order.  Object arrays will be initialized to None.

        See Also
        --------
        empty_like : Return an empty array with shape and type of input.
        ones : Return a new array setting values to one.
        zeros : Return a new array setting values to zero.
        full : Return a new array of given shape filled with value.

        Notes
        -----
        Unlike other array creation functions (e.g. `zeros`, `ones`, `full`),
        `empty` does not initialize the values of the array, and may therefore be
        marginally faster. However, the values stored in the newly allocated array
        are arbitrary. For reproducible behavior, be sure to set each element of
        the array before reading.

        Examples
        --------
        >>> import numpy as np
        >>> np.empty([2, 2])
        array([[ -9.74499359e+001,   6.69583040e-309],
               [  2.13182611e-314,   3.06959433e-309]])         #uninitialized

        >>> np.empty([2, 2], dtype=int)
        array([[-1073741821, -1067949133],
               [  496041986,    19249760]])                     #uninitialized

    empty_like(...)
        empty_like(prototype, dtype=None, order='K', subok=True, shape=None, *,
                   device=None)

        Return a new array with the same shape and type as a given array.

        Parameters
        ----------
        prototype : array_like
            The shape and data-type of `prototype` define these same attributes
            of the returned array.
        dtype : data-type, optional
            Overrides the data type of the result.

            .. versionadded:: 1.6.0
        order : {'C', 'F', 'A', or 'K'}, optional
            Overrides the memory layout of the result. 'C' means C-order,
            'F' means F-order, 'A' means 'F' if `prototype` is Fortran
            contiguous, 'C' otherwise. 'K' means match the layout of `prototype`
            as closely as possible.

            .. versionadded:: 1.6.0
        subok : bool, optional.
            If True, then the newly created array will use the sub-class
            type of `prototype`, otherwise it will be a base-class array. Defaults
            to True.
        shape : int or sequence of ints, optional.
            Overrides the shape of the result. If order='K' and the number of
            dimensions is unchanged, will try to keep order, otherwise,
            order='C' is implied.

            .. versionadded:: 1.17.0
        device : str, optional
            The device on which to place the created array. Default: None.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0

        Returns
        -------
        out : ndarray
            Array of uninitialized (arbitrary) data with the same
            shape and type as `prototype`.

        See Also
        --------
        ones_like : Return an array of ones with shape and type of input.
        zeros_like : Return an array of zeros with shape and type of input.
        full_like : Return a new array with shape of input filled with value.
        empty : Return a new uninitialized array.

        Notes
        -----
        Unlike other array creation functions (e.g. `zeros_like`, `ones_like`,
        `full_like`), `empty_like` does not initialize the values of the array,
        and may therefore be marginally faster. However, the values stored in the
        newly allocated array are arbitrary. For reproducible behavior, be sure
        to set each element of the array before reading.

        Examples
        --------
        >>> import numpy as np
        >>> a = ([1,2,3], [4,5,6])                         # a is array-like
        >>> np.empty_like(a)
        array([[-1073741821, -1073741821,           3],    # uninitialized
               [          0,           0, -1073741821]])
        >>> a = np.array([[1., 2., 3.],[4.,5.,6.]])
        >>> np.empty_like(a)
        array([[ -2.00000715e+000,   1.48219694e-323,  -2.00000572e+000], # uninitialized
               [  4.38791518e-305,  -2.00000715e+000,   4.17269252e-309]])

    expand_dims(a, axis)
        Expand the shape of an array.

        Insert a new axis that will appear at the `axis` position in the expanded
        array shape.

        Parameters
        ----------
        a : array_like
            Input array.
        axis : int or tuple of ints
            Position in the expanded axes where the new axis (or axes) is placed.

            .. deprecated:: 1.13.0
                Passing an axis where ``axis > a.ndim`` will be treated as
                ``axis == a.ndim``, and passing ``axis < -a.ndim - 1`` will
                be treated as ``axis == 0``. This behavior is deprecated.

            .. versionchanged:: 1.18.0
                A tuple of axes is now supported.  Out of range axes as
                described above are now forbidden and raise an
                `~exceptions.AxisError`.

        Returns
        -------
        result : ndarray
            View of `a` with the number of dimensions increased.

        See Also
        --------
        squeeze : The inverse operation, removing singleton dimensions
        reshape : Insert, remove, and combine dimensions, and resize existing ones
        atleast_1d, atleast_2d, atleast_3d

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([1, 2])
        >>> x.shape
        (2,)

        The following is equivalent to ``x[np.newaxis, :]`` or ``x[np.newaxis]``:

        >>> y = np.expand_dims(x, axis=0)
        >>> y
        array([[1, 2]])
        >>> y.shape
        (1, 2)

        The following is equivalent to ``x[:, np.newaxis]``:

        >>> y = np.expand_dims(x, axis=1)
        >>> y
        array([[1],
               [2]])
        >>> y.shape
        (2, 1)

        ``axis`` may also be a tuple:

        >>> y = np.expand_dims(x, axis=(0, 1))
        >>> y
        array([[[1, 2]]])

        >>> y = np.expand_dims(x, axis=(2, 0))
        >>> y
        array([[[1],
                [2]]])

        Note that some examples may use ``None`` instead of ``np.newaxis``.  These
        are the same objects:

        >>> np.newaxis is None
        True

    extract(condition, arr)
        Return the elements of an array that satisfy some condition.

        This is equivalent to ``np.compress(ravel(condition), ravel(arr))``.  If
        `condition` is boolean ``np.extract`` is equivalent to ``arr[condition]``.

        Note that `place` does the exact opposite of `extract`.

        Parameters
        ----------
        condition : array_like
            An array whose nonzero or True entries indicate the elements of `arr`
            to extract.
        arr : array_like
            Input array of the same size as `condition`.

        Returns
        -------
        extract : ndarray
            Rank 1 array of values from `arr` where `condition` is True.

        See Also
        --------
        take, put, copyto, compress, place

        Examples
        --------
        >>> import numpy as np
        >>> arr = np.arange(12).reshape((3, 4))
        >>> arr
        array([[ 0,  1,  2,  3],
               [ 4,  5,  6,  7],
               [ 8,  9, 10, 11]])
        >>> condition = np.mod(arr, 3)==0
        >>> condition
        array([[ True, False, False,  True],
               [False, False,  True, False],
               [False,  True, False, False]])
        >>> np.extract(condition, arr)
        array([0, 3, 6, 9])


        If `condition` is boolean:

        >>> arr[condition]
        array([0, 3, 6, 9])

    eye(N, M=None, k=0, dtype=<class 'float'>, order='C', *, device=None, like=None)
        Return a 2-D array with ones on the diagonal and zeros elsewhere.

        Parameters
        ----------
        N : int
          Number of rows in the output.
        M : int, optional
          Number of columns in the output. If None, defaults to `N`.
        k : int, optional
          Index of the diagonal: 0 (the default) refers to the main diagonal,
          a positive value refers to an upper diagonal, and a negative value
          to a lower diagonal.
        dtype : data-type, optional
          Data-type of the returned array.
        order : {'C', 'F'}, optional
            Whether the output should be stored in row-major (C-style) or
            column-major (Fortran-style) order in memory.

            .. versionadded:: 1.14.0
        device : str, optional
            The device on which to place the created array. Default: None.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        I : ndarray of shape (N,M)
          An array where all elements are equal to zero, except for the `k`-th
          diagonal, whose values are equal to one.

        See Also
        --------
        identity : (almost) equivalent function
        diag : diagonal 2-D array from a 1-D array specified by the user.

        Examples
        --------
        >>> import numpy as np
        >>> np.eye(2, dtype=int)
        array([[1, 0],
               [0, 1]])
        >>> np.eye(3, k=1)
        array([[0.,  1.,  0.],
               [0.,  0.,  1.],
               [0.,  0.,  0.]])

    fill_diagonal(a, val, wrap=False)
        Fill the main diagonal of the given array of any dimensionality.

        For an array `a` with ``a.ndim >= 2``, the diagonal is the list of
        values ``a[i, ..., i]`` with indices ``i`` all identical.  This function
        modifies the input array in-place without returning a value.

        Parameters
        ----------
        a : array, at least 2-D.
          Array whose diagonal is to be filled in-place.
        val : scalar or array_like
          Value(s) to write on the diagonal. If `val` is scalar, the value is
          written along the diagonal. If array-like, the flattened `val` is
          written along the diagonal, repeating if necessary to fill all
          diagonal entries.

        wrap : bool
          For tall matrices in NumPy version up to 1.6.2, the
          diagonal "wrapped" after N columns. You can have this behavior
          with this option. This affects only tall matrices.

        See also
        --------
        diag_indices, diag_indices_from

        Notes
        -----
        .. versionadded:: 1.4.0

        This functionality can be obtained via `diag_indices`, but internally
        this version uses a much faster implementation that never constructs the
        indices and uses simple slicing.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.zeros((3, 3), int)
        >>> np.fill_diagonal(a, 5)
        >>> a
        array([[5, 0, 0],
               [0, 5, 0],
               [0, 0, 5]])

        The same function can operate on a 4-D array:

        >>> a = np.zeros((3, 3, 3, 3), int)
        >>> np.fill_diagonal(a, 4)

        We only show a few blocks for clarity:

        >>> a[0, 0]
        array([[4, 0, 0],
               [0, 0, 0],
               [0, 0, 0]])
        >>> a[1, 1]
        array([[0, 0, 0],
               [0, 4, 0],
               [0, 0, 0]])
        >>> a[2, 2]
        array([[0, 0, 0],
               [0, 0, 0],
               [0, 0, 4]])

        The wrap option affects only tall matrices:

        >>> # tall matrices no wrap
        >>> a = np.zeros((5, 3), int)
        >>> np.fill_diagonal(a, 4)
        >>> a
        array([[4, 0, 0],
               [0, 4, 0],
               [0, 0, 4],
               [0, 0, 0],
               [0, 0, 0]])

        >>> # tall matrices wrap
        >>> a = np.zeros((5, 3), int)
        >>> np.fill_diagonal(a, 4, wrap=True)
        >>> a
        array([[4, 0, 0],
               [0, 4, 0],
               [0, 0, 4],
               [0, 0, 0],
               [4, 0, 0]])

        >>> # wide matrices
        >>> a = np.zeros((3, 5), int)
        >>> np.fill_diagonal(a, 4, wrap=True)
        >>> a
        array([[4, 0, 0, 0, 0],
               [0, 4, 0, 0, 0],
               [0, 0, 4, 0, 0]])

        The anti-diagonal can be filled by reversing the order of elements
        using either `numpy.flipud` or `numpy.fliplr`.

        >>> a = np.zeros((3, 3), int);
        >>> np.fill_diagonal(np.fliplr(a), [1,2,3])  # Horizontal flip
        >>> a
        array([[0, 0, 1],
               [0, 2, 0],
               [3, 0, 0]])
        >>> np.fill_diagonal(np.flipud(a), [1,2,3])  # Vertical flip
        >>> a
        array([[0, 0, 3],
               [0, 2, 0],
               [1, 0, 0]])

        Note that the order in which the diagonal is filled varies depending
        on the flip function.

    fix(x, out=None)
        Round to nearest integer towards zero.

        Round an array of floats element-wise to nearest integer towards zero.
        The rounded values have the same data-type as the input.

        Parameters
        ----------
        x : array_like
            An array to be rounded
        out : ndarray, optional
            A location into which the result is stored. If provided, it must have
            a shape that the input broadcasts to. If not provided or None, a
            freshly-allocated array is returned.

        Returns
        -------
        out : ndarray of floats
            An array with the same dimensions and data-type as the input.
            If second argument is not supplied then a new array is returned
            with the rounded values.

            If a second argument is supplied the result is stored there.
            The return value ``out`` is then a reference to that array.

        See Also
        --------
        rint, trunc, floor, ceil
        around : Round to given number of decimals

        Examples
        --------
        >>> import numpy as np
        >>> np.fix(3.14)
        3.0
        >>> np.fix(3)
        3
        >>> np.fix([2.1, 2.9, -2.1, -2.9])
        array([ 2.,  2., -2., -2.])

    flatnonzero(a)
        Return indices that are non-zero in the flattened version of a.

        This is equivalent to ``np.nonzero(np.ravel(a))[0]``.

        Parameters
        ----------
        a : array_like
            Input data.

        Returns
        -------
        res : ndarray
            Output array, containing the indices of the elements of ``a.ravel()``
            that are non-zero.

        See Also
        --------
        nonzero : Return the indices of the non-zero elements of the input array.
        ravel : Return a 1-D array containing the elements of the input array.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(-2, 3)
        >>> x
        array([-2, -1,  0,  1,  2])
        >>> np.flatnonzero(x)
        array([0, 1, 3, 4])

        Use the indices of the non-zero elements as an index array to extract
        these elements:

        >>> x.ravel()[np.flatnonzero(x)]
        array([-2, -1,  1,  2])

    flip(m, axis=None)
        Reverse the order of elements in an array along the given axis.

        The shape of the array is preserved, but the elements are reordered.

        .. versionadded:: 1.12.0

        Parameters
        ----------
        m : array_like
            Input array.
        axis : None or int or tuple of ints, optional
             Axis or axes along which to flip over. The default,
             axis=None, will flip over all of the axes of the input array.
             If axis is negative it counts from the last to the first axis.

             If axis is a tuple of ints, flipping is performed on all of the axes
             specified in the tuple.

             .. versionchanged:: 1.15.0
                None and tuples of axes are supported

        Returns
        -------
        out : array_like
            A view of `m` with the entries of axis reversed.  Since a view is
            returned, this operation is done in constant time.

        See Also
        --------
        flipud : Flip an array vertically (axis=0).
        fliplr : Flip an array horizontally (axis=1).

        Notes
        -----
        flip(m, 0) is equivalent to flipud(m).

        flip(m, 1) is equivalent to fliplr(m).

        flip(m, n) corresponds to ``m[...,::-1,...]`` with ``::-1`` at position n.

        flip(m) corresponds to ``m[::-1,::-1,...,::-1]`` with ``::-1`` at all
        positions.

        flip(m, (0, 1)) corresponds to ``m[::-1,::-1,...]`` with ``::-1`` at
        position 0 and position 1.

        Examples
        --------
        >>> import numpy as np
        >>> A = np.arange(8).reshape((2,2,2))
        >>> A
        array([[[0, 1],
                [2, 3]],
               [[4, 5],
                [6, 7]]])
        >>> np.flip(A, 0)
        array([[[4, 5],
                [6, 7]],
               [[0, 1],
                [2, 3]]])
        >>> np.flip(A, 1)
        array([[[2, 3],
                [0, 1]],
               [[6, 7],
                [4, 5]]])
        >>> np.flip(A)
        array([[[7, 6],
                [5, 4]],
               [[3, 2],
                [1, 0]]])
        >>> np.flip(A, (0, 2))
        array([[[5, 4],
                [7, 6]],
               [[1, 0],
                [3, 2]]])
        >>> rng = np.random.default_rng()
        >>> A = rng.normal(size=(3,4,5))
        >>> np.all(np.flip(A,2) == A[:,:,::-1,...])
        True

    fliplr(m)
        Reverse the order of elements along axis 1 (left/right).

        For a 2-D array, this flips the entries in each row in the left/right
        direction. Columns are preserved, but appear in a different order than
        before.

        Parameters
        ----------
        m : array_like
            Input array, must be at least 2-D.

        Returns
        -------
        f : ndarray
            A view of `m` with the columns reversed.  Since a view
            is returned, this operation is :math:`\mathcal O(1)`.

        See Also
        --------
        flipud : Flip array in the up/down direction.
        flip : Flip array in one or more dimensions.
        rot90 : Rotate array counterclockwise.

        Notes
        -----
        Equivalent to ``m[:,::-1]`` or ``np.flip(m, axis=1)``.
        Requires the array to be at least 2-D.

        Examples
        --------
        >>> import numpy as np
        >>> A = np.diag([1.,2.,3.])
        >>> A
        array([[1.,  0.,  0.],
               [0.,  2.,  0.],
               [0.,  0.,  3.]])
        >>> np.fliplr(A)
        array([[0.,  0.,  1.],
               [0.,  2.,  0.],
               [3.,  0.,  0.]])

        >>> rng = np.random.default_rng()
        >>> A = rng.normal(size=(2,3,5))
        >>> np.all(np.fliplr(A) == A[:,::-1,...])
        True

    flipud(m)
        Reverse the order of elements along axis 0 (up/down).

        For a 2-D array, this flips the entries in each column in the up/down
        direction. Rows are preserved, but appear in a different order than before.

        Parameters
        ----------
        m : array_like
            Input array.

        Returns
        -------
        out : array_like
            A view of `m` with the rows reversed.  Since a view is
            returned, this operation is :math:`\mathcal O(1)`.

        See Also
        --------
        fliplr : Flip array in the left/right direction.
        flip : Flip array in one or more dimensions.
        rot90 : Rotate array counterclockwise.

        Notes
        -----
        Equivalent to ``m[::-1, ...]`` or ``np.flip(m, axis=0)``.
        Requires the array to be at least 1-D.

        Examples
        --------
        >>> import numpy as np
        >>> A = np.diag([1.0, 2, 3])
        >>> A
        array([[1.,  0.,  0.],
               [0.,  2.,  0.],
               [0.,  0.,  3.]])
        >>> np.flipud(A)
        array([[0.,  0.,  3.],
               [0.,  2.,  0.],
               [1.,  0.,  0.]])

        >>> rng = np.random.default_rng()
        >>> A = rng.normal(size=(2,3,5))
        >>> np.all(np.flipud(A) == A[::-1,...])
        True

        >>> np.flipud([1,2])
        array([2, 1])

    format_float_positional(x, precision=None, unique=True, fractional=True, trim='k', sign=False, pad_left=None, pad_right=None, min_digits=None)
        Format a floating-point scalar as a decimal string in positional notation.

        Provides control over rounding, trimming and padding. Uses and assumes
        IEEE unbiased rounding. Uses the "Dragon4" algorithm.

        Parameters
        ----------
        x : python float or numpy floating scalar
            Value to format.
        precision : non-negative integer or None, optional
            Maximum number of digits to print. May be None if `unique` is
            `True`, but must be an integer if unique is `False`.
        unique : boolean, optional
            If `True`, use a digit-generation strategy which gives the shortest
            representation which uniquely identifies the floating-point number from
            other values of the same type, by judicious rounding. If `precision`
            is given fewer digits than necessary can be printed, or if `min_digits`
            is given more can be printed, in which cases the last digit is rounded
            with unbiased rounding.
            If `False`, digits are generated as if printing an infinite-precision
            value and stopping after `precision` digits, rounding the remaining
            value with unbiased rounding
        fractional : boolean, optional
            If `True`, the cutoffs of `precision` and `min_digits` refer to the
            total number of digits after the decimal point, including leading
            zeros.
            If `False`, `precision` and `min_digits` refer to the total number of
            significant digits, before or after the decimal point, ignoring leading
            zeros.
        trim : one of 'k', '.', '0', '-', optional
            Controls post-processing trimming of trailing digits, as follows:

            * 'k' : keep trailing zeros, keep decimal point (no trimming)
            * '.' : trim all trailing zeros, leave decimal point
            * '0' : trim all but the zero before the decimal point. Insert the
              zero if it is missing.
            * '-' : trim trailing zeros and any trailing decimal point
        sign : boolean, optional
            Whether to show the sign for positive values.
        pad_left : non-negative integer, optional
            Pad the left side of the string with whitespace until at least that
            many characters are to the left of the decimal point.
        pad_right : non-negative integer, optional
            Pad the right side of the string with whitespace until at least that
            many characters are to the right of the decimal point.
        min_digits : non-negative integer or None, optional
            Minimum number of digits to print. Only has an effect if `unique=True`
            in which case additional digits past those necessary to uniquely
            identify the value may be printed, rounding the last additional digit.

            .. versionadded:: 1.21.0

        Returns
        -------
        rep : string
            The string representation of the floating point value

        See Also
        --------
        format_float_scientific

        Examples
        --------
        >>> import numpy as np
        >>> np.format_float_positional(np.float32(np.pi))
        '3.1415927'
        >>> np.format_float_positional(np.float16(np.pi))
        '3.14'
        >>> np.format_float_positional(np.float16(0.3))
        '0.3'
        >>> np.format_float_positional(np.float16(0.3), unique=False, precision=10)
        '0.3000488281'

    format_float_scientific(x, precision=None, unique=True, trim='k', sign=False, pad_left=None, exp_digits=None, min_digits=None)
        Format a floating-point scalar as a decimal string in scientific notation.

        Provides control over rounding, trimming and padding. Uses and assumes
        IEEE unbiased rounding. Uses the "Dragon4" algorithm.

        Parameters
        ----------
        x : python float or numpy floating scalar
            Value to format.
        precision : non-negative integer or None, optional
            Maximum number of digits to print. May be None if `unique` is
            `True`, but must be an integer if unique is `False`.
        unique : boolean, optional
            If `True`, use a digit-generation strategy which gives the shortest
            representation which uniquely identifies the floating-point number from
            other values of the same type, by judicious rounding. If `precision`
            is given fewer digits than necessary can be printed. If `min_digits`
            is given more can be printed, in which cases the last digit is rounded
            with unbiased rounding.
            If `False`, digits are generated as if printing an infinite-precision
            value and stopping after `precision` digits, rounding the remaining
            value with unbiased rounding
        trim : one of 'k', '.', '0', '-', optional
            Controls post-processing trimming of trailing digits, as follows:

            * 'k' : keep trailing zeros, keep decimal point (no trimming)
            * '.' : trim all trailing zeros, leave decimal point
            * '0' : trim all but the zero before the decimal point. Insert the
              zero if it is missing.
            * '-' : trim trailing zeros and any trailing decimal point
        sign : boolean, optional
            Whether to show the sign for positive values.
        pad_left : non-negative integer, optional
            Pad the left side of the string with whitespace until at least that
            many characters are to the left of the decimal point.
        exp_digits : non-negative integer, optional
            Pad the exponent with zeros until it contains at least this
            many digits. If omitted, the exponent will be at least 2 digits.
        min_digits : non-negative integer or None, optional
            Minimum number of digits to print. This only has an effect for
            `unique=True`. In that case more digits than necessary to uniquely
            identify the value may be printed and rounded unbiased.

            .. versionadded:: 1.21.0

        Returns
        -------
        rep : string
            The string representation of the floating point value

        See Also
        --------
        format_float_positional

        Examples
        --------
        >>> import numpy as np
        >>> np.format_float_scientific(np.float32(np.pi))
        '3.1415927e+00'
        >>> s = np.float32(1.23e24)
        >>> np.format_float_scientific(s, unique=False, precision=15)
        '1.230000071797338e+24'
        >>> np.format_float_scientific(s, exp_digits=4)
        '1.23e+0024'

    from_dlpack(...)
        from_dlpack(x, /, *, device=None, copy=None)

        Create a NumPy array from an object implementing the ``__dlpack__``
        protocol. Generally, the returned NumPy array is a read-only view
        of the input object. See [1]_ and [2]_ for more details.

        Parameters
        ----------
        x : object
            A Python object that implements the ``__dlpack__`` and
            ``__dlpack_device__`` methods.
        device : device, optional
            Device on which to place the created array. Default: ``None``.
            Must be ``"cpu"`` if passed which may allow importing an array
            that is not already CPU available.
        copy : bool, optional
            Boolean indicating whether or not to copy the input. If ``True``,
            the copy will be made. If ``False``, the function will never copy,
            and will raise ``BufferError`` in case a copy is deemed necessary.
            Passing it requests a copy from the exporter who may or may not
            implement the capability.
            If ``None``, the function will reuse the existing memory buffer if
            possible and copy otherwise. Default: ``None``.


        Returns
        -------
        out : ndarray

        References
        ----------
        .. [1] Array API documentation,
           https://data-apis.org/array-api/latest/design_topics/data_interchange.html#syntax-for-data-interchange-with-dlpack

        .. [2] Python specification for DLPack,
           https://dmlc.github.io/dlpack/latest/python_spec.html

        Examples
        --------
        >>> import torch  # doctest: +SKIP
        >>> x = torch.arange(10)  # doctest: +SKIP
        >>> # create a view of the torch tensor "x" in NumPy
        >>> y = np.from_dlpack(x)  # doctest: +SKIP

    frombuffer(...)
        frombuffer(buffer, dtype=float, count=-1, offset=0, *, like=None)

        Interpret a buffer as a 1-dimensional array.

        Parameters
        ----------
        buffer : buffer_like
            An object that exposes the buffer interface.
        dtype : data-type, optional
            Data-type of the returned array; default: float.
        count : int, optional
            Number of items to read. ``-1`` means all data in the buffer.
        offset : int, optional
            Start reading the buffer from this offset (in bytes); default: 0.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray

        See also
        --------
        ndarray.tobytes
            Inverse of this operation, construct Python bytes from the raw data
            bytes in the array.

        Notes
        -----
        If the buffer has data that is not in machine byte-order, this should
        be specified as part of the data-type, e.g.::

          >>> dt = np.dtype(int)
          >>> dt = dt.newbyteorder('>')
          >>> np.frombuffer(buf, dtype=dt) # doctest: +SKIP

        The data of the resulting array will not be byteswapped, but will be
        interpreted correctly.

        This function creates a view into the original object.  This should be safe
        in general, but it may make sense to copy the result when the original
        object is mutable or untrusted.

        Examples
        --------
        >>> import numpy as np
        >>> s = b'hello world'
        >>> np.frombuffer(s, dtype='S1', count=5, offset=6)
        array([b'w', b'o', b'r', b'l', b'd'], dtype='|S1')

        >>> np.frombuffer(b'\x01\x02', dtype=np.uint8)
        array([1, 2], dtype=uint8)
        >>> np.frombuffer(b'\x01\x02\x03\x04\x05', dtype=np.uint8, count=3)
        array([1, 2, 3], dtype=uint8)

    fromfile(...)
        fromfile(file, dtype=float, count=-1, sep='', offset=0, *, like=None)

        Construct an array from data in a text or binary file.

        A highly efficient way of reading binary data with a known data-type,
        as well as parsing simply formatted text files.  Data written using the
        `tofile` method can be read using this function.

        Parameters
        ----------
        file : file or str or Path
            Open file object or filename.

            .. versionchanged:: 1.17.0
                `pathlib.Path` objects are now accepted.

        dtype : data-type
            Data type of the returned array.
            For binary files, it is used to determine the size and byte-order
            of the items in the file.
            Most builtin numeric types are supported and extension types may be supported.

            .. versionadded:: 1.18.0
                Complex dtypes.

        count : int
            Number of items to read. ``-1`` means all items (i.e., the complete
            file).
        sep : str
            Separator between items if file is a text file.
            Empty ("") separator means the file should be treated as binary.
            Spaces (" ") in the separator match zero or more whitespace characters.
            A separator consisting only of spaces must match at least one
            whitespace.
        offset : int
            The offset (in bytes) from the file's current position. Defaults to 0.
            Only permitted for binary files.

            .. versionadded:: 1.17.0
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        See also
        --------
        load, save
        ndarray.tofile
        loadtxt : More flexible way of loading data from a text file.

        Notes
        -----
        Do not rely on the combination of `tofile` and `fromfile` for
        data storage, as the binary files generated are not platform
        independent.  In particular, no byte-order or data-type information is
        saved.  Data can be stored in the platform independent ``.npy`` format
        using `save` and `load` instead.

        Examples
        --------
        Construct an ndarray:

        >>> import numpy as np
        >>> dt = np.dtype([('time', [('min', np.int64), ('sec', np.int64)]),
        ...                ('temp', float)])
        >>> x = np.zeros((1,), dtype=dt)
        >>> x['time']['min'] = 10; x['temp'] = 98.25
        >>> x
        array([((10, 0), 98.25)],
              dtype=[('time', [('min', '<i8'), ('sec', '<i8')]), ('temp', '<f8')])

        Save the raw data to disk:

        >>> import tempfile
        >>> fname = tempfile.mkstemp()[1]
        >>> x.tofile(fname)

        Read the raw data from disk:

        >>> np.fromfile(fname, dtype=dt)
        array([((10, 0), 98.25)],
              dtype=[('time', [('min', '<i8'), ('sec', '<i8')]), ('temp', '<f8')])

        The recommended way to store and load data:

        >>> np.save(fname, x)
        >>> np.load(fname + '.npy')
        array([((10, 0), 98.25)],
              dtype=[('time', [('min', '<i8'), ('sec', '<i8')]), ('temp', '<f8')])

    fromfunction(function, shape, *, dtype=<class 'float'>, like=None, **kwargs)
        Construct an array by executing a function over each coordinate.

        The resulting array therefore has a value ``fn(x, y, z)`` at
        coordinate ``(x, y, z)``.

        Parameters
        ----------
        function : callable
            The function is called with N parameters, where N is the rank of
            `shape`.  Each parameter represents the coordinates of the array
            varying along a specific axis.  For example, if `shape`
            were ``(2, 2)``, then the parameters would be
            ``array([[0, 0], [1, 1]])`` and ``array([[0, 1], [0, 1]])``
        shape : (N,) tuple of ints
            Shape of the output array, which also determines the shape of
            the coordinate arrays passed to `function`.
        dtype : data-type, optional
            Data-type of the coordinate arrays passed to `function`.
            By default, `dtype` is float.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        fromfunction : any
            The result of the call to `function` is passed back directly.
            Therefore the shape of `fromfunction` is completely determined by
            `function`.  If `function` returns a scalar value, the shape of
            `fromfunction` would not match the `shape` parameter.

        See Also
        --------
        indices, meshgrid

        Notes
        -----
        Keywords other than `dtype` and `like` are passed to `function`.

        Examples
        --------
        >>> import numpy as np
        >>> np.fromfunction(lambda i, j: i, (2, 2), dtype=float)
        array([[0., 0.],
               [1., 1.]])

        >>> np.fromfunction(lambda i, j: j, (2, 2), dtype=float)
        array([[0., 1.],
               [0., 1.]])

        >>> np.fromfunction(lambda i, j: i == j, (3, 3), dtype=int)
        array([[ True, False, False],
               [False,  True, False],
               [False, False,  True]])

        >>> np.fromfunction(lambda i, j: i + j, (3, 3), dtype=int)
        array([[0, 1, 2],
               [1, 2, 3],
               [2, 3, 4]])

    fromiter(...)
        fromiter(iter, dtype, count=-1, *, like=None)

        Create a new 1-dimensional array from an iterable object.

        Parameters
        ----------
        iter : iterable object
            An iterable object providing data for the array.
        dtype : data-type
            The data-type of the returned array.

            .. versionchanged:: 1.23
                Object and subarray dtypes are now supported (note that the final
                result is not 1-D for a subarray dtype).

        count : int, optional
            The number of items to read from *iterable*.  The default is -1,
            which means all data is read.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            The output array.

        Notes
        -----
        Specify `count` to improve performance.  It allows ``fromiter`` to
        pre-allocate the output array, instead of resizing it on demand.

        Examples
        --------
        >>> import numpy as np
        >>> iterable = (x*x for x in range(5))
        >>> np.fromiter(iterable, float)
        array([  0.,   1.,   4.,   9.,  16.])

        A carefully constructed subarray dtype will lead to higher dimensional
        results:

        >>> iterable = ((x+1, x+2) for x in range(5))
        >>> np.fromiter(iterable, dtype=np.dtype((int, 2)))
        array([[1, 2],
               [2, 3],
               [3, 4],
               [4, 5],
               [5, 6]])

    frompyfunc(...)
        frompyfunc(func, /, nin, nout, *[, identity])

        Takes an arbitrary Python function and returns a NumPy ufunc.

        Can be used, for example, to add broadcasting to a built-in Python
        function (see Examples section).

        Parameters
        ----------
        func : Python function object
            An arbitrary Python function.
        nin : int
            The number of input arguments.
        nout : int
            The number of objects returned by `func`.
        identity : object, optional
            The value to use for the `~numpy.ufunc.identity` attribute of the resulting
            object. If specified, this is equivalent to setting the underlying
            C ``identity`` field to ``PyUFunc_IdentityValue``.
            If omitted, the identity is set to ``PyUFunc_None``. Note that this is
            _not_ equivalent to setting the identity to ``None``, which implies the
            operation is reorderable.

        Returns
        -------
        out : ufunc
            Returns a NumPy universal function (``ufunc``) object.

        See Also
        --------
        vectorize : Evaluates pyfunc over input arrays using broadcasting rules of numpy.

        Notes
        -----
        The returned ufunc always returns PyObject arrays.

        Examples
        --------
        Use frompyfunc to add broadcasting to the Python function ``oct``:

        >>> import numpy as np
        >>> oct_array = np.frompyfunc(oct, 1, 1)
        >>> oct_array(np.array((10, 30, 100)))
        array(['0o12', '0o36', '0o144'], dtype=object)
        >>> np.array((oct(10), oct(30), oct(100))) # for comparison
        array(['0o12', '0o36', '0o144'], dtype='<U5')

    fromregex(file, regexp, dtype, encoding=None)
        Construct an array from a text file, using regular expression parsing.

        The returned array is always a structured array, and is constructed from
        all matches of the regular expression in the file. Groups in the regular
        expression are converted to fields of the structured array.

        Parameters
        ----------
        file : file, str, or pathlib.Path
            Filename or file object to read.

            .. versionchanged:: 1.22.0
                Now accepts `os.PathLike` implementations.
        regexp : str or regexp
            Regular expression used to parse the file.
            Groups in the regular expression correspond to fields in the dtype.
        dtype : dtype or list of dtypes
            Dtype for the structured array; must be a structured datatype.
        encoding : str, optional
            Encoding used to decode the inputfile. Does not apply to input streams.

            .. versionadded:: 1.14.0

        Returns
        -------
        output : ndarray
            The output array, containing the part of the content of `file` that
            was matched by `regexp`. `output` is always a structured array.

        Raises
        ------
        TypeError
            When `dtype` is not a valid dtype for a structured array.

        See Also
        --------
        fromstring, loadtxt

        Notes
        -----
        Dtypes for structured arrays can be specified in several forms, but all
        forms specify at least the data type and field name. For details see
        `basics.rec`.

        Examples
        --------
        >>> import numpy as np
        >>> from io import StringIO
        >>> text = StringIO("1312 foo\n1534  bar\n444   qux")

        >>> regexp = r"(\d+)\s+(...)"  # match [digits, whitespace, anything]
        >>> output = np.fromregex(text, regexp,
        ...                       [('num', np.int64), ('key', 'S3')])
        >>> output
        array([(1312, b'foo'), (1534, b'bar'), ( 444, b'qux')],
              dtype=[('num', '<i8'), ('key', 'S3')])
        >>> output['num']
        array([1312, 1534,  444])

    fromstring(...)
        fromstring(string, dtype=float, count=-1, *, sep, like=None)

        A new 1-D array initialized from text data in a string.

        Parameters
        ----------
        string : str
            A string containing the data.
        dtype : data-type, optional
            The data type of the array; default: float.  For binary input data,
            the data must be in exactly this format. Most builtin numeric types are
            supported and extension types may be supported.

            .. versionadded:: 1.18.0
                Complex dtypes.

        count : int, optional
            Read this number of `dtype` elements from the data.  If this is
            negative (the default), the count will be determined from the
            length of the data.
        sep : str, optional
            The string separating numbers in the data; extra whitespace between
            elements is also ignored.

            .. deprecated:: 1.14
                Passing ``sep=''``, the default, is deprecated since it will
                trigger the deprecated binary mode of this function. This mode
                interprets `string` as binary bytes, rather than ASCII text with
                decimal numbers, an operation which is better spelt
                ``frombuffer(string, dtype, count)``. If `string` contains unicode
                text, the binary mode of `fromstring` will first encode it into
                bytes using utf-8, which will not produce sane results.

        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        arr : ndarray
            The constructed array.

        Raises
        ------
        ValueError
            If the string is not the correct size to satisfy the requested
            `dtype` and `count`.

        See Also
        --------
        frombuffer, fromfile, fromiter

        Examples
        --------
        >>> import numpy as np
        >>> np.fromstring('1 2', dtype=int, sep=' ')
        array([1, 2])
        >>> np.fromstring('1, 2', dtype=int, sep=',')
        array([1, 2])

    full(shape, fill_value, dtype=None, order='C', *, device=None, like=None)
        Return a new array of given shape and type, filled with `fill_value`.

        Parameters
        ----------
        shape : int or sequence of ints
            Shape of the new array, e.g., ``(2, 3)`` or ``2``.
        fill_value : scalar or array_like
            Fill value.
        dtype : data-type, optional
            The desired data-type for the array  The default, None, means
             ``np.array(fill_value).dtype``.
        order : {'C', 'F'}, optional
            Whether to store multidimensional data in C- or Fortran-contiguous
            (row- or column-wise) order in memory.
        device : str, optional
            The device on which to place the created array. Default: None.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            Array of `fill_value` with the given shape, dtype, and order.

        See Also
        --------
        full_like : Return a new array with shape of input filled with value.
        empty : Return a new uninitialized array.
        ones : Return a new array setting values to one.
        zeros : Return a new array setting values to zero.

        Examples
        --------
        >>> import numpy as np
        >>> np.full((2, 2), np.inf)
        array([[inf, inf],
               [inf, inf]])
        >>> np.full((2, 2), 10)
        array([[10, 10],
               [10, 10]])

        >>> np.full((2, 2), [1, 2])
        array([[1, 2],
               [1, 2]])

    full_like(a, fill_value, dtype=None, order='K', subok=True, shape=None, *, device=None)
        Return a full array with the same shape and type as a given array.

        Parameters
        ----------
        a : array_like
            The shape and data-type of `a` define these same attributes of
            the returned array.
        fill_value : array_like
            Fill value.
        dtype : data-type, optional
            Overrides the data type of the result.
        order : {'C', 'F', 'A', or 'K'}, optional
            Overrides the memory layout of the result. 'C' means C-order,
            'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
            'C' otherwise. 'K' means match the layout of `a` as closely
            as possible.
        subok : bool, optional.
            If True, then the newly created array will use the sub-class
            type of `a`, otherwise it will be a base-class array. Defaults
            to True.
        shape : int or sequence of ints, optional.
            Overrides the shape of the result. If order='K' and the number of
            dimensions is unchanged, will try to keep order, otherwise,
            order='C' is implied.

            .. versionadded:: 1.17.0
        device : str, optional
            The device on which to place the created array. Default: None.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0

        Returns
        -------
        out : ndarray
            Array of `fill_value` with the same shape and type as `a`.

        See Also
        --------
        empty_like : Return an empty array with shape and type of input.
        ones_like : Return an array of ones with shape and type of input.
        zeros_like : Return an array of zeros with shape and type of input.
        full : Return a new array of given shape filled with value.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(6, dtype=int)
        >>> np.full_like(x, 1)
        array([1, 1, 1, 1, 1, 1])
        >>> np.full_like(x, 0.1)
        array([0, 0, 0, 0, 0, 0])
        >>> np.full_like(x, 0.1, dtype=np.double)
        array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1])
        >>> np.full_like(x, np.nan, dtype=np.double)
        array([nan, nan, nan, nan, nan, nan])

        >>> y = np.arange(6, dtype=np.double)
        >>> np.full_like(y, 0.1)
        array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1])

        >>> y = np.zeros([2, 2, 3], dtype=int)
        >>> np.full_like(y, [0, 0, 255])
        array([[[  0,   0, 255],
                [  0,   0, 255]],
               [[  0,   0, 255],
                [  0,   0, 255]]])

    genfromtxt(fname, dtype=<class 'float'>, comments='#', delimiter=None, skip_header=0, skip_footer=0, converters=None, missing_values=None, filling_values=None, usecols=None, names=None, excludelist=None, deletechars=" !#$%&'()*+,-./:;<=>?@[\\]^{|}~", replace_space='_', autostrip=False, case_sensitive=True, defaultfmt='f%i', unpack=None, usemask=False, loose=True, invalid_raise=True, max_rows=None, encoding=None, *, ndmin=0, like=None)
        Load data from a text file, with missing values handled as specified.

        Each line past the first `skip_header` lines is split at the `delimiter`
        character, and characters following the `comments` character are discarded.

        Parameters
        ----------
        fname : file, str, pathlib.Path, list of str, generator
            File, filename, list, or generator to read.  If the filename
            extension is ``.gz`` or ``.bz2``, the file is first decompressed. Note
            that generators must return bytes or strings. The strings
            in a list or produced by a generator are treated as lines.
        dtype : dtype, optional
            Data type of the resulting array.
            If None, the dtypes will be determined by the contents of each
            column, individually.
        comments : str, optional
            The character used to indicate the start of a comment.
            All the characters occurring on a line after a comment are discarded.
        delimiter : str, int, or sequence, optional
            The string used to separate values.  By default, any consecutive
            whitespaces act as delimiter.  An integer or sequence of integers
            can also be provided as width(s) of each field.
        skiprows : int, optional
            `skiprows` was removed in numpy 1.10. Please use `skip_header` instead.
        skip_header : int, optional
            The number of lines to skip at the beginning of the file.
        skip_footer : int, optional
            The number of lines to skip at the end of the file.
        converters : variable, optional
            The set of functions that convert the data of a column to a value.
            The converters can also be used to provide a default value
            for missing data: ``converters = {3: lambda s: float(s or 0)}``.
        missing : variable, optional
            `missing` was removed in numpy 1.10. Please use `missing_values`
            instead.
        missing_values : variable, optional
            The set of strings corresponding to missing data.
        filling_values : variable, optional
            The set of values to be used as default when the data are missing.
        usecols : sequence, optional
            Which columns to read, with 0 being the first.  For example,
            ``usecols = (1, 4, 5)`` will extract the 2nd, 5th and 6th columns.
        names : {None, True, str, sequence}, optional
            If `names` is True, the field names are read from the first line after
            the first `skip_header` lines. This line can optionally be preceded
            by a comment delimiter. Any content before the comment delimiter is
            discarded. If `names` is a sequence or a single-string of
            comma-separated names, the names will be used to define the field
            names in a structured dtype. If `names` is None, the names of the
            dtype fields will be used, if any.
        excludelist : sequence, optional
            A list of names to exclude. This list is appended to the default list
            ['return','file','print']. Excluded names are appended with an
            underscore: for example, `file` would become `file_`.
        deletechars : str, optional
            A string combining invalid characters that must be deleted from the
            names.
        defaultfmt : str, optional
            A format used to define default field names, such as "f%i" or "f_%02i".
        autostrip : bool, optional
            Whether to automatically strip white spaces from the variables.
        replace_space : char, optional
            Character(s) used in replacement of white spaces in the variable
            names. By default, use a '_'.
        case_sensitive : {True, False, 'upper', 'lower'}, optional
            If True, field names are case sensitive.
            If False or 'upper', field names are converted to upper case.
            If 'lower', field names are converted to lower case.
        unpack : bool, optional
            If True, the returned array is transposed, so that arguments may be
            unpacked using ``x, y, z = genfromtxt(...)``.  When used with a
            structured data-type, arrays are returned for each field.
            Default is False.
        usemask : bool, optional
            If True, return a masked array.
            If False, return a regular array.
        loose : bool, optional
            If True, do not raise errors for invalid values.
        invalid_raise : bool, optional
            If True, an exception is raised if an inconsistency is detected in the
            number of columns.
            If False, a warning is emitted and the offending lines are skipped.
        max_rows : int,  optional
            The maximum number of rows to read. Must not be used with skip_footer
            at the same time.  If given, the value must be at least 1. Default is
            to read the entire file.

            .. versionadded:: 1.10.0
        encoding : str, optional
            Encoding used to decode the inputfile. Does not apply when `fname`
            is a file object. The special value 'bytes' enables backward
            compatibility workarounds that ensure that you receive byte arrays
            when possible and passes latin1 encoded strings to converters.
            Override this value to receive unicode arrays and pass strings
            as input to converters.  If set to None the system default is used.
            The default value is 'bytes'.

            .. versionadded:: 1.14.0
            .. versionchanged:: 2.0
                Before NumPy 2, the default was ``'bytes'`` for Python 2
                compatibility. The default is now ``None``.

        ndmin : int, optional
            Same parameter as `loadtxt`

            .. versionadded:: 1.23.0
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            Data read from the text file. If `usemask` is True, this is a
            masked array.

        See Also
        --------
        numpy.loadtxt : equivalent function when no data is missing.

        Notes
        -----
        * When spaces are used as delimiters, or when no delimiter has been given
          as input, there should not be any missing data between two fields.
        * When variables are named (either by a flexible dtype or with a `names`
          sequence), there must not be any header in the file (else a ValueError
          exception is raised).
        * Individual values are not stripped of spaces by default.
          When using a custom converter, make sure the function does remove spaces.
        * Custom converters may receive unexpected values due to dtype
          discovery.

        References
        ----------
        .. [1] NumPy User Guide, section `I/O with NumPy
               <https://docs.scipy.org/doc/numpy/user/basics.io.genfromtxt.html>`_.

        Examples
        --------
        >>> from io import StringIO
        >>> import numpy as np

        Comma delimited file with mixed dtype

        >>> s = StringIO("1,1.3,abcde")
        >>> data = np.genfromtxt(s, dtype=[('myint','i8'),('myfloat','f8'),
        ... ('mystring','S5')], delimiter=",")
        >>> data
        array((1, 1.3, b'abcde'),
              dtype=[('myint', '<i8'), ('myfloat', '<f8'), ('mystring', 'S5')])

        Using dtype = None

        >>> _ = s.seek(0) # needed for StringIO example only
        >>> data = np.genfromtxt(s, dtype=None,
        ... names = ['myint','myfloat','mystring'], delimiter=",")
        >>> data
        array((1, 1.3, 'abcde'),
              dtype=[('myint', '<i8'), ('myfloat', '<f8'), ('mystring', '<U5')])

        Specifying dtype and names

        >>> _ = s.seek(0)
        >>> data = np.genfromtxt(s, dtype="i8,f8,S5",
        ... names=['myint','myfloat','mystring'], delimiter=",")
        >>> data
        array((1, 1.3, b'abcde'),
              dtype=[('myint', '<i8'), ('myfloat', '<f8'), ('mystring', 'S5')])

        An example with fixed-width columns

        >>> s = StringIO("11.3abcde")
        >>> data = np.genfromtxt(s, dtype=None, names=['intvar','fltvar','strvar'],
        ...     delimiter=[1,3,5])
        >>> data
        array((1, 1.3, 'abcde'),
              dtype=[('intvar', '<i8'), ('fltvar', '<f8'), ('strvar', '<U5')])

        An example to show comments

        >>> f = StringIO('''
        ... text,# of chars
        ... hello world,11
        ... numpy,5''')
        >>> np.genfromtxt(f, dtype='S12,S12', delimiter=',')
        array([(b'text', b''), (b'hello world', b'11'), (b'numpy', b'5')],
          dtype=[('f0', 'S12'), ('f1', 'S12')])

    geomspace(start, stop, num=50, endpoint=True, dtype=None, axis=0)
        Return numbers spaced evenly on a log scale (a geometric progression).

        This is similar to `logspace`, but with endpoints specified directly.
        Each output sample is a constant multiple of the previous.

        .. versionchanged:: 1.16.0
            Non-scalar `start` and `stop` are now supported.

        Parameters
        ----------
        start : array_like
            The starting value of the sequence.
        stop : array_like
            The final value of the sequence, unless `endpoint` is False.
            In that case, ``num + 1`` values are spaced over the
            interval in log-space, of which all but the last (a sequence of
            length `num`) are returned.
        num : integer, optional
            Number of samples to generate.  Default is 50.
        endpoint : boolean, optional
            If true, `stop` is the last sample. Otherwise, it is not included.
            Default is True.
        dtype : dtype
            The type of the output array.  If `dtype` is not given, the data type
            is inferred from `start` and `stop`. The inferred dtype will never be
            an integer; `float` is chosen even if the arguments would produce an
            array of integers.
        axis : int, optional
            The axis in the result to store the samples.  Relevant only if start
            or stop are array-like.  By default (0), the samples will be along a
            new axis inserted at the beginning. Use -1 to get an axis at the end.

            .. versionadded:: 1.16.0

        Returns
        -------
        samples : ndarray
            `num` samples, equally spaced on a log scale.

        See Also
        --------
        logspace : Similar to geomspace, but with endpoints specified using log
                   and base.
        linspace : Similar to geomspace, but with arithmetic instead of geometric
                   progression.
        arange : Similar to linspace, with the step size specified instead of the
                 number of samples.
        :ref:`how-to-partition`

        Notes
        -----
        If the inputs or dtype are complex, the output will follow a logarithmic
        spiral in the complex plane.  (There are an infinite number of spirals
        passing through two points; the output will follow the shortest such path.)

        Examples
        --------
        >>> import numpy as np
        >>> np.geomspace(1, 1000, num=4)
        array([    1.,    10.,   100.,  1000.])
        >>> np.geomspace(1, 1000, num=3, endpoint=False)
        array([   1.,   10.,  100.])
        >>> np.geomspace(1, 1000, num=4, endpoint=False)
        array([   1.        ,    5.62341325,   31.6227766 ,  177.827941  ])
        >>> np.geomspace(1, 256, num=9)
        array([   1.,    2.,    4.,    8.,   16.,   32.,   64.,  128.,  256.])

        Note that the above may not produce exact integers:

        >>> np.geomspace(1, 256, num=9, dtype=int)
        array([  1,   2,   4,   7,  16,  32,  63, 127, 256])
        >>> np.around(np.geomspace(1, 256, num=9)).astype(int)
        array([  1,   2,   4,   8,  16,  32,  64, 128, 256])

        Negative, decreasing, and complex inputs are allowed:

        >>> np.geomspace(1000, 1, num=4)
        array([1000.,  100.,   10.,    1.])
        >>> np.geomspace(-1000, -1, num=4)
        array([-1000.,  -100.,   -10.,    -1.])
        >>> np.geomspace(1j, 1000j, num=4)  # Straight line
        array([0.   +1.j, 0.  +10.j, 0. +100.j, 0.+1000.j])
        >>> np.geomspace(-1+0j, 1+0j, num=5)  # Circle
        array([-1.00000000e+00+1.22464680e-16j, -7.07106781e-01+7.07106781e-01j,
                6.12323400e-17+1.00000000e+00j,  7.07106781e-01+7.07106781e-01j,
                1.00000000e+00+0.00000000e+00j])

        Graphical illustration of `endpoint` parameter:

        >>> import matplotlib.pyplot as plt
        >>> N = 10
        >>> y = np.zeros(N)
        >>> plt.semilogx(np.geomspace(1, 1000, N, endpoint=True), y + 1, 'o')
        [<matplotlib.lines.Line2D object at 0x...>]
        >>> plt.semilogx(np.geomspace(1, 1000, N, endpoint=False), y + 2, 'o')
        [<matplotlib.lines.Line2D object at 0x...>]
        >>> plt.axis([0.5, 2000, 0, 3])
        [0.5, 2000, 0, 3]
        >>> plt.grid(True, color='0.7', linestyle='-', which='both', axis='both')
        >>> plt.show()

    get_include()
        Return the directory that contains the NumPy \*.h header files.

        Extension modules that need to compile against NumPy may need to use this
        function to locate the appropriate include directory.

        Notes
        -----
        When using ``setuptools``, for example in ``setup.py``::

            import numpy as np
            ...
            Extension('extension_name', ...
                      include_dirs=[np.get_include()])
            ...

        Note that a CLI tool ``numpy-config`` was introduced in NumPy 2.0, using
        that is likely preferred for build systems other than ``setuptools``::

            $ numpy-config --cflags
            -I/path/to/site-packages/numpy/_core/include

            # Or rely on pkg-config:
            $ export PKG_CONFIG_PATH=$(numpy-config --pkgconfigdir)
            $ pkg-config --cflags
            -I/path/to/site-packages/numpy/_core/include

        Examples
        --------
        >>> np.get_include()
        '.../site-packages/numpy/core/include'  # may vary

    get_printoptions()
        Return the current print options.

        Returns
        -------
        print_opts : dict
            Dictionary of current print options with keys

            - precision : int
            - threshold : int
            - edgeitems : int
            - linewidth : int
            - suppress : bool
            - nanstr : str
            - infstr : str
            - sign : str
            - formatter : dict of callables
            - floatmode : str
            - legacy : str or False

            For a full description of these options, see `set_printoptions`.

        See Also
        --------
        set_printoptions, printoptions

        Examples
        --------
        >>> import numpy as np

        >>> np.get_printoptions()
        {'edgeitems': 3, 'threshold': 1000, ..., 'override_repr': None}

        >>> np.get_printoptions()['linewidth']
        75
        >>> np.set_printoptions(linewidth=100)
        >>> np.get_printoptions()['linewidth']
        100

    getbufsize()
        Return the size of the buffer used in ufuncs.

        Returns
        -------
        getbufsize : int
            Size of ufunc buffer in bytes.

        Examples
        --------
        >>> import numpy as np
        >>> np.getbufsize()
        8192

    geterr()
        Get the current way of handling floating-point errors.

        Returns
        -------
        res : dict
            A dictionary with keys "divide", "over", "under", and "invalid",
            whose values are from the strings "ignore", "print", "log", "warn",
            "raise", and "call". The keys represent possible floating-point
            exceptions, and the values define how these exceptions are handled.

        See Also
        --------
        geterrcall, seterr, seterrcall

        Notes
        -----
        For complete documentation of the types of floating-point exceptions and
        treatment options, see `seterr`.

        Examples
        --------
        >>> import numpy as np
        >>> np.geterr()
        {'divide': 'warn', 'over': 'warn', 'under': 'ignore', 'invalid': 'warn'}
        >>> np.arange(3.) / np.arange(3.)  # doctest: +SKIP
        array([nan,  1.,  1.])
        RuntimeWarning: invalid value encountered in divide

        >>> oldsettings = np.seterr(all='warn', invalid='raise')
        >>> np.geterr()
        {'divide': 'warn', 'over': 'warn', 'under': 'warn', 'invalid': 'raise'}
        >>> np.arange(3.) / np.arange(3.)
        Traceback (most recent call last):
          ...
        FloatingPointError: invalid value encountered in divide
        >>> oldsettings = np.seterr(**oldsettings)  # restore original

    geterrcall()
        Return the current callback function used on floating-point errors.

        When the error handling for a floating-point error (one of "divide",
        "over", "under", or "invalid") is set to 'call' or 'log', the function
        that is called or the log instance that is written to is returned by
        `geterrcall`. This function or log instance has been set with
        `seterrcall`.

        Returns
        -------
        errobj : callable, log instance or None
            The current error handler. If no handler was set through `seterrcall`,
            ``None`` is returned.

        See Also
        --------
        seterrcall, seterr, geterr

        Notes
        -----
        For complete documentation of the types of floating-point exceptions and
        treatment options, see `seterr`.

        Examples
        --------
        >>> import numpy as np
        >>> np.geterrcall()  # we did not yet set a handler, returns None

        >>> orig_settings = np.seterr(all='call')
        >>> def err_handler(type, flag):
        ...     print("Floating point error (%s), with flag %s" % (type, flag))
        >>> old_handler = np.seterrcall(err_handler)
        >>> np.array([1, 2, 3]) / 0.0
        Floating point error (divide by zero), with flag 1
        array([inf, inf, inf])

        >>> cur_handler = np.geterrcall()
        >>> cur_handler is err_handler
        True
        >>> old_settings = np.seterr(**orig_settings)  # restore original
        >>> old_handler = np.seterrcall(None)  # restore original

    gradient(f, *varargs, axis=None, edge_order=1)
        Return the gradient of an N-dimensional array.

        The gradient is computed using second order accurate central differences
        in the interior points and either first or second order accurate one-sides
        (forward or backwards) differences at the boundaries.
        The returned gradient hence has the same shape as the input array.

        Parameters
        ----------
        f : array_like
            An N-dimensional array containing samples of a scalar function.
        varargs : list of scalar or array, optional
            Spacing between f values. Default unitary spacing for all dimensions.
            Spacing can be specified using:

            1. single scalar to specify a sample distance for all dimensions.
            2. N scalars to specify a constant sample distance for each dimension.
               i.e. `dx`, `dy`, `dz`, ...
            3. N arrays to specify the coordinates of the values along each
               dimension of F. The length of the array must match the size of
               the corresponding dimension
            4. Any combination of N scalars/arrays with the meaning of 2. and 3.

            If `axis` is given, the number of varargs must equal the number of axes.
            Default: 1. (see Examples below).

        edge_order : {1, 2}, optional
            Gradient is calculated using N-th order accurate differences
            at the boundaries. Default: 1.

            .. versionadded:: 1.9.1

        axis : None or int or tuple of ints, optional
            Gradient is calculated only along the given axis or axes
            The default (axis = None) is to calculate the gradient for all the axes
            of the input array. axis may be negative, in which case it counts from
            the last to the first axis.

            .. versionadded:: 1.11.0

        Returns
        -------
        gradient : ndarray or tuple of ndarray
            A tuple of ndarrays (or a single ndarray if there is only one
            dimension) corresponding to the derivatives of f with respect
            to each dimension. Each derivative has the same shape as f.

        Examples
        --------
        >>> import numpy as np
        >>> f = np.array([1, 2, 4, 7, 11, 16])
        >>> np.gradient(f)
        array([1. , 1.5, 2.5, 3.5, 4.5, 5. ])
        >>> np.gradient(f, 2)
        array([0.5 ,  0.75,  1.25,  1.75,  2.25,  2.5 ])

        Spacing can be also specified with an array that represents the coordinates
        of the values F along the dimensions.
        For instance a uniform spacing:

        >>> x = np.arange(f.size)
        >>> np.gradient(f, x)
        array([1. ,  1.5,  2.5,  3.5,  4.5,  5. ])

        Or a non uniform one:

        >>> x = np.array([0., 1., 1.5, 3.5, 4., 6.])
        >>> np.gradient(f, x)
        array([1. ,  3. ,  3.5,  6.7,  6.9,  2.5])

        For two dimensional arrays, the return will be two arrays ordered by
        axis. In this example the first array stands for the gradient in
        rows and the second one in columns direction:

        >>> np.gradient(np.array([[1, 2, 6], [3, 4, 5]]))
        (array([[ 2.,  2., -1.],
                [ 2.,  2., -1.]]),
         array([[1. , 2.5, 4. ],
                [1. , 1. , 1. ]]))

        In this example the spacing is also specified:
        uniform for axis=0 and non uniform for axis=1

        >>> dx = 2.
        >>> y = [1., 1.5, 3.5]
        >>> np.gradient(np.array([[1, 2, 6], [3, 4, 5]]), dx, y)
        (array([[ 1. ,  1. , -0.5],
                [ 1. ,  1. , -0.5]]),
         array([[2. , 2. , 2. ],
                [2. , 1.7, 0.5]]))

        It is possible to specify how boundaries are treated using `edge_order`

        >>> x = np.array([0, 1, 2, 3, 4])
        >>> f = x**2
        >>> np.gradient(f, edge_order=1)
        array([1.,  2.,  4.,  6.,  7.])
        >>> np.gradient(f, edge_order=2)
        array([0., 2., 4., 6., 8.])

        The `axis` keyword can be used to specify a subset of axes of which the
        gradient is calculated

        >>> np.gradient(np.array([[1, 2, 6], [3, 4, 5]]), axis=0)
        array([[ 2.,  2., -1.],
               [ 2.,  2., -1.]])

        The `varargs` argument defines the spacing between sample points in the
        input array. It can take two forms:

        1. An array, specifying coordinates, which may be unevenly spaced:

        >>> x = np.array([0., 2., 3., 6., 8.])
        >>> y = x ** 2
        >>> np.gradient(y, x, edge_order=2)
        array([ 0.,  4.,  6., 12., 16.])

        2. A scalar, representing the fixed sample distance:

        >>> dx = 2
        >>> x = np.array([0., 2., 4., 6., 8.])
        >>> y = x ** 2
        >>> np.gradient(y, dx, edge_order=2)
        array([ 0.,  4.,  8., 12., 16.])

        It's possible to provide different data for spacing along each dimension.
        The number of arguments must match the number of dimensions in the input
        data.

        >>> dx = 2
        >>> dy = 3
        >>> x = np.arange(0, 6, dx)
        >>> y = np.arange(0, 9, dy)
        >>> xs, ys = np.meshgrid(x, y)
        >>> zs = xs + 2 * ys
        >>> np.gradient(zs, dy, dx)  # Passing two scalars
        (array([[2., 2., 2.],
                [2., 2., 2.],
                [2., 2., 2.]]),
         array([[1., 1., 1.],
                [1., 1., 1.],
                [1., 1., 1.]]))

        Mixing scalars and arrays is also allowed:

        >>> np.gradient(zs, y, dx)  # Passing one array and one scalar
        (array([[2., 2., 2.],
                [2., 2., 2.],
                [2., 2., 2.]]),
         array([[1., 1., 1.],
                [1., 1., 1.],
                [1., 1., 1.]]))

        Notes
        -----
        Assuming that :math:`f\in C^{3}` (i.e., :math:`f` has at least 3 continuous
        derivatives) and let :math:`h_{*}` be a non-homogeneous stepsize, we
        minimize the "consistency error" :math:`\eta_{i}` between the true gradient
        and its estimate from a linear combination of the neighboring grid-points:

        .. math::

            \eta_{i} = f_{i}^{\left(1\right)} -
                        \left[ \alpha f\left(x_{i}\right) +
                                \beta f\left(x_{i} + h_{d}\right) +
                                \gamma f\left(x_{i}-h_{s}\right)
                        \right]

        By substituting :math:`f(x_{i} + h_{d})` and :math:`f(x_{i} - h_{s})`
        with their Taylor series expansion, this translates into solving
        the following the linear system:

        .. math::

            \left\{
                \begin{array}{r}
                    \alpha+\beta+\gamma=0 \\
                    \beta h_{d}-\gamma h_{s}=1 \\
                    \beta h_{d}^{2}+\gamma h_{s}^{2}=0
                \end{array}
            \right.

        The resulting approximation of :math:`f_{i}^{(1)}` is the following:

        .. math::

            \hat f_{i}^{(1)} =
                \frac{
                    h_{s}^{2}f\left(x_{i} + h_{d}\right)
                    + \left(h_{d}^{2} - h_{s}^{2}\right)f\left(x_{i}\right)
                    - h_{d}^{2}f\left(x_{i}-h_{s}\right)}
                    { h_{s}h_{d}\left(h_{d} + h_{s}\right)}
                + \mathcal{O}\left(\frac{h_{d}h_{s}^{2}
                                    + h_{s}h_{d}^{2}}{h_{d}
                                    + h_{s}}\right)

        It is worth noting that if :math:`h_{s}=h_{d}`
        (i.e., data are evenly spaced)
        we find the standard second order approximation:

        .. math::

            \hat f_{i}^{(1)}=
                \frac{f\left(x_{i+1}\right) - f\left(x_{i-1}\right)}{2h}
                + \mathcal{O}\left(h^{2}\right)

        With a similar procedure the forward/backward approximations used for
        boundaries can be derived.

        References
        ----------
        .. [1]  Quarteroni A., Sacco R., Saleri F. (2007) Numerical Mathematics
                (Texts in Applied Mathematics). New York: Springer.
        .. [2]  Durran D. R. (1999) Numerical Methods for Wave Equations
                in Geophysical Fluid Dynamics. New York: Springer.
        .. [3]  Fornberg B. (1988) Generation of Finite Difference Formulas on
                Arbitrarily Spaced Grids,
                Mathematics of Computation 51, no. 184 : 699-706.
                `PDF <https://www.ams.org/journals/mcom/1988-51-184/
                S0025-5718-1988-0935077-0/S0025-5718-1988-0935077-0.pdf>`_.

    hamming(M)
        Return the Hamming window.

        The Hamming window is a taper formed by using a weighted cosine.

        Parameters
        ----------
        M : int
            Number of points in the output window. If zero or less, an
            empty array is returned.

        Returns
        -------
        out : ndarray
            The window, with the maximum value normalized to one (the value
            one appears only if the number of samples is odd).

        See Also
        --------
        bartlett, blackman, hanning, kaiser

        Notes
        -----
        The Hamming window is defined as

        .. math::  w(n) = 0.54 - 0.46\cos\left(\frac{2\pi{n}}{M-1}\right)
                   \qquad 0 \leq n \leq M-1

        The Hamming was named for R. W. Hamming, an associate of J. W. Tukey
        and is described in Blackman and Tukey. It was recommended for
        smoothing the truncated autocovariance function in the time domain.
        Most references to the Hamming window come from the signal processing
        literature, where it is used as one of many windowing functions for
        smoothing values.  It is also known as an apodization (which means
        "removing the foot", i.e. smoothing discontinuities at the beginning
        and end of the sampled signal) or tapering function.

        References
        ----------
        .. [1] Blackman, R.B. and Tukey, J.W., (1958) The measurement of power
               spectra, Dover Publications, New York.
        .. [2] E.R. Kanasewich, "Time Sequence Analysis in Geophysics", The
               University of Alberta Press, 1975, pp. 109-110.
        .. [3] Wikipedia, "Window function",
               https://en.wikipedia.org/wiki/Window_function
        .. [4] W.H. Press,  B.P. Flannery, S.A. Teukolsky, and W.T. Vetterling,
               "Numerical Recipes", Cambridge University Press, 1986, page 425.

        Examples
        --------
        >>> import numpy as np
        >>> np.hamming(12)
        array([ 0.08      ,  0.15302337,  0.34890909,  0.60546483,  0.84123594, # may vary
                0.98136677,  0.98136677,  0.84123594,  0.60546483,  0.34890909,
                0.15302337,  0.08      ])

        Plot the window and the frequency response.

        .. plot::
            :include-source:

            import matplotlib.pyplot as plt
            from numpy.fft import fft, fftshift
            window = np.hamming(51)
            plt.plot(window)
            plt.title("Hamming window")
            plt.ylabel("Amplitude")
            plt.xlabel("Sample")
            plt.show()

            plt.figure()
            A = fft(window, 2048) / 25.5
            mag = np.abs(fftshift(A))
            freq = np.linspace(-0.5, 0.5, len(A))
            response = 20 * np.log10(mag)
            response = np.clip(response, -100, 100)
            plt.plot(freq, response)
            plt.title("Frequency response of Hamming window")
            plt.ylabel("Magnitude [dB]")
            plt.xlabel("Normalized frequency [cycles per sample]")
            plt.axis('tight')
            plt.show()

    hanning(M)
        Return the Hanning window.

        The Hanning window is a taper formed by using a weighted cosine.

        Parameters
        ----------
        M : int
            Number of points in the output window. If zero or less, an
            empty array is returned.

        Returns
        -------
        out : ndarray, shape(M,)
            The window, with the maximum value normalized to one (the value
            one appears only if `M` is odd).

        See Also
        --------
        bartlett, blackman, hamming, kaiser

        Notes
        -----
        The Hanning window is defined as

        .. math::  w(n) = 0.5 - 0.5\cos\left(\frac{2\pi{n}}{M-1}\right)
                   \qquad 0 \leq n \leq M-1

        The Hanning was named for Julius von Hann, an Austrian meteorologist.
        It is also known as the Cosine Bell. Some authors prefer that it be
        called a Hann window, to help avoid confusion with the very similar
        Hamming window.

        Most references to the Hanning window come from the signal processing
        literature, where it is used as one of many windowing functions for
        smoothing values.  It is also known as an apodization (which means
        "removing the foot", i.e. smoothing discontinuities at the beginning
        and end of the sampled signal) or tapering function.

        References
        ----------
        .. [1] Blackman, R.B. and Tukey, J.W., (1958) The measurement of power
               spectra, Dover Publications, New York.
        .. [2] E.R. Kanasewich, "Time Sequence Analysis in Geophysics",
               The University of Alberta Press, 1975, pp. 106-108.
        .. [3] Wikipedia, "Window function",
               https://en.wikipedia.org/wiki/Window_function
        .. [4] W.H. Press,  B.P. Flannery, S.A. Teukolsky, and W.T. Vetterling,
               "Numerical Recipes", Cambridge University Press, 1986, page 425.

        Examples
        --------
        >>> import numpy as np
        >>> np.hanning(12)
        array([0.        , 0.07937323, 0.29229249, 0.57115742, 0.82743037,
               0.97974649, 0.97974649, 0.82743037, 0.57115742, 0.29229249,
               0.07937323, 0.        ])

        Plot the window and its frequency response.

        .. plot::
            :include-source:

            import matplotlib.pyplot as plt
            from numpy.fft import fft, fftshift
            window = np.hanning(51)
            plt.plot(window)
            plt.title("Hann window")
            plt.ylabel("Amplitude")
            plt.xlabel("Sample")
            plt.show()

            plt.figure()
            A = fft(window, 2048) / 25.5
            mag = np.abs(fftshift(A))
            freq = np.linspace(-0.5, 0.5, len(A))
            with np.errstate(divide='ignore', invalid='ignore'):
                response = 20 * np.log10(mag)
            response = np.clip(response, -100, 100)
            plt.plot(freq, response)
            plt.title("Frequency response of the Hann window")
            plt.ylabel("Magnitude [dB]")
            plt.xlabel("Normalized frequency [cycles per sample]")
            plt.axis('tight')
            plt.show()

    histogram(a, bins=10, range=None, density=None, weights=None)
        Compute the histogram of a dataset.

        Parameters
        ----------
        a : array_like
            Input data. The histogram is computed over the flattened array.
        bins : int or sequence of scalars or str, optional
            If `bins` is an int, it defines the number of equal-width
            bins in the given range (10, by default). If `bins` is a
            sequence, it defines a monotonically increasing array of bin edges,
            including the rightmost edge, allowing for non-uniform bin widths.

            .. versionadded:: 1.11.0

            If `bins` is a string, it defines the method used to calculate the
            optimal bin width, as defined by `histogram_bin_edges`.

        range : (float, float), optional
            The lower and upper range of the bins.  If not provided, range
            is simply ``(a.min(), a.max())``.  Values outside the range are
            ignored. The first element of the range must be less than or
            equal to the second. `range` affects the automatic bin
            computation as well. While bin width is computed to be optimal
            based on the actual data within `range`, the bin count will fill
            the entire range including portions containing no data.
        weights : array_like, optional
            An array of weights, of the same shape as `a`.  Each value in
            `a` only contributes its associated weight towards the bin count
            (instead of 1). If `density` is True, the weights are
            normalized, so that the integral of the density over the range
            remains 1.
            Please note that the ``dtype`` of `weights` will also become the
            ``dtype`` of the returned accumulator (`hist`), so it must be
            large enough to hold accumulated values as well.
        density : bool, optional
            If ``False``, the result will contain the number of samples in
            each bin. If ``True``, the result is the value of the
            probability *density* function at the bin, normalized such that
            the *integral* over the range is 1. Note that the sum of the
            histogram values will not be equal to 1 unless bins of unity
            width are chosen; it is not a probability *mass* function.

        Returns
        -------
        hist : array
            The values of the histogram. See `density` and `weights` for a
            description of the possible semantics.  If `weights` are given,
            ``hist.dtype`` will be taken from `weights`.
        bin_edges : array of dtype float
            Return the bin edges ``(length(hist)+1)``.


        See Also
        --------
        histogramdd, bincount, searchsorted, digitize, histogram_bin_edges

        Notes
        -----
        All but the last (righthand-most) bin is half-open.  In other words,
        if `bins` is::

          [1, 2, 3, 4]

        then the first bin is ``[1, 2)`` (including 1, but excluding 2) and
        the second ``[2, 3)``.  The last bin, however, is ``[3, 4]``, which
        *includes* 4.


        Examples
        --------
        >>> import numpy as np
        >>> np.histogram([1, 2, 1], bins=[0, 1, 2, 3])
        (array([0, 2, 1]), array([0, 1, 2, 3]))
        >>> np.histogram(np.arange(4), bins=np.arange(5), density=True)
        (array([0.25, 0.25, 0.25, 0.25]), array([0, 1, 2, 3, 4]))
        >>> np.histogram([[1, 2, 1], [1, 0, 1]], bins=[0,1,2,3])
        (array([1, 4, 1]), array([0, 1, 2, 3]))

        >>> a = np.arange(5)
        >>> hist, bin_edges = np.histogram(a, density=True)
        >>> hist
        array([0.5, 0. , 0.5, 0. , 0. , 0.5, 0. , 0.5, 0. , 0.5])
        >>> hist.sum()
        2.4999999999999996
        >>> np.sum(hist * np.diff(bin_edges))
        1.0

        .. versionadded:: 1.11.0

        Automated Bin Selection Methods example, using 2 peak random data
        with 2000 points.

        .. plot::
            :include-source:

            import matplotlib.pyplot as plt
            import numpy as np

            rng = np.random.RandomState(10)  # deterministic random data
            a = np.hstack((rng.normal(size=1000),
                           rng.normal(loc=5, scale=2, size=1000)))
            plt.hist(a, bins='auto')  # arguments are passed to np.histogram
            plt.title("Histogram with 'auto' bins")
            plt.show()

    histogram2d(x, y, bins=10, range=None, density=None, weights=None)
        Compute the bi-dimensional histogram of two data samples.

        Parameters
        ----------
        x : array_like, shape (N,)
            An array containing the x coordinates of the points to be
            histogrammed.
        y : array_like, shape (N,)
            An array containing the y coordinates of the points to be
            histogrammed.
        bins : int or array_like or [int, int] or [array, array], optional
            The bin specification:

            * If int, the number of bins for the two dimensions (nx=ny=bins).
            * If array_like, the bin edges for the two dimensions
              (x_edges=y_edges=bins).
            * If [int, int], the number of bins in each dimension
              (nx, ny = bins).
            * If [array, array], the bin edges in each dimension
              (x_edges, y_edges = bins).
            * A combination [int, array] or [array, int], where int
              is the number of bins and array is the bin edges.

        range : array_like, shape(2,2), optional
            The leftmost and rightmost edges of the bins along each dimension
            (if not specified explicitly in the `bins` parameters):
            ``[[xmin, xmax], [ymin, ymax]]``. All values outside of this range
            will be considered outliers and not tallied in the histogram.
        density : bool, optional
            If False, the default, returns the number of samples in each bin.
            If True, returns the probability *density* function at the bin,
            ``bin_count / sample_count / bin_area``.
        weights : array_like, shape(N,), optional
            An array of values ``w_i`` weighing each sample ``(x_i, y_i)``.
            Weights are normalized to 1 if `density` is True. If `density` is
            False, the values of the returned histogram are equal to the sum of
            the weights belonging to the samples falling into each bin.

        Returns
        -------
        H : ndarray, shape(nx, ny)
            The bi-dimensional histogram of samples `x` and `y`. Values in `x`
            are histogrammed along the first dimension and values in `y` are
            histogrammed along the second dimension.
        xedges : ndarray, shape(nx+1,)
            The bin edges along the first dimension.
        yedges : ndarray, shape(ny+1,)
            The bin edges along the second dimension.

        See Also
        --------
        histogram : 1D histogram
        histogramdd : Multidimensional histogram

        Notes
        -----
        When `density` is True, then the returned histogram is the sample
        density, defined such that the sum over bins of the product
        ``bin_value * bin_area`` is 1.

        Please note that the histogram does not follow the Cartesian convention
        where `x` values are on the abscissa and `y` values on the ordinate
        axis.  Rather, `x` is histogrammed along the first dimension of the
        array (vertical), and `y` along the second dimension of the array
        (horizontal).  This ensures compatibility with `histogramdd`.

        Examples
        --------
        >>> import numpy as np
        >>> from matplotlib.image import NonUniformImage
        >>> import matplotlib.pyplot as plt

        Construct a 2-D histogram with variable bin width. First define the bin
        edges:

        >>> xedges = [0, 1, 3, 5]
        >>> yedges = [0, 2, 3, 4, 6]

        Next we create a histogram H with random bin content:

        >>> x = np.random.normal(2, 1, 100)
        >>> y = np.random.normal(1, 1, 100)
        >>> H, xedges, yedges = np.histogram2d(x, y, bins=(xedges, yedges))
        >>> # Histogram does not follow Cartesian convention (see Notes),
        >>> # therefore transpose H for visualization purposes.
        >>> H = H.T

        :func:`imshow <matplotlib.pyplot.imshow>` can only display square bins:

        >>> fig = plt.figure(figsize=(7, 3))
        >>> ax = fig.add_subplot(131, title='imshow: square bins')
        >>> plt.imshow(H, interpolation='nearest', origin='lower',
        ...         extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]])
        <matplotlib.image.AxesImage object at 0x...>

        :func:`pcolormesh <matplotlib.pyplot.pcolormesh>` can display actual edges:

        >>> ax = fig.add_subplot(132, title='pcolormesh: actual edges',
        ...         aspect='equal')
        >>> X, Y = np.meshgrid(xedges, yedges)
        >>> ax.pcolormesh(X, Y, H)
        <matplotlib.collections.QuadMesh object at 0x...>

        :class:`NonUniformImage <matplotlib.image.NonUniformImage>` can be used to
        display actual bin edges with interpolation:

        >>> ax = fig.add_subplot(133, title='NonUniformImage: interpolated',
        ...         aspect='equal', xlim=xedges[[0, -1]], ylim=yedges[[0, -1]])
        >>> im = NonUniformImage(ax, interpolation='bilinear')
        >>> xcenters = (xedges[:-1] + xedges[1:]) / 2
        >>> ycenters = (yedges[:-1] + yedges[1:]) / 2
        >>> im.set_data(xcenters, ycenters, H)
        >>> ax.add_image(im)
        >>> plt.show()

        It is also possible to construct a 2-D histogram without specifying bin
        edges:

        >>> # Generate non-symmetric test data
        >>> n = 10000
        >>> x = np.linspace(1, 100, n)
        >>> y = 2*np.log(x) + np.random.rand(n) - 0.5
        >>> # Compute 2d histogram. Note the order of x/y and xedges/yedges
        >>> H, yedges, xedges = np.histogram2d(y, x, bins=20)

        Now we can plot the histogram using
        :func:`pcolormesh <matplotlib.pyplot.pcolormesh>`, and a
        :func:`hexbin <matplotlib.pyplot.hexbin>` for comparison.

        >>> # Plot histogram using pcolormesh
        >>> fig, (ax1, ax2) = plt.subplots(ncols=2, sharey=True)
        >>> ax1.pcolormesh(xedges, yedges, H, cmap='rainbow')
        >>> ax1.plot(x, 2*np.log(x), 'k-')
        >>> ax1.set_xlim(x.min(), x.max())
        >>> ax1.set_ylim(y.min(), y.max())
        >>> ax1.set_xlabel('x')
        >>> ax1.set_ylabel('y')
        >>> ax1.set_title('histogram2d')
        >>> ax1.grid()

        >>> # Create hexbin plot for comparison
        >>> ax2.hexbin(x, y, gridsize=20, cmap='rainbow')
        >>> ax2.plot(x, 2*np.log(x), 'k-')
        >>> ax2.set_title('hexbin')
        >>> ax2.set_xlim(x.min(), x.max())
        >>> ax2.set_xlabel('x')
        >>> ax2.grid()

        >>> plt.show()

    histogram_bin_edges(a, bins=10, range=None, weights=None)
        Function to calculate only the edges of the bins used by the `histogram`
        function.

        Parameters
        ----------
        a : array_like
            Input data. The histogram is computed over the flattened array.
        bins : int or sequence of scalars or str, optional
            If `bins` is an int, it defines the number of equal-width
            bins in the given range (10, by default). If `bins` is a
            sequence, it defines the bin edges, including the rightmost
            edge, allowing for non-uniform bin widths.

            If `bins` is a string from the list below, `histogram_bin_edges` will
            use the method chosen to calculate the optimal bin width and
            consequently the number of bins (see the Notes section for more detail
            on the estimators) from the data that falls within the requested range.
            While the bin width will be optimal for the actual data
            in the range, the number of bins will be computed to fill the
            entire range, including the empty portions. For visualisation,
            using the 'auto' option is suggested. Weighted data is not
            supported for automated bin size selection.

            'auto'
                Minimum bin width between the 'sturges' and 'fd' estimators.
                Provides good all-around performance.

            'fd' (Freedman Diaconis Estimator)
                Robust (resilient to outliers) estimator that takes into
                account data variability and data size.

            'doane'
                An improved version of Sturges' estimator that works better
                with non-normal datasets.

            'scott'
                Less robust estimator that takes into account data variability
                and data size.

            'stone'
                Estimator based on leave-one-out cross-validation estimate of
                the integrated squared error. Can be regarded as a generalization
                of Scott's rule.

            'rice'
                Estimator does not take variability into account, only data
                size. Commonly overestimates number of bins required.

            'sturges'
                R's default method, only accounts for data size. Only
                optimal for gaussian data and underestimates number of bins
                for large non-gaussian datasets.

            'sqrt'
                Square root (of data size) estimator, used by Excel and
                other programs for its speed and simplicity.

        range : (float, float), optional
            The lower and upper range of the bins.  If not provided, range
            is simply ``(a.min(), a.max())``.  Values outside the range are
            ignored. The first element of the range must be less than or
            equal to the second. `range` affects the automatic bin
            computation as well. While bin width is computed to be optimal
            based on the actual data within `range`, the bin count will fill
            the entire range including portions containing no data.

        weights : array_like, optional
            An array of weights, of the same shape as `a`.  Each value in
            `a` only contributes its associated weight towards the bin count
            (instead of 1). This is currently not used by any of the bin estimators,
            but may be in the future.

        Returns
        -------
        bin_edges : array of dtype float
            The edges to pass into `histogram`

        See Also
        --------
        histogram

        Notes
        -----
        The methods to estimate the optimal number of bins are well founded
        in literature, and are inspired by the choices R provides for
        histogram visualisation. Note that having the number of bins
        proportional to :math:`n^{1/3}` is asymptotically optimal, which is
        why it appears in most estimators. These are simply plug-in methods
        that give good starting points for number of bins. In the equations
        below, :math:`h` is the binwidth and :math:`n_h` is the number of
        bins. All estimators that compute bin counts are recast to bin width
        using the `ptp` of the data. The final bin count is obtained from
        ``np.round(np.ceil(range / h))``. The final bin width is often less
        than what is returned by the estimators below.

        'auto' (minimum bin width of the 'sturges' and 'fd' estimators)
            A compromise to get a good value. For small datasets the Sturges
            value will usually be chosen, while larger datasets will usually
            default to FD.  Avoids the overly conservative behaviour of FD
            and Sturges for small and large datasets respectively.
            Switchover point is usually :math:`a.size \approx 1000`.

        'fd' (Freedman Diaconis Estimator)
            .. math:: h = 2 \frac{IQR}{n^{1/3}}

            The binwidth is proportional to the interquartile range (IQR)
            and inversely proportional to cube root of a.size. Can be too
            conservative for small datasets, but is quite good for large
            datasets. The IQR is very robust to outliers.

        'scott'
            .. math:: h = \sigma \sqrt[3]{\frac{24 \sqrt{\pi}}{n}}

            The binwidth is proportional to the standard deviation of the
            data and inversely proportional to cube root of ``x.size``. Can
            be too conservative for small datasets, but is quite good for
            large datasets. The standard deviation is not very robust to
            outliers. Values are very similar to the Freedman-Diaconis
            estimator in the absence of outliers.

        'rice'
            .. math:: n_h = 2n^{1/3}

            The number of bins is only proportional to cube root of
            ``a.size``. It tends to overestimate the number of bins and it
            does not take into account data variability.

        'sturges'
            .. math:: n_h = \log _{2}(n) + 1

            The number of bins is the base 2 log of ``a.size``.  This
            estimator assumes normality of data and is too conservative for
            larger, non-normal datasets. This is the default method in R's
            ``hist`` method.

        'doane'
            .. math:: n_h = 1 + \log_{2}(n) +
                            \log_{2}\left(1 + \frac{|g_1|}{\sigma_{g_1}}\right)

                g_1 = mean\left[\left(\frac{x - \mu}{\sigma}\right)^3\right]

                \sigma_{g_1} = \sqrt{\frac{6(n - 2)}{(n + 1)(n + 3)}}

            An improved version of Sturges' formula that produces better
            estimates for non-normal datasets. This estimator attempts to
            account for the skew of the data.

        'sqrt'
            .. math:: n_h = \sqrt n

            The simplest and fastest estimator. Only takes into account the
            data size.

        Additionally, if the data is of integer dtype, then the binwidth will never
        be less than 1.

        Examples
        --------
        >>> import numpy as np
        >>> arr = np.array([0, 0, 0, 1, 2, 3, 3, 4, 5])
        >>> np.histogram_bin_edges(arr, bins='auto', range=(0, 1))
        array([0.  , 0.25, 0.5 , 0.75, 1.  ])
        >>> np.histogram_bin_edges(arr, bins=2)
        array([0. , 2.5, 5. ])

        For consistency with histogram, an array of pre-computed bins is
        passed through unmodified:

        >>> np.histogram_bin_edges(arr, [1, 2])
        array([1, 2])

        This function allows one set of bins to be computed, and reused across
        multiple histograms:

        >>> shared_bins = np.histogram_bin_edges(arr, bins='auto')
        >>> shared_bins
        array([0., 1., 2., 3., 4., 5.])

        >>> group_id = np.array([0, 1, 1, 0, 1, 1, 0, 1, 1])
        >>> hist_0, _ = np.histogram(arr[group_id == 0], bins=shared_bins)
        >>> hist_1, _ = np.histogram(arr[group_id == 1], bins=shared_bins)

        >>> hist_0; hist_1
        array([1, 1, 0, 1, 0])
        array([2, 0, 1, 1, 2])

        Which gives more easily comparable results than using separate bins for
        each histogram:

        >>> hist_0, bins_0 = np.histogram(arr[group_id == 0], bins='auto')
        >>> hist_1, bins_1 = np.histogram(arr[group_id == 1], bins='auto')
        >>> hist_0; hist_1
        array([1, 1, 1])
        array([2, 1, 1, 2])
        >>> bins_0; bins_1
        array([0., 1., 2., 3.])
        array([0.  , 1.25, 2.5 , 3.75, 5.  ])

    histogramdd(sample, bins=10, range=None, density=None, weights=None)
        Compute the multidimensional histogram of some data.

        Parameters
        ----------
        sample : (N, D) array, or (N, D) array_like
            The data to be histogrammed.

            Note the unusual interpretation of sample when an array_like:

            * When an array, each row is a coordinate in a D-dimensional space -
              such as ``histogramdd(np.array([p1, p2, p3]))``.
            * When an array_like, each element is the list of values for single
              coordinate - such as ``histogramdd((X, Y, Z))``.

            The first form should be preferred.

        bins : sequence or int, optional
            The bin specification:

            * A sequence of arrays describing the monotonically increasing bin
              edges along each dimension.
            * The number of bins for each dimension (nx, ny, ... =bins)
            * The number of bins for all dimensions (nx=ny=...=bins).

        range : sequence, optional
            A sequence of length D, each an optional (lower, upper) tuple giving
            the outer bin edges to be used if the edges are not given explicitly in
            `bins`.
            An entry of None in the sequence results in the minimum and maximum
            values being used for the corresponding dimension.
            The default, None, is equivalent to passing a tuple of D None values.
        density : bool, optional
            If False, the default, returns the number of samples in each bin.
            If True, returns the probability *density* function at the bin,
            ``bin_count / sample_count / bin_volume``.
        weights : (N,) array_like, optional
            An array of values `w_i` weighing each sample `(x_i, y_i, z_i, ...)`.
            Weights are normalized to 1 if density is True. If density is False,
            the values of the returned histogram are equal to the sum of the
            weights belonging to the samples falling into each bin.

        Returns
        -------
        H : ndarray
            The multidimensional histogram of sample x. See density and weights
            for the different possible semantics.
        edges : tuple of ndarrays
            A tuple of D arrays describing the bin edges for each dimension.

        See Also
        --------
        histogram: 1-D histogram
        histogram2d: 2-D histogram

        Examples
        --------
        >>> import numpy as np
        >>> rng = np.random.default_rng()
        >>> r = rng.normal(size=(100,3))
        >>> H, edges = np.histogramdd(r, bins = (5, 8, 4))
        >>> H.shape, edges[0].size, edges[1].size, edges[2].size
        ((5, 8, 4), 6, 9, 5)

    hsplit(ary, indices_or_sections)
        Split an array into multiple sub-arrays horizontally (column-wise).

        Please refer to the `split` documentation.  `hsplit` is equivalent
        to `split` with ``axis=1``, the array is always split along the second
        axis except for 1-D arrays, where it is split at ``axis=0``.

        See Also
        --------
        split : Split an array into multiple sub-arrays of equal size.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(16.0).reshape(4, 4)
        >>> x
        array([[ 0.,   1.,   2.,   3.],
               [ 4.,   5.,   6.,   7.],
               [ 8.,   9.,  10.,  11.],
               [12.,  13.,  14.,  15.]])
        >>> np.hsplit(x, 2)
        [array([[  0.,   1.],
               [  4.,   5.],
               [  8.,   9.],
               [12.,  13.]]),
         array([[  2.,   3.],
               [  6.,   7.],
               [10.,  11.],
               [14.,  15.]])]
        >>> np.hsplit(x, np.array([3, 6]))
        [array([[ 0.,   1.,   2.],
               [ 4.,   5.,   6.],
               [ 8.,   9.,  10.],
               [12.,  13.,  14.]]),
         array([[ 3.],
               [ 7.],
               [11.],
               [15.]]),
         array([], shape=(4, 0), dtype=float64)]

        With a higher dimensional array the split is still along the second axis.

        >>> x = np.arange(8.0).reshape(2, 2, 2)
        >>> x
        array([[[0.,  1.],
                [2.,  3.]],
               [[4.,  5.],
                [6.,  7.]]])
        >>> np.hsplit(x, 2)
        [array([[[0.,  1.]],
               [[4.,  5.]]]),
         array([[[2.,  3.]],
               [[6.,  7.]]])]

        With a 1-D array, the split is along axis 0.

        >>> x = np.array([0, 1, 2, 3, 4, 5])
        >>> np.hsplit(x, 2)
        [array([0, 1, 2]), array([3, 4, 5])]

    hstack(tup, *, dtype=None, casting='same_kind')
        Stack arrays in sequence horizontally (column wise).

        This is equivalent to concatenation along the second axis, except for 1-D
        arrays where it concatenates along the first axis. Rebuilds arrays divided
        by `hsplit`.

        This function makes most sense for arrays with up to 3 dimensions. For
        instance, for pixel-data with a height (first axis), width (second axis),
        and r/g/b channels (third axis). The functions `concatenate`, `stack` and
        `block` provide more general stacking and concatenation operations.

        Parameters
        ----------
        tup : sequence of ndarrays
            The arrays must have the same shape along all but the second axis,
            except 1-D arrays which can be any length.

        dtype : str or dtype
            If provided, the destination array will have this dtype. Cannot be
            provided together with `out`.

            .. versionadded:: 1.24

        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
            Controls what kind of data casting may occur. Defaults to 'same_kind'.

            .. versionadded:: 1.24

        Returns
        -------
        stacked : ndarray
            The array formed by stacking the given arrays.

        See Also
        --------
        concatenate : Join a sequence of arrays along an existing axis.
        stack : Join a sequence of arrays along a new axis.
        block : Assemble an nd-array from nested lists of blocks.
        vstack : Stack arrays in sequence vertically (row wise).
        dstack : Stack arrays in sequence depth wise (along third axis).
        column_stack : Stack 1-D arrays as columns into a 2-D array.
        hsplit : Split an array into multiple sub-arrays
                 horizontally (column-wise).
        unstack : Split an array into a tuple of sub-arrays along an axis.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array((1,2,3))
        >>> b = np.array((4,5,6))
        >>> np.hstack((a,b))
        array([1, 2, 3, 4, 5, 6])
        >>> a = np.array([[1],[2],[3]])
        >>> b = np.array([[4],[5],[6]])
        >>> np.hstack((a,b))
        array([[1, 4],
               [2, 5],
               [3, 6]])

    i0(x)
        Modified Bessel function of the first kind, order 0.

        Usually denoted :math:`I_0`.

        Parameters
        ----------
        x : array_like of float
            Argument of the Bessel function.

        Returns
        -------
        out : ndarray, shape = x.shape, dtype = float
            The modified Bessel function evaluated at each of the elements of `x`.

        See Also
        --------
        scipy.special.i0, scipy.special.iv, scipy.special.ive

        Notes
        -----
        The scipy implementation is recommended over this function: it is a
        proper ufunc written in C, and more than an order of magnitude faster.

        We use the algorithm published by Clenshaw [1]_ and referenced by
        Abramowitz and Stegun [2]_, for which the function domain is
        partitioned into the two intervals [0,8] and (8,inf), and Chebyshev
        polynomial expansions are employed in each interval. Relative error on
        the domain [0,30] using IEEE arithmetic is documented [3]_ as having a
        peak of 5.8e-16 with an rms of 1.4e-16 (n = 30000).

        References
        ----------
        .. [1] C. W. Clenshaw, "Chebyshev series for mathematical functions", in
               *National Physical Laboratory Mathematical Tables*, vol. 5, London:
               Her Majesty's Stationery Office, 1962.
        .. [2] M. Abramowitz and I. A. Stegun, *Handbook of Mathematical
               Functions*, 10th printing, New York: Dover, 1964, pp. 379.
               https://personal.math.ubc.ca/~cbm/aands/page_379.htm
        .. [3] https://metacpan.org/pod/distribution/Math-Cephes/lib/Math/Cephes.pod#i0:-Modified-Bessel-function-of-order-zero

        Examples
        --------
        >>> import numpy as np
        >>> np.i0(0.)
        array(1.0)
        >>> np.i0([0, 1, 2, 3])
        array([1.        , 1.26606588, 2.2795853 , 4.88079259])

    identity(n, dtype=None, *, like=None)
        Return the identity array.

        The identity array is a square array with ones on
        the main diagonal.

        Parameters
        ----------
        n : int
            Number of rows (and columns) in `n` x `n` output.
        dtype : data-type, optional
            Data-type of the output.  Defaults to ``float``.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            `n` x `n` array with its main diagonal set to one,
            and all other elements 0.

        Examples
        --------
        >>> import numpy as np
        >>> np.identity(3)
        array([[1.,  0.,  0.],
               [0.,  1.,  0.],
               [0.,  0.,  1.]])

    imag(val)
        Return the imaginary part of the complex argument.

        Parameters
        ----------
        val : array_like
            Input array.

        Returns
        -------
        out : ndarray or scalar
            The imaginary component of the complex argument. If `val` is real,
            the type of `val` is used for the output.  If `val` has complex
            elements, the returned type is float.

        See Also
        --------
        real, angle, real_if_close

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([1+2j, 3+4j, 5+6j])
        >>> a.imag
        array([2.,  4.,  6.])
        >>> a.imag = np.array([8, 10, 12])
        >>> a
        array([1. +8.j,  3.+10.j,  5.+12.j])
        >>> np.imag(1 + 1j)
        1.0

    in1d(ar1, ar2, assume_unique=False, invert=False, *, kind=None)
        Test whether each element of a 1-D array is also present in a second array.

        .. deprecated:: 2.0
            Use :func:`isin` instead of `in1d` for new code.

        Returns a boolean array the same length as `ar1` that is True
        where an element of `ar1` is in `ar2` and False otherwise.

        Parameters
        ----------
        ar1 : (M,) array_like
            Input array.
        ar2 : array_like
            The values against which to test each value of `ar1`.
        assume_unique : bool, optional
            If True, the input arrays are both assumed to be unique, which
            can speed up the calculation.  Default is False.
        invert : bool, optional
            If True, the values in the returned array are inverted (that is,
            False where an element of `ar1` is in `ar2` and True otherwise).
            Default is False. ``np.in1d(a, b, invert=True)`` is equivalent
            to (but is faster than) ``np.invert(in1d(a, b))``.
        kind : {None, 'sort', 'table'}, optional
            The algorithm to use. This will not affect the final result,
            but will affect the speed and memory use. The default, None,
            will select automatically based on memory considerations.

            * If 'sort', will use a mergesort-based approach. This will have
              a memory usage of roughly 6 times the sum of the sizes of
              `ar1` and `ar2`, not accounting for size of dtypes.
            * If 'table', will use a lookup table approach similar
              to a counting sort. This is only available for boolean and
              integer arrays. This will have a memory usage of the
              size of `ar1` plus the max-min value of `ar2`. `assume_unique`
              has no effect when the 'table' option is used.
            * If None, will automatically choose 'table' if
              the required memory allocation is less than or equal to
              6 times the sum of the sizes of `ar1` and `ar2`,
              otherwise will use 'sort'. This is done to not use
              a large amount of memory by default, even though
              'table' may be faster in most cases. If 'table' is chosen,
              `assume_unique` will have no effect.

            .. versionadded:: 1.8.0

        Returns
        -------
        in1d : (M,) ndarray, bool
            The values `ar1[in1d]` are in `ar2`.

        See Also
        --------
        isin                  : Version of this function that preserves the
                                shape of ar1.

        Notes
        -----
        `in1d` can be considered as an element-wise function version of the
        python keyword `in`, for 1-D sequences. ``in1d(a, b)`` is roughly
        equivalent to ``np.array([item in b for item in a])``.
        However, this idea fails if `ar2` is a set, or similar (non-sequence)
        container:  As ``ar2`` is converted to an array, in those cases
        ``asarray(ar2)`` is an object array rather than the expected array of
        contained values.

        Using ``kind='table'`` tends to be faster than `kind='sort'` if the
        following relationship is true:
        ``log10(len(ar2)) > (log10(max(ar2)-min(ar2)) - 2.27) / 0.927``,
        but may use greater memory. The default value for `kind` will
        be automatically selected based only on memory usage, so one may
        manually set ``kind='table'`` if memory constraints can be relaxed.

        .. versionadded:: 1.4.0

        Examples
        --------
        >>> import numpy as np
        >>> test = np.array([0, 1, 2, 5, 0])
        >>> states = [0, 2]
        >>> mask = np.in1d(test, states)
        >>> mask
        array([ True, False,  True, False,  True])
        >>> test[mask]
        array([0, 2, 0])
        >>> mask = np.in1d(test, states, invert=True)
        >>> mask
        array([False,  True, False,  True, False])
        >>> test[mask]
        array([1, 5])

    indices(dimensions, dtype=<class 'int'>, sparse=False)
        Return an array representing the indices of a grid.

        Compute an array where the subarrays contain index values 0, 1, ...
        varying only along the corresponding axis.

        Parameters
        ----------
        dimensions : sequence of ints
            The shape of the grid.
        dtype : dtype, optional
            Data type of the result.
        sparse : boolean, optional
            Return a sparse representation of the grid instead of a dense
            representation. Default is False.

            .. versionadded:: 1.17

        Returns
        -------
        grid : one ndarray or tuple of ndarrays
            If sparse is False:
                Returns one array of grid indices,
                ``grid.shape = (len(dimensions),) + tuple(dimensions)``.
            If sparse is True:
                Returns a tuple of arrays, with
                ``grid[i].shape = (1, ..., 1, dimensions[i], 1, ..., 1)`` with
                dimensions[i] in the ith place

        See Also
        --------
        mgrid, ogrid, meshgrid

        Notes
        -----
        The output shape in the dense case is obtained by prepending the number
        of dimensions in front of the tuple of dimensions, i.e. if `dimensions`
        is a tuple ``(r0, ..., rN-1)`` of length ``N``, the output shape is
        ``(N, r0, ..., rN-1)``.

        The subarrays ``grid[k]`` contains the N-D array of indices along the
        ``k-th`` axis. Explicitly::

            grid[k, i0, i1, ..., iN-1] = ik

        Examples
        --------
        >>> import numpy as np
        >>> grid = np.indices((2, 3))
        >>> grid.shape
        (2, 2, 3)
        >>> grid[0]        # row indices
        array([[0, 0, 0],
               [1, 1, 1]])
        >>> grid[1]        # column indices
        array([[0, 1, 2],
               [0, 1, 2]])

        The indices can be used as an index into an array.

        >>> x = np.arange(20).reshape(5, 4)
        >>> row, col = np.indices((2, 3))
        >>> x[row, col]
        array([[0, 1, 2],
               [4, 5, 6]])

        Note that it would be more straightforward in the above example to
        extract the required elements directly with ``x[:2, :3]``.

        If sparse is set to true, the grid will be returned in a sparse
        representation.

        >>> i, j = np.indices((2, 3), sparse=True)
        >>> i.shape
        (2, 1)
        >>> j.shape
        (1, 3)
        >>> i        # row indices
        array([[0],
               [1]])
        >>> j        # column indices
        array([[0, 1, 2]])

    info(object=None, maxwidth=76, output=None, toplevel='numpy')
        Get help information for an array, function, class, or module.

        Parameters
        ----------
        object : object or str, optional
            Input object or name to get information about. If `object` is
            an `ndarray` instance, information about the array is printed.
            If `object` is a numpy object, its docstring is given. If it is
            a string, available modules are searched for matching objects.
            If None, information about `info` itself is returned.
        maxwidth : int, optional
            Printing width.
        output : file like object, optional
            File like object that the output is written to, default is
            ``None``, in which case ``sys.stdout`` will be used.
            The object has to be opened in 'w' or 'a' mode.
        toplevel : str, optional
            Start search at this level.

        Notes
        -----
        When used interactively with an object, ``np.info(obj)`` is equivalent
        to ``help(obj)`` on the Python prompt or ``obj?`` on the IPython
        prompt.

        Examples
        --------
        >>> np.info(np.polyval) # doctest: +SKIP
           polyval(p, x)
             Evaluate the polynomial p at x.
             ...

        When using a string for `object` it is possible to get multiple results.

        >>> np.info('fft') # doctest: +SKIP
             *** Found in numpy ***
        Core FFT routines
        ...
             *** Found in numpy.fft ***
         fft(a, n=None, axis=-1)
        ...
             *** Repeat reference found in numpy.fft.fftpack ***
             *** Total of 3 references found. ***

        When the argument is an array, information about the array is printed.

        >>> a = np.array([[1 + 2j, 3, -4], [-5j, 6, 0]], dtype=np.complex64)
        >>> np.info(a)
        class:  ndarray
        shape:  (2, 3)
        strides:  (24, 8)
        itemsize:  8
        aligned:  True
        contiguous:  True
        fortran:  False
        data pointer: 0x562b6e0d2860  # may vary
        byteorder:  little
        byteswap:  False
        type: complex64

    inner(...)
        inner(a, b, /)

        Inner product of two arrays.

        Ordinary inner product of vectors for 1-D arrays (without complex
        conjugation), in higher dimensions a sum product over the last axes.

        Parameters
        ----------
        a, b : array_like
            If `a` and `b` are nonscalar, their last dimensions must match.

        Returns
        -------
        out : ndarray
            If `a` and `b` are both
            scalars or both 1-D arrays then a scalar is returned; otherwise
            an array is returned.
            ``out.shape = (*a.shape[:-1], *b.shape[:-1])``

        Raises
        ------
        ValueError
            If both `a` and `b` are nonscalar and their last dimensions have
            different sizes.

        See Also
        --------
        tensordot : Sum products over arbitrary axes.
        dot : Generalised matrix product, using second last dimension of `b`.
        einsum : Einstein summation convention.

        Notes
        -----
        For vectors (1-D arrays) it computes the ordinary inner-product::

            np.inner(a, b) = sum(a[:]*b[:])

        More generally, if ``ndim(a) = r > 0`` and ``ndim(b) = s > 0``::

            np.inner(a, b) = np.tensordot(a, b, axes=(-1,-1))

        or explicitly::

            np.inner(a, b)[i0,...,ir-2,j0,...,js-2]
                 = sum(a[i0,...,ir-2,:]*b[j0,...,js-2,:])

        In addition `a` or `b` may be scalars, in which case::

           np.inner(a,b) = a*b

        Examples
        --------
        Ordinary inner product for vectors:

        >>> import numpy as np
        >>> a = np.array([1,2,3])
        >>> b = np.array([0,1,0])
        >>> np.inner(a, b)
        2

        Some multidimensional examples:

        >>> a = np.arange(24).reshape((2,3,4))
        >>> b = np.arange(4)
        >>> c = np.inner(a, b)
        >>> c.shape
        (2, 3)
        >>> c
        array([[ 14,  38,  62],
               [ 86, 110, 134]])

        >>> a = np.arange(2).reshape((1,1,2))
        >>> b = np.arange(6).reshape((3,2))
        >>> c = np.inner(a, b)
        >>> c.shape
        (1, 1, 3)
        >>> c
        array([[[1, 3, 5]]])

        An example where `b` is a scalar:

        >>> np.inner(np.eye(2), 7)
        array([[7., 0.],
               [0., 7.]])

    insert(arr, obj, values, axis=None)
        Insert values along the given axis before the given indices.

        Parameters
        ----------
        arr : array_like
            Input array.
        obj : int, slice or sequence of ints
            Object that defines the index or indices before which `values` is
            inserted.

            .. versionadded:: 1.8.0

            Support for multiple insertions when `obj` is a single scalar or a
            sequence with one element (similar to calling insert multiple
            times).
        values : array_like
            Values to insert into `arr`. If the type of `values` is different
            from that of `arr`, `values` is converted to the type of `arr`.
            `values` should be shaped so that ``arr[...,obj,...] = values``
            is legal.
        axis : int, optional
            Axis along which to insert `values`.  If `axis` is None then `arr`
            is flattened first.

        Returns
        -------
        out : ndarray
            A copy of `arr` with `values` inserted.  Note that `insert`
            does not occur in-place: a new array is returned. If
            `axis` is None, `out` is a flattened array.

        See Also
        --------
        append : Append elements at the end of an array.
        concatenate : Join a sequence of arrays along an existing axis.
        delete : Delete elements from an array.

        Notes
        -----
        Note that for higher dimensional inserts ``obj=0`` behaves very different
        from ``obj=[0]`` just like ``arr[:,0,:] = values`` is different from
        ``arr[:,[0],:] = values``. This is because of the difference between basic
        and advanced :ref:`indexing <basics.indexing>`.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(6).reshape(3, 2)
        >>> a
        array([[0, 1],
               [2, 3],
               [4, 5]])
        >>> np.insert(a, 1, 6)
        array([0, 6, 1, 2, 3, 4, 5])
        >>> np.insert(a, 1, 6, axis=1)
        array([[0, 6, 1],
               [2, 6, 3],
               [4, 6, 5]])

        Difference between sequence and scalars,
        showing how ``obj=[1]`` behaves different from ``obj=1``:

        >>> np.insert(a, [1], [[7],[8],[9]], axis=1)
        array([[0, 7, 1],
               [2, 8, 3],
               [4, 9, 5]])
        >>> np.insert(a, 1, [[7],[8],[9]], axis=1)
        array([[0, 7, 8, 9, 1],
               [2, 7, 8, 9, 3],
               [4, 7, 8, 9, 5]])
        >>> np.array_equal(np.insert(a, 1, [7, 8, 9], axis=1),
        ...                np.insert(a, [1], [[7],[8],[9]], axis=1))
        True

        >>> b = a.flatten()
        >>> b
        array([0, 1, 2, 3, 4, 5])
        >>> np.insert(b, [2, 2], [6, 7])
        array([0, 1, 6, 7, 2, 3, 4, 5])

        >>> np.insert(b, slice(2, 4), [7, 8])
        array([0, 1, 7, 2, 8, 3, 4, 5])

        >>> np.insert(b, [2, 2], [7.13, False]) # type casting
        array([0, 1, 7, 0, 2, 3, 4, 5])

        >>> x = np.arange(8).reshape(2, 4)
        >>> idx = (1, 3)
        >>> np.insert(x, idx, 999, axis=1)
        array([[  0, 999,   1,   2, 999,   3],
               [  4, 999,   5,   6, 999,   7]])

    interp(x, xp, fp, left=None, right=None, period=None)
        One-dimensional linear interpolation for monotonically increasing sample points.

        Returns the one-dimensional piecewise linear interpolant to a function
        with given discrete data points (`xp`, `fp`), evaluated at `x`.

        Parameters
        ----------
        x : array_like
            The x-coordinates at which to evaluate the interpolated values.

        xp : 1-D sequence of floats
            The x-coordinates of the data points, must be increasing if argument
            `period` is not specified. Otherwise, `xp` is internally sorted after
            normalizing the periodic boundaries with ``xp = xp % period``.

        fp : 1-D sequence of float or complex
            The y-coordinates of the data points, same length as `xp`.

        left : optional float or complex corresponding to fp
            Value to return for `x < xp[0]`, default is `fp[0]`.

        right : optional float or complex corresponding to fp
            Value to return for `x > xp[-1]`, default is `fp[-1]`.

        period : None or float, optional
            A period for the x-coordinates. This parameter allows the proper
            interpolation of angular x-coordinates. Parameters `left` and `right`
            are ignored if `period` is specified.

            .. versionadded:: 1.10.0

        Returns
        -------
        y : float or complex (corresponding to fp) or ndarray
            The interpolated values, same shape as `x`.

        Raises
        ------
        ValueError
            If `xp` and `fp` have different length
            If `xp` or `fp` are not 1-D sequences
            If `period == 0`

        See Also
        --------
        scipy.interpolate

        Warnings
        --------
        The x-coordinate sequence is expected to be increasing, but this is not
        explicitly enforced.  However, if the sequence `xp` is non-increasing,
        interpolation results are meaningless.

        Note that, since NaN is unsortable, `xp` also cannot contain NaNs.

        A simple check for `xp` being strictly increasing is::

            np.all(np.diff(xp) > 0)

        Examples
        --------
        >>> import numpy as np
        >>> xp = [1, 2, 3]
        >>> fp = [3, 2, 0]
        >>> np.interp(2.5, xp, fp)
        1.0
        >>> np.interp([0, 1, 1.5, 2.72, 3.14], xp, fp)
        array([3.  , 3.  , 2.5 , 0.56, 0.  ])
        >>> UNDEF = -99.0
        >>> np.interp(3.14, xp, fp, right=UNDEF)
        -99.0

        Plot an interpolant to the sine function:

        >>> x = np.linspace(0, 2*np.pi, 10)
        >>> y = np.sin(x)
        >>> xvals = np.linspace(0, 2*np.pi, 50)
        >>> yinterp = np.interp(xvals, x, y)
        >>> import matplotlib.pyplot as plt
        >>> plt.plot(x, y, 'o')
        [<matplotlib.lines.Line2D object at 0x...>]
        >>> plt.plot(xvals, yinterp, '-x')
        [<matplotlib.lines.Line2D object at 0x...>]
        >>> plt.show()

        Interpolation with periodic x-coordinates:

        >>> x = [-180, -170, -185, 185, -10, -5, 0, 365]
        >>> xp = [190, -190, 350, -350]
        >>> fp = [5, 10, 3, 4]
        >>> np.interp(x, xp, fp, period=360)
        array([7.5 , 5.  , 8.75, 6.25, 3.  , 3.25, 3.5 , 3.75])

        Complex interpolation:

        >>> x = [1.5, 4.0]
        >>> xp = [2,3,5]
        >>> fp = [1.0j, 0, 2+3j]
        >>> np.interp(x, xp, fp)
        array([0.+1.j , 1.+1.5j])

    intersect1d(ar1, ar2, assume_unique=False, return_indices=False)
        Find the intersection of two arrays.

        Return the sorted, unique values that are in both of the input arrays.

        Parameters
        ----------
        ar1, ar2 : array_like
            Input arrays. Will be flattened if not already 1D.
        assume_unique : bool
            If True, the input arrays are both assumed to be unique, which
            can speed up the calculation.  If True but ``ar1`` or ``ar2`` are not
            unique, incorrect results and out-of-bounds indices could result.
            Default is False.
        return_indices : bool
            If True, the indices which correspond to the intersection of the two
            arrays are returned. The first instance of a value is used if there are
            multiple. Default is False.

            .. versionadded:: 1.15.0

        Returns
        -------
        intersect1d : ndarray
            Sorted 1D array of common and unique elements.
        comm1 : ndarray
            The indices of the first occurrences of the common values in `ar1`.
            Only provided if `return_indices` is True.
        comm2 : ndarray
            The indices of the first occurrences of the common values in `ar2`.
            Only provided if `return_indices` is True.

        Examples
        --------
        >>> import numpy as np
        >>> np.intersect1d([1, 3, 4, 3], [3, 1, 2, 1])
        array([1, 3])

        To intersect more than two arrays, use functools.reduce:

        >>> from functools import reduce
        >>> reduce(np.intersect1d, ([1, 3, 4, 3], [3, 1, 2, 1], [6, 3, 4, 2]))
        array([3])

        To return the indices of the values common to the input arrays
        along with the intersected values:

        >>> x = np.array([1, 1, 2, 3, 4])
        >>> y = np.array([2, 1, 4, 6])
        >>> xy, x_ind, y_ind = np.intersect1d(x, y, return_indices=True)
        >>> x_ind, y_ind
        (array([0, 2, 4]), array([1, 0, 2]))
        >>> xy, x[x_ind], y[y_ind]
        (array([1, 2, 4]), array([1, 2, 4]), array([1, 2, 4]))

    is_busday(...)
        is_busday(
            dates,
            weekmask='1111100',
            holidays=None,
            busdaycal=None,
            out=None
        )

        Calculates which of the given dates are valid days, and which are not.

        .. versionadded:: 1.7.0

        Parameters
        ----------
        dates : array_like of datetime64[D]
            The array of dates to process.
        weekmask : str or array_like of bool, optional
            A seven-element array indicating which of Monday through Sunday are
            valid days. May be specified as a length-seven list or array, like
            [1,1,1,1,1,0,0]; a length-seven string, like '1111100'; or a string
            like "Mon Tue Wed Thu Fri", made up of 3-character abbreviations for
            weekdays, optionally separated by white space. Valid abbreviations
            are: Mon Tue Wed Thu Fri Sat Sun
        holidays : array_like of datetime64[D], optional
            An array of dates to consider as invalid dates.  They may be
            specified in any order, and NaT (not-a-time) dates are ignored.
            This list is saved in a normalized form that is suited for
            fast calculations of valid days.
        busdaycal : busdaycalendar, optional
            A `busdaycalendar` object which specifies the valid days. If this
            parameter is provided, neither weekmask nor holidays may be
            provided.
        out : array of bool, optional
            If provided, this array is filled with the result.

        Returns
        -------
        out : array of bool
            An array with the same shape as ``dates``, containing True for
            each valid day, and False for each invalid day.

        See Also
        --------
        busdaycalendar : An object that specifies a custom set of valid days.
        busday_offset : Applies an offset counted in valid days.
        busday_count : Counts how many valid days are in a half-open date range.

        Examples
        --------
        >>> import numpy as np
        >>> # The weekdays are Friday, Saturday, and Monday
        ... np.is_busday(['2011-07-01', '2011-07-02', '2011-07-18'],
        ...                 holidays=['2011-07-01', '2011-07-04', '2011-07-17'])
        array([False, False,  True])

    isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False)
        Returns a boolean array where two arrays are element-wise equal within a
        tolerance.

        The tolerance values are positive, typically very small numbers.  The
        relative difference (`rtol` * abs(`b`)) and the absolute difference
        `atol` are added together to compare against the absolute difference
        between `a` and `b`.

        .. warning:: The default `atol` is not appropriate for comparing numbers
                     with magnitudes much smaller than one (see Notes).

        Parameters
        ----------
        a, b : array_like
            Input arrays to compare.
        rtol : array_like
            The relative tolerance parameter (see Notes).
        atol : array_like
            The absolute tolerance parameter (see Notes).
        equal_nan : bool
            Whether to compare NaN's as equal.  If True, NaN's in `a` will be
            considered equal to NaN's in `b` in the output array.

        Returns
        -------
        y : array_like
            Returns a boolean array of where `a` and `b` are equal within the
            given tolerance. If both `a` and `b` are scalars, returns a single
            boolean value.

        See Also
        --------
        allclose
        math.isclose

        Notes
        -----
        .. versionadded:: 1.7.0

        For finite values, isclose uses the following equation to test whether
        two floating point values are equivalent.::

         absolute(a - b) <= (atol + rtol * absolute(b))

        Unlike the built-in `math.isclose`, the above equation is not symmetric
        in `a` and `b` -- it assumes `b` is the reference value -- so that
        `isclose(a, b)` might be different from `isclose(b, a)`.

        The default value of `atol` is not appropriate when the reference value
        `b` has magnitude smaller than one. For example, it is unlikely that
        ``a = 1e-9`` and ``b = 2e-9`` should be considered "close", yet
        ``isclose(1e-9, 2e-9)`` is ``True`` with default settings. Be sure
        to select `atol` for the use case at hand, especially for defining the
        threshold below which a non-zero value in `a` will be considered "close"
        to a very small or zero value in `b`.

        `isclose` is not defined for non-numeric data types.
        :class:`bool` is considered a numeric data-type for this purpose.

        Examples
        --------
        >>> import numpy as np
        >>> np.isclose([1e10,1e-7], [1.00001e10,1e-8])
        array([ True, False])

        >>> np.isclose([1e10,1e-8], [1.00001e10,1e-9])
        array([ True, True])

        >>> np.isclose([1e10,1e-8], [1.0001e10,1e-9])
        array([False,  True])

        >>> np.isclose([1.0, np.nan], [1.0, np.nan])
        array([ True, False])

        >>> np.isclose([1.0, np.nan], [1.0, np.nan], equal_nan=True)
        array([ True, True])

        >>> np.isclose([1e-8, 1e-7], [0.0, 0.0])
        array([ True, False])

        >>> np.isclose([1e-100, 1e-7], [0.0, 0.0], atol=0.0)
        array([False, False])

        >>> np.isclose([1e-10, 1e-10], [1e-20, 0.0])
        array([ True,  True])

        >>> np.isclose([1e-10, 1e-10], [1e-20, 0.999999e-10], atol=0.0)
        array([False,  True])

    iscomplex(x)
        Returns a bool array, where True if input element is complex.

        What is tested is whether the input has a non-zero imaginary part, not if
        the input type is complex.

        Parameters
        ----------
        x : array_like
            Input array.

        Returns
        -------
        out : ndarray of bools
            Output array.

        See Also
        --------
        isreal
        iscomplexobj : Return True if x is a complex type or an array of complex
                       numbers.

        Examples
        --------
        >>> import numpy as np
        >>> np.iscomplex([1+1j, 1+0j, 4.5, 3, 2, 2j])
        array([ True, False, False, False, False,  True])

    iscomplexobj(x)
        Check for a complex type or an array of complex numbers.

        The type of the input is checked, not the value. Even if the input
        has an imaginary part equal to zero, `iscomplexobj` evaluates to True.

        Parameters
        ----------
        x : any
            The input can be of any type and shape.

        Returns
        -------
        iscomplexobj : bool
            The return value, True if `x` is of a complex type or has at least
            one complex element.

        See Also
        --------
        isrealobj, iscomplex

        Examples
        --------
        >>> import numpy as np
        >>> np.iscomplexobj(1)
        False
        >>> np.iscomplexobj(1+0j)
        True
        >>> np.iscomplexobj([3, 1+0j, True])
        True

    isdtype(dtype, kind)
        Determine if a provided dtype is of a specified data type ``kind``.

        This function only supports built-in NumPy's data types.
        Third-party dtypes are not yet supported.

        Parameters
        ----------
        dtype : dtype
            The input dtype.
        kind : dtype or str or tuple of dtypes/strs.
            dtype or dtype kind. Allowed dtype kinds are:
            * ``'bool'`` : boolean kind
            * ``'signed integer'`` : signed integer data types
            * ``'unsigned integer'`` : unsigned integer data types
            * ``'integral'`` : integer data types
            * ``'real floating'`` : real-valued floating-point data types
            * ``'complex floating'`` : complex floating-point data types
            * ``'numeric'`` : numeric data types

        Returns
        -------
        out : bool

        See Also
        --------
        issubdtype

        Examples
        --------
        >>> import numpy as np
        >>> np.isdtype(np.float32, np.float64)
        False
        >>> np.isdtype(np.float32, "real floating")
        True
        >>> np.isdtype(np.complex128, ("real floating", "complex floating"))
        True

    isfortran(a)
        Check if the array is Fortran contiguous but *not* C contiguous.

        This function is obsolete. If you only want to check if an array is Fortran
        contiguous use ``a.flags.f_contiguous`` instead.

        Parameters
        ----------
        a : ndarray
            Input array.

        Returns
        -------
        isfortran : bool
            Returns True if the array is Fortran contiguous but *not* C contiguous.


        Examples
        --------

        np.array allows to specify whether the array is written in C-contiguous
        order (last index varies the fastest), or FORTRAN-contiguous order in
        memory (first index varies the fastest).

        >>> import numpy as np
        >>> a = np.array([[1, 2, 3], [4, 5, 6]], order='C')
        >>> a
        array([[1, 2, 3],
               [4, 5, 6]])
        >>> np.isfortran(a)
        False

        >>> b = np.array([[1, 2, 3], [4, 5, 6]], order='F')
        >>> b
        array([[1, 2, 3],
               [4, 5, 6]])
        >>> np.isfortran(b)
        True


        The transpose of a C-ordered array is a FORTRAN-ordered array.

        >>> a = np.array([[1, 2, 3], [4, 5, 6]], order='C')
        >>> a
        array([[1, 2, 3],
               [4, 5, 6]])
        >>> np.isfortran(a)
        False
        >>> b = a.T
        >>> b
        array([[1, 4],
               [2, 5],
               [3, 6]])
        >>> np.isfortran(b)
        True

        C-ordered arrays evaluate as False even if they are also FORTRAN-ordered.

        >>> np.isfortran(np.array([1, 2], order='F'))
        False

    isin(element, test_elements, assume_unique=False, invert=False, *, kind=None)
        Calculates ``element in test_elements``, broadcasting over `element` only.
        Returns a boolean array of the same shape as `element` that is True
        where an element of `element` is in `test_elements` and False otherwise.

        Parameters
        ----------
        element : array_like
            Input array.
        test_elements : array_like
            The values against which to test each value of `element`.
            This argument is flattened if it is an array or array_like.
            See notes for behavior with non-array-like parameters.
        assume_unique : bool, optional
            If True, the input arrays are both assumed to be unique, which
            can speed up the calculation.  Default is False.
        invert : bool, optional
            If True, the values in the returned array are inverted, as if
            calculating `element not in test_elements`. Default is False.
            ``np.isin(a, b, invert=True)`` is equivalent to (but faster
            than) ``np.invert(np.isin(a, b))``.
        kind : {None, 'sort', 'table'}, optional
            The algorithm to use. This will not affect the final result,
            but will affect the speed and memory use. The default, None,
            will select automatically based on memory considerations.

            * If 'sort', will use a mergesort-based approach. This will have
              a memory usage of roughly 6 times the sum of the sizes of
              `element` and `test_elements`, not accounting for size of dtypes.
            * If 'table', will use a lookup table approach similar
              to a counting sort. This is only available for boolean and
              integer arrays. This will have a memory usage of the
              size of `element` plus the max-min value of `test_elements`.
              `assume_unique` has no effect when the 'table' option is used.
            * If None, will automatically choose 'table' if
              the required memory allocation is less than or equal to
              6 times the sum of the sizes of `element` and `test_elements`,
              otherwise will use 'sort'. This is done to not use
              a large amount of memory by default, even though
              'table' may be faster in most cases. If 'table' is chosen,
              `assume_unique` will have no effect.


        Returns
        -------
        isin : ndarray, bool
            Has the same shape as `element`. The values `element[isin]`
            are in `test_elements`.

        Notes
        -----

        `isin` is an element-wise function version of the python keyword `in`.
        ``isin(a, b)`` is roughly equivalent to
        ``np.array([item in b for item in a])`` if `a` and `b` are 1-D sequences.

        `element` and `test_elements` are converted to arrays if they are not
        already. If `test_elements` is a set (or other non-sequence collection)
        it will be converted to an object array with one element, rather than an
        array of the values contained in `test_elements`. This is a consequence
        of the `array` constructor's way of handling non-sequence collections.
        Converting the set to a list usually gives the desired behavior.

        Using ``kind='table'`` tends to be faster than `kind='sort'` if the
        following relationship is true:
        ``log10(len(test_elements)) >
        (log10(max(test_elements)-min(test_elements)) - 2.27) / 0.927``,
        but may use greater memory. The default value for `kind` will
        be automatically selected based only on memory usage, so one may
        manually set ``kind='table'`` if memory constraints can be relaxed.

        .. versionadded:: 1.13.0

        Examples
        --------
        >>> import numpy as np
        >>> element = 2*np.arange(4).reshape((2, 2))
        >>> element
        array([[0, 2],
               [4, 6]])
        >>> test_elements = [1, 2, 4, 8]
        >>> mask = np.isin(element, test_elements)
        >>> mask
        array([[False,  True],
               [ True, False]])
        >>> element[mask]
        array([2, 4])

        The indices of the matched values can be obtained with `nonzero`:

        >>> np.nonzero(mask)
        (array([0, 1]), array([1, 0]))

        The test can also be inverted:

        >>> mask = np.isin(element, test_elements, invert=True)
        >>> mask
        array([[ True, False],
               [False,  True]])
        >>> element[mask]
        array([0, 6])

        Because of how `array` handles sets, the following does not
        work as expected:

        >>> test_set = {1, 2, 4, 8}
        >>> np.isin(element, test_set)
        array([[False, False],
               [False, False]])

        Casting the set to a list gives the expected result:

        >>> np.isin(element, list(test_set))
        array([[False,  True],
               [ True, False]])

    isneginf(x, out=None)
        Test element-wise for negative infinity, return result as bool array.

        Parameters
        ----------
        x : array_like
            The input array.
        out : array_like, optional
            A location into which the result is stored. If provided, it must have a
            shape that the input broadcasts to. If not provided or None, a
            freshly-allocated boolean array is returned.

        Returns
        -------
        out : ndarray
            A boolean array with the same dimensions as the input.
            If second argument is not supplied then a numpy boolean array is
            returned with values True where the corresponding element of the
            input is negative infinity and values False where the element of
            the input is not negative infinity.

            If a second argument is supplied the result is stored there. If the
            type of that array is a numeric type the result is represented as
            zeros and ones, if the type is boolean then as False and True. The
            return value `out` is then a reference to that array.

        See Also
        --------
        isinf, isposinf, isnan, isfinite

        Notes
        -----
        NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
        (IEEE 754).

        Errors result if the second argument is also supplied when x is a scalar
        input, if first and second arguments have different shapes, or if the
        first argument has complex values.

        Examples
        --------
        >>> import numpy as np
        >>> np.isneginf(-np.inf)
        True
        >>> np.isneginf(np.inf)
        False
        >>> np.isneginf([-np.inf, 0., np.inf])
        array([ True, False, False])

        >>> x = np.array([-np.inf, 0., np.inf])
        >>> y = np.array([2, 2, 2])
        >>> np.isneginf(x, y)
        array([1, 0, 0])
        >>> y
        array([1, 0, 0])

    isposinf(x, out=None)
        Test element-wise for positive infinity, return result as bool array.

        Parameters
        ----------
        x : array_like
            The input array.
        out : array_like, optional
            A location into which the result is stored. If provided, it must have a
            shape that the input broadcasts to. If not provided or None, a
            freshly-allocated boolean array is returned.

        Returns
        -------
        out : ndarray
            A boolean array with the same dimensions as the input.
            If second argument is not supplied then a boolean array is returned
            with values True where the corresponding element of the input is
            positive infinity and values False where the element of the input is
            not positive infinity.

            If a second argument is supplied the result is stored there. If the
            type of that array is a numeric type the result is represented as zeros
            and ones, if the type is boolean then as False and True.
            The return value `out` is then a reference to that array.

        See Also
        --------
        isinf, isneginf, isfinite, isnan

        Notes
        -----
        NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
        (IEEE 754).

        Errors result if the second argument is also supplied when x is a scalar
        input, if first and second arguments have different shapes, or if the
        first argument has complex values

        Examples
        --------
        >>> import numpy as np
        >>> np.isposinf(np.inf)
        True
        >>> np.isposinf(-np.inf)
        False
        >>> np.isposinf([-np.inf, 0., np.inf])
        array([False, False,  True])

        >>> x = np.array([-np.inf, 0., np.inf])
        >>> y = np.array([2, 2, 2])
        >>> np.isposinf(x, y)
        array([0, 0, 1])
        >>> y
        array([0, 0, 1])

    isreal(x)
        Returns a bool array, where True if input element is real.

        If element has complex type with zero imaginary part, the return value
        for that element is True.

        Parameters
        ----------
        x : array_like
            Input array.

        Returns
        -------
        out : ndarray, bool
            Boolean array of same shape as `x`.

        Notes
        -----
        `isreal` may behave unexpectedly for string or object arrays (see examples)

        See Also
        --------
        iscomplex
        isrealobj : Return True if x is not a complex type.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([1+1j, 1+0j, 4.5, 3, 2, 2j], dtype=complex)
        >>> np.isreal(a)
        array([False,  True,  True,  True,  True, False])

        The function does not work on string arrays.

        >>> a = np.array([2j, "a"], dtype="U")
        >>> np.isreal(a)  # Warns about non-elementwise comparison
        False

        Returns True for all elements in input array of ``dtype=object`` even if
        any of the elements is complex.

        >>> a = np.array([1, "2", 3+4j], dtype=object)
        >>> np.isreal(a)
        array([ True,  True,  True])

        isreal should not be used with object arrays

        >>> a = np.array([1+2j, 2+1j], dtype=object)
        >>> np.isreal(a)
        array([ True,  True])

    isrealobj(x)
        Return True if x is a not complex type or an array of complex numbers.

        The type of the input is checked, not the value. So even if the input
        has an imaginary part equal to zero, `isrealobj` evaluates to False
        if the data type is complex.

        Parameters
        ----------
        x : any
            The input can be of any type and shape.

        Returns
        -------
        y : bool
            The return value, False if `x` is of a complex type.

        See Also
        --------
        iscomplexobj, isreal

        Notes
        -----
        The function is only meant for arrays with numerical values but it
        accepts all other objects. Since it assumes array input, the return
        value of other objects may be True.

        >>> np.isrealobj('A string')
        True
        >>> np.isrealobj(False)
        True
        >>> np.isrealobj(None)
        True

        Examples
        --------
        >>> import numpy as np
        >>> np.isrealobj(1)
        True
        >>> np.isrealobj(1+0j)
        False
        >>> np.isrealobj([3, 1+0j, True])
        False

    isscalar(element)
        Returns True if the type of `element` is a scalar type.

        Parameters
        ----------
        element : any
            Input argument, can be of any type and shape.

        Returns
        -------
        val : bool
            True if `element` is a scalar type, False if it is not.

        See Also
        --------
        ndim : Get the number of dimensions of an array

        Notes
        -----
        If you need a stricter way to identify a *numerical* scalar, use
        ``isinstance(x, numbers.Number)``, as that returns ``False`` for most
        non-numerical elements such as strings.

        In most cases ``np.ndim(x) == 0`` should be used instead of this function,
        as that will also return true for 0d arrays. This is how numpy overloads
        functions in the style of the ``dx`` arguments to `gradient` and
        the ``bins`` argument to `histogram`. Some key differences:

        +------------------------------------+---------------+-------------------+
        | x                                  |``isscalar(x)``|``np.ndim(x) == 0``|
        +====================================+===============+===================+
        | PEP 3141 numeric objects           | ``True``      | ``True``          |
        | (including builtins)               |               |                   |
        +------------------------------------+---------------+-------------------+
        | builtin string and buffer objects  | ``True``      | ``True``          |
        +------------------------------------+---------------+-------------------+
        | other builtin objects, like        | ``False``     | ``True``          |
        | `pathlib.Path`, `Exception`,       |               |                   |
        | the result of `re.compile`         |               |                   |
        +------------------------------------+---------------+-------------------+
        | third-party objects like           | ``False``     | ``True``          |
        | `matplotlib.figure.Figure`         |               |                   |
        +------------------------------------+---------------+-------------------+
        | zero-dimensional numpy arrays      | ``False``     | ``True``          |
        +------------------------------------+---------------+-------------------+
        | other numpy arrays                 | ``False``     | ``False``         |
        +------------------------------------+---------------+-------------------+
        | `list`, `tuple`, and other         | ``False``     | ``False``         |
        | sequence objects                   |               |                   |
        +------------------------------------+---------------+-------------------+

        Examples
        --------
        >>> import numpy as np

        >>> np.isscalar(3.1)
        True

        >>> np.isscalar(np.array(3.1))
        False

        >>> np.isscalar([3.1])
        False

        >>> np.isscalar(False)
        True

        >>> np.isscalar('numpy')
        True

        NumPy supports PEP 3141 numbers:

        >>> from fractions import Fraction
        >>> np.isscalar(Fraction(5, 17))
        True
        >>> from numbers import Number
        >>> np.isscalar(Number())
        True

    issubdtype(arg1, arg2)
        Returns True if first argument is a typecode lower/equal in type hierarchy.

        This is like the builtin :func:`issubclass`, but for `dtype`\ s.

        Parameters
        ----------
        arg1, arg2 : dtype_like
            `dtype` or object coercible to one

        Returns
        -------
        out : bool

        See Also
        --------
        :ref:`arrays.scalars` : Overview of the numpy type hierarchy.

        Examples
        --------
        `issubdtype` can be used to check the type of arrays:

        >>> ints = np.array([1, 2, 3], dtype=np.int32)
        >>> np.issubdtype(ints.dtype, np.integer)
        True
        >>> np.issubdtype(ints.dtype, np.floating)
        False

        >>> floats = np.array([1, 2, 3], dtype=np.float32)
        >>> np.issubdtype(floats.dtype, np.integer)
        False
        >>> np.issubdtype(floats.dtype, np.floating)
        True

        Similar types of different sizes are not subdtypes of each other:

        >>> np.issubdtype(np.float64, np.float32)
        False
        >>> np.issubdtype(np.float32, np.float64)
        False

        but both are subtypes of `floating`:

        >>> np.issubdtype(np.float64, np.floating)
        True
        >>> np.issubdtype(np.float32, np.floating)
        True

        For convenience, dtype-like objects are allowed too:

        >>> np.issubdtype('S1', np.bytes_)
        True
        >>> np.issubdtype('i4', np.signedinteger)
        True

    iterable(y)
        Check whether or not an object can be iterated over.

        Parameters
        ----------
        y : object
          Input object.

        Returns
        -------
        b : bool
          Return ``True`` if the object has an iterator method or is a
          sequence and ``False`` otherwise.


        Examples
        --------
        >>> import numpy as np
        >>> np.iterable([1, 2, 3])
        True
        >>> np.iterable(2)
        False

        Notes
        -----
        In most cases, the results of ``np.iterable(obj)`` are consistent with
        ``isinstance(obj, collections.abc.Iterable)``. One notable exception is
        the treatment of 0-dimensional arrays::

            >>> from collections.abc import Iterable
            >>> a = np.array(1.0)  # 0-dimensional numpy array
            >>> isinstance(a, Iterable)
            True
            >>> np.iterable(a)
            False

    ix_(*args)
        Construct an open mesh from multiple sequences.

        This function takes N 1-D sequences and returns N outputs with N
        dimensions each, such that the shape is 1 in all but one dimension
        and the dimension with the non-unit shape value cycles through all
        N dimensions.

        Using `ix_` one can quickly construct index arrays that will index
        the cross product. ``a[np.ix_([1,3],[2,5])]`` returns the array
        ``[[a[1,2] a[1,5]], [a[3,2] a[3,5]]]``.

        Parameters
        ----------
        args : 1-D sequences
            Each sequence should be of integer or boolean type.
            Boolean sequences will be interpreted as boolean masks for the
            corresponding dimension (equivalent to passing in
            ``np.nonzero(boolean_sequence)``).

        Returns
        -------
        out : tuple of ndarrays
            N arrays with N dimensions each, with N the number of input
            sequences. Together these arrays form an open mesh.

        See Also
        --------
        ogrid, mgrid, meshgrid

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(10).reshape(2, 5)
        >>> a
        array([[0, 1, 2, 3, 4],
               [5, 6, 7, 8, 9]])
        >>> ixgrid = np.ix_([0, 1], [2, 4])
        >>> ixgrid
        (array([[0],
               [1]]), array([[2, 4]]))
        >>> ixgrid[0].shape, ixgrid[1].shape
        ((2, 1), (1, 2))
        >>> a[ixgrid]
        array([[2, 4],
               [7, 9]])

        >>> ixgrid = np.ix_([True, True], [2, 4])
        >>> a[ixgrid]
        array([[2, 4],
               [7, 9]])
        >>> ixgrid = np.ix_([True, True], [False, False, True, False, True])
        >>> a[ixgrid]
        array([[2, 4],
               [7, 9]])

    kaiser(M, beta)
        Return the Kaiser window.

        The Kaiser window is a taper formed by using a Bessel function.

        Parameters
        ----------
        M : int
            Number of points in the output window. If zero or less, an
            empty array is returned.
        beta : float
            Shape parameter for window.

        Returns
        -------
        out : array
            The window, with the maximum value normalized to one (the value
            one appears only if the number of samples is odd).

        See Also
        --------
        bartlett, blackman, hamming, hanning

        Notes
        -----
        The Kaiser window is defined as

        .. math::  w(n) = I_0\left( \beta \sqrt{1-\frac{4n^2}{(M-1)^2}}
                   \right)/I_0(\beta)

        with

        .. math:: \quad -\frac{M-1}{2} \leq n \leq \frac{M-1}{2},

        where :math:`I_0` is the modified zeroth-order Bessel function.

        The Kaiser was named for Jim Kaiser, who discovered a simple
        approximation to the DPSS window based on Bessel functions.  The Kaiser
        window is a very good approximation to the Digital Prolate Spheroidal
        Sequence, or Slepian window, which is the transform which maximizes the
        energy in the main lobe of the window relative to total energy.

        The Kaiser can approximate many other windows by varying the beta
        parameter.

        ====  =======================
        beta  Window shape
        ====  =======================
        0     Rectangular
        5     Similar to a Hamming
        6     Similar to a Hanning
        8.6   Similar to a Blackman
        ====  =======================

        A beta value of 14 is probably a good starting point. Note that as beta
        gets large, the window narrows, and so the number of samples needs to be
        large enough to sample the increasingly narrow spike, otherwise NaNs will
        get returned.

        Most references to the Kaiser window come from the signal processing
        literature, where it is used as one of many windowing functions for
        smoothing values.  It is also known as an apodization (which means
        "removing the foot", i.e. smoothing discontinuities at the beginning
        and end of the sampled signal) or tapering function.

        References
        ----------
        .. [1] J. F. Kaiser, "Digital Filters" - Ch 7 in "Systems analysis by
               digital computer", Editors: F.F. Kuo and J.F. Kaiser, p 218-285.
               John Wiley and Sons, New York, (1966).
        .. [2] E.R. Kanasewich, "Time Sequence Analysis in Geophysics", The
               University of Alberta Press, 1975, pp. 177-178.
        .. [3] Wikipedia, "Window function",
               https://en.wikipedia.org/wiki/Window_function

        Examples
        --------
        >>> import numpy as np
        >>> import matplotlib.pyplot as plt
        >>> np.kaiser(12, 14)
         array([7.72686684e-06, 3.46009194e-03, 4.65200189e-02, # may vary
                2.29737120e-01, 5.99885316e-01, 9.45674898e-01,
                9.45674898e-01, 5.99885316e-01, 2.29737120e-01,
                4.65200189e-02, 3.46009194e-03, 7.72686684e-06])


        Plot the window and the frequency response.

        .. plot::
            :include-source:

            import matplotlib.pyplot as plt
            from numpy.fft import fft, fftshift
            window = np.kaiser(51, 14)
            plt.plot(window)
            plt.title("Kaiser window")
            plt.ylabel("Amplitude")
            plt.xlabel("Sample")
            plt.show()

            plt.figure()
            A = fft(window, 2048) / 25.5
            mag = np.abs(fftshift(A))
            freq = np.linspace(-0.5, 0.5, len(A))
            response = 20 * np.log10(mag)
            response = np.clip(response, -100, 100)
            plt.plot(freq, response)
            plt.title("Frequency response of Kaiser window")
            plt.ylabel("Magnitude [dB]")
            plt.xlabel("Normalized frequency [cycles per sample]")
            plt.axis('tight')
            plt.show()

    kron(a, b)
        Kronecker product of two arrays.

        Computes the Kronecker product, a composite array made of blocks of the
        second array scaled by the first.

        Parameters
        ----------
        a, b : array_like

        Returns
        -------
        out : ndarray

        See Also
        --------
        outer : The outer product

        Notes
        -----
        The function assumes that the number of dimensions of `a` and `b`
        are the same, if necessary prepending the smallest with ones.
        If ``a.shape = (r0,r1,..,rN)`` and ``b.shape = (s0,s1,...,sN)``,
        the Kronecker product has shape ``(r0*s0, r1*s1, ..., rN*SN)``.
        The elements are products of elements from `a` and `b`, organized
        explicitly by::

            kron(a,b)[k0,k1,...,kN] = a[i0,i1,...,iN] * b[j0,j1,...,jN]

        where::

            kt = it * st + jt,  t = 0,...,N

        In the common 2-D case (N=1), the block structure can be visualized::

            [[ a[0,0]*b,   a[0,1]*b,  ... , a[0,-1]*b  ],
             [  ...                              ...   ],
             [ a[-1,0]*b,  a[-1,1]*b, ... , a[-1,-1]*b ]]


        Examples
        --------
        >>> import numpy as np
        >>> np.kron([1,10,100], [5,6,7])
        array([  5,   6,   7, ..., 500, 600, 700])
        >>> np.kron([5,6,7], [1,10,100])
        array([  5,  50, 500, ...,   7,  70, 700])

        >>> np.kron(np.eye(2), np.ones((2,2)))
        array([[1.,  1.,  0.,  0.],
               [1.,  1.,  0.,  0.],
               [0.,  0.,  1.,  1.],
               [0.,  0.,  1.,  1.]])

        >>> a = np.arange(100).reshape((2,5,2,5))
        >>> b = np.arange(24).reshape((2,3,4))
        >>> c = np.kron(a,b)
        >>> c.shape
        (2, 10, 6, 20)
        >>> I = (1,3,0,2)
        >>> J = (0,2,1)
        >>> J1 = (0,) + J             # extend to ndim=4
        >>> S1 = (1,) + b.shape
        >>> K = tuple(np.array(I) * np.array(S1) + np.array(J1))
        >>> c[K] == a[I]*b[J]
        True

    lexsort(...)
        lexsort(keys, axis=-1)

        Perform an indirect stable sort using a sequence of keys.

        Given multiple sorting keys, lexsort returns an array of integer indices
        that describes the sort order by multiple keys. The last key in the
        sequence is used for the primary sort order, ties are broken by the
        second-to-last key, and so on.

        Parameters
        ----------
        keys : (k, m, n, ...) array-like
            The `k` keys to be sorted. The *last* key (e.g, the last
            row if `keys` is a 2D array) is the primary sort key.
            Each element of `keys` along the zeroth axis must be
            an array-like object of the same shape.
        axis : int, optional
            Axis to be indirectly sorted. By default, sort over the last axis
            of each sequence. Separate slices along `axis` sorted over
            independently; see last example.

        Returns
        -------
        indices : (m, n, ...) ndarray of ints
            Array of indices that sort the keys along the specified axis.

        See Also
        --------
        argsort : Indirect sort.
        ndarray.sort : In-place sort.
        sort : Return a sorted copy of an array.

        Examples
        --------
        Sort names: first by surname, then by name.

        >>> import numpy as np
        >>> surnames =    ('Hertz',    'Galilei', 'Hertz')
        >>> first_names = ('Heinrich', 'Galileo', 'Gustav')
        >>> ind = np.lexsort((first_names, surnames))
        >>> ind
        array([1, 2, 0])

        >>> [surnames[i] + ", " + first_names[i] for i in ind]
        ['Galilei, Galileo', 'Hertz, Gustav', 'Hertz, Heinrich']

        Sort according to two numerical keys, first by elements
        of ``a``, then breaking ties according to elements of ``b``:

        >>> a = [1, 5, 1, 4, 3, 4, 4]  # First sequence
        >>> b = [9, 4, 0, 4, 0, 2, 1]  # Second sequence
        >>> ind = np.lexsort((b, a))  # Sort by `a`, then by `b`
        >>> ind
        array([2, 0, 4, 6, 5, 3, 1])
        >>> [(a[i], b[i]) for i in ind]
        [(1, 0), (1, 9), (3, 0), (4, 1), (4, 2), (4, 4), (5, 4)]

        Compare against `argsort`, which would sort each key independently.

        >>> np.argsort((b, a), kind='stable')
        array([[2, 4, 6, 5, 1, 3, 0],
               [0, 2, 4, 3, 5, 6, 1]])

        To sort lexicographically with `argsort`, we would need to provide a
        structured array.

        >>> x = np.array([(ai, bi) for ai, bi in zip(a, b)],
        ...              dtype = np.dtype([('x', int), ('y', int)]))
        >>> np.argsort(x)  # or np.argsort(x, order=('x', 'y'))
        array([2, 0, 4, 6, 5, 3, 1])

        The zeroth axis of `keys` always corresponds with the sequence of keys,
        so 2D arrays are treated just like other sequences of keys.

        >>> arr = np.asarray([b, a])
        >>> ind2 = np.lexsort(arr)
        >>> np.testing.assert_equal(ind2, ind)

        Accordingly, the `axis` parameter refers to an axis of *each* key, not of
        the `keys` argument itself. For instance, the array ``arr`` is treated as
        a sequence of two 1-D keys, so specifying ``axis=0`` is equivalent to
        using the default axis, ``axis=-1``.

        >>> np.testing.assert_equal(np.lexsort(arr, axis=0),
        ...                         np.lexsort(arr, axis=-1))

        For higher-dimensional arrays, the axis parameter begins to matter. The
        resulting array has the same shape as each key, and the values are what
        we would expect if `lexsort` were performed on corresponding slices
        of the keys independently. For instance,

        >>> x = [[1, 2, 3, 4],
        ...      [4, 3, 2, 1],
        ...      [2, 1, 4, 3]]
        >>> y = [[2, 2, 1, 1],
        ...      [1, 2, 1, 2],
        ...      [1, 1, 2, 1]]
        >>> np.lexsort((x, y), axis=1)
        array([[2, 3, 0, 1],
               [2, 0, 3, 1],
               [1, 0, 3, 2]])

        Each row of the result is what we would expect if we were to perform
        `lexsort` on the corresponding row of the keys:

        >>> for i in range(3):
        ...     print(np.lexsort((x[i], y[i])))
        [2 3 0 1]
        [2 0 3 1]
        [1 0 3 2]

    linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0, *, device=None)
        Return evenly spaced numbers over a specified interval.

        Returns `num` evenly spaced samples, calculated over the
        interval [`start`, `stop`].

        The endpoint of the interval can optionally be excluded.

        .. versionchanged:: 1.16.0
            Non-scalar `start` and `stop` are now supported.

        .. versionchanged:: 1.20.0
            Values are rounded towards ``-inf`` instead of ``0`` when an
            integer ``dtype`` is specified. The old behavior can
            still be obtained with ``np.linspace(start, stop, num).astype(int)``

        Parameters
        ----------
        start : array_like
            The starting value of the sequence.
        stop : array_like
            The end value of the sequence, unless `endpoint` is set to False.
            In that case, the sequence consists of all but the last of ``num + 1``
            evenly spaced samples, so that `stop` is excluded.  Note that the step
            size changes when `endpoint` is False.
        num : int, optional
            Number of samples to generate. Default is 50. Must be non-negative.
        endpoint : bool, optional
            If True, `stop` is the last sample. Otherwise, it is not included.
            Default is True.
        retstep : bool, optional
            If True, return (`samples`, `step`), where `step` is the spacing
            between samples.
        dtype : dtype, optional
            The type of the output array.  If `dtype` is not given, the data type
            is inferred from `start` and `stop`. The inferred dtype will never be
            an integer; `float` is chosen even if the arguments would produce an
            array of integers.

            .. versionadded:: 1.9.0
        axis : int, optional
            The axis in the result to store the samples.  Relevant only if start
            or stop are array-like.  By default (0), the samples will be along a
            new axis inserted at the beginning. Use -1 to get an axis at the end.

            .. versionadded:: 1.16.0
        device : str, optional
            The device on which to place the created array. Default: None.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0

        Returns
        -------
        samples : ndarray
            There are `num` equally spaced samples in the closed interval
            ``[start, stop]`` or the half-open interval ``[start, stop)``
            (depending on whether `endpoint` is True or False).
        step : float, optional
            Only returned if `retstep` is True

            Size of spacing between samples.


        See Also
        --------
        arange : Similar to `linspace`, but uses a step size (instead of the
                 number of samples).
        geomspace : Similar to `linspace`, but with numbers spaced evenly on a log
                    scale (a geometric progression).
        logspace : Similar to `geomspace`, but with the end points specified as
                   logarithms.
        :ref:`how-to-partition`

        Examples
        --------
        >>> import numpy as np
        >>> np.linspace(2.0, 3.0, num=5)
        array([2.  , 2.25, 2.5 , 2.75, 3.  ])
        >>> np.linspace(2.0, 3.0, num=5, endpoint=False)
        array([2. ,  2.2,  2.4,  2.6,  2.8])
        >>> np.linspace(2.0, 3.0, num=5, retstep=True)
        (array([2.  ,  2.25,  2.5 ,  2.75,  3.  ]), 0.25)

        Graphical illustration:

        >>> import matplotlib.pyplot as plt
        >>> N = 8
        >>> y = np.zeros(N)
        >>> x1 = np.linspace(0, 10, N, endpoint=True)
        >>> x2 = np.linspace(0, 10, N, endpoint=False)
        >>> plt.plot(x1, y, 'o')
        [<matplotlib.lines.Line2D object at 0x...>]
        >>> plt.plot(x2, y + 0.5, 'o')
        [<matplotlib.lines.Line2D object at 0x...>]
        >>> plt.ylim([-0.5, 1])
        (-0.5, 1)
        >>> plt.show()

    load(file, mmap_mode=None, allow_pickle=False, fix_imports=True, encoding='ASCII', *, max_header_size=10000)
        Load arrays or pickled objects from ``.npy``, ``.npz`` or pickled files.

        .. warning:: Loading files that contain object arrays uses the ``pickle``
                     module, which is not secure against erroneous or maliciously
                     constructed data. Consider passing ``allow_pickle=False`` to
                     load data that is known not to contain object arrays for the
                     safer handling of untrusted sources.

        Parameters
        ----------
        file : file-like object, string, or pathlib.Path
            The file to read. File-like objects must support the
            ``seek()`` and ``read()`` methods and must always
            be opened in binary mode.  Pickled files require that the
            file-like object support the ``readline()`` method as well.
        mmap_mode : {None, 'r+', 'r', 'w+', 'c'}, optional
            If not None, then memory-map the file, using the given mode (see
            `numpy.memmap` for a detailed description of the modes).  A
            memory-mapped array is kept on disk. However, it can be accessed
            and sliced like any ndarray.  Memory mapping is especially useful
            for accessing small fragments of large files without reading the
            entire file into memory.
        allow_pickle : bool, optional
            Allow loading pickled object arrays stored in npy files. Reasons for
            disallowing pickles include security, as loading pickled data can
            execute arbitrary code. If pickles are disallowed, loading object
            arrays will fail. Default: False

            .. versionchanged:: 1.16.3
                Made default False in response to CVE-2019-6446.

        fix_imports : bool, optional
            Only useful when loading Python 2 generated pickled files on Python 3,
            which includes npy/npz files containing object arrays. If `fix_imports`
            is True, pickle will try to map the old Python 2 names to the new names
            used in Python 3.
        encoding : str, optional
            What encoding to use when reading Python 2 strings. Only useful when
            loading Python 2 generated pickled files in Python 3, which includes
            npy/npz files containing object arrays. Values other than 'latin1',
            'ASCII', and 'bytes' are not allowed, as they can corrupt numerical
            data. Default: 'ASCII'
        max_header_size : int, optional
            Maximum allowed size of the header.  Large headers may not be safe
            to load securely and thus require explicitly passing a larger value.
            See :py:func:`ast.literal_eval()` for details.
            This option is ignored when `allow_pickle` is passed.  In that case
            the file is by definition trusted and the limit is unnecessary.

        Returns
        -------
        result : array, tuple, dict, etc.
            Data stored in the file. For ``.npz`` files, the returned instance
            of NpzFile class must be closed to avoid leaking file descriptors.

        Raises
        ------
        OSError
            If the input file does not exist or cannot be read.
        UnpicklingError
            If ``allow_pickle=True``, but the file cannot be loaded as a pickle.
        ValueError
            The file contains an object array, but ``allow_pickle=False`` given.
        EOFError
            When calling ``np.load`` multiple times on the same file handle,
            if all data has already been read

        See Also
        --------
        save, savez, savez_compressed, loadtxt
        memmap : Create a memory-map to an array stored in a file on disk.
        lib.format.open_memmap : Create or load a memory-mapped ``.npy`` file.

        Notes
        -----
        - If the file contains pickle data, then whatever object is stored
          in the pickle is returned.
        - If the file is a ``.npy`` file, then a single array is returned.
        - If the file is a ``.npz`` file, then a dictionary-like object is
          returned, containing ``{filename: array}`` key-value pairs, one for
          each file in the archive.
        - If the file is a ``.npz`` file, the returned value supports the
          context manager protocol in a similar fashion to the open function::

            with load('foo.npz') as data:
                a = data['a']

          The underlying file descriptor is closed when exiting the 'with'
          block.

        Examples
        --------
        >>> import numpy as np

        Store data to disk, and load it again:

        >>> np.save('/tmp/123', np.array([[1, 2, 3], [4, 5, 6]]))
        >>> np.load('/tmp/123.npy')
        array([[1, 2, 3],
               [4, 5, 6]])

        Store compressed data to disk, and load it again:

        >>> a=np.array([[1, 2, 3], [4, 5, 6]])
        >>> b=np.array([1, 2])
        >>> np.savez('/tmp/123.npz', a=a, b=b)
        >>> data = np.load('/tmp/123.npz')
        >>> data['a']
        array([[1, 2, 3],
               [4, 5, 6]])
        >>> data['b']
        array([1, 2])
        >>> data.close()

        Mem-map the stored array, and then access the second row
        directly from disk:

        >>> X = np.load('/tmp/123.npy', mmap_mode='r')
        >>> X[1, :]
        memmap([4, 5, 6])

    loadtxt(fname, dtype=<class 'float'>, comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0, encoding=None, max_rows=None, *, quotechar=None, like=None)
        Load data from a text file.

        Parameters
        ----------
        fname : file, str, pathlib.Path, list of str, generator
            File, filename, list, or generator to read.  If the filename
            extension is ``.gz`` or ``.bz2``, the file is first decompressed. Note
            that generators must return bytes or strings. The strings
            in a list or produced by a generator are treated as lines.
        dtype : data-type, optional
            Data-type of the resulting array; default: float.  If this is a
            structured data-type, the resulting array will be 1-dimensional, and
            each row will be interpreted as an element of the array.  In this
            case, the number of columns used must match the number of fields in
            the data-type.
        comments : str or sequence of str or None, optional
            The characters or list of characters used to indicate the start of a
            comment. None implies no comments. For backwards compatibility, byte
            strings will be decoded as 'latin1'. The default is '#'.
        delimiter : str, optional
            The character used to separate the values. For backwards compatibility,
            byte strings will be decoded as 'latin1'. The default is whitespace.

            .. versionchanged:: 1.23.0
               Only single character delimiters are supported. Newline characters
               cannot be used as the delimiter.

        converters : dict or callable, optional
            Converter functions to customize value parsing. If `converters` is
            callable, the function is applied to all columns, else it must be a
            dict that maps column number to a parser function.
            See examples for further details.
            Default: None.

            .. versionchanged:: 1.23.0
               The ability to pass a single callable to be applied to all columns
               was added.

        skiprows : int, optional
            Skip the first `skiprows` lines, including comments; default: 0.
        usecols : int or sequence, optional
            Which columns to read, with 0 being the first. For example,
            ``usecols = (1,4,5)`` will extract the 2nd, 5th and 6th columns.
            The default, None, results in all columns being read.

            .. versionchanged:: 1.11.0
                When a single column has to be read it is possible to use
                an integer instead of a tuple. E.g ``usecols = 3`` reads the
                fourth column the same way as ``usecols = (3,)`` would.
        unpack : bool, optional
            If True, the returned array is transposed, so that arguments may be
            unpacked using ``x, y, z = loadtxt(...)``.  When used with a
            structured data-type, arrays are returned for each field.
            Default is False.
        ndmin : int, optional
            The returned array will have at least `ndmin` dimensions.
            Otherwise mono-dimensional axes will be squeezed.
            Legal values: 0 (default), 1 or 2.

            .. versionadded:: 1.6.0
        encoding : str, optional
            Encoding used to decode the inputfile. Does not apply to input streams.
            The special value 'bytes' enables backward compatibility workarounds
            that ensures you receive byte arrays as results if possible and passes
            'latin1' encoded strings to converters. Override this value to receive
            unicode arrays and pass strings as input to converters.  If set to None
            the system default is used. The default value is 'bytes'.

            .. versionadded:: 1.14.0
            .. versionchanged:: 2.0
                Before NumPy 2, the default was ``'bytes'`` for Python 2
                compatibility. The default is now ``None``.

        max_rows : int, optional
            Read `max_rows` rows of content after `skiprows` lines. The default is
            to read all the rows. Note that empty rows containing no data such as
            empty lines and comment lines are not counted towards `max_rows`,
            while such lines are counted in `skiprows`.

            .. versionadded:: 1.16.0

            .. versionchanged:: 1.23.0
                Lines containing no data, including comment lines (e.g., lines
                starting with '#' or as specified via `comments`) are not counted
                towards `max_rows`.
        quotechar : unicode character or None, optional
            The character used to denote the start and end of a quoted item.
            Occurrences of the delimiter or comment characters are ignored within
            a quoted item. The default value is ``quotechar=None``, which means
            quoting support is disabled.

            If two consecutive instances of `quotechar` are found within a quoted
            field, the first is treated as an escape character. See examples.

            .. versionadded:: 1.23.0
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            Data read from the text file.

        See Also
        --------
        load, fromstring, fromregex
        genfromtxt : Load data with missing values handled as specified.
        scipy.io.loadmat : reads MATLAB data files

        Notes
        -----
        This function aims to be a fast reader for simply formatted files.  The
        `genfromtxt` function provides more sophisticated handling of, e.g.,
        lines with missing values.

        Each row in the input text file must have the same number of values to be
        able to read all values. If all rows do not have same number of values, a
        subset of up to n columns (where n is the least number of values present
        in all rows) can be read by specifying the columns via `usecols`.

        .. versionadded:: 1.10.0

        The strings produced by the Python float.hex method can be used as
        input for floats.

        Examples
        --------
        >>> import numpy as np
        >>> from io import StringIO   # StringIO behaves like a file object
        >>> c = StringIO("0 1\n2 3")
        >>> np.loadtxt(c)
        array([[0., 1.],
               [2., 3.]])

        >>> d = StringIO("M 21 72\nF 35 58")
        >>> np.loadtxt(d, dtype={'names': ('gender', 'age', 'weight'),
        ...                      'formats': ('S1', 'i4', 'f4')})
        array([(b'M', 21, 72.), (b'F', 35, 58.)],
              dtype=[('gender', 'S1'), ('age', '<i4'), ('weight', '<f4')])

        >>> c = StringIO("1,0,2\n3,0,4")
        >>> x, y = np.loadtxt(c, delimiter=',', usecols=(0, 2), unpack=True)
        >>> x
        array([1., 3.])
        >>> y
        array([2., 4.])

        The `converters` argument is used to specify functions to preprocess the
        text prior to parsing. `converters` can be a dictionary that maps
        preprocessing functions to each column:

        >>> s = StringIO("1.618, 2.296\n3.141, 4.669\n")
        >>> conv = {
        ...     0: lambda x: np.floor(float(x)),  # conversion fn for column 0
        ...     1: lambda x: np.ceil(float(x)),  # conversion fn for column 1
        ... }
        >>> np.loadtxt(s, delimiter=",", converters=conv)
        array([[1., 3.],
               [3., 5.]])

        `converters` can be a callable instead of a dictionary, in which case it
        is applied to all columns:

        >>> s = StringIO("0xDE 0xAD\n0xC0 0xDE")
        >>> import functools
        >>> conv = functools.partial(int, base=16)
        >>> np.loadtxt(s, converters=conv)
        array([[222., 173.],
               [192., 222.]])

        This example shows how `converters` can be used to convert a field
        with a trailing minus sign into a negative number.

        >>> s = StringIO("10.01 31.25-\n19.22 64.31\n17.57- 63.94")
        >>> def conv(fld):
        ...     return -float(fld[:-1]) if fld.endswith("-") else float(fld)
        ...
        >>> np.loadtxt(s, converters=conv)
        array([[ 10.01, -31.25],
               [ 19.22,  64.31],
               [-17.57,  63.94]])

        Using a callable as the converter can be particularly useful for handling
        values with different formatting, e.g. floats with underscores:

        >>> s = StringIO("1 2.7 100_000")
        >>> np.loadtxt(s, converters=float)
        array([1.e+00, 2.7e+00, 1.e+05])

        This idea can be extended to automatically handle values specified in
        many different formats, such as hex values:

        >>> def conv(val):
        ...     try:
        ...         return float(val)
        ...     except ValueError:
        ...         return float.fromhex(val)
        >>> s = StringIO("1, 2.5, 3_000, 0b4, 0x1.4000000000000p+2")
        >>> np.loadtxt(s, delimiter=",", converters=conv)
        array([1.0e+00, 2.5e+00, 3.0e+03, 1.8e+02, 5.0e+00])

        Or a format where the ``-`` sign comes after the number:

        >>> s = StringIO("10.01 31.25-\n19.22 64.31\n17.57- 63.94")
        >>> conv = lambda x: -float(x[:-1]) if x.endswith("-") else float(x)
        >>> np.loadtxt(s, converters=conv)
        array([[ 10.01, -31.25],
               [ 19.22,  64.31],
               [-17.57,  63.94]])

        Support for quoted fields is enabled with the `quotechar` parameter.
        Comment and delimiter characters are ignored when they appear within a
        quoted item delineated by `quotechar`:

        >>> s = StringIO('"alpha, #42", 10.0\n"beta, #64", 2.0\n')
        >>> dtype = np.dtype([("label", "U12"), ("value", float)])
        >>> np.loadtxt(s, dtype=dtype, delimiter=",", quotechar='"')
        array([('alpha, #42', 10.), ('beta, #64',  2.)],
              dtype=[('label', '<U12'), ('value', '<f8')])

        Quoted fields can be separated by multiple whitespace characters:

        >>> s = StringIO('"alpha, #42"       10.0\n"beta, #64" 2.0\n')
        >>> dtype = np.dtype([("label", "U12"), ("value", float)])
        >>> np.loadtxt(s, dtype=dtype, delimiter=None, quotechar='"')
        array([('alpha, #42', 10.), ('beta, #64',  2.)],
              dtype=[('label', '<U12'), ('value', '<f8')])

        Two consecutive quote characters within a quoted field are treated as a
        single escaped character:

        >>> s = StringIO('"Hello, my name is ""Monty""!"')
        >>> np.loadtxt(s, dtype="U", delimiter=",", quotechar='"')
        array('Hello, my name is "Monty"!', dtype='<U26')

        Read subset of columns when all rows do not contain equal number of values:

        >>> d = StringIO("1 2\n2 4\n3 9 12\n4 16 20")
        >>> np.loadtxt(d, usecols=(0, 1))
        array([[ 1.,  2.],
               [ 2.,  4.],
               [ 3.,  9.],
               [ 4., 16.]])

    logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None, axis=0)
        Return numbers spaced evenly on a log scale.

        In linear space, the sequence starts at ``base ** start``
        (`base` to the power of `start`) and ends with ``base ** stop``
        (see `endpoint` below).

        .. versionchanged:: 1.16.0
            Non-scalar `start` and `stop` are now supported.

        .. versionchanged:: 1.25.0
            Non-scalar 'base` is now supported

        Parameters
        ----------
        start : array_like
            ``base ** start`` is the starting value of the sequence.
        stop : array_like
            ``base ** stop`` is the final value of the sequence, unless `endpoint`
            is False.  In that case, ``num + 1`` values are spaced over the
            interval in log-space, of which all but the last (a sequence of
            length `num`) are returned.
        num : integer, optional
            Number of samples to generate.  Default is 50.
        endpoint : boolean, optional
            If true, `stop` is the last sample. Otherwise, it is not included.
            Default is True.
        base : array_like, optional
            The base of the log space. The step size between the elements in
            ``ln(samples) / ln(base)`` (or ``log_base(samples)``) is uniform.
            Default is 10.0.
        dtype : dtype
            The type of the output array.  If `dtype` is not given, the data type
            is inferred from `start` and `stop`. The inferred type will never be
            an integer; `float` is chosen even if the arguments would produce an
            array of integers.
        axis : int, optional
            The axis in the result to store the samples.  Relevant only if start,
            stop, or base are array-like.  By default (0), the samples will be
            along a new axis inserted at the beginning. Use -1 to get an axis at
            the end.

            .. versionadded:: 1.16.0


        Returns
        -------
        samples : ndarray
            `num` samples, equally spaced on a log scale.

        See Also
        --------
        arange : Similar to linspace, with the step size specified instead of the
                 number of samples. Note that, when used with a float endpoint, the
                 endpoint may or may not be included.
        linspace : Similar to logspace, but with the samples uniformly distributed
                   in linear space, instead of log space.
        geomspace : Similar to logspace, but with endpoints specified directly.
        :ref:`how-to-partition`

        Notes
        -----
        If base is a scalar, logspace is equivalent to the code

        >>> y = np.linspace(start, stop, num=num, endpoint=endpoint)
        ... # doctest: +SKIP
        >>> power(base, y).astype(dtype)
        ... # doctest: +SKIP

        Examples
        --------
        >>> import numpy as np
        >>> np.logspace(2.0, 3.0, num=4)
        array([ 100.        ,  215.443469  ,  464.15888336, 1000.        ])
        >>> np.logspace(2.0, 3.0, num=4, endpoint=False)
        array([100.        ,  177.827941  ,  316.22776602,  562.34132519])
        >>> np.logspace(2.0, 3.0, num=4, base=2.0)
        array([4.        ,  5.0396842 ,  6.34960421,  8.        ])
        >>> np.logspace(2.0, 3.0, num=4, base=[2.0, 3.0], axis=-1)
        array([[ 4.        ,  5.0396842 ,  6.34960421,  8.        ],
               [ 9.        , 12.98024613, 18.72075441, 27.        ]])

        Graphical illustration:

        >>> import matplotlib.pyplot as plt
        >>> N = 10
        >>> x1 = np.logspace(0.1, 1, N, endpoint=True)
        >>> x2 = np.logspace(0.1, 1, N, endpoint=False)
        >>> y = np.zeros(N)
        >>> plt.plot(x1, y, 'o')
        [<matplotlib.lines.Line2D object at 0x...>]
        >>> plt.plot(x2, y + 0.5, 'o')
        [<matplotlib.lines.Line2D object at 0x...>]
        >>> plt.ylim([-0.5, 1])
        (-0.5, 1)
        >>> plt.show()

    mask_indices(n, mask_func, k=0)
        Return the indices to access (n, n) arrays, given a masking function.

        Assume `mask_func` is a function that, for a square array a of size
        ``(n, n)`` with a possible offset argument `k`, when called as
        ``mask_func(a, k)`` returns a new array with zeros in certain locations
        (functions like `triu` or `tril` do precisely this). Then this function
        returns the indices where the non-zero values would be located.

        Parameters
        ----------
        n : int
            The returned indices will be valid to access arrays of shape (n, n).
        mask_func : callable
            A function whose call signature is similar to that of `triu`, `tril`.
            That is, ``mask_func(x, k)`` returns a boolean array, shaped like `x`.
            `k` is an optional argument to the function.
        k : scalar
            An optional argument which is passed through to `mask_func`. Functions
            like `triu`, `tril` take a second argument that is interpreted as an
            offset.

        Returns
        -------
        indices : tuple of arrays.
            The `n` arrays of indices corresponding to the locations where
            ``mask_func(np.ones((n, n)), k)`` is True.

        See Also
        --------
        triu, tril, triu_indices, tril_indices

        Notes
        -----
        .. versionadded:: 1.4.0

        Examples
        --------
        >>> import numpy as np

        These are the indices that would allow you to access the upper triangular
        part of any 3x3 array:

        >>> iu = np.mask_indices(3, np.triu)

        For example, if `a` is a 3x3 array:

        >>> a = np.arange(9).reshape(3, 3)
        >>> a
        array([[0, 1, 2],
               [3, 4, 5],
               [6, 7, 8]])
        >>> a[iu]
        array([0, 1, 2, 4, 5, 8])

        An offset can be passed also to the masking function.  This gets us the
        indices starting on the first diagonal right of the main one:

        >>> iu1 = np.mask_indices(3, np.triu, 1)

        with which we now extract only three elements:

        >>> a[iu1]
        array([1, 2, 5])

    matrix_transpose(x, /)
        Transposes a matrix (or a stack of matrices) ``x``.

        This function is Array API compatible.

        Parameters
        ----------
        x : array_like
            Input array having shape (..., M, N) and whose two innermost
            dimensions form ``MxN`` matrices.

        Returns
        -------
        out : ndarray
            An array containing the transpose for each matrix and having shape
            (..., N, M).

        See Also
        --------
        transpose : Generic transpose method.

        Examples
        --------
        >>> import numpy as np
        >>> np.matrix_transpose([[1, 2], [3, 4]])
        array([[1, 3],
               [2, 4]])

        >>> np.matrix_transpose([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])
        array([[[1, 3],
                [2, 4]],
               [[5, 7],
                [6, 8]]])

    max(a, axis=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Return the maximum of an array or maximum along an axis.

        Parameters
        ----------
        a : array_like
            Input data.
        axis : None or int or tuple of ints, optional
            Axis or axes along which to operate.  By default, flattened input is
            used.

            .. versionadded:: 1.7.0

            If this is a tuple of ints, the maximum is selected over multiple axes,
            instead of a single axis or all the axes as before.
        out : ndarray, optional
            Alternative output array in which to place the result.  Must
            be of the same shape and buffer length as the expected output.
            See :ref:`ufuncs-output-type` for more details.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the ``max`` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.

        initial : scalar, optional
            The minimum value of an output element. Must be present to allow
            computation on empty slice. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.15.0

        where : array_like of bool, optional
            Elements to compare for the maximum. See `~numpy.ufunc.reduce`
            for details.

            .. versionadded:: 1.17.0

        Returns
        -------
        max : ndarray or scalar
            Maximum of `a`. If `axis` is None, the result is a scalar value.
            If `axis` is an int, the result is an array of dimension
            ``a.ndim - 1``. If `axis` is a tuple, the result is an array of
            dimension ``a.ndim - len(axis)``.

        See Also
        --------
        amin :
            The minimum value of an array along a given axis, propagating any NaNs.
        nanmax :
            The maximum value of an array along a given axis, ignoring any NaNs.
        maximum :
            Element-wise maximum of two arrays, propagating any NaNs.
        fmax :
            Element-wise maximum of two arrays, ignoring any NaNs.
        argmax :
            Return the indices of the maximum values.

        nanmin, minimum, fmin

        Notes
        -----
        NaN values are propagated, that is if at least one item is NaN, the
        corresponding max value will be NaN as well. To ignore NaN values
        (MATLAB behavior), please use nanmax.

        Don't use `~numpy.max` for element-wise comparison of 2 arrays; when
        ``a.shape[0]`` is 2, ``maximum(a[0], a[1])`` is faster than
        ``max(a, axis=0)``.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(4).reshape((2,2))
        >>> a
        array([[0, 1],
               [2, 3]])
        >>> np.max(a)           # Maximum of the flattened array
        3
        >>> np.max(a, axis=0)   # Maxima along the first axis
        array([2, 3])
        >>> np.max(a, axis=1)   # Maxima along the second axis
        array([1, 3])
        >>> np.max(a, where=[False, True], initial=-1, axis=0)
        array([-1,  3])
        >>> b = np.arange(5, dtype=float)
        >>> b[2] = np.nan
        >>> np.max(b)
        np.float64(nan)
        >>> np.max(b, where=~np.isnan(b), initial=-1)
        4.0
        >>> np.nanmax(b)
        4.0

        You can use an initial value to compute the maximum of an empty slice, or
        to initialize it to a different value:

        >>> np.max([[-50], [10]], axis=-1, initial=0)
        array([ 0, 10])

        Notice that the initial value is used as one of the elements for which the
        maximum is determined, unlike for the default argument Python's max
        function, which is only used for empty iterables.

        >>> np.max([5], initial=6)
        6
        >>> max([5], default=6)
        5

    may_share_memory(...)
        may_share_memory(a, b, /, max_work=None)

        Determine if two arrays might share memory

        A return of True does not necessarily mean that the two arrays
        share any element.  It just means that they *might*.

        Only the memory bounds of a and b are checked by default.

        Parameters
        ----------
        a, b : ndarray
            Input arrays
        max_work : int, optional
            Effort to spend on solving the overlap problem.  See
            `shares_memory` for details.  Default for ``may_share_memory``
            is to do a bounds check.

        Returns
        -------
        out : bool

        See Also
        --------
        shares_memory

        Examples
        --------
        >>> import numpy as np
        >>> np.may_share_memory(np.array([1,2]), np.array([5,8,9]))
        False
        >>> x = np.zeros([3, 4])
        >>> np.may_share_memory(x[:,0], x[:,1])
        True

    mean(a, axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)
        Compute the arithmetic mean along the specified axis.

        Returns the average of the array elements.  The average is taken over
        the flattened array by default, otherwise over the specified axis.
        `float64` intermediate and return values are used for integer inputs.

        Parameters
        ----------
        a : array_like
            Array containing numbers whose mean is desired. If `a` is not an
            array, a conversion is attempted.
        axis : None or int or tuple of ints, optional
            Axis or axes along which the means are computed. The default is to
            compute the mean of the flattened array.

            .. versionadded:: 1.7.0

            If this is a tuple of ints, a mean is performed over multiple axes,
            instead of a single axis or all the axes as before.
        dtype : data-type, optional
            Type to use in computing the mean.  For integer inputs, the default
            is `float64`; for floating point inputs, it is the same as the
            input dtype.
        out : ndarray, optional
            Alternate output array in which to place the result.  The default
            is ``None``; if provided, it must have the same shape as the
            expected output, but the type will be cast if necessary.
            See :ref:`ufuncs-output-type` for more details.
            See :ref:`ufuncs-output-type` for more details.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the `mean` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.

        where : array_like of bool, optional
            Elements to include in the mean. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.20.0

        Returns
        -------
        m : ndarray, see dtype parameter above
            If `out=None`, returns a new array containing the mean values,
            otherwise a reference to the output array is returned.

        See Also
        --------
        average : Weighted average
        std, var, nanmean, nanstd, nanvar

        Notes
        -----
        The arithmetic mean is the sum of the elements along the axis divided
        by the number of elements.

        Note that for floating-point input, the mean is computed using the
        same precision the input has.  Depending on the input data, this can
        cause the results to be inaccurate, especially for `float32` (see
        example below).  Specifying a higher-precision accumulator using the
        `dtype` keyword can alleviate this issue.

        By default, `float16` results are computed using `float32` intermediates
        for extra precision.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, 4]])
        >>> np.mean(a)
        2.5
        >>> np.mean(a, axis=0)
        array([2., 3.])
        >>> np.mean(a, axis=1)
        array([1.5, 3.5])

        In single precision, `mean` can be inaccurate:

        >>> a = np.zeros((2, 512*512), dtype=np.float32)
        >>> a[0, :] = 1.0
        >>> a[1, :] = 0.1
        >>> np.mean(a)
        0.54999924

        Computing the mean in float64 is more accurate:

        >>> np.mean(a, dtype=np.float64)
        0.55000000074505806 # may vary

        Specifying a where argument:

        >>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]])
        >>> np.mean(a)
        12.0
        >>> np.mean(a, where=[[True], [False], [False]])
        9.0

    median(a, axis=None, out=None, overwrite_input=False, keepdims=False)
        Compute the median along the specified axis.

        Returns the median of the array elements.

        Parameters
        ----------
        a : array_like
            Input array or object that can be converted to an array.
        axis : {int, sequence of int, None}, optional
            Axis or axes along which the medians are computed. The default,
            axis=None, will compute the median along a flattened version of
            the array.

            .. versionadded:: 1.9.0

            If a sequence of axes, the array is first flattened along the
            given axes, then the median is computed along the resulting
            flattened axis.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output,
            but the type (of the output) will be cast if necessary.
        overwrite_input : bool, optional
           If True, then allow use of memory of input array `a` for
           calculations. The input array will be modified by the call to
           `median`. This will save memory when you do not need to preserve
           the contents of the input array. Treat the input as undefined,
           but it will probably be fully or partially sorted. Default is
           False. If `overwrite_input` is ``True`` and `a` is not already an
           `ndarray`, an error will be raised.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the original `arr`.

            .. versionadded:: 1.9.0

        Returns
        -------
        median : ndarray
            A new array holding the result. If the input contains integers
            or floats smaller than ``float64``, then the output data-type is
            ``np.float64``.  Otherwise, the data-type of the output is the
            same as that of the input. If `out` is specified, that array is
            returned instead.

        See Also
        --------
        mean, percentile

        Notes
        -----
        Given a vector ``V`` of length ``N``, the median of ``V`` is the
        middle value of a sorted copy of ``V``, ``V_sorted`` - i
        e., ``V_sorted[(N-1)/2]``, when ``N`` is odd, and the average of the
        two middle values of ``V_sorted`` when ``N`` is even.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[10, 7, 4], [3, 2, 1]])
        >>> a
        array([[10,  7,  4],
               [ 3,  2,  1]])
        >>> np.median(a)
        np.float64(3.5)
        >>> np.median(a, axis=0)
        array([6.5, 4.5, 2.5])
        >>> np.median(a, axis=1)
        array([7.,  2.])
        >>> np.median(a, axis=(0, 1))
        np.float64(3.5)
        >>> m = np.median(a, axis=0)
        >>> out = np.zeros_like(m)
        >>> np.median(a, axis=0, out=m)
        array([6.5,  4.5,  2.5])
        >>> m
        array([6.5,  4.5,  2.5])
        >>> b = a.copy()
        >>> np.median(b, axis=1, overwrite_input=True)
        array([7.,  2.])
        >>> assert not np.all(a==b)
        >>> b = a.copy()
        >>> np.median(b, axis=None, overwrite_input=True)
        np.float64(3.5)
        >>> assert not np.all(a==b)

    meshgrid(*xi, copy=True, sparse=False, indexing='xy')
        Return a tuple of coordinate matrices from coordinate vectors.

        Make N-D coordinate arrays for vectorized evaluations of
        N-D scalar/vector fields over N-D grids, given
        one-dimensional coordinate arrays x1, x2,..., xn.

        .. versionchanged:: 1.9
           1-D and 0-D cases are allowed.

        Parameters
        ----------
        x1, x2,..., xn : array_like
            1-D arrays representing the coordinates of a grid.
        indexing : {'xy', 'ij'}, optional
            Cartesian ('xy', default) or matrix ('ij') indexing of output.
            See Notes for more details.

            .. versionadded:: 1.7.0
        sparse : bool, optional
            If True the shape of the returned coordinate array for dimension *i*
            is reduced from ``(N1, ..., Ni, ... Nn)`` to
            ``(1, ..., 1, Ni, 1, ..., 1)``.  These sparse coordinate grids are
            intended to be use with :ref:`basics.broadcasting`.  When all
            coordinates are used in an expression, broadcasting still leads to a
            fully-dimensonal result array.

            Default is False.

            .. versionadded:: 1.7.0
        copy : bool, optional
            If False, a view into the original arrays are returned in order to
            conserve memory.  Default is True.  Please note that
            ``sparse=False, copy=False`` will likely return non-contiguous
            arrays.  Furthermore, more than one element of a broadcast array
            may refer to a single memory location.  If you need to write to the
            arrays, make copies first.

            .. versionadded:: 1.7.0

        Returns
        -------
        X1, X2,..., XN : tuple of ndarrays
            For vectors `x1`, `x2`,..., `xn` with lengths ``Ni=len(xi)``,
            returns ``(N1, N2, N3,..., Nn)`` shaped arrays if indexing='ij'
            or ``(N2, N1, N3,..., Nn)`` shaped arrays if indexing='xy'
            with the elements of `xi` repeated to fill the matrix along
            the first dimension for `x1`, the second for `x2` and so on.

        Notes
        -----
        This function supports both indexing conventions through the indexing
        keyword argument.  Giving the string 'ij' returns a meshgrid with
        matrix indexing, while 'xy' returns a meshgrid with Cartesian indexing.
        In the 2-D case with inputs of length M and N, the outputs are of shape
        (N, M) for 'xy' indexing and (M, N) for 'ij' indexing.  In the 3-D case
        with inputs of length M, N and P, outputs are of shape (N, M, P) for
        'xy' indexing and (M, N, P) for 'ij' indexing.  The difference is
        illustrated by the following code snippet::

            xv, yv = np.meshgrid(x, y, indexing='ij')
            for i in range(nx):
                for j in range(ny):
                    # treat xv[i,j], yv[i,j]

            xv, yv = np.meshgrid(x, y, indexing='xy')
            for i in range(nx):
                for j in range(ny):
                    # treat xv[j,i], yv[j,i]

        In the 1-D and 0-D case, the indexing and sparse keywords have no effect.

        See Also
        --------
        mgrid : Construct a multi-dimensional "meshgrid" using indexing notation.
        ogrid : Construct an open multi-dimensional "meshgrid" using indexing
                notation.
        :ref:`how-to-index`

        Examples
        --------
        >>> import numpy as np
        >>> nx, ny = (3, 2)
        >>> x = np.linspace(0, 1, nx)
        >>> y = np.linspace(0, 1, ny)
        >>> xv, yv = np.meshgrid(x, y)
        >>> xv
        array([[0. , 0.5, 1. ],
               [0. , 0.5, 1. ]])
        >>> yv
        array([[0.,  0.,  0.],
               [1.,  1.,  1.]])

        The result of `meshgrid` is a coordinate grid:

        >>> import matplotlib.pyplot as plt
        >>> plt.plot(xv, yv, marker='o', color='k', linestyle='none')
        >>> plt.show()

        You can create sparse output arrays to save memory and computation time.

        >>> xv, yv = np.meshgrid(x, y, sparse=True)
        >>> xv
        array([[0. ,  0.5,  1. ]])
        >>> yv
        array([[0.],
               [1.]])

        `meshgrid` is very useful to evaluate functions on a grid. If the
        function depends on all coordinates, both dense and sparse outputs can be
        used.

        >>> x = np.linspace(-5, 5, 101)
        >>> y = np.linspace(-5, 5, 101)
        >>> # full coordinate arrays
        >>> xx, yy = np.meshgrid(x, y)
        >>> zz = np.sqrt(xx**2 + yy**2)
        >>> xx.shape, yy.shape, zz.shape
        ((101, 101), (101, 101), (101, 101))
        >>> # sparse coordinate arrays
        >>> xs, ys = np.meshgrid(x, y, sparse=True)
        >>> zs = np.sqrt(xs**2 + ys**2)
        >>> xs.shape, ys.shape, zs.shape
        ((1, 101), (101, 1), (101, 101))
        >>> np.array_equal(zz, zs)
        True

        >>> h = plt.contourf(x, y, zs)
        >>> plt.axis('scaled')
        >>> plt.colorbar()
        >>> plt.show()

    min(a, axis=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Return the minimum of an array or minimum along an axis.

        Parameters
        ----------
        a : array_like
            Input data.
        axis : None or int or tuple of ints, optional
            Axis or axes along which to operate.  By default, flattened input is
            used.

            .. versionadded:: 1.7.0

            If this is a tuple of ints, the minimum is selected over multiple axes,
            instead of a single axis or all the axes as before.
        out : ndarray, optional
            Alternative output array in which to place the result.  Must
            be of the same shape and buffer length as the expected output.
            See :ref:`ufuncs-output-type` for more details.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the ``min`` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.

        initial : scalar, optional
            The maximum value of an output element. Must be present to allow
            computation on empty slice. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.15.0

        where : array_like of bool, optional
            Elements to compare for the minimum. See `~numpy.ufunc.reduce`
            for details.

            .. versionadded:: 1.17.0

        Returns
        -------
        min : ndarray or scalar
            Minimum of `a`. If `axis` is None, the result is a scalar value.
            If `axis` is an int, the result is an array of dimension
            ``a.ndim - 1``.  If `axis` is a tuple, the result is an array of
            dimension ``a.ndim - len(axis)``.

        See Also
        --------
        amax :
            The maximum value of an array along a given axis, propagating any NaNs.
        nanmin :
            The minimum value of an array along a given axis, ignoring any NaNs.
        minimum :
            Element-wise minimum of two arrays, propagating any NaNs.
        fmin :
            Element-wise minimum of two arrays, ignoring any NaNs.
        argmin :
            Return the indices of the minimum values.

        nanmax, maximum, fmax

        Notes
        -----
        NaN values are propagated, that is if at least one item is NaN, the
        corresponding min value will be NaN as well. To ignore NaN values
        (MATLAB behavior), please use nanmin.

        Don't use `~numpy.min` for element-wise comparison of 2 arrays; when
        ``a.shape[0]`` is 2, ``minimum(a[0], a[1])`` is faster than
        ``min(a, axis=0)``.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(4).reshape((2,2))
        >>> a
        array([[0, 1],
               [2, 3]])
        >>> np.min(a)           # Minimum of the flattened array
        0
        >>> np.min(a, axis=0)   # Minima along the first axis
        array([0, 1])
        >>> np.min(a, axis=1)   # Minima along the second axis
        array([0, 2])
        >>> np.min(a, where=[False, True], initial=10, axis=0)
        array([10,  1])

        >>> b = np.arange(5, dtype=float)
        >>> b[2] = np.nan
        >>> np.min(b)
        np.float64(nan)
        >>> np.min(b, where=~np.isnan(b), initial=10)
        0.0
        >>> np.nanmin(b)
        0.0

        >>> np.min([[-50], [10]], axis=-1, initial=0)
        array([-50,   0])

        Notice that the initial value is used as one of the elements for which the
        minimum is determined, unlike for the default argument Python's max
        function, which is only used for empty iterables.

        Notice that this isn't the same as Python's ``default`` argument.

        >>> np.min([6], initial=5)
        5
        >>> min([6], default=5)
        6

    min_scalar_type(...)
        min_scalar_type(a, /)

        For scalar ``a``, returns the data type with the smallest size
        and smallest scalar kind which can hold its value.  For non-scalar
        array ``a``, returns the vector's dtype unmodified.

        Floating point values are not demoted to integers,
        and complex values are not demoted to floats.

        Parameters
        ----------
        a : scalar or array_like
            The value whose minimal data type is to be found.

        Returns
        -------
        out : dtype
            The minimal data type.

        Notes
        -----
        .. versionadded:: 1.6.0

        See Also
        --------
        result_type, promote_types, dtype, can_cast

        Examples
        --------
        >>> import numpy as np
        >>> np.min_scalar_type(10)
        dtype('uint8')

        >>> np.min_scalar_type(-260)
        dtype('int16')

        >>> np.min_scalar_type(3.1)
        dtype('float16')

        >>> np.min_scalar_type(1e50)
        dtype('float64')

        >>> np.min_scalar_type(np.arange(4,dtype='f8'))
        dtype('float64')

    mintypecode(typechars, typeset='GDFgdf', default='d')
        Return the character for the minimum-size type to which given types can
        be safely cast.

        The returned type character must represent the smallest size dtype such
        that an array of the returned type can handle the data from an array of
        all types in `typechars` (or if `typechars` is an array, then its
        dtype.char).

        Parameters
        ----------
        typechars : list of str or array_like
            If a list of strings, each string should represent a dtype.
            If array_like, the character representation of the array dtype is used.
        typeset : str or list of str, optional
            The set of characters that the returned character is chosen from.
            The default set is 'GDFgdf'.
        default : str, optional
            The default character, this is returned if none of the characters in
            `typechars` matches a character in `typeset`.

        Returns
        -------
        typechar : str
            The character representing the minimum-size type that was found.

        See Also
        --------
        dtype

        Examples
        --------
        >>> import numpy as np
        >>> np.mintypecode(['d', 'f', 'S'])
        'd'
        >>> x = np.array([1.1, 2-3.j])
        >>> np.mintypecode(x)
        'D'

        >>> np.mintypecode('abceh', default='G')
        'G'

    moveaxis(a, source, destination)
        Move axes of an array to new positions.

        Other axes remain in their original order.

        .. versionadded:: 1.11.0

        Parameters
        ----------
        a : np.ndarray
            The array whose axes should be reordered.
        source : int or sequence of int
            Original positions of the axes to move. These must be unique.
        destination : int or sequence of int
            Destination positions for each of the original axes. These must also be
            unique.

        Returns
        -------
        result : np.ndarray
            Array with moved axes. This array is a view of the input array.

        See Also
        --------
        transpose : Permute the dimensions of an array.
        swapaxes : Interchange two axes of an array.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.zeros((3, 4, 5))
        >>> np.moveaxis(x, 0, -1).shape
        (4, 5, 3)
        >>> np.moveaxis(x, -1, 0).shape
        (5, 3, 4)

        These all achieve the same result:

        >>> np.transpose(x).shape
        (5, 4, 3)
        >>> np.swapaxes(x, 0, -1).shape
        (5, 4, 3)
        >>> np.moveaxis(x, [0, 1], [-1, -2]).shape
        (5, 4, 3)
        >>> np.moveaxis(x, [0, 1, 2], [-1, -2, -3]).shape
        (5, 4, 3)

    nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None)
        Replace NaN with zero and infinity with large finite numbers (default
        behaviour) or with the numbers defined by the user using the `nan`,
        `posinf` and/or `neginf` keywords.

        If `x` is inexact, NaN is replaced by zero or by the user defined value in
        `nan` keyword, infinity is replaced by the largest finite floating point
        values representable by ``x.dtype`` or by the user defined value in
        `posinf` keyword and -infinity is replaced by the most negative finite
        floating point values representable by ``x.dtype`` or by the user defined
        value in `neginf` keyword.

        For complex dtypes, the above is applied to each of the real and
        imaginary components of `x` separately.

        If `x` is not inexact, then no replacements are made.

        Parameters
        ----------
        x : scalar or array_like
            Input data.
        copy : bool, optional
            Whether to create a copy of `x` (True) or to replace values
            in-place (False). The in-place operation only occurs if
            casting to an array does not require a copy.
            Default is True.

            .. versionadded:: 1.13
        nan : int, float, optional
            Value to be used to fill NaN values. If no value is passed
            then NaN values will be replaced with 0.0.

            .. versionadded:: 1.17
        posinf : int, float, optional
            Value to be used to fill positive infinity values. If no value is
            passed then positive infinity values will be replaced with a very
            large number.

            .. versionadded:: 1.17
        neginf : int, float, optional
            Value to be used to fill negative infinity values. If no value is
            passed then negative infinity values will be replaced with a very
            small (or negative) number.

            .. versionadded:: 1.17



        Returns
        -------
        out : ndarray
            `x`, with the non-finite values replaced. If `copy` is False, this may
            be `x` itself.

        See Also
        --------
        isinf : Shows which elements are positive or negative infinity.
        isneginf : Shows which elements are negative infinity.
        isposinf : Shows which elements are positive infinity.
        isnan : Shows which elements are Not a Number (NaN).
        isfinite : Shows which elements are finite (not NaN, not infinity)

        Notes
        -----
        NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
        (IEEE 754). This means that Not a Number is not equivalent to infinity.

        Examples
        --------
        >>> import numpy as np
        >>> np.nan_to_num(np.inf)
        1.7976931348623157e+308
        >>> np.nan_to_num(-np.inf)
        -1.7976931348623157e+308
        >>> np.nan_to_num(np.nan)
        0.0
        >>> x = np.array([np.inf, -np.inf, np.nan, -128, 128])
        >>> np.nan_to_num(x)
        array([ 1.79769313e+308, -1.79769313e+308,  0.00000000e+000, # may vary
               -1.28000000e+002,  1.28000000e+002])
        >>> np.nan_to_num(x, nan=-9999, posinf=33333333, neginf=33333333)
        array([ 3.3333333e+07,  3.3333333e+07, -9.9990000e+03,
               -1.2800000e+02,  1.2800000e+02])
        >>> y = np.array([complex(np.inf, np.nan), np.nan, complex(np.nan, np.inf)])
        array([  1.79769313e+308,  -1.79769313e+308,   0.00000000e+000, # may vary
             -1.28000000e+002,   1.28000000e+002])
        >>> np.nan_to_num(y)
        array([  1.79769313e+308 +0.00000000e+000j, # may vary
                 0.00000000e+000 +0.00000000e+000j,
                 0.00000000e+000 +1.79769313e+308j])
        >>> np.nan_to_num(y, nan=111111, posinf=222222)
        array([222222.+111111.j, 111111.     +0.j, 111111.+222222.j])

    nanargmax(a, axis=None, out=None, *, keepdims=<no value>)
        Return the indices of the maximum values in the specified axis ignoring
        NaNs. For all-NaN slices ``ValueError`` is raised. Warning: the
        results cannot be trusted if a slice contains only NaNs and -Infs.


        Parameters
        ----------
        a : array_like
            Input data.
        axis : int, optional
            Axis along which to operate.  By default flattened input is used.
        out : array, optional
            If provided, the result will be inserted into this array. It should
            be of the appropriate shape and dtype.

            .. versionadded:: 1.22.0
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the array.

            .. versionadded:: 1.22.0

        Returns
        -------
        index_array : ndarray
            An array of indices or a single index value.

        See Also
        --------
        argmax, nanargmin

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[np.nan, 4], [2, 3]])
        >>> np.argmax(a)
        0
        >>> np.nanargmax(a)
        1
        >>> np.nanargmax(a, axis=0)
        array([1, 0])
        >>> np.nanargmax(a, axis=1)
        array([1, 1])

    nanargmin(a, axis=None, out=None, *, keepdims=<no value>)
        Return the indices of the minimum values in the specified axis ignoring
        NaNs. For all-NaN slices ``ValueError`` is raised. Warning: the results
        cannot be trusted if a slice contains only NaNs and Infs.

        Parameters
        ----------
        a : array_like
            Input data.
        axis : int, optional
            Axis along which to operate.  By default flattened input is used.
        out : array, optional
            If provided, the result will be inserted into this array. It should
            be of the appropriate shape and dtype.

            .. versionadded:: 1.22.0
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the array.

            .. versionadded:: 1.22.0

        Returns
        -------
        index_array : ndarray
            An array of indices or a single index value.

        See Also
        --------
        argmin, nanargmax

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[np.nan, 4], [2, 3]])
        >>> np.argmin(a)
        0
        >>> np.nanargmin(a)
        2
        >>> np.nanargmin(a, axis=0)
        array([1, 1])
        >>> np.nanargmin(a, axis=1)
        array([1, 0])

    nancumprod(a, axis=None, dtype=None, out=None)
        Return the cumulative product of array elements over a given axis treating Not a
        Numbers (NaNs) as one.  The cumulative product does not change when NaNs are
        encountered and leading NaNs are replaced by ones.

        Ones are returned for slices that are all-NaN or empty.

        .. versionadded:: 1.12.0

        Parameters
        ----------
        a : array_like
            Input array.
        axis : int, optional
            Axis along which the cumulative product is computed.  By default
            the input is flattened.
        dtype : dtype, optional
            Type of the returned array, as well as of the accumulator in which
            the elements are multiplied.  If *dtype* is not specified, it
            defaults to the dtype of `a`, unless `a` has an integer dtype with
            a precision less than that of the default platform integer.  In
            that case, the default platform integer is used instead.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type of the resulting values will be cast if necessary.

        Returns
        -------
        nancumprod : ndarray
            A new array holding the result is returned unless `out` is
            specified, in which case it is returned.

        See Also
        --------
        numpy.cumprod : Cumulative product across array propagating NaNs.
        isnan : Show which elements are NaN.

        Examples
        --------
        >>> import numpy as np
        >>> np.nancumprod(1)
        array([1])
        >>> np.nancumprod([1])
        array([1])
        >>> np.nancumprod([1, np.nan])
        array([1.,  1.])
        >>> a = np.array([[1, 2], [3, np.nan]])
        >>> np.nancumprod(a)
        array([1.,  2.,  6.,  6.])
        >>> np.nancumprod(a, axis=0)
        array([[1.,  2.],
               [3.,  2.]])
        >>> np.nancumprod(a, axis=1)
        array([[1.,  2.],
               [3.,  3.]])

    nancumsum(a, axis=None, dtype=None, out=None)
        Return the cumulative sum of array elements over a given axis treating Not a
        Numbers (NaNs) as zero.  The cumulative sum does not change when NaNs are
        encountered and leading NaNs are replaced by zeros.

        Zeros are returned for slices that are all-NaN or empty.

        .. versionadded:: 1.12.0

        Parameters
        ----------
        a : array_like
            Input array.
        axis : int, optional
            Axis along which the cumulative sum is computed. The default
            (None) is to compute the cumsum over the flattened array.
        dtype : dtype, optional
            Type of the returned array and of the accumulator in which the
            elements are summed.  If `dtype` is not specified, it defaults
            to the dtype of `a`, unless `a` has an integer dtype with a
            precision less than that of the default platform integer.  In
            that case, the default platform integer is used.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type will be cast if necessary. See :ref:`ufuncs-output-type` for
            more details.

        Returns
        -------
        nancumsum : ndarray.
            A new array holding the result is returned unless `out` is
            specified, in which it is returned. The result has the same
            size as `a`, and the same shape as `a` if `axis` is not None
            or `a` is a 1-d array.

        See Also
        --------
        numpy.cumsum : Cumulative sum across array propagating NaNs.
        isnan : Show which elements are NaN.

        Examples
        --------
        >>> import numpy as np
        >>> np.nancumsum(1)
        array([1])
        >>> np.nancumsum([1])
        array([1])
        >>> np.nancumsum([1, np.nan])
        array([1.,  1.])
        >>> a = np.array([[1, 2], [3, np.nan]])
        >>> np.nancumsum(a)
        array([1.,  3.,  6.,  6.])
        >>> np.nancumsum(a, axis=0)
        array([[1.,  2.],
               [4.,  2.]])
        >>> np.nancumsum(a, axis=1)
        array([[1.,  3.],
               [3.,  3.]])

    nanmax(a, axis=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Return the maximum of an array or maximum along an axis, ignoring any
        NaNs.  When all-NaN slices are encountered a ``RuntimeWarning`` is
        raised and NaN is returned for that slice.

        Parameters
        ----------
        a : array_like
            Array containing numbers whose maximum is desired. If `a` is not an
            array, a conversion is attempted.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the maximum is computed. The default is to compute
            the maximum of the flattened array.
        out : ndarray, optional
            Alternate output array in which to place the result.  The default
            is ``None``; if provided, it must have the same shape as the
            expected output, but the type will be cast if necessary. See
            :ref:`ufuncs-output-type` for more details.

            .. versionadded:: 1.8.0
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the original `a`.

            If the value is anything but the default, then
            `keepdims` will be passed through to the `max` method
            of sub-classes of `ndarray`.  If the sub-classes methods
            does not implement `keepdims` any exceptions will be raised.

            .. versionadded:: 1.8.0
        initial : scalar, optional
            The minimum value of an output element. Must be present to allow
            computation on empty slice. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.22.0
        where : array_like of bool, optional
            Elements to compare for the maximum. See `~numpy.ufunc.reduce`
            for details.

            .. versionadded:: 1.22.0

        Returns
        -------
        nanmax : ndarray
            An array with the same shape as `a`, with the specified axis removed.
            If `a` is a 0-d array, or if axis is None, an ndarray scalar is
            returned.  The same dtype as `a` is returned.

        See Also
        --------
        nanmin :
            The minimum value of an array along a given axis, ignoring any NaNs.
        amax :
            The maximum value of an array along a given axis, propagating any NaNs.
        fmax :
            Element-wise maximum of two arrays, ignoring any NaNs.
        maximum :
            Element-wise maximum of two arrays, propagating any NaNs.
        isnan :
            Shows which elements are Not a Number (NaN).
        isfinite:
            Shows which elements are neither NaN nor infinity.

        amin, fmin, minimum

        Notes
        -----
        NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
        (IEEE 754). This means that Not a Number is not equivalent to infinity.
        Positive infinity is treated as a very large number and negative
        infinity is treated as a very small (i.e. negative) number.

        If the input has a integer type the function is equivalent to np.max.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, np.nan]])
        >>> np.nanmax(a)
        3.0
        >>> np.nanmax(a, axis=0)
        array([3.,  2.])
        >>> np.nanmax(a, axis=1)
        array([2.,  3.])

        When positive infinity and negative infinity are present:

        >>> np.nanmax([1, 2, np.nan, -np.inf])
        2.0
        >>> np.nanmax([1, 2, np.nan, np.inf])
        inf

    nanmean(a, axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)
        Compute the arithmetic mean along the specified axis, ignoring NaNs.

        Returns the average of the array elements.  The average is taken over
        the flattened array by default, otherwise over the specified axis.
        `float64` intermediate and return values are used for integer inputs.

        For all-NaN slices, NaN is returned and a `RuntimeWarning` is raised.

        .. versionadded:: 1.8.0

        Parameters
        ----------
        a : array_like
            Array containing numbers whose mean is desired. If `a` is not an
            array, a conversion is attempted.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the means are computed. The default is to compute
            the mean of the flattened array.
        dtype : data-type, optional
            Type to use in computing the mean.  For integer inputs, the default
            is `float64`; for inexact inputs, it is the same as the input
            dtype.
        out : ndarray, optional
            Alternate output array in which to place the result.  The default
            is ``None``; if provided, it must have the same shape as the
            expected output, but the type will be cast if necessary.
            See :ref:`ufuncs-output-type` for more details.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the original `a`.

            If the value is anything but the default, then
            `keepdims` will be passed through to the `mean` or `sum` methods
            of sub-classes of `ndarray`.  If the sub-classes methods
            does not implement `keepdims` any exceptions will be raised.
        where : array_like of bool, optional
            Elements to include in the mean. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.22.0

        Returns
        -------
        m : ndarray, see dtype parameter above
            If `out=None`, returns a new array containing the mean values,
            otherwise a reference to the output array is returned. Nan is
            returned for slices that contain only NaNs.

        See Also
        --------
        average : Weighted average
        mean : Arithmetic mean taken while not ignoring NaNs
        var, nanvar

        Notes
        -----
        The arithmetic mean is the sum of the non-NaN elements along the axis
        divided by the number of non-NaN elements.

        Note that for floating-point input, the mean is computed using the same
        precision the input has.  Depending on the input data, this can cause
        the results to be inaccurate, especially for `float32`.  Specifying a
        higher-precision accumulator using the `dtype` keyword can alleviate
        this issue.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, np.nan], [3, 4]])
        >>> np.nanmean(a)
        2.6666666666666665
        >>> np.nanmean(a, axis=0)
        array([2.,  4.])
        >>> np.nanmean(a, axis=1)
        array([1.,  3.5]) # may vary

    nanmedian(a, axis=None, out=None, overwrite_input=False, keepdims=<no value>)
        Compute the median along the specified axis, while ignoring NaNs.

        Returns the median of the array elements.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        a : array_like
            Input array or object that can be converted to an array.
        axis : {int, sequence of int, None}, optional
            Axis or axes along which the medians are computed. The default
            is to compute the median along a flattened version of the array.
            A sequence of axes is supported since version 1.9.0.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output,
            but the type (of the output) will be cast if necessary.
        overwrite_input : bool, optional
           If True, then allow use of memory of input array `a` for
           calculations. The input array will be modified by the call to
           `median`. This will save memory when you do not need to preserve
           the contents of the input array. Treat the input as undefined,
           but it will probably be fully or partially sorted. Default is
           False. If `overwrite_input` is ``True`` and `a` is not already an
           `ndarray`, an error will be raised.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the original `a`.

            If this is anything but the default value it will be passed
            through (in the special case of an empty array) to the
            `mean` function of the underlying array.  If the array is
            a sub-class and `mean` does not have the kwarg `keepdims` this
            will raise a RuntimeError.

        Returns
        -------
        median : ndarray
            A new array holding the result. If the input contains integers
            or floats smaller than ``float64``, then the output data-type is
            ``np.float64``.  Otherwise, the data-type of the output is the
            same as that of the input. If `out` is specified, that array is
            returned instead.

        See Also
        --------
        mean, median, percentile

        Notes
        -----
        Given a vector ``V`` of length ``N``, the median of ``V`` is the
        middle value of a sorted copy of ``V``, ``V_sorted`` - i.e.,
        ``V_sorted[(N-1)/2]``, when ``N`` is odd and the average of the two
        middle values of ``V_sorted`` when ``N`` is even.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[10.0, 7, 4], [3, 2, 1]])
        >>> a[0, 1] = np.nan
        >>> a
        array([[10., nan,  4.],
               [ 3.,  2.,  1.]])
        >>> np.median(a)
        np.float64(nan)
        >>> np.nanmedian(a)
        3.0
        >>> np.nanmedian(a, axis=0)
        array([6.5, 2. , 2.5])
        >>> np.median(a, axis=1)
        array([nan,  2.])
        >>> b = a.copy()
        >>> np.nanmedian(b, axis=1, overwrite_input=True)
        array([7.,  2.])
        >>> assert not np.all(a==b)
        >>> b = a.copy()
        >>> np.nanmedian(b, axis=None, overwrite_input=True)
        3.0
        >>> assert not np.all(a==b)

    nanmin(a, axis=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Return minimum of an array or minimum along an axis, ignoring any NaNs.
        When all-NaN slices are encountered a ``RuntimeWarning`` is raised and
        Nan is returned for that slice.

        Parameters
        ----------
        a : array_like
            Array containing numbers whose minimum is desired. If `a` is not an
            array, a conversion is attempted.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the minimum is computed. The default is to compute
            the minimum of the flattened array.
        out : ndarray, optional
            Alternate output array in which to place the result.  The default
            is ``None``; if provided, it must have the same shape as the
            expected output, but the type will be cast if necessary. See
            :ref:`ufuncs-output-type` for more details.

            .. versionadded:: 1.8.0
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the original `a`.

            If the value is anything but the default, then
            `keepdims` will be passed through to the `min` method
            of sub-classes of `ndarray`.  If the sub-classes methods
            does not implement `keepdims` any exceptions will be raised.

            .. versionadded:: 1.8.0
        initial : scalar, optional
            The maximum value of an output element. Must be present to allow
            computation on empty slice. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.22.0
        where : array_like of bool, optional
            Elements to compare for the minimum. See `~numpy.ufunc.reduce`
            for details.

            .. versionadded:: 1.22.0

        Returns
        -------
        nanmin : ndarray
            An array with the same shape as `a`, with the specified axis
            removed.  If `a` is a 0-d array, or if axis is None, an ndarray
            scalar is returned.  The same dtype as `a` is returned.

        See Also
        --------
        nanmax :
            The maximum value of an array along a given axis, ignoring any NaNs.
        amin :
            The minimum value of an array along a given axis, propagating any NaNs.
        fmin :
            Element-wise minimum of two arrays, ignoring any NaNs.
        minimum :
            Element-wise minimum of two arrays, propagating any NaNs.
        isnan :
            Shows which elements are Not a Number (NaN).
        isfinite:
            Shows which elements are neither NaN nor infinity.

        amax, fmax, maximum

        Notes
        -----
        NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
        (IEEE 754). This means that Not a Number is not equivalent to infinity.
        Positive infinity is treated as a very large number and negative
        infinity is treated as a very small (i.e. negative) number.

        If the input has a integer type the function is equivalent to np.min.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, np.nan]])
        >>> np.nanmin(a)
        1.0
        >>> np.nanmin(a, axis=0)
        array([1.,  2.])
        >>> np.nanmin(a, axis=1)
        array([1.,  3.])

        When positive infinity and negative infinity are present:

        >>> np.nanmin([1, 2, np.nan, np.inf])
        1.0
        >>> np.nanmin([1, 2, np.nan, -np.inf])
        -inf

    nanpercentile(a, q, axis=None, out=None, overwrite_input=False, method='linear', keepdims=<no value>, *, weights=None, interpolation=None)
        Compute the qth percentile of the data along the specified axis,
        while ignoring nan values.

        Returns the qth percentile(s) of the array elements.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        a : array_like
            Input array or object that can be converted to an array, containing
            nan values to be ignored.
        q : array_like of float
            Percentile or sequence of percentiles to compute, which must be
            between 0 and 100 inclusive.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the percentiles are computed. The default
            is to compute the percentile(s) along a flattened version of the
            array.
        out : ndarray, optional
            Alternative output array in which to place the result. It must have
            the same shape and buffer length as the expected output, but the
            type (of the output) will be cast if necessary.
        overwrite_input : bool, optional
            If True, then allow the input array `a` to be modified by
            intermediate calculations, to save memory. In this case, the
            contents of the input `a` after this function completes is
            undefined.
        method : str, optional
            This parameter specifies the method to use for estimating the
            percentile.  There are many different methods, some unique to NumPy.
            See the notes for explanation.  The options sorted by their R type
            as summarized in the H&F paper [1]_ are:

            1. 'inverted_cdf'
            2. 'averaged_inverted_cdf'
            3. 'closest_observation'
            4. 'interpolated_inverted_cdf'
            5. 'hazen'
            6. 'weibull'
            7. 'linear'  (default)
            8. 'median_unbiased'
            9. 'normal_unbiased'

            The first three methods are discontinuous.  NumPy further defines the
            following discontinuous variations of the default 'linear' (7.) option:

            * 'lower'
            * 'higher',
            * 'midpoint'
            * 'nearest'

            .. versionchanged:: 1.22.0
                This argument was previously called "interpolation" and only
                offered the "linear" default and last four options.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left in
            the result as dimensions with size one. With this option, the
            result will broadcast correctly against the original array `a`.

            If this is anything but the default value it will be passed
            through (in the special case of an empty array) to the
            `mean` function of the underlying array.  If the array is
            a sub-class and `mean` does not have the kwarg `keepdims` this
            will raise a RuntimeError.

        weights : array_like, optional
            An array of weights associated with the values in `a`. Each value in
            `a` contributes to the percentile according to its associated weight.
            The weights array can either be 1-D (in which case its length must be
            the size of `a` along the given axis) or of the same shape as `a`.
            If `weights=None`, then all data in `a` are assumed to have a
            weight equal to one.
            Only `method="inverted_cdf"` supports weights.

            .. versionadded:: 2.0.0

        interpolation : str, optional
            Deprecated name for the method keyword argument.

            .. deprecated:: 1.22.0

        Returns
        -------
        percentile : scalar or ndarray
            If `q` is a single percentile and `axis=None`, then the result
            is a scalar. If multiple percentiles are given, first axis of
            the result corresponds to the percentiles. The other axes are
            the axes that remain after the reduction of `a`. If the input
            contains integers or floats smaller than ``float64``, the output
            data-type is ``float64``. Otherwise, the output data-type is the
            same as that of the input. If `out` is specified, that array is
            returned instead.

        See Also
        --------
        nanmean
        nanmedian : equivalent to ``nanpercentile(..., 50)``
        percentile, median, mean
        nanquantile : equivalent to nanpercentile, except q in range [0, 1].

        Notes
        -----
        The behavior of `numpy.nanpercentile` with percentage `q` is that of
        `numpy.quantile` with argument ``q/100`` (ignoring nan values).
        For more information, please see `numpy.quantile`.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[10., 7., 4.], [3., 2., 1.]])
        >>> a[0][1] = np.nan
        >>> a
        array([[10.,  nan,   4.],
              [ 3.,   2.,   1.]])
        >>> np.percentile(a, 50)
        np.float64(nan)
        >>> np.nanpercentile(a, 50)
        3.0
        >>> np.nanpercentile(a, 50, axis=0)
        array([6.5, 2. , 2.5])
        >>> np.nanpercentile(a, 50, axis=1, keepdims=True)
        array([[7.],
               [2.]])
        >>> m = np.nanpercentile(a, 50, axis=0)
        >>> out = np.zeros_like(m)
        >>> np.nanpercentile(a, 50, axis=0, out=out)
        array([6.5, 2. , 2.5])
        >>> m
        array([6.5,  2. ,  2.5])

        >>> b = a.copy()
        >>> np.nanpercentile(b, 50, axis=1, overwrite_input=True)
        array([7., 2.])
        >>> assert not np.all(a==b)

        References
        ----------
        .. [1] R. J. Hyndman and Y. Fan,
           "Sample quantiles in statistical packages,"
           The American Statistician, 50(4), pp. 361-365, 1996

    nanprod(a, axis=None, dtype=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Return the product of array elements over a given axis treating Not a
        Numbers (NaNs) as ones.

        One is returned for slices that are all-NaN or empty.

        .. versionadded:: 1.10.0

        Parameters
        ----------
        a : array_like
            Array containing numbers whose product is desired. If `a` is not an
            array, a conversion is attempted.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the product is computed. The default is to compute
            the product of the flattened array.
        dtype : data-type, optional
            The type of the returned array and of the accumulator in which the
            elements are summed.  By default, the dtype of `a` is used.  An
            exception is when `a` has an integer type with less precision than
            the platform (u)intp. In that case, the default will be either
            (u)int32 or (u)int64 depending on whether the platform is 32 or 64
            bits. For inexact inputs, dtype must be inexact.
        out : ndarray, optional
            Alternate output array in which to place the result.  The default
            is ``None``. If provided, it must have the same shape as the
            expected output, but the type will be cast if necessary. See
            :ref:`ufuncs-output-type` for more details. The casting of NaN to integer
            can yield unexpected results.
        keepdims : bool, optional
            If True, the axes which are reduced are left in the result as
            dimensions with size one. With this option, the result will
            broadcast correctly against the original `arr`.
        initial : scalar, optional
            The starting value for this product. See `~numpy.ufunc.reduce`
            for details.

            .. versionadded:: 1.22.0
        where : array_like of bool, optional
            Elements to include in the product. See `~numpy.ufunc.reduce`
            for details.

            .. versionadded:: 1.22.0

        Returns
        -------
        nanprod : ndarray
            A new array holding the result is returned unless `out` is
            specified, in which case it is returned.

        See Also
        --------
        numpy.prod : Product across array propagating NaNs.
        isnan : Show which elements are NaN.

        Examples
        --------
        >>> import numpy as np
        >>> np.nanprod(1)
        1
        >>> np.nanprod([1])
        1
        >>> np.nanprod([1, np.nan])
        1.0
        >>> a = np.array([[1, 2], [3, np.nan]])
        >>> np.nanprod(a)
        6.0
        >>> np.nanprod(a, axis=0)
        array([3., 2.])

    nanquantile(a, q, axis=None, out=None, overwrite_input=False, method='linear', keepdims=<no value>, *, weights=None, interpolation=None)
        Compute the qth quantile of the data along the specified axis,
        while ignoring nan values.
        Returns the qth quantile(s) of the array elements.

        .. versionadded:: 1.15.0

        Parameters
        ----------
        a : array_like
            Input array or object that can be converted to an array, containing
            nan values to be ignored
        q : array_like of float
            Probability or sequence of probabilities for the quantiles to compute.
            Values must be between 0 and 1 inclusive.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the quantiles are computed. The
            default is to compute the quantile(s) along a flattened
            version of the array.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output,
            but the type (of the output) will be cast if necessary.
        overwrite_input : bool, optional
            If True, then allow the input array `a` to be modified by intermediate
            calculations, to save memory. In this case, the contents of the input
            `a` after this function completes is undefined.
        method : str, optional
            This parameter specifies the method to use for estimating the
            quantile.  There are many different methods, some unique to NumPy.
            See the notes for explanation.  The options sorted by their R type
            as summarized in the H&F paper [1]_ are:

            1. 'inverted_cdf'
            2. 'averaged_inverted_cdf'
            3. 'closest_observation'
            4. 'interpolated_inverted_cdf'
            5. 'hazen'
            6. 'weibull'
            7. 'linear'  (default)
            8. 'median_unbiased'
            9. 'normal_unbiased'

            The first three methods are discontinuous.  NumPy further defines the
            following discontinuous variations of the default 'linear' (7.) option:

            * 'lower'
            * 'higher',
            * 'midpoint'
            * 'nearest'

            .. versionchanged:: 1.22.0
                This argument was previously called "interpolation" and only
                offered the "linear" default and last four options.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left in
            the result as dimensions with size one. With this option, the
            result will broadcast correctly against the original array `a`.

            If this is anything but the default value it will be passed
            through (in the special case of an empty array) to the
            `mean` function of the underlying array.  If the array is
            a sub-class and `mean` does not have the kwarg `keepdims` this
            will raise a RuntimeError.

        weights : array_like, optional
            An array of weights associated with the values in `a`. Each value in
            `a` contributes to the quantile according to its associated weight.
            The weights array can either be 1-D (in which case its length must be
            the size of `a` along the given axis) or of the same shape as `a`.
            If `weights=None`, then all data in `a` are assumed to have a
            weight equal to one.
            Only `method="inverted_cdf"` supports weights.

            .. versionadded:: 2.0.0

        interpolation : str, optional
            Deprecated name for the method keyword argument.

            .. deprecated:: 1.22.0

        Returns
        -------
        quantile : scalar or ndarray
            If `q` is a single probability and `axis=None`, then the result
            is a scalar. If multiple probability levels are given, first axis of
            the result corresponds to the quantiles. The other axes are
            the axes that remain after the reduction of `a`. If the input
            contains integers or floats smaller than ``float64``, the output
            data-type is ``float64``. Otherwise, the output data-type is the
            same as that of the input. If `out` is specified, that array is
            returned instead.

        See Also
        --------
        quantile
        nanmean, nanmedian
        nanmedian : equivalent to ``nanquantile(..., 0.5)``
        nanpercentile : same as nanquantile, but with q in the range [0, 100].

        Notes
        -----
        The behavior of `numpy.nanquantile` is the same as that of
        `numpy.quantile` (ignoring nan values).
        For more information, please see `numpy.quantile`.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[10., 7., 4.], [3., 2., 1.]])
        >>> a[0][1] = np.nan
        >>> a
        array([[10.,  nan,   4.],
              [ 3.,   2.,   1.]])
        >>> np.quantile(a, 0.5)
        np.float64(nan)
        >>> np.nanquantile(a, 0.5)
        3.0
        >>> np.nanquantile(a, 0.5, axis=0)
        array([6.5, 2. , 2.5])
        >>> np.nanquantile(a, 0.5, axis=1, keepdims=True)
        array([[7.],
               [2.]])
        >>> m = np.nanquantile(a, 0.5, axis=0)
        >>> out = np.zeros_like(m)
        >>> np.nanquantile(a, 0.5, axis=0, out=out)
        array([6.5, 2. , 2.5])
        >>> m
        array([6.5,  2. ,  2.5])
        >>> b = a.copy()
        >>> np.nanquantile(b, 0.5, axis=1, overwrite_input=True)
        array([7., 2.])
        >>> assert not np.all(a==b)

        References
        ----------
        .. [1] R. J. Hyndman and Y. Fan,
           "Sample quantiles in statistical packages,"
           The American Statistician, 50(4), pp. 361-365, 1996

    nanstd(a, axis=None, dtype=None, out=None, ddof=0, keepdims=<no value>, *, where=<no value>, mean=<no value>, correction=<no value>)
        Compute the standard deviation along the specified axis, while
        ignoring NaNs.

        Returns the standard deviation, a measure of the spread of a
        distribution, of the non-NaN array elements. The standard deviation is
        computed for the flattened array by default, otherwise over the
        specified axis.

        For all-NaN slices or slices with zero degrees of freedom, NaN is
        returned and a `RuntimeWarning` is raised.

        .. versionadded:: 1.8.0

        Parameters
        ----------
        a : array_like
            Calculate the standard deviation of the non-NaN values.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the standard deviation is computed. The default is
            to compute the standard deviation of the flattened array.
        dtype : dtype, optional
            Type to use in computing the standard deviation. For arrays of
            integer type the default is float64, for arrays of float types it
            is the same as the array type.
        out : ndarray, optional
            Alternative output array in which to place the result. It must have
            the same shape as the expected output but the type (of the
            calculated values) will be cast if necessary.
        ddof : {int, float}, optional
            Means Delta Degrees of Freedom.  The divisor used in calculations
            is ``N - ddof``, where ``N`` represents the number of non-NaN
            elements.  By default `ddof` is zero.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the original `a`.

            If this value is anything but the default it is passed through
            as-is to the relevant functions of the sub-classes.  If these
            functions do not have a `keepdims` kwarg, a RuntimeError will
            be raised.
        where : array_like of bool, optional
            Elements to include in the standard deviation.
            See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.22.0

        mean : array_like, optional
            Provide the mean to prevent its recalculation. The mean should have
            a shape as if it was calculated with ``keepdims=True``.
            The axis for the calculation of the mean should be the same as used in
            the call to this std function.

            .. versionadded:: 1.26.0

        correction : {int, float}, optional
            Array API compatible name for the ``ddof`` parameter. Only one of them
            can be provided at the same time.

            .. versionadded:: 2.0.0

        Returns
        -------
        standard_deviation : ndarray, see dtype parameter above.
            If `out` is None, return a new array containing the standard
            deviation, otherwise return a reference to the output array. If
            ddof is >= the number of non-NaN elements in a slice or the slice
            contains only NaNs, then the result for that slice is NaN.

        See Also
        --------
        var, mean, std
        nanvar, nanmean
        :ref:`ufuncs-output-type`

        Notes
        -----
        The standard deviation is the square root of the average of the squared
        deviations from the mean: ``std = sqrt(mean(abs(x - x.mean())**2))``.

        The average squared deviation is normally calculated as
        ``x.sum() / N``, where ``N = len(x)``.  If, however, `ddof` is
        specified, the divisor ``N - ddof`` is used instead. In standard
        statistical practice, ``ddof=1`` provides an unbiased estimator of the
        variance of the infinite population. ``ddof=0`` provides a maximum
        likelihood estimate of the variance for normally distributed variables.
        The standard deviation computed in this function is the square root of
        the estimated variance, so even with ``ddof=1``, it will not be an
        unbiased estimate of the standard deviation per se.

        Note that, for complex numbers, `std` takes the absolute value before
        squaring, so that the result is always real and nonnegative.

        For floating-point input, the *std* is computed using the same
        precision the input has. Depending on the input data, this can cause
        the results to be inaccurate, especially for float32 (see example
        below).  Specifying a higher-accuracy accumulator using the `dtype`
        keyword can alleviate this issue.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, np.nan], [3, 4]])
        >>> np.nanstd(a)
        1.247219128924647
        >>> np.nanstd(a, axis=0)
        array([1., 0.])
        >>> np.nanstd(a, axis=1)
        array([0.,  0.5]) # may vary

    nansum(a, axis=None, dtype=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Return the sum of array elements over a given axis treating Not a
        Numbers (NaNs) as zero.

        In NumPy versions <= 1.9.0 Nan is returned for slices that are all-NaN or
        empty. In later versions zero is returned.

        Parameters
        ----------
        a : array_like
            Array containing numbers whose sum is desired. If `a` is not an
            array, a conversion is attempted.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the sum is computed. The default is to compute the
            sum of the flattened array.
        dtype : data-type, optional
            The type of the returned array and of the accumulator in which the
            elements are summed.  By default, the dtype of `a` is used.  An
            exception is when `a` has an integer type with less precision than
            the platform (u)intp. In that case, the default will be either
            (u)int32 or (u)int64 depending on whether the platform is 32 or 64
            bits. For inexact inputs, dtype must be inexact.

            .. versionadded:: 1.8.0
        out : ndarray, optional
            Alternate output array in which to place the result.  The default
            is ``None``. If provided, it must have the same shape as the
            expected output, but the type will be cast if necessary.  See
            :ref:`ufuncs-output-type` for more details. The casting of NaN to integer
            can yield unexpected results.

            .. versionadded:: 1.8.0
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the original `a`.


            If the value is anything but the default, then
            `keepdims` will be passed through to the `mean` or `sum` methods
            of sub-classes of `ndarray`.  If the sub-classes methods
            does not implement `keepdims` any exceptions will be raised.

            .. versionadded:: 1.8.0
        initial : scalar, optional
            Starting value for the sum. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.22.0
        where : array_like of bool, optional
            Elements to include in the sum. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.22.0

        Returns
        -------
        nansum : ndarray.
            A new array holding the result is returned unless `out` is
            specified, in which it is returned. The result has the same
            size as `a`, and the same shape as `a` if `axis` is not None
            or `a` is a 1-d array.

        See Also
        --------
        numpy.sum : Sum across array propagating NaNs.
        isnan : Show which elements are NaN.
        isfinite : Show which elements are not NaN or +/-inf.

        Notes
        -----
        If both positive and negative infinity are present, the sum will be Not
        A Number (NaN).

        Examples
        --------
        >>> import numpy as np
        >>> np.nansum(1)
        1
        >>> np.nansum([1])
        1
        >>> np.nansum([1, np.nan])
        1.0
        >>> a = np.array([[1, 1], [1, np.nan]])
        >>> np.nansum(a)
        3.0
        >>> np.nansum(a, axis=0)
        array([2.,  1.])
        >>> np.nansum([1, np.nan, np.inf])
        inf
        >>> np.nansum([1, np.nan, -np.inf])
        -inf
        >>> from numpy.testing import suppress_warnings
        >>> with np.errstate(invalid="ignore"):
        ...     np.nansum([1, np.nan, np.inf, -np.inf]) # both +/- infinity present
        np.float64(nan)

    nanvar(a, axis=None, dtype=None, out=None, ddof=0, keepdims=<no value>, *, where=<no value>, mean=<no value>, correction=<no value>)
        Compute the variance along the specified axis, while ignoring NaNs.

        Returns the variance of the array elements, a measure of the spread of
        a distribution.  The variance is computed for the flattened array by
        default, otherwise over the specified axis.

        For all-NaN slices or slices with zero degrees of freedom, NaN is
        returned and a `RuntimeWarning` is raised.

        .. versionadded:: 1.8.0

        Parameters
        ----------
        a : array_like
            Array containing numbers whose variance is desired.  If `a` is not an
            array, a conversion is attempted.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the variance is computed.  The default is to compute
            the variance of the flattened array.
        dtype : data-type, optional
            Type to use in computing the variance.  For arrays of integer type
            the default is `float64`; for arrays of float types it is the same as
            the array type.
        out : ndarray, optional
            Alternate output array in which to place the result.  It must have
            the same shape as the expected output, but the type is cast if
            necessary.
        ddof : {int, float}, optional
            "Delta Degrees of Freedom": the divisor used in the calculation is
            ``N - ddof``, where ``N`` represents the number of non-NaN
            elements. By default `ddof` is zero.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the original `a`.
        where : array_like of bool, optional
            Elements to include in the variance. See `~numpy.ufunc.reduce` for
            details.

            .. versionadded:: 1.22.0

        mean : array_like, optional
            Provide the mean to prevent its recalculation. The mean should have
            a shape as if it was calculated with ``keepdims=True``.
            The axis for the calculation of the mean should be the same as used in
            the call to this var function.

            .. versionadded:: 1.26.0

        correction : {int, float}, optional
            Array API compatible name for the ``ddof`` parameter. Only one of them
            can be provided at the same time.

            .. versionadded:: 2.0.0

        Returns
        -------
        variance : ndarray, see dtype parameter above
            If `out` is None, return a new array containing the variance,
            otherwise return a reference to the output array. If ddof is >= the
            number of non-NaN elements in a slice or the slice contains only
            NaNs, then the result for that slice is NaN.

        See Also
        --------
        std : Standard deviation
        mean : Average
        var : Variance while not ignoring NaNs
        nanstd, nanmean
        :ref:`ufuncs-output-type`

        Notes
        -----
        The variance is the average of the squared deviations from the mean,
        i.e.,  ``var = mean(abs(x - x.mean())**2)``.

        The mean is normally calculated as ``x.sum() / N``, where ``N = len(x)``.
        If, however, `ddof` is specified, the divisor ``N - ddof`` is used
        instead.  In standard statistical practice, ``ddof=1`` provides an
        unbiased estimator of the variance of a hypothetical infinite
        population.  ``ddof=0`` provides a maximum likelihood estimate of the
        variance for normally distributed variables.

        Note that for complex numbers, the absolute value is taken before
        squaring, so that the result is always real and nonnegative.

        For floating-point input, the variance is computed using the same
        precision the input has.  Depending on the input data, this can cause
        the results to be inaccurate, especially for `float32` (see example
        below).  Specifying a higher-accuracy accumulator using the ``dtype``
        keyword can alleviate this issue.

        For this function to work on sub-classes of ndarray, they must define
        `sum` with the kwarg `keepdims`

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, np.nan], [3, 4]])
        >>> np.nanvar(a)
        1.5555555555555554
        >>> np.nanvar(a, axis=0)
        array([1.,  0.])
        >>> np.nanvar(a, axis=1)
        array([0.,  0.25])  # may vary

    ndim(a)
        Return the number of dimensions of an array.

        Parameters
        ----------
        a : array_like
            Input array.  If it is not already an ndarray, a conversion is
            attempted.

        Returns
        -------
        number_of_dimensions : int
            The number of dimensions in `a`.  Scalars are zero-dimensional.

        See Also
        --------
        ndarray.ndim : equivalent method
        shape : dimensions of array
        ndarray.shape : dimensions of array

        Examples
        --------
        >>> import numpy as np
        >>> np.ndim([[1,2,3],[4,5,6]])
        2
        >>> np.ndim(np.array([[1,2,3],[4,5,6]]))
        2
        >>> np.ndim(1)
        0

    nested_iters(...)
        nested_iters(op, axes, flags=None, op_flags=None, op_dtypes=None,     order="K", casting="safe", buffersize=0)

        Create nditers for use in nested loops

        Create a tuple of `nditer` objects which iterate in nested loops over
        different axes of the op argument. The first iterator is used in the
        outermost loop, the last in the innermost loop. Advancing one will change
        the subsequent iterators to point at its new element.

        Parameters
        ----------
        op : ndarray or sequence of array_like
            The array(s) to iterate over.

        axes : list of list of int
            Each item is used as an "op_axes" argument to an nditer

        flags, op_flags, op_dtypes, order, casting, buffersize (optional)
            See `nditer` parameters of the same name

        Returns
        -------
        iters : tuple of nditer
            An nditer for each item in `axes`, outermost first

        See Also
        --------
        nditer

        Examples
        --------

        Basic usage. Note how y is the "flattened" version of
        [a[:, 0, :], a[:, 1, 0], a[:, 2, :]] since we specified
        the first iter's axes as [1]

        >>> import numpy as np
        >>> a = np.arange(12).reshape(2, 3, 2)
        >>> i, j = np.nested_iters(a, [[1], [0, 2]], flags=["multi_index"])
        >>> for x in i:
        ...      print(i.multi_index)
        ...      for y in j:
        ...          print('', j.multi_index, y)
        (0,)
         (0, 0) 0
         (0, 1) 1
         (1, 0) 6
         (1, 1) 7
        (1,)
         (0, 0) 2
         (0, 1) 3
         (1, 0) 8
         (1, 1) 9
        (2,)
         (0, 0) 4
         (0, 1) 5
         (1, 0) 10
         (1, 1) 11

    nonzero(a)
        Return the indices of the elements that are non-zero.

        Returns a tuple of arrays, one for each dimension of `a`,
        containing the indices of the non-zero elements in that
        dimension. The values in `a` are always tested and returned in
        row-major, C-style order.

        To group the indices by element, rather than dimension, use `argwhere`,
        which returns a row for each non-zero element.

        .. note::

           When called on a zero-d array or scalar, ``nonzero(a)`` is treated
           as ``nonzero(atleast_1d(a))``.

           .. deprecated:: 1.17.0

              Use `atleast_1d` explicitly if this behavior is deliberate.

        Parameters
        ----------
        a : array_like
            Input array.

        Returns
        -------
        tuple_of_arrays : tuple
            Indices of elements that are non-zero.

        See Also
        --------
        flatnonzero :
            Return indices that are non-zero in the flattened version of the input
            array.
        ndarray.nonzero :
            Equivalent ndarray method.
        count_nonzero :
            Counts the number of non-zero elements in the input array.

        Notes
        -----
        While the nonzero values can be obtained with ``a[nonzero(a)]``, it is
        recommended to use ``x[x.astype(bool)]`` or ``x[x != 0]`` instead, which
        will correctly handle 0-d arrays.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([[3, 0, 0], [0, 4, 0], [5, 6, 0]])
        >>> x
        array([[3, 0, 0],
               [0, 4, 0],
               [5, 6, 0]])
        >>> np.nonzero(x)
        (array([0, 1, 2, 2]), array([0, 1, 0, 1]))

        >>> x[np.nonzero(x)]
        array([3, 4, 5, 6])
        >>> np.transpose(np.nonzero(x))
        array([[0, 0],
               [1, 1],
               [2, 0],
               [2, 1]])

        A common use for ``nonzero`` is to find the indices of an array, where
        a condition is True.  Given an array `a`, the condition `a` > 3 is a
        boolean array and since False is interpreted as 0, np.nonzero(a > 3)
        yields the indices of the `a` where the condition is true.

        >>> a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
        >>> a > 3
        array([[False, False, False],
               [ True,  True,  True],
               [ True,  True,  True]])
        >>> np.nonzero(a > 3)
        (array([1, 1, 1, 2, 2, 2]), array([0, 1, 2, 0, 1, 2]))

        Using this result to index `a` is equivalent to using the mask directly:

        >>> a[np.nonzero(a > 3)]
        array([4, 5, 6, 7, 8, 9])
        >>> a[a > 3]  # prefer this spelling
        array([4, 5, 6, 7, 8, 9])

        ``nonzero`` can also be called as a method of the array.

        >>> (a > 3).nonzero()
        (array([1, 1, 1, 2, 2, 2]), array([0, 1, 2, 0, 1, 2]))

    ones(shape, dtype=None, order='C', *, device=None, like=None)
        Return a new array of given shape and type, filled with ones.

        Parameters
        ----------
        shape : int or sequence of ints
            Shape of the new array, e.g., ``(2, 3)`` or ``2``.
        dtype : data-type, optional
            The desired data-type for the array, e.g., `numpy.int8`.  Default is
            `numpy.float64`.
        order : {'C', 'F'}, optional, default: C
            Whether to store multi-dimensional data in row-major
            (C-style) or column-major (Fortran-style) order in
            memory.
        device : str, optional
            The device on which to place the created array. Default: None.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            Array of ones with the given shape, dtype, and order.

        See Also
        --------
        ones_like : Return an array of ones with shape and type of input.
        empty : Return a new uninitialized array.
        zeros : Return a new array setting values to zero.
        full : Return a new array of given shape filled with value.

        Examples
        --------
        >>> import numpy as np
        >>> np.ones(5)
        array([1., 1., 1., 1., 1.])

        >>> np.ones((5,), dtype=int)
        array([1, 1, 1, 1, 1])

        >>> np.ones((2, 1))
        array([[1.],
               [1.]])

        >>> s = (2,2)
        >>> np.ones(s)
        array([[1.,  1.],
               [1.,  1.]])

    ones_like(a, dtype=None, order='K', subok=True, shape=None, *, device=None)
        Return an array of ones with the same shape and type as a given array.

        Parameters
        ----------
        a : array_like
            The shape and data-type of `a` define these same attributes of
            the returned array.
        dtype : data-type, optional
            Overrides the data type of the result.

            .. versionadded:: 1.6.0
        order : {'C', 'F', 'A', or 'K'}, optional
            Overrides the memory layout of the result. 'C' means C-order,
            'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
            'C' otherwise. 'K' means match the layout of `a` as closely
            as possible.

            .. versionadded:: 1.6.0
        subok : bool, optional.
            If True, then the newly created array will use the sub-class
            type of `a`, otherwise it will be a base-class array. Defaults
            to True.
        shape : int or sequence of ints, optional.
            Overrides the shape of the result. If order='K' and the number of
            dimensions is unchanged, will try to keep order, otherwise,
            order='C' is implied.

            .. versionadded:: 1.17.0
        device : str, optional
            The device on which to place the created array. Default: None.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0

        Returns
        -------
        out : ndarray
            Array of ones with the same shape and type as `a`.

        See Also
        --------
        empty_like : Return an empty array with shape and type of input.
        zeros_like : Return an array of zeros with shape and type of input.
        full_like : Return a new array with shape of input filled with value.
        ones : Return a new array setting values to one.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(6)
        >>> x = x.reshape((2, 3))
        >>> x
        array([[0, 1, 2],
               [3, 4, 5]])
        >>> np.ones_like(x)
        array([[1, 1, 1],
               [1, 1, 1]])

        >>> y = np.arange(3, dtype=float)
        >>> y
        array([0., 1., 2.])
        >>> np.ones_like(y)
        array([1.,  1.,  1.])

    outer(a, b, out=None)
        Compute the outer product of two vectors.

        Given two vectors `a` and `b` of length ``M`` and ``N``, respectively,
        the outer product [1]_ is::

          [[a_0*b_0  a_0*b_1 ... a_0*b_{N-1} ]
           [a_1*b_0    .
           [ ...          .
           [a_{M-1}*b_0            a_{M-1}*b_{N-1} ]]

        Parameters
        ----------
        a : (M,) array_like
            First input vector.  Input is flattened if
            not already 1-dimensional.
        b : (N,) array_like
            Second input vector.  Input is flattened if
            not already 1-dimensional.
        out : (M, N) ndarray, optional
            A location where the result is stored

            .. versionadded:: 1.9.0

        Returns
        -------
        out : (M, N) ndarray
            ``out[i, j] = a[i] * b[j]``

        See also
        --------
        inner
        einsum : ``einsum('i,j->ij', a.ravel(), b.ravel())`` is the equivalent.
        ufunc.outer : A generalization to dimensions other than 1D and other
                      operations. ``np.multiply.outer(a.ravel(), b.ravel())``
                      is the equivalent.
        linalg.outer : An Array API compatible variation of ``np.outer``,
                       which accepts 1-dimensional inputs only.
        tensordot : ``np.tensordot(a.ravel(), b.ravel(), axes=((), ()))``
                    is the equivalent.

        References
        ----------
        .. [1] G. H. Golub and C. F. Van Loan, *Matrix Computations*, 3rd
               ed., Baltimore, MD, Johns Hopkins University Press, 1996,
               pg. 8.

        Examples
        --------
        Make a (*very* coarse) grid for computing a Mandelbrot set:

        >>> import numpy as np
        >>> rl = np.outer(np.ones((5,)), np.linspace(-2, 2, 5))
        >>> rl
        array([[-2., -1.,  0.,  1.,  2.],
               [-2., -1.,  0.,  1.,  2.],
               [-2., -1.,  0.,  1.,  2.],
               [-2., -1.,  0.,  1.,  2.],
               [-2., -1.,  0.,  1.,  2.]])
        >>> im = np.outer(1j*np.linspace(2, -2, 5), np.ones((5,)))
        >>> im
        array([[0.+2.j, 0.+2.j, 0.+2.j, 0.+2.j, 0.+2.j],
               [0.+1.j, 0.+1.j, 0.+1.j, 0.+1.j, 0.+1.j],
               [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
               [0.-1.j, 0.-1.j, 0.-1.j, 0.-1.j, 0.-1.j],
               [0.-2.j, 0.-2.j, 0.-2.j, 0.-2.j, 0.-2.j]])
        >>> grid = rl + im
        >>> grid
        array([[-2.+2.j, -1.+2.j,  0.+2.j,  1.+2.j,  2.+2.j],
               [-2.+1.j, -1.+1.j,  0.+1.j,  1.+1.j,  2.+1.j],
               [-2.+0.j, -1.+0.j,  0.+0.j,  1.+0.j,  2.+0.j],
               [-2.-1.j, -1.-1.j,  0.-1.j,  1.-1.j,  2.-1.j],
               [-2.-2.j, -1.-2.j,  0.-2.j,  1.-2.j,  2.-2.j]])

        An example using a "vector" of letters:

        >>> x = np.array(['a', 'b', 'c'], dtype=object)
        >>> np.outer(x, [1, 2, 3])
        array([['a', 'aa', 'aaa'],
               ['b', 'bb', 'bbb'],
               ['c', 'cc', 'ccc']], dtype=object)

    packbits(...)
        packbits(a, /, axis=None, bitorder='big')

        Packs the elements of a binary-valued array into bits in a uint8 array.

        The result is padded to full bytes by inserting zero bits at the end.

        Parameters
        ----------
        a : array_like
            An array of integers or booleans whose elements should be packed to
            bits.
        axis : int, optional
            The dimension over which bit-packing is done.
            ``None`` implies packing the flattened array.
        bitorder : {'big', 'little'}, optional
            The order of the input bits. 'big' will mimic bin(val),
            ``[0, 0, 0, 0, 0, 0, 1, 1] => 3 = 0b00000011``, 'little' will
            reverse the order so ``[1, 1, 0, 0, 0, 0, 0, 0] => 3``.
            Defaults to 'big'.

            .. versionadded:: 1.17.0

        Returns
        -------
        packed : ndarray
            Array of type uint8 whose elements represent bits corresponding to the
            logical (0 or nonzero) value of the input elements. The shape of
            `packed` has the same number of dimensions as the input (unless `axis`
            is None, in which case the output is 1-D).

        See Also
        --------
        unpackbits: Unpacks elements of a uint8 array into a binary-valued output
                    array.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[[1,0,1],
        ...                [0,1,0]],
        ...               [[1,1,0],
        ...                [0,0,1]]])
        >>> b = np.packbits(a, axis=-1)
        >>> b
        array([[[160],
                [ 64]],
               [[192],
                [ 32]]], dtype=uint8)

        Note that in binary 160 = 1010 0000, 64 = 0100 0000, 192 = 1100 0000,
        and 32 = 0010 0000.

    pad(array, pad_width, mode='constant', **kwargs)
        Pad an array.

        Parameters
        ----------
        array : array_like of rank N
            The array to pad.
        pad_width : {sequence, array_like, int}
            Number of values padded to the edges of each axis.
            ``((before_1, after_1), ... (before_N, after_N))`` unique pad widths
            for each axis.
            ``(before, after)`` or ``((before, after),)`` yields same before
            and after pad for each axis.
            ``(pad,)`` or ``int`` is a shortcut for before = after = pad width
            for all axes.
        mode : str or function, optional
            One of the following string values or a user supplied function.

            'constant' (default)
                Pads with a constant value.
            'edge'
                Pads with the edge values of array.
            'linear_ramp'
                Pads with the linear ramp between end_value and the
                array edge value.
            'maximum'
                Pads with the maximum value of all or part of the
                vector along each axis.
            'mean'
                Pads with the mean value of all or part of the
                vector along each axis.
            'median'
                Pads with the median value of all or part of the
                vector along each axis.
            'minimum'
                Pads with the minimum value of all or part of the
                vector along each axis.
            'reflect'
                Pads with the reflection of the vector mirrored on
                the first and last values of the vector along each
                axis.
            'symmetric'
                Pads with the reflection of the vector mirrored
                along the edge of the array.
            'wrap'
                Pads with the wrap of the vector along the axis.
                The first values are used to pad the end and the
                end values are used to pad the beginning.
            'empty'
                Pads with undefined values.

                .. versionadded:: 1.17

            <function>
                Padding function, see Notes.
        stat_length : sequence or int, optional
            Used in 'maximum', 'mean', 'median', and 'minimum'.  Number of
            values at edge of each axis used to calculate the statistic value.

            ``((before_1, after_1), ... (before_N, after_N))`` unique statistic
            lengths for each axis.

            ``(before, after)`` or ``((before, after),)`` yields same before
            and after statistic lengths for each axis.

            ``(stat_length,)`` or ``int`` is a shortcut for
            ``before = after = statistic`` length for all axes.

            Default is ``None``, to use the entire axis.
        constant_values : sequence or scalar, optional
            Used in 'constant'.  The values to set the padded values for each
            axis.

            ``((before_1, after_1), ... (before_N, after_N))`` unique pad constants
            for each axis.

            ``(before, after)`` or ``((before, after),)`` yields same before
            and after constants for each axis.

            ``(constant,)`` or ``constant`` is a shortcut for
            ``before = after = constant`` for all axes.

            Default is 0.
        end_values : sequence or scalar, optional
            Used in 'linear_ramp'.  The values used for the ending value of the
            linear_ramp and that will form the edge of the padded array.

            ``((before_1, after_1), ... (before_N, after_N))`` unique end values
            for each axis.

            ``(before, after)`` or ``((before, after),)`` yields same before
            and after end values for each axis.

            ``(constant,)`` or ``constant`` is a shortcut for
            ``before = after = constant`` for all axes.

            Default is 0.
        reflect_type : {'even', 'odd'}, optional
            Used in 'reflect', and 'symmetric'.  The 'even' style is the
            default with an unaltered reflection around the edge value.  For
            the 'odd' style, the extended part of the array is created by
            subtracting the reflected values from two times the edge value.

        Returns
        -------
        pad : ndarray
            Padded array of rank equal to `array` with shape increased
            according to `pad_width`.

        Notes
        -----
        .. versionadded:: 1.7.0

        For an array with rank greater than 1, some of the padding of later
        axes is calculated from padding of previous axes.  This is easiest to
        think about with a rank 2 array where the corners of the padded array
        are calculated by using padded values from the first axis.

        The padding function, if used, should modify a rank 1 array in-place. It
        has the following signature::

            padding_func(vector, iaxis_pad_width, iaxis, kwargs)

        where

        vector : ndarray
            A rank 1 array already padded with zeros.  Padded values are
            vector[:iaxis_pad_width[0]] and vector[-iaxis_pad_width[1]:].
        iaxis_pad_width : tuple
            A 2-tuple of ints, iaxis_pad_width[0] represents the number of
            values padded at the beginning of vector where
            iaxis_pad_width[1] represents the number of values padded at
            the end of vector.
        iaxis : int
            The axis currently being calculated.
        kwargs : dict
            Any keyword arguments the function requires.

        Examples
        --------
        >>> import numpy as np
        >>> a = [1, 2, 3, 4, 5]
        >>> np.pad(a, (2, 3), 'constant', constant_values=(4, 6))
        array([4, 4, 1, ..., 6, 6, 6])

        >>> np.pad(a, (2, 3), 'edge')
        array([1, 1, 1, ..., 5, 5, 5])

        >>> np.pad(a, (2, 3), 'linear_ramp', end_values=(5, -4))
        array([ 5,  3,  1,  2,  3,  4,  5,  2, -1, -4])

        >>> np.pad(a, (2,), 'maximum')
        array([5, 5, 1, 2, 3, 4, 5, 5, 5])

        >>> np.pad(a, (2,), 'mean')
        array([3, 3, 1, 2, 3, 4, 5, 3, 3])

        >>> np.pad(a, (2,), 'median')
        array([3, 3, 1, 2, 3, 4, 5, 3, 3])

        >>> a = [[1, 2], [3, 4]]
        >>> np.pad(a, ((3, 2), (2, 3)), 'minimum')
        array([[1, 1, 1, 2, 1, 1, 1],
               [1, 1, 1, 2, 1, 1, 1],
               [1, 1, 1, 2, 1, 1, 1],
               [1, 1, 1, 2, 1, 1, 1],
               [3, 3, 3, 4, 3, 3, 3],
               [1, 1, 1, 2, 1, 1, 1],
               [1, 1, 1, 2, 1, 1, 1]])

        >>> a = [1, 2, 3, 4, 5]
        >>> np.pad(a, (2, 3), 'reflect')
        array([3, 2, 1, 2, 3, 4, 5, 4, 3, 2])

        >>> np.pad(a, (2, 3), 'reflect', reflect_type='odd')
        array([-1,  0,  1,  2,  3,  4,  5,  6,  7,  8])

        >>> np.pad(a, (2, 3), 'symmetric')
        array([2, 1, 1, 2, 3, 4, 5, 5, 4, 3])

        >>> np.pad(a, (2, 3), 'symmetric', reflect_type='odd')
        array([0, 1, 1, 2, 3, 4, 5, 5, 6, 7])

        >>> np.pad(a, (2, 3), 'wrap')
        array([4, 5, 1, 2, 3, 4, 5, 1, 2, 3])

        >>> def pad_with(vector, pad_width, iaxis, kwargs):
        ...     pad_value = kwargs.get('padder', 10)
        ...     vector[:pad_width[0]] = pad_value
        ...     vector[-pad_width[1]:] = pad_value
        >>> a = np.arange(6)
        >>> a = a.reshape((2, 3))
        >>> np.pad(a, 2, pad_with)
        array([[10, 10, 10, 10, 10, 10, 10],
               [10, 10, 10, 10, 10, 10, 10],
               [10, 10,  0,  1,  2, 10, 10],
               [10, 10,  3,  4,  5, 10, 10],
               [10, 10, 10, 10, 10, 10, 10],
               [10, 10, 10, 10, 10, 10, 10]])
        >>> np.pad(a, 2, pad_with, padder=100)
        array([[100, 100, 100, 100, 100, 100, 100],
               [100, 100, 100, 100, 100, 100, 100],
               [100, 100,   0,   1,   2, 100, 100],
               [100, 100,   3,   4,   5, 100, 100],
               [100, 100, 100, 100, 100, 100, 100],
               [100, 100, 100, 100, 100, 100, 100]])

    partition(a, kth, axis=-1, kind='introselect', order=None)
        Return a partitioned copy of an array.

        Creates a copy of the array and partially sorts it in such a way that
        the value of the element in k-th position is in the position it would be
        in a sorted array. In the output array, all elements smaller than the k-th
        element are located to the left of this element and all equal or greater
        are located to its right. The ordering of the elements in the two
        partitions on the either side of the k-th element in the output array is
        undefined.

        .. versionadded:: 1.8.0

        Parameters
        ----------
        a : array_like
            Array to be sorted.
        kth : int or sequence of ints
            Element index to partition by. The k-th value of the element
            will be in its final sorted position and all smaller elements
            will be moved before it and all equal or greater elements behind
            it. The order of all elements in the partitions is undefined. If
            provided with a sequence of k-th it will partition all elements
            indexed by k-th  of them into their sorted position at once.

            .. deprecated:: 1.22.0
                Passing booleans as index is deprecated.
        axis : int or None, optional
            Axis along which to sort. If None, the array is flattened before
            sorting. The default is -1, which sorts along the last axis.
        kind : {'introselect'}, optional
            Selection algorithm. Default is 'introselect'.
        order : str or list of str, optional
            When `a` is an array with fields defined, this argument
            specifies which fields to compare first, second, etc.  A single
            field can be specified as a string.  Not all fields need be
            specified, but unspecified fields will still be used, in the
            order in which they come up in the dtype, to break ties.

        Returns
        -------
        partitioned_array : ndarray
            Array of the same type and shape as `a`.

        See Also
        --------
        ndarray.partition : Method to sort an array in-place.
        argpartition : Indirect partition.
        sort : Full sorting

        Notes
        -----
        The various selection algorithms are characterized by their average
        speed, worst case performance, work space size, and whether they are
        stable. A stable sort keeps items with the same key in the same
        relative order. The available algorithms have the following
        properties:

        ================= ======= ============= ============ =======
           kind            speed   worst case    work space  stable
        ================= ======= ============= ============ =======
        'introselect'        1        O(n)           0         no
        ================= ======= ============= ============ =======

        All the partition algorithms make temporary copies of the data when
        partitioning along any but the last axis.  Consequently,
        partitioning along the last axis is faster and uses less space than
        partitioning along any other axis.

        The sort order for complex numbers is lexicographic. If both the
        real and imaginary parts are non-nan then the order is determined by
        the real parts except when they are equal, in which case the order
        is determined by the imaginary parts.

        The sort order of ``np.nan`` is bigger than ``np.inf``.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([7, 1, 7, 7, 1, 5, 7, 2, 3, 2, 6, 2, 3, 0])
        >>> p = np.partition(a, 4)
        >>> p
        array([0, 1, 2, 1, 2, 5, 2, 3, 3, 6, 7, 7, 7, 7]) # may vary

        ``p[4]`` is 2;  all elements in ``p[:4]`` are less than or equal
        to ``p[4]``, and all elements in ``p[5:]`` are greater than or
        equal to ``p[4]``.  The partition is::

            [0, 1, 2, 1], [2], [5, 2, 3, 3, 6, 7, 7, 7, 7]

        The next example shows the use of multiple values passed to `kth`.

        >>> p2 = np.partition(a, (4, 8))
        >>> p2
        array([0, 1, 2, 1, 2, 3, 3, 2, 5, 6, 7, 7, 7, 7])

        ``p2[4]`` is 2  and ``p2[8]`` is 5.  All elements in ``p2[:4]``
        are less than or equal to ``p2[4]``, all elements in ``p2[5:8]``
        are greater than or equal to ``p2[4]`` and less than or equal to
        ``p2[8]``, and all elements in ``p2[9:]`` are greater than or
        equal to ``p2[8]``.  The partition is::

            [0, 1, 2, 1], [2], [3, 3, 2], [5], [6, 7, 7, 7, 7]

    percentile(a, q, axis=None, out=None, overwrite_input=False, method='linear', keepdims=False, *, weights=None, interpolation=None)
        Compute the q-th percentile of the data along the specified axis.

        Returns the q-th percentile(s) of the array elements.

        Parameters
        ----------
        a : array_like of real numbers
            Input array or object that can be converted to an array.
        q : array_like of float
            Percentage or sequence of percentages for the percentiles to compute.
            Values must be between 0 and 100 inclusive.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the percentiles are computed. The
            default is to compute the percentile(s) along a flattened
            version of the array.

            .. versionchanged:: 1.9.0
                A tuple of axes is supported
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output,
            but the type (of the output) will be cast if necessary.
        overwrite_input : bool, optional
            If True, then allow the input array `a` to be modified by intermediate
            calculations, to save memory. In this case, the contents of the input
            `a` after this function completes is undefined.
        method : str, optional
            This parameter specifies the method to use for estimating the
            percentile.  There are many different methods, some unique to NumPy.
            See the notes for explanation.  The options sorted by their R type
            as summarized in the H&F paper [1]_ are:

            1. 'inverted_cdf'
            2. 'averaged_inverted_cdf'
            3. 'closest_observation'
            4. 'interpolated_inverted_cdf'
            5. 'hazen'
            6. 'weibull'
            7. 'linear'  (default)
            8. 'median_unbiased'
            9. 'normal_unbiased'

            The first three methods are discontinuous.  NumPy further defines the
            following discontinuous variations of the default 'linear' (7.) option:

            * 'lower'
            * 'higher',
            * 'midpoint'
            * 'nearest'

            .. versionchanged:: 1.22.0
                This argument was previously called "interpolation" and only
                offered the "linear" default and last four options.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left in
            the result as dimensions with size one. With this option, the
            result will broadcast correctly against the original array `a`.

            .. versionadded:: 1.9.0

         weights : array_like, optional
            An array of weights associated with the values in `a`. Each value in
            `a` contributes to the percentile according to its associated weight.
            The weights array can either be 1-D (in which case its length must be
            the size of `a` along the given axis) or of the same shape as `a`.
            If `weights=None`, then all data in `a` are assumed to have a
            weight equal to one.
            Only `method="inverted_cdf"` supports weights.
            See the notes for more details.

            .. versionadded:: 2.0.0

        interpolation : str, optional
            Deprecated name for the method keyword argument.

            .. deprecated:: 1.22.0

        Returns
        -------
        percentile : scalar or ndarray
            If `q` is a single percentile and `axis=None`, then the result
            is a scalar. If multiple percentiles are given, first axis of
            the result corresponds to the percentiles. The other axes are
            the axes that remain after the reduction of `a`. If the input
            contains integers or floats smaller than ``float64``, the output
            data-type is ``float64``. Otherwise, the output data-type is the
            same as that of the input. If `out` is specified, that array is
            returned instead.

        See Also
        --------
        mean
        median : equivalent to ``percentile(..., 50)``
        nanpercentile
        quantile : equivalent to percentile, except q in the range [0, 1].

        Notes
        -----
        The behavior of `numpy.percentile` with percentage `q` is
        that of `numpy.quantile` with argument ``q/100``.
        For more information, please see `numpy.quantile`.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[10, 7, 4], [3, 2, 1]])
        >>> a
        array([[10,  7,  4],
               [ 3,  2,  1]])
        >>> np.percentile(a, 50)
        3.5
        >>> np.percentile(a, 50, axis=0)
        array([6.5, 4.5, 2.5])
        >>> np.percentile(a, 50, axis=1)
        array([7.,  2.])
        >>> np.percentile(a, 50, axis=1, keepdims=True)
        array([[7.],
               [2.]])

        >>> m = np.percentile(a, 50, axis=0)
        >>> out = np.zeros_like(m)
        >>> np.percentile(a, 50, axis=0, out=out)
        array([6.5, 4.5, 2.5])
        >>> m
        array([6.5, 4.5, 2.5])

        >>> b = a.copy()
        >>> np.percentile(b, 50, axis=1, overwrite_input=True)
        array([7.,  2.])
        >>> assert not np.all(a == b)

        The different methods can be visualized graphically:

        .. plot::

            import matplotlib.pyplot as plt

            a = np.arange(4)
            p = np.linspace(0, 100, 6001)
            ax = plt.gca()
            lines = [
                ('linear', '-', 'C0'),
                ('inverted_cdf', ':', 'C1'),
                # Almost the same as `inverted_cdf`:
                ('averaged_inverted_cdf', '-.', 'C1'),
                ('closest_observation', ':', 'C2'),
                ('interpolated_inverted_cdf', '--', 'C1'),
                ('hazen', '--', 'C3'),
                ('weibull', '-.', 'C4'),
                ('median_unbiased', '--', 'C5'),
                ('normal_unbiased', '-.', 'C6'),
                ]
            for method, style, color in lines:
                ax.plot(
                    p, np.percentile(a, p, method=method),
                    label=method, linestyle=style, color=color)
            ax.set(
                title='Percentiles for different methods and data: ' + str(a),
                xlabel='Percentile',
                ylabel='Estimated percentile value',
                yticks=a)
            ax.legend(bbox_to_anchor=(1.03, 1))
            plt.tight_layout()
            plt.show()

        References
        ----------
        .. [1] R. J. Hyndman and Y. Fan,
           "Sample quantiles in statistical packages,"
           The American Statistician, 50(4), pp. 361-365, 1996

    permute_dims = transpose(a, axes=None)
        Returns an array with axes transposed.

        For a 1-D array, this returns an unchanged view of the original array, as a
        transposed vector is simply the same vector.
        To convert a 1-D array into a 2-D column vector, an additional dimension
        must be added, e.g., ``np.atleast_2d(a).T`` achieves this, as does
        ``a[:, np.newaxis]``.
        For a 2-D array, this is the standard matrix transpose.
        For an n-D array, if axes are given, their order indicates how the
        axes are permuted (see Examples). If axes are not provided, then
        ``transpose(a).shape == a.shape[::-1]``.

        Parameters
        ----------
        a : array_like
            Input array.
        axes : tuple or list of ints, optional
            If specified, it must be a tuple or list which contains a permutation
            of [0,1,...,N-1] where N is the number of axes of `a`. The `i`'th axis
            of the returned array will correspond to the axis numbered ``axes[i]``
            of the input. If not specified, defaults to ``range(a.ndim)[::-1]``,
            which reverses the order of the axes.

        Returns
        -------
        p : ndarray
            `a` with its axes permuted. A view is returned whenever possible.

        See Also
        --------
        ndarray.transpose : Equivalent method.
        moveaxis : Move axes of an array to new positions.
        argsort : Return the indices that would sort an array.

        Notes
        -----
        Use ``transpose(a, argsort(axes))`` to invert the transposition of tensors
        when using the `axes` keyword argument.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, 4]])
        >>> a
        array([[1, 2],
               [3, 4]])
        >>> np.transpose(a)
        array([[1, 3],
               [2, 4]])

        >>> a = np.array([1, 2, 3, 4])
        >>> a
        array([1, 2, 3, 4])
        >>> np.transpose(a)
        array([1, 2, 3, 4])

        >>> a = np.ones((1, 2, 3))
        >>> np.transpose(a, (1, 0, 2)).shape
        (2, 1, 3)

        >>> a = np.ones((2, 3, 4, 5))
        >>> np.transpose(a).shape
        (5, 4, 3, 2)

    piecewise(x, condlist, funclist, *args, **kw)
        Evaluate a piecewise-defined function.

        Given a set of conditions and corresponding functions, evaluate each
        function on the input data wherever its condition is true.

        Parameters
        ----------
        x : ndarray or scalar
            The input domain.
        condlist : list of bool arrays or bool scalars
            Each boolean array corresponds to a function in `funclist`.  Wherever
            `condlist[i]` is True, `funclist[i](x)` is used as the output value.

            Each boolean array in `condlist` selects a piece of `x`,
            and should therefore be of the same shape as `x`.

            The length of `condlist` must correspond to that of `funclist`.
            If one extra function is given, i.e. if
            ``len(funclist) == len(condlist) + 1``, then that extra function
            is the default value, used wherever all conditions are false.
        funclist : list of callables, f(x,*args,**kw), or scalars
            Each function is evaluated over `x` wherever its corresponding
            condition is True.  It should take a 1d array as input and give an 1d
            array or a scalar value as output.  If, instead of a callable,
            a scalar is provided then a constant function (``lambda x: scalar``) is
            assumed.
        args : tuple, optional
            Any further arguments given to `piecewise` are passed to the functions
            upon execution, i.e., if called ``piecewise(..., ..., 1, 'a')``, then
            each function is called as ``f(x, 1, 'a')``.
        kw : dict, optional
            Keyword arguments used in calling `piecewise` are passed to the
            functions upon execution, i.e., if called
            ``piecewise(..., ..., alpha=1)``, then each function is called as
            ``f(x, alpha=1)``.

        Returns
        -------
        out : ndarray
            The output is the same shape and type as x and is found by
            calling the functions in `funclist` on the appropriate portions of `x`,
            as defined by the boolean arrays in `condlist`.  Portions not covered
            by any condition have a default value of 0.


        See Also
        --------
        choose, select, where

        Notes
        -----
        This is similar to choose or select, except that functions are
        evaluated on elements of `x` that satisfy the corresponding condition from
        `condlist`.

        The result is::

                |--
                |funclist[0](x[condlist[0]])
          out = |funclist[1](x[condlist[1]])
                |...
                |funclist[n2](x[condlist[n2]])
                |--

        Examples
        --------
        >>> import numpy as np

        Define the signum function, which is -1 for ``x < 0`` and +1 for ``x >= 0``.

        >>> x = np.linspace(-2.5, 2.5, 6)
        >>> np.piecewise(x, [x < 0, x >= 0], [-1, 1])
        array([-1., -1., -1.,  1.,  1.,  1.])

        Define the absolute value, which is ``-x`` for ``x <0`` and ``x`` for
        ``x >= 0``.

        >>> np.piecewise(x, [x < 0, x >= 0], [lambda x: -x, lambda x: x])
        array([2.5,  1.5,  0.5,  0.5,  1.5,  2.5])

        Apply the same function to a scalar value.

        >>> y = -2
        >>> np.piecewise(y, [y < 0, y >= 0], [lambda x: -x, lambda x: x])
        array(2)

    place(arr, mask, vals)
        Change elements of an array based on conditional and input values.

        Similar to ``np.copyto(arr, vals, where=mask)``, the difference is that
        `place` uses the first N elements of `vals`, where N is the number of
        True values in `mask`, while `copyto` uses the elements where `mask`
        is True.

        Note that `extract` does the exact opposite of `place`.

        Parameters
        ----------
        arr : ndarray
            Array to put data into.
        mask : array_like
            Boolean mask array. Must have the same size as `a`.
        vals : 1-D sequence
            Values to put into `a`. Only the first N elements are used, where
            N is the number of True values in `mask`. If `vals` is smaller
            than N, it will be repeated, and if elements of `a` are to be masked,
            this sequence must be non-empty.

        See Also
        --------
        copyto, put, take, extract

        Examples
        --------
        >>> import numpy as np
        >>> arr = np.arange(6).reshape(2, 3)
        >>> np.place(arr, arr>2, [44, 55])
        >>> arr
        array([[ 0,  1,  2],
               [44, 55, 44]])

    poly(seq_of_zeros)
        Find the coefficients of a polynomial with the given sequence of roots.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        Returns the coefficients of the polynomial whose leading coefficient
        is one for the given sequence of zeros (multiple roots must be included
        in the sequence as many times as their multiplicity; see Examples).
        A square matrix (or array, which will be treated as a matrix) can also
        be given, in which case the coefficients of the characteristic polynomial
        of the matrix are returned.

        Parameters
        ----------
        seq_of_zeros : array_like, shape (N,) or (N, N)
            A sequence of polynomial roots, or a square array or matrix object.

        Returns
        -------
        c : ndarray
            1D array of polynomial coefficients from highest to lowest degree:

            ``c[0] * x**(N) + c[1] * x**(N-1) + ... + c[N-1] * x + c[N]``
            where c[0] always equals 1.

        Raises
        ------
        ValueError
            If input is the wrong shape (the input must be a 1-D or square
            2-D array).

        See Also
        --------
        polyval : Compute polynomial values.
        roots : Return the roots of a polynomial.
        polyfit : Least squares polynomial fit.
        poly1d : A one-dimensional polynomial class.

        Notes
        -----
        Specifying the roots of a polynomial still leaves one degree of
        freedom, typically represented by an undetermined leading
        coefficient. [1]_ In the case of this function, that coefficient -
        the first one in the returned array - is always taken as one. (If
        for some reason you have one other point, the only automatic way
        presently to leverage that information is to use ``polyfit``.)

        The characteristic polynomial, :math:`p_a(t)`, of an `n`-by-`n`
        matrix **A** is given by

        :math:`p_a(t) = \mathrm{det}(t\, \mathbf{I} - \mathbf{A})`,

        where **I** is the `n`-by-`n` identity matrix. [2]_

        References
        ----------
        .. [1] M. Sullivan and M. Sullivan, III, "Algebra and Trigonometry,
           Enhanced With Graphing Utilities," Prentice-Hall, pg. 318, 1996.

        .. [2] G. Strang, "Linear Algebra and Its Applications, 2nd Edition,"
           Academic Press, pg. 182, 1980.

        Examples
        --------
        Given a sequence of a polynomial's zeros:

        >>> import numpy as np

        >>> np.poly((0, 0, 0)) # Multiple root example
        array([1., 0., 0., 0.])

        The line above represents z**3 + 0*z**2 + 0*z + 0.

        >>> np.poly((-1./2, 0, 1./2))
        array([ 1.  ,  0.  , -0.25,  0.  ])

        The line above represents z**3 - z/4

        >>> np.poly((np.random.random(1)[0], 0, np.random.random(1)[0]))
        array([ 1.        , -0.77086955,  0.08618131,  0.        ]) # random

        Given a square array object:

        >>> P = np.array([[0, 1./3], [-1./2, 0]])
        >>> np.poly(P)
        array([1.        , 0.        , 0.16666667])

        Note how in all cases the leading coefficient is always 1.

    polyadd(a1, a2)
        Find the sum of two polynomials.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        Returns the polynomial resulting from the sum of two input polynomials.
        Each input must be either a poly1d object or a 1D sequence of polynomial
        coefficients, from highest to lowest degree.

        Parameters
        ----------
        a1, a2 : array_like or poly1d object
            Input polynomials.

        Returns
        -------
        out : ndarray or poly1d object
            The sum of the inputs. If either input is a poly1d object, then the
            output is also a poly1d object. Otherwise, it is a 1D array of
            polynomial coefficients from highest to lowest degree.

        See Also
        --------
        poly1d : A one-dimensional polynomial class.
        poly, polyadd, polyder, polydiv, polyfit, polyint, polysub, polyval

        Examples
        --------
        >>> import numpy as np
        >>> np.polyadd([1, 2], [9, 5, 4])
        array([9, 6, 6])

        Using poly1d objects:

        >>> p1 = np.poly1d([1, 2])
        >>> p2 = np.poly1d([9, 5, 4])
        >>> print(p1)
        1 x + 2
        >>> print(p2)
           2
        9 x + 5 x + 4
        >>> print(np.polyadd(p1, p2))
           2
        9 x + 6 x + 6

    polyder(p, m=1)
        Return the derivative of the specified order of a polynomial.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        Parameters
        ----------
        p : poly1d or sequence
            Polynomial to differentiate.
            A sequence is interpreted as polynomial coefficients, see `poly1d`.
        m : int, optional
            Order of differentiation (default: 1)

        Returns
        -------
        der : poly1d
            A new polynomial representing the derivative.

        See Also
        --------
        polyint : Anti-derivative of a polynomial.
        poly1d : Class for one-dimensional polynomials.

        Examples
        --------
        The derivative of the polynomial :math:`x^3 + x^2 + x^1 + 1` is:

        >>> import numpy as np

        >>> p = np.poly1d([1,1,1,1])
        >>> p2 = np.polyder(p)
        >>> p2
        poly1d([3, 2, 1])

        which evaluates to:

        >>> p2(2.)
        17.0

        We can verify this, approximating the derivative with
        ``(f(x + h) - f(x))/h``:

        >>> (p(2. + 0.001) - p(2.)) / 0.001
        17.007000999997857

        The fourth-order derivative of a 3rd-order polynomial is zero:

        >>> np.polyder(p, 2)
        poly1d([6, 2])
        >>> np.polyder(p, 3)
        poly1d([6])
        >>> np.polyder(p, 4)
        poly1d([0])

    polydiv(u, v)
        Returns the quotient and remainder of polynomial division.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        The input arrays are the coefficients (including any coefficients
        equal to zero) of the "numerator" (dividend) and "denominator"
        (divisor) polynomials, respectively.

        Parameters
        ----------
        u : array_like or poly1d
            Dividend polynomial's coefficients.

        v : array_like or poly1d
            Divisor polynomial's coefficients.

        Returns
        -------
        q : ndarray
            Coefficients, including those equal to zero, of the quotient.
        r : ndarray
            Coefficients, including those equal to zero, of the remainder.

        See Also
        --------
        poly, polyadd, polyder, polydiv, polyfit, polyint, polymul, polysub
        polyval

        Notes
        -----
        Both `u` and `v` must be 0-d or 1-d (ndim = 0 or 1), but `u.ndim` need
        not equal `v.ndim`. In other words, all four possible combinations -
        ``u.ndim = v.ndim = 0``, ``u.ndim = v.ndim = 1``,
        ``u.ndim = 1, v.ndim = 0``, and ``u.ndim = 0, v.ndim = 1`` - work.

        Examples
        --------
        .. math:: \frac{3x^2 + 5x + 2}{2x + 1} = 1.5x + 1.75, remainder 0.25

        >>> import numpy as np
        >>> x = np.array([3.0, 5.0, 2.0])
        >>> y = np.array([2.0, 1.0])
        >>> np.polydiv(x, y)
        (array([1.5 , 1.75]), array([0.25]))

    polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False)
        Least squares polynomial fit.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        Fit a polynomial ``p(x) = p[0] * x**deg + ... + p[deg]`` of degree `deg`
        to points `(x, y)`. Returns a vector of coefficients `p` that minimises
        the squared error in the order `deg`, `deg-1`, ... `0`.

        The `Polynomial.fit <numpy.polynomial.polynomial.Polynomial.fit>` class
        method is recommended for new code as it is more stable numerically. See
        the documentation of the method for more information.

        Parameters
        ----------
        x : array_like, shape (M,)
            x-coordinates of the M sample points ``(x[i], y[i])``.
        y : array_like, shape (M,) or (M, K)
            y-coordinates of the sample points. Several data sets of sample
            points sharing the same x-coordinates can be fitted at once by
            passing in a 2D-array that contains one dataset per column.
        deg : int
            Degree of the fitting polynomial
        rcond : float, optional
            Relative condition number of the fit. Singular values smaller than
            this relative to the largest singular value will be ignored. The
            default value is len(x)*eps, where eps is the relative precision of
            the float type, about 2e-16 in most cases.
        full : bool, optional
            Switch determining nature of return value. When it is False (the
            default) just the coefficients are returned, when True diagnostic
            information from the singular value decomposition is also returned.
        w : array_like, shape (M,), optional
            Weights. If not None, the weight ``w[i]`` applies to the unsquared
            residual ``y[i] - y_hat[i]`` at ``x[i]``. Ideally the weights are
            chosen so that the errors of the products ``w[i]*y[i]`` all have the
            same variance.  When using inverse-variance weighting, use
            ``w[i] = 1/sigma(y[i])``.  The default value is None.
        cov : bool or str, optional
            If given and not `False`, return not just the estimate but also its
            covariance matrix. By default, the covariance are scaled by
            chi2/dof, where dof = M - (deg + 1), i.e., the weights are presumed
            to be unreliable except in a relative sense and everything is scaled
            such that the reduced chi2 is unity. This scaling is omitted if
            ``cov='unscaled'``, as is relevant for the case that the weights are
            w = 1/sigma, with sigma known to be a reliable estimate of the
            uncertainty.

        Returns
        -------
        p : ndarray, shape (deg + 1,) or (deg + 1, K)
            Polynomial coefficients, highest power first.  If `y` was 2-D, the
            coefficients for `k`-th data set are in ``p[:,k]``.

        residuals, rank, singular_values, rcond
            These values are only returned if ``full == True``

            - residuals -- sum of squared residuals of the least squares fit
            - rank -- the effective rank of the scaled Vandermonde
               coefficient matrix
            - singular_values -- singular values of the scaled Vandermonde
               coefficient matrix
            - rcond -- value of `rcond`.

            For more details, see `numpy.linalg.lstsq`.

        V : ndarray, shape (deg + 1, deg + 1) or (deg + 1, deg + 1, K)
            Present only if ``full == False`` and ``cov == True``.  The covariance
            matrix of the polynomial coefficient estimates.  The diagonal of
            this matrix are the variance estimates for each coefficient.  If y
            is a 2-D array, then the covariance matrix for the `k`-th data set
            are in ``V[:,:,k]``


        Warns
        -----
        RankWarning
            The rank of the coefficient matrix in the least-squares fit is
            deficient. The warning is only raised if ``full == False``.

            The warnings can be turned off by

            >>> import warnings
            >>> warnings.simplefilter('ignore', np.exceptions.RankWarning)

        See Also
        --------
        polyval : Compute polynomial values.
        linalg.lstsq : Computes a least-squares fit.
        scipy.interpolate.UnivariateSpline : Computes spline fits.

        Notes
        -----
        The solution minimizes the squared error

        .. math::
            E = \sum_{j=0}^k |p(x_j) - y_j|^2

        in the equations::

            x[0]**n * p[0] + ... + x[0] * p[n-1] + p[n] = y[0]
            x[1]**n * p[0] + ... + x[1] * p[n-1] + p[n] = y[1]
            ...
            x[k]**n * p[0] + ... + x[k] * p[n-1] + p[n] = y[k]

        The coefficient matrix of the coefficients `p` is a Vandermonde matrix.

        `polyfit` issues a `~exceptions.RankWarning` when the least-squares fit is
        badly conditioned. This implies that the best fit is not well-defined due
        to numerical error. The results may be improved by lowering the polynomial
        degree or by replacing `x` by `x` - `x`.mean(). The `rcond` parameter
        can also be set to a value smaller than its default, but the resulting
        fit may be spurious: including contributions from the small singular
        values can add numerical noise to the result.

        Note that fitting polynomial coefficients is inherently badly conditioned
        when the degree of the polynomial is large or the interval of sample points
        is badly centered. The quality of the fit should always be checked in these
        cases. When polynomial fits are not satisfactory, splines may be a good
        alternative.

        References
        ----------
        .. [1] Wikipedia, "Curve fitting",
               https://en.wikipedia.org/wiki/Curve_fitting
        .. [2] Wikipedia, "Polynomial interpolation",
               https://en.wikipedia.org/wiki/Polynomial_interpolation

        Examples
        --------
        >>> import numpy as np
        >>> import warnings
        >>> x = np.array([0.0, 1.0, 2.0, 3.0,  4.0,  5.0])
        >>> y = np.array([0.0, 0.8, 0.9, 0.1, -0.8, -1.0])
        >>> z = np.polyfit(x, y, 3)
        >>> z
        array([ 0.08703704, -0.81349206,  1.69312169, -0.03968254]) # may vary

        It is convenient to use `poly1d` objects for dealing with polynomials:

        >>> p = np.poly1d(z)
        >>> p(0.5)
        0.6143849206349179 # may vary
        >>> p(3.5)
        -0.34732142857143039 # may vary
        >>> p(10)
        22.579365079365115 # may vary

        High-order polynomials may oscillate wildly:

        >>> with warnings.catch_warnings():
        ...     warnings.simplefilter('ignore', np.exceptions.RankWarning)
        ...     p30 = np.poly1d(np.polyfit(x, y, 30))
        ...
        >>> p30(4)
        -0.80000000000000204 # may vary
        >>> p30(5)
        -0.99999999999999445 # may vary
        >>> p30(4.5)
        -0.10547061179440398 # may vary

        Illustration:

        >>> import matplotlib.pyplot as plt
        >>> xp = np.linspace(-2, 6, 100)
        >>> _ = plt.plot(x, y, '.', xp, p(xp), '-', xp, p30(xp), '--')
        >>> plt.ylim(-2,2)
        (-2, 2)
        >>> plt.show()

    polyint(p, m=1, k=None)
        Return an antiderivative (indefinite integral) of a polynomial.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        The returned order `m` antiderivative `P` of polynomial `p` satisfies
        :math:`\frac{d^m}{dx^m}P(x) = p(x)` and is defined up to `m - 1`
        integration constants `k`. The constants determine the low-order
        polynomial part

        .. math:: \frac{k_{m-1}}{0!} x^0 + \ldots + \frac{k_0}{(m-1)!}x^{m-1}

        of `P` so that :math:`P^{(j)}(0) = k_{m-j-1}`.

        Parameters
        ----------
        p : array_like or poly1d
            Polynomial to integrate.
            A sequence is interpreted as polynomial coefficients, see `poly1d`.
        m : int, optional
            Order of the antiderivative. (Default: 1)
        k : list of `m` scalars or scalar, optional
            Integration constants. They are given in the order of integration:
            those corresponding to highest-order terms come first.

            If ``None`` (default), all constants are assumed to be zero.
            If `m = 1`, a single scalar can be given instead of a list.

        See Also
        --------
        polyder : derivative of a polynomial
        poly1d.integ : equivalent method

        Examples
        --------
        The defining property of the antiderivative:

        >>> import numpy as np

        >>> p = np.poly1d([1,1,1])
        >>> P = np.polyint(p)
        >>> P
         poly1d([ 0.33333333,  0.5       ,  1.        ,  0.        ]) # may vary
        >>> np.polyder(P) == p
        True

        The integration constants default to zero, but can be specified:

        >>> P = np.polyint(p, 3)
        >>> P(0)
        0.0
        >>> np.polyder(P)(0)
        0.0
        >>> np.polyder(P, 2)(0)
        0.0
        >>> P = np.polyint(p, 3, k=[6,5,3])
        >>> P
        poly1d([ 0.01666667,  0.04166667,  0.16666667,  3. ,  5. ,  3. ]) # may vary

        Note that 3 = 6 / 2!, and that the constants are given in the order of
        integrations. Constant of the highest-order polynomial term comes first:

        >>> np.polyder(P, 2)(0)
        6.0
        >>> np.polyder(P, 1)(0)
        5.0
        >>> P(0)
        3.0

    polymul(a1, a2)
        Find the product of two polynomials.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        Finds the polynomial resulting from the multiplication of the two input
        polynomials. Each input must be either a poly1d object or a 1D sequence
        of polynomial coefficients, from highest to lowest degree.

        Parameters
        ----------
        a1, a2 : array_like or poly1d object
            Input polynomials.

        Returns
        -------
        out : ndarray or poly1d object
            The polynomial resulting from the multiplication of the inputs. If
            either inputs is a poly1d object, then the output is also a poly1d
            object. Otherwise, it is a 1D array of polynomial coefficients from
            highest to lowest degree.

        See Also
        --------
        poly1d : A one-dimensional polynomial class.
        poly, polyadd, polyder, polydiv, polyfit, polyint, polysub, polyval
        convolve : Array convolution. Same output as polymul, but has parameter
                   for overlap mode.

        Examples
        --------
        >>> import numpy as np
        >>> np.polymul([1, 2, 3], [9, 5, 1])
        array([ 9, 23, 38, 17,  3])

        Using poly1d objects:

        >>> p1 = np.poly1d([1, 2, 3])
        >>> p2 = np.poly1d([9, 5, 1])
        >>> print(p1)
           2
        1 x + 2 x + 3
        >>> print(p2)
           2
        9 x + 5 x + 1
        >>> print(np.polymul(p1, p2))
           4      3      2
        9 x + 23 x + 38 x + 17 x + 3

    polysub(a1, a2)
        Difference (subtraction) of two polynomials.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        Given two polynomials `a1` and `a2`, returns ``a1 - a2``.
        `a1` and `a2` can be either array_like sequences of the polynomials'
        coefficients (including coefficients equal to zero), or `poly1d` objects.

        Parameters
        ----------
        a1, a2 : array_like or poly1d
            Minuend and subtrahend polynomials, respectively.

        Returns
        -------
        out : ndarray or poly1d
            Array or `poly1d` object of the difference polynomial's coefficients.

        See Also
        --------
        polyval, polydiv, polymul, polyadd

        Examples
        --------
        .. math:: (2 x^2 + 10 x - 2) - (3 x^2 + 10 x -4) = (-x^2 + 2)

        >>> import numpy as np

        >>> np.polysub([2, 10, -2], [3, 10, -4])
        array([-1,  0,  2])

    polyval(p, x)
        Evaluate a polynomial at specific values.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        If `p` is of length N, this function returns the value::

            p[0]*x**(N-1) + p[1]*x**(N-2) + ... + p[N-2]*x + p[N-1]

        If `x` is a sequence, then ``p(x)`` is returned for each element of ``x``.
        If `x` is another polynomial then the composite polynomial ``p(x(t))``
        is returned.

        Parameters
        ----------
        p : array_like or poly1d object
           1D array of polynomial coefficients (including coefficients equal
           to zero) from highest degree to the constant term, or an
           instance of poly1d.
        x : array_like or poly1d object
           A number, an array of numbers, or an instance of poly1d, at
           which to evaluate `p`.

        Returns
        -------
        values : ndarray or poly1d
           If `x` is a poly1d instance, the result is the composition of the two
           polynomials, i.e., `x` is "substituted" in `p` and the simplified
           result is returned. In addition, the type of `x` - array_like or
           poly1d - governs the type of the output: `x` array_like => `values`
           array_like, `x` a poly1d object => `values` is also.

        See Also
        --------
        poly1d: A polynomial class.

        Notes
        -----
        Horner's scheme [1]_ is used to evaluate the polynomial. Even so,
        for polynomials of high degree the values may be inaccurate due to
        rounding errors. Use carefully.

        If `x` is a subtype of `ndarray` the return value will be of the same type.

        References
        ----------
        .. [1] I. N. Bronshtein, K. A. Semendyayev, and K. A. Hirsch (Eng.
           trans. Ed.), *Handbook of Mathematics*, New York, Van Nostrand
           Reinhold Co., 1985, pg. 720.

        Examples
        --------
        >>> import numpy as np
        >>> np.polyval([3,0,1], 5)  # 3 * 5**2 + 0 * 5**1 + 1
        76
        >>> np.polyval([3,0,1], np.poly1d(5))
        poly1d([76])
        >>> np.polyval(np.poly1d([3,0,1]), 5)
        76
        >>> np.polyval(np.poly1d([3,0,1]), np.poly1d(5))
        poly1d([76])

    printoptions(*args, **kwargs)
        Context manager for setting print options.

        Set print options for the scope of the `with` block, and restore the old
        options at the end. See `set_printoptions` for the full description of
        available options.

        Examples
        --------
        >>> import numpy as np

        >>> from numpy.testing import assert_equal
        >>> with np.printoptions(precision=2):
        ...     np.array([2.0]) / 3
        array([0.67])

        The `as`-clause of the `with`-statement gives the current print options:

        >>> with np.printoptions(precision=2) as opts:
        ...      assert_equal(opts, np.get_printoptions())

        See Also
        --------
        set_printoptions, get_printoptions

    prod(a, axis=None, dtype=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Return the product of array elements over a given axis.

        Parameters
        ----------
        a : array_like
            Input data.
        axis : None or int or tuple of ints, optional
            Axis or axes along which a product is performed.  The default,
            axis=None, will calculate the product of all the elements in the
            input array. If axis is negative it counts from the last to the
            first axis.

            .. versionadded:: 1.7.0

            If axis is a tuple of ints, a product is performed on all of the
            axes specified in the tuple instead of a single axis or all the
            axes as before.
        dtype : dtype, optional
            The type of the returned array, as well as of the accumulator in
            which the elements are multiplied.  The dtype of `a` is used by
            default unless `a` has an integer dtype of less precision than the
            default platform integer.  In that case, if `a` is signed then the
            platform integer is used while if `a` is unsigned then an unsigned
            integer of the same precision as the platform integer is used.
        out : ndarray, optional
            Alternative output array in which to place the result. It must have
            the same shape as the expected output, but the type of the output
            values will be cast if necessary.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left in the
            result as dimensions with size one. With this option, the result
            will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the `prod` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.
        initial : scalar, optional
            The starting value for this product. See `~numpy.ufunc.reduce`
            for details.

            .. versionadded:: 1.15.0

        where : array_like of bool, optional
            Elements to include in the product. See `~numpy.ufunc.reduce`
            for details.

            .. versionadded:: 1.17.0

        Returns
        -------
        product_along_axis : ndarray, see `dtype` parameter above.
            An array shaped as `a` but with the specified axis removed.
            Returns a reference to `out` if specified.

        See Also
        --------
        ndarray.prod : equivalent method
        :ref:`ufuncs-output-type`

        Notes
        -----
        Arithmetic is modular when using integer types, and no error is
        raised on overflow.  That means that, on a 32-bit platform:

        >>> x = np.array([536870910, 536870910, 536870910, 536870910])
        >>> np.prod(x)
        16 # may vary

        The product of an empty array is the neutral element 1:

        >>> np.prod([])
        1.0

        Examples
        --------
        By default, calculate the product of all elements:

        >>> import numpy as np
        >>> np.prod([1.,2.])
        2.0

        Even when the input array is two-dimensional:

        >>> a = np.array([[1., 2.], [3., 4.]])
        >>> np.prod(a)
        24.0

        But we can also specify the axis over which to multiply:

        >>> np.prod(a, axis=1)
        array([  2.,  12.])
        >>> np.prod(a, axis=0)
        array([3., 8.])

        Or select specific elements to include:

        >>> np.prod([1., np.nan, 3.], where=[True, False, True])
        3.0

        If the type of `x` is unsigned, then the output type is
        the unsigned platform integer:

        >>> x = np.array([1, 2, 3], dtype=np.uint8)
        >>> np.prod(x).dtype == np.uint
        True

        If `x` is of a signed integer type, then the output type
        is the default platform integer:

        >>> x = np.array([1, 2, 3], dtype=np.int8)
        >>> np.prod(x).dtype == int
        True

        You can also start the product with a value other than one:

        >>> np.prod([1, 2], initial=5)
        10

    promote_types(...)
        promote_types(type1, type2)

        Returns the data type with the smallest size and smallest scalar
        kind to which both ``type1`` and ``type2`` may be safely cast.
        The returned data type is always considered "canonical", this mainly
        means that the promoted dtype will always be in native byte order.

        This function is symmetric, but rarely associative.

        Parameters
        ----------
        type1 : dtype or dtype specifier
            First data type.
        type2 : dtype or dtype specifier
            Second data type.

        Returns
        -------
        out : dtype
            The promoted data type.

        Notes
        -----
        Please see `numpy.result_type` for additional information about promotion.

        .. versionadded:: 1.6.0

        Starting in NumPy 1.9, promote_types function now returns a valid string
        length when given an integer or float dtype as one argument and a string
        dtype as another argument. Previously it always returned the input string
        dtype, even if it wasn't long enough to store the max integer/float value
        converted to a string.

        .. versionchanged:: 1.23.0

        NumPy now supports promotion for more structured dtypes.  It will now
        remove unnecessary padding from a structure dtype and promote included
        fields individually.

        See Also
        --------
        result_type, dtype, can_cast

        Examples
        --------
        >>> import numpy as np
        >>> np.promote_types('f4', 'f8')
        dtype('float64')

        >>> np.promote_types('i8', 'f4')
        dtype('float64')

        >>> np.promote_types('>i8', '<c8')
        dtype('complex128')

        >>> np.promote_types('i4', 'S8')
        dtype('S11')

        An example of a non-associative case:

        >>> p = np.promote_types
        >>> p('S', p('i1', 'u1'))
        dtype('S6')
        >>> p(p('S', 'i1'), 'u1')
        dtype('S4')

    ptp(a, axis=None, out=None, keepdims=<no value>)
        Range of values (maximum - minimum) along an axis.

        The name of the function comes from the acronym for 'peak to peak'.

        .. warning::
            `ptp` preserves the data type of the array. This means the
            return value for an input of signed integers with n bits
            (e.g. `numpy.int8`, `numpy.int16`, etc) is also a signed integer
            with n bits.  In that case, peak-to-peak values greater than
            ``2**(n-1)-1`` will be returned as negative values. An example
            with a work-around is shown below.

        Parameters
        ----------
        a : array_like
            Input values.
        axis : None or int or tuple of ints, optional
            Axis along which to find the peaks.  By default, flatten the
            array.  `axis` may be negative, in
            which case it counts from the last to the first axis.

            .. versionadded:: 1.15.0

            If this is a tuple of ints, a reduction is performed on multiple
            axes, instead of a single axis or all the axes as before.
        out : array_like
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output,
            but the type of the output values will be cast if necessary.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the `ptp` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.

        Returns
        -------
        ptp : ndarray or scalar
            The range of a given array - `scalar` if array is one-dimensional
            or a new array holding the result along the given axis

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([[4, 9, 2, 10],
        ...               [6, 9, 7, 12]])

        >>> np.ptp(x, axis=1)
        array([8, 6])

        >>> np.ptp(x, axis=0)
        array([2, 0, 5, 2])

        >>> np.ptp(x)
        10

        This example shows that a negative value can be returned when
        the input is an array of signed integers.

        >>> y = np.array([[1, 127],
        ...               [0, 127],
        ...               [-1, 127],
        ...               [-2, 127]], dtype=np.int8)
        >>> np.ptp(y, axis=1)
        array([ 126,  127, -128, -127], dtype=int8)

        A work-around is to use the `view()` method to view the result as
        unsigned integers with the same bit width:

        >>> np.ptp(y, axis=1).view(np.uint8)
        array([126, 127, 128, 129], dtype=uint8)

    put(a, ind, v, mode='raise')
        Replaces specified elements of an array with given values.

        The indexing works on the flattened target array. `put` is roughly
        equivalent to:

        ::

            a.flat[ind] = v

        Parameters
        ----------
        a : ndarray
            Target array.
        ind : array_like
            Target indices, interpreted as integers.
        v : array_like
            Values to place in `a` at target indices. If `v` is shorter than
            `ind` it will be repeated as necessary.
        mode : {'raise', 'wrap', 'clip'}, optional
            Specifies how out-of-bounds indices will behave.

            * 'raise' -- raise an error (default)
            * 'wrap' -- wrap around
            * 'clip' -- clip to the range

            'clip' mode means that all indices that are too large are replaced
            by the index that addresses the last element along that axis. Note
            that this disables indexing with negative numbers. In 'raise' mode,
            if an exception occurs the target array may still be modified.

        See Also
        --------
        putmask, place
        put_along_axis : Put elements by matching the array and the index arrays

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(5)
        >>> np.put(a, [0, 2], [-44, -55])
        >>> a
        array([-44,   1, -55,   3,   4])

        >>> a = np.arange(5)
        >>> np.put(a, 22, -5, mode='clip')
        >>> a
        array([ 0,  1,  2,  3, -5])

    put_along_axis(arr, indices, values, axis)
        Put values into the destination array by matching 1d index and data slices.

        This iterates over matching 1d slices oriented along the specified axis in
        the index and data arrays, and uses the former to place values into the
        latter. These slices can be different lengths.

        Functions returning an index along an axis, like `argsort` and
        `argpartition`, produce suitable indices for this function.

        .. versionadded:: 1.15.0

        Parameters
        ----------
        arr : ndarray (Ni..., M, Nk...)
            Destination array.
        indices : ndarray (Ni..., J, Nk...)
            Indices to change along each 1d slice of `arr`. This must match the
            dimension of arr, but dimensions in Ni and Nj may be 1 to broadcast
            against `arr`.
        values : array_like (Ni..., J, Nk...)
            values to insert at those indices. Its shape and dimension are
            broadcast to match that of `indices`.
        axis : int
            The axis to take 1d slices along. If axis is None, the destination
            array is treated as if a flattened 1d view had been created of it.

        Notes
        -----
        This is equivalent to (but faster than) the following use of `ndindex` and
        `s_`, which sets each of ``ii`` and ``kk`` to a tuple of indices::

            Ni, M, Nk = a.shape[:axis], a.shape[axis], a.shape[axis+1:]
            J = indices.shape[axis]  # Need not equal M

            for ii in ndindex(Ni):
                for kk in ndindex(Nk):
                    a_1d       = a      [ii + s_[:,] + kk]
                    indices_1d = indices[ii + s_[:,] + kk]
                    values_1d  = values [ii + s_[:,] + kk]
                    for j in range(J):
                        a_1d[indices_1d[j]] = values_1d[j]

        Equivalently, eliminating the inner loop, the last two lines would be::

                    a_1d[indices_1d] = values_1d

        See Also
        --------
        take_along_axis :
            Take values from the input array by matching 1d index and data slices

        Examples
        --------
        >>> import numpy as np

        For this sample array

        >>> a = np.array([[10, 30, 20], [60, 40, 50]])

        We can replace the maximum values with:

        >>> ai = np.argmax(a, axis=1, keepdims=True)
        >>> ai
        array([[1],
               [0]])
        >>> np.put_along_axis(a, ai, 99, axis=1)
        >>> a
        array([[10, 99, 20],
               [99, 40, 50]])

    putmask(...)
        putmask(a, mask, values)

        Changes elements of an array based on conditional and input values.

        Sets ``a.flat[n] = values[n]`` for each n where ``mask.flat[n]==True``.

        If `values` is not the same size as `a` and `mask` then it will repeat.
        This gives behavior different from ``a[mask] = values``.

        Parameters
        ----------
        a : ndarray
            Target array.
        mask : array_like
            Boolean mask array. It has to be the same shape as `a`.
        values : array_like
            Values to put into `a` where `mask` is True. If `values` is smaller
            than `a` it will be repeated.

        See Also
        --------
        place, put, take, copyto

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(6).reshape(2, 3)
        >>> np.putmask(x, x>2, x**2)
        >>> x
        array([[ 0,  1,  2],
               [ 9, 16, 25]])

        If `values` is smaller than `a` it is repeated:

        >>> x = np.arange(5)
        >>> np.putmask(x, x>1, [-33, -44])
        >>> x
        array([  0,   1, -33, -44, -33])

    quantile(a, q, axis=None, out=None, overwrite_input=False, method='linear', keepdims=False, *, weights=None, interpolation=None)
        Compute the q-th quantile of the data along the specified axis.

        .. versionadded:: 1.15.0

        Parameters
        ----------
        a : array_like of real numbers
            Input array or object that can be converted to an array.
        q : array_like of float
            Probability or sequence of probabilities of the quantiles to compute.
            Values must be between 0 and 1 inclusive.
        axis : {int, tuple of int, None}, optional
            Axis or axes along which the quantiles are computed. The default is
            to compute the quantile(s) along a flattened version of the array.
        out : ndarray, optional
            Alternative output array in which to place the result. It must have
            the same shape and buffer length as the expected output, but the
            type (of the output) will be cast if necessary.
        overwrite_input : bool, optional
            If True, then allow the input array `a` to be modified by
            intermediate calculations, to save memory. In this case, the
            contents of the input `a` after this function completes is
            undefined.
        method : str, optional
            This parameter specifies the method to use for estimating the
            quantile.  There are many different methods, some unique to NumPy.
            The recommended options, numbered as they appear in [1]_, are:

            1. 'inverted_cdf'
            2. 'averaged_inverted_cdf'
            3. 'closest_observation'
            4. 'interpolated_inverted_cdf'
            5. 'hazen'
            6. 'weibull'
            7. 'linear'  (default)
            8. 'median_unbiased'
            9. 'normal_unbiased'

            The first three methods are discontinuous. For backward compatibility
            with previous versions of NumPy, the following discontinuous variations
            of the default 'linear' (7.) option are available:

            * 'lower'
            * 'higher',
            * 'midpoint'
            * 'nearest'

            See Notes for details.

            .. versionchanged:: 1.22.0
                This argument was previously called "interpolation" and only
                offered the "linear" default and last four options.

        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left in
            the result as dimensions with size one. With this option, the
            result will broadcast correctly against the original array `a`.

        weights : array_like, optional
            An array of weights associated with the values in `a`. Each value in
            `a` contributes to the quantile according to its associated weight.
            The weights array can either be 1-D (in which case its length must be
            the size of `a` along the given axis) or of the same shape as `a`.
            If `weights=None`, then all data in `a` are assumed to have a
            weight equal to one.
            Only `method="inverted_cdf"` supports weights.
            See the notes for more details.

            .. versionadded:: 2.0.0

        interpolation : str, optional
            Deprecated name for the method keyword argument.

            .. deprecated:: 1.22.0

        Returns
        -------
        quantile : scalar or ndarray
            If `q` is a single probability and `axis=None`, then the result
            is a scalar. If multiple probability levels are given, first axis
            of the result corresponds to the quantiles. The other axes are
            the axes that remain after the reduction of `a`. If the input
            contains integers or floats smaller than ``float64``, the output
            data-type is ``float64``. Otherwise, the output data-type is the
            same as that of the input. If `out` is specified, that array is
            returned instead.

        See Also
        --------
        mean
        percentile : equivalent to quantile, but with q in the range [0, 100].
        median : equivalent to ``quantile(..., 0.5)``
        nanquantile

        Notes
        -----
        Given a sample `a` from an underlying distribution, `quantile` provides a
        nonparametric estimate of the inverse cumulative distribution function.

        By default, this is done by interpolating between adjacent elements in
        ``y``, a sorted copy of `a`::

            (1-g)*y[j] + g*y[j+1]

        where the index ``j`` and coefficient ``g`` are the integral and
        fractional components of ``q * (n-1)``, and ``n`` is the number of
        elements in the sample.

        This is a special case of Equation 1 of H&F [1]_. More generally,

        - ``j = (q*n + m - 1) // 1``, and
        - ``g = (q*n + m - 1) % 1``,

        where ``m`` may be defined according to several different conventions.
        The preferred convention may be selected using the ``method`` parameter:

        =============================== =============== ===============
        ``method``                      number in H&F   ``m``
        =============================== =============== ===============
        ``interpolated_inverted_cdf``   4               ``0``
        ``hazen``                       5               ``1/2``
        ``weibull``                     6               ``q``
        ``linear`` (default)            7               ``1 - q``
        ``median_unbiased``             8               ``q/3 + 1/3``
        ``normal_unbiased``             9               ``q/4 + 3/8``
        =============================== =============== ===============

        Note that indices ``j`` and ``j + 1`` are clipped to the range ``0`` to
        ``n - 1`` when the results of the formula would be outside the allowed
        range of non-negative indices. The ``- 1`` in the formulas for ``j`` and
        ``g`` accounts for Python's 0-based indexing.

        The table above includes only the estimators from H&F that are continuous
        functions of probability `q` (estimators 4-9). NumPy also provides the
        three discontinuous estimators from H&F (estimators 1-3), where ``j`` is
        defined as above, ``m`` is defined as follows, and ``g`` is a function
        of the real-valued ``index = q*n + m - 1`` and ``j``.

        1. ``inverted_cdf``: ``m = 0`` and ``g = int(index - j > 0)``
        2. ``averaged_inverted_cdf``: ``m = 0`` and
           ``g = (1 + int(index - j > 0)) / 2``
        3. ``closest_observation``: ``m = -1/2`` and
           ``g = 1 - int((index == j) & (j%2 == 1))``

        For backward compatibility with previous versions of NumPy, `quantile`
        provides four additional discontinuous estimators. Like
        ``method='linear'``, all have ``m = 1 - q`` so that ``j = q*(n-1) // 1``,
        but ``g`` is defined as follows.

        - ``lower``: ``g = 0``
        - ``midpoint``: ``g = 0.5``
        - ``higher``: ``g = 1``
        - ``nearest``: ``g = (q*(n-1) % 1) > 0.5``

        **Weighted quantiles:**
        More formally, the quantile at probability level :math:`q` of a cumulative
        distribution function :math:`F(y)=P(Y \leq y)` with probability measure
        :math:`P` is defined as any number :math:`x` that fulfills the
        *coverage conditions*

        .. math:: P(Y < x) \leq q \quad\text{and}\quad P(Y \leq x) \geq q

        with random variable :math:`Y\sim P`.
        Sample quantiles, the result of `quantile`, provide nonparametric
        estimation of the underlying population counterparts, represented by the
        unknown :math:`F`, given a data vector `a` of length ``n``.

        Some of the estimators above arise when one considers :math:`F` as the
        empirical distribution function of the data, i.e.
        :math:`F(y) = \frac{1}{n} \sum_i 1_{a_i \leq y}`.
        Then, different methods correspond to different choices of :math:`x` that
        fulfill the above coverage conditions. Methods that follow this approach
        are ``inverted_cdf`` and ``averaged_inverted_cdf``.

        For weighted quantiles, the coverage conditions still hold. The
        empirical cumulative distribution is simply replaced by its weighted
        version, i.e.
        :math:`P(Y \leq t) = \frac{1}{\sum_i w_i} \sum_i w_i 1_{x_i \leq t}`.
        Only ``method="inverted_cdf"`` supports weights.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[10, 7, 4], [3, 2, 1]])
        >>> a
        array([[10,  7,  4],
               [ 3,  2,  1]])
        >>> np.quantile(a, 0.5)
        3.5
        >>> np.quantile(a, 0.5, axis=0)
        array([6.5, 4.5, 2.5])
        >>> np.quantile(a, 0.5, axis=1)
        array([7.,  2.])
        >>> np.quantile(a, 0.5, axis=1, keepdims=True)
        array([[7.],
               [2.]])
        >>> m = np.quantile(a, 0.5, axis=0)
        >>> out = np.zeros_like(m)
        >>> np.quantile(a, 0.5, axis=0, out=out)
        array([6.5, 4.5, 2.5])
        >>> m
        array([6.5, 4.5, 2.5])
        >>> b = a.copy()
        >>> np.quantile(b, 0.5, axis=1, overwrite_input=True)
        array([7.,  2.])
        >>> assert not np.all(a == b)

        See also `numpy.percentile` for a visualization of most methods.

        References
        ----------
        .. [1] R. J. Hyndman and Y. Fan,
           "Sample quantiles in statistical packages,"
           The American Statistician, 50(4), pp. 361-365, 1996

    ravel(a, order='C')
        Return a contiguous flattened array.

        A 1-D array, containing the elements of the input, is returned.  A copy is
        made only if needed.

        As of NumPy 1.10, the returned array will have the same type as the input
        array. (for example, a masked array will be returned for a masked array
        input)

        Parameters
        ----------
        a : array_like
            Input array.  The elements in `a` are read in the order specified by
            `order`, and packed as a 1-D array.
        order : {'C','F', 'A', 'K'}, optional

            The elements of `a` are read using this index order. 'C' means
            to index the elements in row-major, C-style order,
            with the last axis index changing fastest, back to the first
            axis index changing slowest.  'F' means to index the elements
            in column-major, Fortran-style order, with the
            first index changing fastest, and the last index changing
            slowest. Note that the 'C' and 'F' options take no account of
            the memory layout of the underlying array, and only refer to
            the order of axis indexing.  'A' means to read the elements in
            Fortran-like index order if `a` is Fortran *contiguous* in
            memory, C-like order otherwise.  'K' means to read the
            elements in the order they occur in memory, except for
            reversing the data when strides are negative.  By default, 'C'
            index order is used.

        Returns
        -------
        y : array_like
            y is a contiguous 1-D array of the same subtype as `a`,
            with shape ``(a.size,)``.
            Note that matrices are special cased for backward compatibility,
            if `a` is a matrix, then y is a 1-D ndarray.

        See Also
        --------
        ndarray.flat : 1-D iterator over an array.
        ndarray.flatten : 1-D array copy of the elements of an array
                          in row-major order.
        ndarray.reshape : Change the shape of an array without changing its data.

        Notes
        -----
        In row-major, C-style order, in two dimensions, the row index
        varies the slowest, and the column index the quickest.  This can
        be generalized to multiple dimensions, where row-major order
        implies that the index along the first axis varies slowest, and
        the index along the last quickest.  The opposite holds for
        column-major, Fortran-style index ordering.

        When a view is desired in as many cases as possible, ``arr.reshape(-1)``
        may be preferable. However, ``ravel`` supports ``K`` in the optional
        ``order`` argument while ``reshape`` does not.

        Examples
        --------
        It is equivalent to ``reshape(-1, order=order)``.

        >>> import numpy as np
        >>> x = np.array([[1, 2, 3], [4, 5, 6]])
        >>> np.ravel(x)
        array([1, 2, 3, 4, 5, 6])

        >>> x.reshape(-1)
        array([1, 2, 3, 4, 5, 6])

        >>> np.ravel(x, order='F')
        array([1, 4, 2, 5, 3, 6])

        When ``order`` is 'A', it will preserve the array's 'C' or 'F' ordering:

        >>> np.ravel(x.T)
        array([1, 4, 2, 5, 3, 6])
        >>> np.ravel(x.T, order='A')
        array([1, 2, 3, 4, 5, 6])

        When ``order`` is 'K', it will preserve orderings that are neither 'C'
        nor 'F', but won't reverse axes:

        >>> a = np.arange(3)[::-1]; a
        array([2, 1, 0])
        >>> a.ravel(order='C')
        array([2, 1, 0])
        >>> a.ravel(order='K')
        array([2, 1, 0])

        >>> a = np.arange(12).reshape(2,3,2).swapaxes(1,2); a
        array([[[ 0,  2,  4],
                [ 1,  3,  5]],
               [[ 6,  8, 10],
                [ 7,  9, 11]]])
        >>> a.ravel(order='C')
        array([ 0,  2,  4,  1,  3,  5,  6,  8, 10,  7,  9, 11])
        >>> a.ravel(order='K')
        array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11])

    ravel_multi_index(...)
        ravel_multi_index(multi_index, dims, mode='raise', order='C')

        Converts a tuple of index arrays into an array of flat
        indices, applying boundary modes to the multi-index.

        Parameters
        ----------
        multi_index : tuple of array_like
            A tuple of integer arrays, one array for each dimension.
        dims : tuple of ints
            The shape of array into which the indices from ``multi_index`` apply.
        mode : {'raise', 'wrap', 'clip'}, optional
            Specifies how out-of-bounds indices are handled.  Can specify
            either one mode or a tuple of modes, one mode per index.

            * 'raise' -- raise an error (default)
            * 'wrap' -- wrap around
            * 'clip' -- clip to the range

            In 'clip' mode, a negative index which would normally
            wrap will clip to 0 instead.
        order : {'C', 'F'}, optional
            Determines whether the multi-index should be viewed as
            indexing in row-major (C-style) or column-major
            (Fortran-style) order.

        Returns
        -------
        raveled_indices : ndarray
            An array of indices into the flattened version of an array
            of dimensions ``dims``.

        See Also
        --------
        unravel_index

        Notes
        -----
        .. versionadded:: 1.6.0

        Examples
        --------
        >>> import numpy as np
        >>> arr = np.array([[3,6,6],[4,5,1]])
        >>> np.ravel_multi_index(arr, (7,6))
        array([22, 41, 37])
        >>> np.ravel_multi_index(arr, (7,6), order='F')
        array([31, 41, 13])
        >>> np.ravel_multi_index(arr, (4,6), mode='clip')
        array([22, 23, 19])
        >>> np.ravel_multi_index(arr, (4,4), mode=('clip','wrap'))
        array([12, 13, 13])

        >>> np.ravel_multi_index((3,1,4,1), (6,7,8,9))
        1621

    real(val)
        Return the real part of the complex argument.

        Parameters
        ----------
        val : array_like
            Input array.

        Returns
        -------
        out : ndarray or scalar
            The real component of the complex argument. If `val` is real, the type
            of `val` is used for the output.  If `val` has complex elements, the
            returned type is float.

        See Also
        --------
        real_if_close, imag, angle

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([1+2j, 3+4j, 5+6j])
        >>> a.real
        array([1.,  3.,  5.])
        >>> a.real = 9
        >>> a
        array([9.+2.j,  9.+4.j,  9.+6.j])
        >>> a.real = np.array([9, 8, 7])
        >>> a
        array([9.+2.j,  8.+4.j,  7.+6.j])
        >>> np.real(1 + 1j)
        1.0

    real_if_close(a, tol=100)
        If input is complex with all imaginary parts close to zero, return
        real parts.

        "Close to zero" is defined as `tol` * (machine epsilon of the type for
        `a`).

        Parameters
        ----------
        a : array_like
            Input array.
        tol : float
            Tolerance in machine epsilons for the complex part of the elements
            in the array. If the tolerance is <=1, then the absolute tolerance
            is used.

        Returns
        -------
        out : ndarray
            If `a` is real, the type of `a` is used for the output.  If `a`
            has complex elements, the returned type is float.

        See Also
        --------
        real, imag, angle

        Notes
        -----
        Machine epsilon varies from machine to machine and between data types
        but Python floats on most platforms have a machine epsilon equal to
        2.2204460492503131e-16.  You can use 'np.finfo(float).eps' to print
        out the machine epsilon for floats.

        Examples
        --------
        >>> import numpy as np
        >>> np.finfo(float).eps
        2.2204460492503131e-16 # may vary

        >>> np.real_if_close([2.1 + 4e-14j, 5.2 + 3e-15j], tol=1000)
        array([2.1, 5.2])
        >>> np.real_if_close([2.1 + 4e-13j, 5.2 + 3e-15j], tol=1000)
        array([2.1+4.e-13j, 5.2 + 3e-15j])

    repeat(a, repeats, axis=None)
        Repeat each element of an array after themselves

        Parameters
        ----------
        a : array_like
            Input array.
        repeats : int or array of ints
            The number of repetitions for each element.  `repeats` is broadcasted
            to fit the shape of the given axis.
        axis : int, optional
            The axis along which to repeat values.  By default, use the
            flattened input array, and return a flat output array.

        Returns
        -------
        repeated_array : ndarray
            Output array which has the same shape as `a`, except along
            the given axis.

        See Also
        --------
        tile : Tile an array.
        unique : Find the unique elements of an array.

        Examples
        --------
        >>> import numpy as np
        >>> np.repeat(3, 4)
        array([3, 3, 3, 3])
        >>> x = np.array([[1,2],[3,4]])
        >>> np.repeat(x, 2)
        array([1, 1, 2, 2, 3, 3, 4, 4])
        >>> np.repeat(x, 3, axis=1)
        array([[1, 1, 1, 2, 2, 2],
               [3, 3, 3, 4, 4, 4]])
        >>> np.repeat(x, [1, 2], axis=0)
        array([[1, 2],
               [3, 4],
               [3, 4]])

    require(a, dtype=None, requirements=None, *, like=None)
        Return an ndarray of the provided type that satisfies requirements.

        This function is useful to be sure that an array with the correct flags
        is returned for passing to compiled code (perhaps through ctypes).

        Parameters
        ----------
        a : array_like
           The object to be converted to a type-and-requirement-satisfying array.
        dtype : data-type
           The required data-type. If None preserve the current dtype. If your
           application requires the data to be in native byteorder, include
           a byteorder specification as a part of the dtype specification.
        requirements : str or sequence of str
           The requirements list can be any of the following

           * 'F_CONTIGUOUS' ('F') - ensure a Fortran-contiguous array
           * 'C_CONTIGUOUS' ('C') - ensure a C-contiguous array
           * 'ALIGNED' ('A')      - ensure a data-type aligned array
           * 'WRITEABLE' ('W')    - ensure a writable array
           * 'OWNDATA' ('O')      - ensure an array that owns its own data
           * 'ENSUREARRAY', ('E') - ensure a base array, instead of a subclass
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            Array with specified requirements and type if given.

        See Also
        --------
        asarray : Convert input to an ndarray.
        asanyarray : Convert to an ndarray, but pass through ndarray subclasses.
        ascontiguousarray : Convert input to a contiguous array.
        asfortranarray : Convert input to an ndarray with column-major
                         memory order.
        ndarray.flags : Information about the memory layout of the array.

        Notes
        -----
        The returned array will be guaranteed to have the listed requirements
        by making a copy if needed.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(6).reshape(2,3)
        >>> x.flags
          C_CONTIGUOUS : True
          F_CONTIGUOUS : False
          OWNDATA : False
          WRITEABLE : True
          ALIGNED : True
          WRITEBACKIFCOPY : False

        >>> y = np.require(x, dtype=np.float32, requirements=['A', 'O', 'W', 'F'])
        >>> y.flags
          C_CONTIGUOUS : False
          F_CONTIGUOUS : True
          OWNDATA : True
          WRITEABLE : True
          ALIGNED : True
          WRITEBACKIFCOPY : False

    reshape(a, /, shape=None, order='C', *, newshape=None, copy=None)
        Gives a new shape to an array without changing its data.

        Parameters
        ----------
        a : array_like
            Array to be reshaped.
        shape : int or tuple of ints
            The new shape should be compatible with the original shape. If
            an integer, then the result will be a 1-D array of that length.
            One shape dimension can be -1. In this case, the value is
            inferred from the length of the array and remaining dimensions.
        order : {'C', 'F', 'A'}, optional
            Read the elements of ``a`` using this index order, and place the
            elements into the reshaped array using this index order. 'C'
            means to read / write the elements using C-like index order,
            with the last axis index changing fastest, back to the first
            axis index changing slowest. 'F' means to read / write the
            elements using Fortran-like index order, with the first index
            changing fastest, and the last index changing slowest. Note that
            the 'C' and 'F' options take no account of the memory layout of
            the underlying array, and only refer to the order of indexing.
            'A' means to read / write the elements in Fortran-like index
            order if ``a`` is Fortran *contiguous* in memory, C-like order
            otherwise.
        newshape : int or tuple of ints
            .. deprecated:: 2.1
                Replaced by ``shape`` argument. Retained for backward
                compatibility.
        copy : bool, optional
            If ``True``, then the array data is copied. If ``None``, a copy will
            only be made if it's required by ``order``. For ``False`` it raises
            a ``ValueError`` if a copy cannot be avoided. Default: ``None``.

        Returns
        -------
        reshaped_array : ndarray
            This will be a new view object if possible; otherwise, it will
            be a copy.  Note there is no guarantee of the *memory layout* (C- or
            Fortran- contiguous) of the returned array.

        See Also
        --------
        ndarray.reshape : Equivalent method.

        Notes
        -----
        It is not always possible to change the shape of an array without copying
        the data.

        The ``order`` keyword gives the index ordering both for *fetching*
        the values from ``a``, and then *placing* the values into the output
        array. For example, let's say you have an array:

        >>> a = np.arange(6).reshape((3, 2))
        >>> a
        array([[0, 1],
               [2, 3],
               [4, 5]])

        You can think of reshaping as first raveling the array (using the given
        index order), then inserting the elements from the raveled array into the
        new array using the same kind of index ordering as was used for the
        raveling.

        >>> np.reshape(a, (2, 3)) # C-like index ordering
        array([[0, 1, 2],
               [3, 4, 5]])
        >>> np.reshape(np.ravel(a), (2, 3)) # equivalent to C ravel then C reshape
        array([[0, 1, 2],
               [3, 4, 5]])
        >>> np.reshape(a, (2, 3), order='F') # Fortran-like index ordering
        array([[0, 4, 3],
               [2, 1, 5]])
        >>> np.reshape(np.ravel(a, order='F'), (2, 3), order='F')
        array([[0, 4, 3],
               [2, 1, 5]])

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1,2,3], [4,5,6]])
        >>> np.reshape(a, 6)
        array([1, 2, 3, 4, 5, 6])
        >>> np.reshape(a, 6, order='F')
        array([1, 4, 2, 5, 3, 6])

        >>> np.reshape(a, (3,-1))       # the unspecified value is inferred to be 2
        array([[1, 2],
               [3, 4],
               [5, 6]])

    resize(a, new_shape)
        Return a new array with the specified shape.

        If the new array is larger than the original array, then the new
        array is filled with repeated copies of `a`.  Note that this behavior
        is different from a.resize(new_shape) which fills with zeros instead
        of repeated copies of `a`.

        Parameters
        ----------
        a : array_like
            Array to be resized.

        new_shape : int or tuple of int
            Shape of resized array.

        Returns
        -------
        reshaped_array : ndarray
            The new array is formed from the data in the old array, repeated
            if necessary to fill out the required number of elements.  The
            data are repeated iterating over the array in C-order.

        See Also
        --------
        numpy.reshape : Reshape an array without changing the total size.
        numpy.pad : Enlarge and pad an array.
        numpy.repeat : Repeat elements of an array.
        ndarray.resize : resize an array in-place.

        Notes
        -----
        When the total size of the array does not change `~numpy.reshape` should
        be used.  In most other cases either indexing (to reduce the size)
        or padding (to increase the size) may be a more appropriate solution.

        Warning: This functionality does **not** consider axes separately,
        i.e. it does not apply interpolation/extrapolation.
        It fills the return array with the required number of elements, iterating
        over `a` in C-order, disregarding axes (and cycling back from the start if
        the new shape is larger).  This functionality is therefore not suitable to
        resize images, or data where each axis represents a separate and distinct
        entity.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[0,1],[2,3]])
        >>> np.resize(a,(2,3))
        array([[0, 1, 2],
               [3, 0, 1]])
        >>> np.resize(a,(1,4))
        array([[0, 1, 2, 3]])
        >>> np.resize(a,(2,4))
        array([[0, 1, 2, 3],
               [0, 1, 2, 3]])

    result_type(...)
        result_type(*arrays_and_dtypes)

        Returns the type that results from applying the NumPy
        type promotion rules to the arguments.

        Type promotion in NumPy works similarly to the rules in languages
        like C++, with some slight differences.  When both scalars and
        arrays are used, the array's type takes precedence and the actual value
        of the scalar is taken into account.

        For example, calculating 3*a, where a is an array of 32-bit floats,
        intuitively should result in a 32-bit float output.  If the 3 is a
        32-bit integer, the NumPy rules indicate it can't convert losslessly
        into a 32-bit float, so a 64-bit float should be the result type.
        By examining the value of the constant, '3', we see that it fits in
        an 8-bit integer, which can be cast losslessly into the 32-bit float.

        Parameters
        ----------
        arrays_and_dtypes : list of arrays and dtypes
            The operands of some operation whose result type is needed.

        Returns
        -------
        out : dtype
            The result type.

        See also
        --------
        dtype, promote_types, min_scalar_type, can_cast

        Notes
        -----
        .. versionadded:: 1.6.0

        The specific algorithm used is as follows.

        Categories are determined by first checking which of boolean,
        integer (int/uint), or floating point (float/complex) the maximum
        kind of all the arrays and the scalars are.

        If there are only scalars or the maximum category of the scalars
        is higher than the maximum category of the arrays,
        the data types are combined with :func:`promote_types`
        to produce the return value.

        Otherwise, `min_scalar_type` is called on each scalar, and
        the resulting data types are all combined with :func:`promote_types`
        to produce the return value.

        The set of int values is not a subset of the uint values for types
        with the same number of bits, something not reflected in
        :func:`min_scalar_type`, but handled as a special case in `result_type`.

        Examples
        --------
        >>> import numpy as np
        >>> np.result_type(3, np.arange(7, dtype='i1'))
        dtype('int8')

        >>> np.result_type('i4', 'c8')
        dtype('complex128')

        >>> np.result_type(3.0, -2)
        dtype('float64')

    roll(a, shift, axis=None)
        Roll array elements along a given axis.

        Elements that roll beyond the last position are re-introduced at
        the first.

        Parameters
        ----------
        a : array_like
            Input array.
        shift : int or tuple of ints
            The number of places by which elements are shifted.  If a tuple,
            then `axis` must be a tuple of the same size, and each of the
            given axes is shifted by the corresponding number.  If an int
            while `axis` is a tuple of ints, then the same value is used for
            all given axes.
        axis : int or tuple of ints, optional
            Axis or axes along which elements are shifted.  By default, the
            array is flattened before shifting, after which the original
            shape is restored.

        Returns
        -------
        res : ndarray
            Output array, with the same shape as `a`.

        See Also
        --------
        rollaxis : Roll the specified axis backwards, until it lies in a
                   given position.

        Notes
        -----
        .. versionadded:: 1.12.0

        Supports rolling over multiple dimensions simultaneously.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(10)
        >>> np.roll(x, 2)
        array([8, 9, 0, 1, 2, 3, 4, 5, 6, 7])
        >>> np.roll(x, -2)
        array([2, 3, 4, 5, 6, 7, 8, 9, 0, 1])

        >>> x2 = np.reshape(x, (2, 5))
        >>> x2
        array([[0, 1, 2, 3, 4],
               [5, 6, 7, 8, 9]])
        >>> np.roll(x2, 1)
        array([[9, 0, 1, 2, 3],
               [4, 5, 6, 7, 8]])
        >>> np.roll(x2, -1)
        array([[1, 2, 3, 4, 5],
               [6, 7, 8, 9, 0]])
        >>> np.roll(x2, 1, axis=0)
        array([[5, 6, 7, 8, 9],
               [0, 1, 2, 3, 4]])
        >>> np.roll(x2, -1, axis=0)
        array([[5, 6, 7, 8, 9],
               [0, 1, 2, 3, 4]])
        >>> np.roll(x2, 1, axis=1)
        array([[4, 0, 1, 2, 3],
               [9, 5, 6, 7, 8]])
        >>> np.roll(x2, -1, axis=1)
        array([[1, 2, 3, 4, 0],
               [6, 7, 8, 9, 5]])
        >>> np.roll(x2, (1, 1), axis=(1, 0))
        array([[9, 5, 6, 7, 8],
               [4, 0, 1, 2, 3]])
        >>> np.roll(x2, (2, 1), axis=(1, 0))
        array([[8, 9, 5, 6, 7],
               [3, 4, 0, 1, 2]])

    rollaxis(a, axis, start=0)
        Roll the specified axis backwards, until it lies in a given position.

        This function continues to be supported for backward compatibility, but you
        should prefer `moveaxis`. The `moveaxis` function was added in NumPy
        1.11.

        Parameters
        ----------
        a : ndarray
            Input array.
        axis : int
            The axis to be rolled. The positions of the other axes do not
            change relative to one another.
        start : int, optional
            When ``start <= axis``, the axis is rolled back until it lies in
            this position. When ``start > axis``, the axis is rolled until it
            lies before this position. The default, 0, results in a "complete"
            roll. The following table describes how negative values of ``start``
            are interpreted:

            .. table::
               :align: left

               +-------------------+----------------------+
               |     ``start``     | Normalized ``start`` |
               +===================+======================+
               | ``-(arr.ndim+1)`` | raise ``AxisError``  |
               +-------------------+----------------------+
               | ``-arr.ndim``     | 0                    |
               +-------------------+----------------------+
               | |vdots|           | |vdots|              |
               +-------------------+----------------------+
               | ``-1``            | ``arr.ndim-1``       |
               +-------------------+----------------------+
               | ``0``             | ``0``                |
               +-------------------+----------------------+
               | |vdots|           | |vdots|              |
               +-------------------+----------------------+
               | ``arr.ndim``      | ``arr.ndim``         |
               +-------------------+----------------------+
               | ``arr.ndim + 1``  | raise ``AxisError``  |
               +-------------------+----------------------+

            .. |vdots|   unicode:: U+22EE .. Vertical Ellipsis

        Returns
        -------
        res : ndarray
            For NumPy >= 1.10.0 a view of `a` is always returned. For earlier
            NumPy versions a view of `a` is returned only if the order of the
            axes is changed, otherwise the input array is returned.

        See Also
        --------
        moveaxis : Move array axes to new positions.
        roll : Roll the elements of an array by a number of positions along a
            given axis.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.ones((3,4,5,6))
        >>> np.rollaxis(a, 3, 1).shape
        (3, 6, 4, 5)
        >>> np.rollaxis(a, 2).shape
        (5, 3, 4, 6)
        >>> np.rollaxis(a, 1, 4).shape
        (3, 5, 6, 4)

    roots(p)
        Return the roots of a polynomial with coefficients given in p.

        .. note::
           This forms part of the old polynomial API. Since version 1.4, the
           new polynomial API defined in `numpy.polynomial` is preferred.
           A summary of the differences can be found in the
           :doc:`transition guide </reference/routines.polynomials>`.

        The values in the rank-1 array `p` are coefficients of a polynomial.
        If the length of `p` is n+1 then the polynomial is described by::

          p[0] * x**n + p[1] * x**(n-1) + ... + p[n-1]*x + p[n]

        Parameters
        ----------
        p : array_like
            Rank-1 array of polynomial coefficients.

        Returns
        -------
        out : ndarray
            An array containing the roots of the polynomial.

        Raises
        ------
        ValueError
            When `p` cannot be converted to a rank-1 array.

        See also
        --------
        poly : Find the coefficients of a polynomial with a given sequence
               of roots.
        polyval : Compute polynomial values.
        polyfit : Least squares polynomial fit.
        poly1d : A one-dimensional polynomial class.

        Notes
        -----
        The algorithm relies on computing the eigenvalues of the
        companion matrix [1]_.

        References
        ----------
        .. [1] R. A. Horn & C. R. Johnson, *Matrix Analysis*.  Cambridge, UK:
            Cambridge University Press, 1999, pp. 146-7.

        Examples
        --------
        >>> import numpy as np
        >>> coeff = [3.2, 2, 1]
        >>> np.roots(coeff)
        array([-0.3125+0.46351241j, -0.3125-0.46351241j])

    rot90(m, k=1, axes=(0, 1))
        Rotate an array by 90 degrees in the plane specified by axes.

        Rotation direction is from the first towards the second axis.
        This means for a 2D array with the default `k` and `axes`, the
        rotation will be counterclockwise.

        Parameters
        ----------
        m : array_like
            Array of two or more dimensions.
        k : integer
            Number of times the array is rotated by 90 degrees.
        axes : (2,) array_like
            The array is rotated in the plane defined by the axes.
            Axes must be different.

            .. versionadded:: 1.12.0

        Returns
        -------
        y : ndarray
            A rotated view of `m`.

        See Also
        --------
        flip : Reverse the order of elements in an array along the given axis.
        fliplr : Flip an array horizontally.
        flipud : Flip an array vertically.

        Notes
        -----
        ``rot90(m, k=1, axes=(1,0))``  is the reverse of
        ``rot90(m, k=1, axes=(0,1))``

        ``rot90(m, k=1, axes=(1,0))`` is equivalent to
        ``rot90(m, k=-1, axes=(0,1))``

        Examples
        --------
        >>> import numpy as np
        >>> m = np.array([[1,2],[3,4]], int)
        >>> m
        array([[1, 2],
               [3, 4]])
        >>> np.rot90(m)
        array([[2, 4],
               [1, 3]])
        >>> np.rot90(m, 2)
        array([[4, 3],
               [2, 1]])
        >>> m = np.arange(8).reshape((2,2,2))
        >>> np.rot90(m, 1, (1,2))
        array([[[1, 3],
                [0, 2]],
               [[5, 7],
                [4, 6]]])

    round(a, decimals=0, out=None)
        Evenly round to the given number of decimals.

        Parameters
        ----------
        a : array_like
            Input data.
        decimals : int, optional
            Number of decimal places to round to (default: 0).  If
            decimals is negative, it specifies the number of positions to
            the left of the decimal point.
        out : ndarray, optional
            Alternative output array in which to place the result. It must have
            the same shape as the expected output, but the type of the output
            values will be cast if necessary. See :ref:`ufuncs-output-type`
            for more details.

        Returns
        -------
        rounded_array : ndarray
            An array of the same type as `a`, containing the rounded values.
            Unless `out` was specified, a new array is created.  A reference to
            the result is returned.

            The real and imaginary parts of complex numbers are rounded
            separately.  The result of rounding a float is a float.

        See Also
        --------
        ndarray.round : equivalent method
        around : an alias for this function
        ceil, fix, floor, rint, trunc


        Notes
        -----
        For values exactly halfway between rounded decimal values, NumPy
        rounds to the nearest even value. Thus 1.5 and 2.5 round to 2.0,
        -0.5 and 0.5 round to 0.0, etc.

        ``np.round`` uses a fast but sometimes inexact algorithm to round
        floating-point datatypes. For positive `decimals` it is equivalent to
        ``np.true_divide(np.rint(a * 10**decimals), 10**decimals)``, which has
        error due to the inexact representation of decimal fractions in the IEEE
        floating point standard [1]_ and errors introduced when scaling by powers
        of ten. For instance, note the extra "1" in the following:

            >>> np.round(56294995342131.5, 3)
            56294995342131.51

        If your goal is to print such values with a fixed number of decimals, it is
        preferable to use numpy's float printing routines to limit the number of
        printed decimals:

            >>> np.format_float_positional(56294995342131.5, precision=3)
            '56294995342131.5'

        The float printing routines use an accurate but much more computationally
        demanding algorithm to compute the number of digits after the decimal
        point.

        Alternatively, Python's builtin `round` function uses a more accurate
        but slower algorithm for 64-bit floating point values:

            >>> round(56294995342131.5, 3)
            56294995342131.5
            >>> np.round(16.055, 2), round(16.055, 2)  # equals 16.0549999999999997
            (16.06, 16.05)


        References
        ----------
        .. [1] "Lecture Notes on the Status of IEEE 754", William Kahan,
               https://people.eecs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF

        Examples
        --------
        >>> import numpy as np
        >>> np.round([0.37, 1.64])
        array([0., 2.])
        >>> np.round([0.37, 1.64], decimals=1)
        array([0.4, 1.6])
        >>> np.round([.5, 1.5, 2.5, 3.5, 4.5]) # rounds to nearest even value
        array([0., 2., 2., 4., 4.])
        >>> np.round([1,2,3,11], decimals=1) # ndarray of ints is returned
        array([ 1,  2,  3, 11])
        >>> np.round([1,2,3,11], decimals=-1)
        array([ 0,  0,  0, 10])

    row_stack(tup, *, dtype=None, casting='same_kind')
        Stack arrays in sequence vertically (row wise).

        This is equivalent to concatenation along the first axis after 1-D arrays
        of shape `(N,)` have been reshaped to `(1,N)`. Rebuilds arrays divided by
        `vsplit`.

        This function makes most sense for arrays with up to 3 dimensions. For
        instance, for pixel-data with a height (first axis), width (second axis),
        and r/g/b channels (third axis). The functions `concatenate`, `stack` and
        `block` provide more general stacking and concatenation operations.

        Parameters
        ----------
        tup : sequence of ndarrays
            The arrays must have the same shape along all but the first axis.
            1-D arrays must have the same length.

        dtype : str or dtype
            If provided, the destination array will have this dtype. Cannot be
            provided together with `out`.

            .. versionadded:: 1.24

        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
            Controls what kind of data casting may occur. Defaults to 'same_kind'.

            .. versionadded:: 1.24

        Returns
        -------
        stacked : ndarray
            The array formed by stacking the given arrays, will be at least 2-D.

        See Also
        --------
        concatenate : Join a sequence of arrays along an existing axis.
        stack : Join a sequence of arrays along a new axis.
        block : Assemble an nd-array from nested lists of blocks.
        hstack : Stack arrays in sequence horizontally (column wise).
        dstack : Stack arrays in sequence depth wise (along third axis).
        column_stack : Stack 1-D arrays as columns into a 2-D array.
        vsplit : Split an array into multiple sub-arrays vertically (row-wise).
        unstack : Split an array into a tuple of sub-arrays along an axis.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([1, 2, 3])
        >>> b = np.array([4, 5, 6])
        >>> np.vstack((a,b))
        array([[1, 2, 3],
               [4, 5, 6]])

        >>> a = np.array([[1], [2], [3]])
        >>> b = np.array([[4], [5], [6]])
        >>> np.vstack((a,b))
        array([[1],
               [2],
               [3],
               [4],
               [5],
               [6]])

    save(file, arr, allow_pickle=True, fix_imports=<no value>)
        Save an array to a binary file in NumPy ``.npy`` format.

        Parameters
        ----------
        file : file, str, or pathlib.Path
            File or filename to which the data is saved. If file is a file-object,
            then the filename is unchanged.  If file is a string or Path,
            a ``.npy`` extension will be appended to the filename if it does not
            already have one.
        arr : array_like
            Array data to be saved.
        allow_pickle : bool, optional
            Allow saving object arrays using Python pickles. Reasons for
            disallowing pickles include security (loading pickled data can execute
            arbitrary code) and portability (pickled objects may not be loadable
            on different Python installations, for example if the stored objects
            require libraries that are not available, and not all pickled data is
            compatible between different versions of Python).
            Default: True
        fix_imports : bool, optional
            The `fix_imports` flag is deprecated and has no effect.

            .. deprecated:: 2.1
                This flag is ignored since NumPy 1.17 and was only needed to
                support loading some files in Python 2 written in Python 3.

        See Also
        --------
        savez : Save several arrays into a ``.npz`` archive
        savetxt, load

        Notes
        -----
        For a description of the ``.npy`` format, see :py:mod:`numpy.lib.format`.

        Any data saved to the file is appended to the end of the file.

        Examples
        --------
        >>> import numpy as np

        >>> from tempfile import TemporaryFile
        >>> outfile = TemporaryFile()

        >>> x = np.arange(10)
        >>> np.save(outfile, x)

        >>> _ = outfile.seek(0) # Only needed to simulate closing & reopening file
        >>> np.load(outfile)
        array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])


        >>> with open('test.npy', 'wb') as f:
        ...     np.save(f, np.array([1, 2]))
        ...     np.save(f, np.array([1, 3]))
        >>> with open('test.npy', 'rb') as f:
        ...     a = np.load(f)
        ...     b = np.load(f)
        >>> print(a, b)
        # [1 2] [1 3]

    savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='\n', header='', footer='', comments='# ', encoding=None)
        Save an array to a text file.

        Parameters
        ----------
        fname : filename, file handle or pathlib.Path
            If the filename ends in ``.gz``, the file is automatically saved in
            compressed gzip format.  `loadtxt` understands gzipped files
            transparently.
        X : 1D or 2D array_like
            Data to be saved to a text file.
        fmt : str or sequence of strs, optional
            A single format (%10.5f), a sequence of formats, or a
            multi-format string, e.g. 'Iteration %d -- %10.5f', in which
            case `delimiter` is ignored. For complex `X`, the legal options
            for `fmt` are:

            * a single specifier, ``fmt='%.4e'``, resulting in numbers formatted
              like ``' (%s+%sj)' % (fmt, fmt)``
            * a full string specifying every real and imaginary part, e.g.
              ``' %.4e %+.4ej %.4e %+.4ej %.4e %+.4ej'`` for 3 columns
            * a list of specifiers, one per column - in this case, the real
              and imaginary part must have separate specifiers,
              e.g. ``['%.3e + %.3ej', '(%.15e%+.15ej)']`` for 2 columns
        delimiter : str, optional
            String or character separating columns.
        newline : str, optional
            String or character separating lines.

            .. versionadded:: 1.5.0
        header : str, optional
            String that will be written at the beginning of the file.

            .. versionadded:: 1.7.0
        footer : str, optional
            String that will be written at the end of the file.

            .. versionadded:: 1.7.0
        comments : str, optional
            String that will be prepended to the ``header`` and ``footer`` strings,
            to mark them as comments. Default: '# ',  as expected by e.g.
            ``numpy.loadtxt``.

            .. versionadded:: 1.7.0
        encoding : {None, str}, optional
            Encoding used to encode the outputfile. Does not apply to output
            streams. If the encoding is something other than 'bytes' or 'latin1'
            you will not be able to load the file in NumPy versions < 1.14. Default
            is 'latin1'.

            .. versionadded:: 1.14.0


        See Also
        --------
        save : Save an array to a binary file in NumPy ``.npy`` format
        savez : Save several arrays into an uncompressed ``.npz`` archive
        savez_compressed : Save several arrays into a compressed ``.npz`` archive

        Notes
        -----
        Further explanation of the `fmt` parameter
        (``%[flag]width[.precision]specifier``):

        flags:
            ``-`` : left justify

            ``+`` : Forces to precede result with + or -.

            ``0`` : Left pad the number with zeros instead of space (see width).

        width:
            Minimum number of characters to be printed. The value is not truncated
            if it has more characters.

        precision:
            - For integer specifiers (eg. ``d,i,o,x``), the minimum number of
              digits.
            - For ``e, E`` and ``f`` specifiers, the number of digits to print
              after the decimal point.
            - For ``g`` and ``G``, the maximum number of significant digits.
            - For ``s``, the maximum number of characters.

        specifiers:
            ``c`` : character

            ``d`` or ``i`` : signed decimal integer

            ``e`` or ``E`` : scientific notation with ``e`` or ``E``.

            ``f`` : decimal floating point

            ``g,G`` : use the shorter of ``e,E`` or ``f``

            ``o`` : signed octal

            ``s`` : string of characters

            ``u`` : unsigned decimal integer

            ``x,X`` : unsigned hexadecimal integer

        This explanation of ``fmt`` is not complete, for an exhaustive
        specification see [1]_.

        References
        ----------
        .. [1] `Format Specification Mini-Language
               <https://docs.python.org/library/string.html#format-specification-mini-language>`_,
               Python Documentation.

        Examples
        --------
        >>> import numpy as np
        >>> x = y = z = np.arange(0.0,5.0,1.0)
        >>> np.savetxt('test.out', x, delimiter=',')   # X is an array
        >>> np.savetxt('test.out', (x,y,z))   # x,y,z equal sized 1D arrays
        >>> np.savetxt('test.out', x, fmt='%1.4e')   # use exponential notation

    savez(file, *args, **kwds)
        Save several arrays into a single file in uncompressed ``.npz`` format.

        Provide arrays as keyword arguments to store them under the
        corresponding name in the output file: ``savez(fn, x=x, y=y)``.

        If arrays are specified as positional arguments, i.e., ``savez(fn,
        x, y)``, their names will be `arr_0`, `arr_1`, etc.

        Parameters
        ----------
        file : file, str, or pathlib.Path
            Either the filename (string) or an open file (file-like object)
            where the data will be saved. If file is a string or a Path, the
            ``.npz`` extension will be appended to the filename if it is not
            already there.
        args : Arguments, optional
            Arrays to save to the file. Please use keyword arguments (see
            `kwds` below) to assign names to arrays.  Arrays specified as
            args will be named "arr_0", "arr_1", and so on.
        kwds : Keyword arguments, optional
            Arrays to save to the file. Each array will be saved to the
            output file with its corresponding keyword name.

        Returns
        -------
        None

        See Also
        --------
        save : Save a single array to a binary file in NumPy format.
        savetxt : Save an array to a file as plain text.
        savez_compressed : Save several arrays into a compressed ``.npz`` archive

        Notes
        -----
        The ``.npz`` file format is a zipped archive of files named after the
        variables they contain.  The archive is not compressed and each file
        in the archive contains one variable in ``.npy`` format. For a
        description of the ``.npy`` format, see :py:mod:`numpy.lib.format`.

        When opening the saved ``.npz`` file with `load` a `~lib.npyio.NpzFile`
        object is returned. This is a dictionary-like object which can be queried
        for its list of arrays (with the ``.files`` attribute), and for the arrays
        themselves.

        Keys passed in `kwds` are used as filenames inside the ZIP archive.
        Therefore, keys should be valid filenames; e.g., avoid keys that begin with
        ``/`` or contain ``.``.

        When naming variables with keyword arguments, it is not possible to name a
        variable ``file``, as this would cause the ``file`` argument to be defined
        twice in the call to ``savez``.

        Examples
        --------
        >>> import numpy as np
        >>> from tempfile import TemporaryFile
        >>> outfile = TemporaryFile()
        >>> x = np.arange(10)
        >>> y = np.sin(x)

        Using `savez` with \*args, the arrays are saved with default names.

        >>> np.savez(outfile, x, y)
        >>> _ = outfile.seek(0) # Only needed to simulate closing & reopening file
        >>> npzfile = np.load(outfile)
        >>> npzfile.files
        ['arr_0', 'arr_1']
        >>> npzfile['arr_0']
        array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

        Using `savez` with \**kwds, the arrays are saved with the keyword names.

        >>> outfile = TemporaryFile()
        >>> np.savez(outfile, x=x, y=y)
        >>> _ = outfile.seek(0)
        >>> npzfile = np.load(outfile)
        >>> sorted(npzfile.files)
        ['x', 'y']
        >>> npzfile['x']
        array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

    savez_compressed(file, *args, **kwds)
        Save several arrays into a single file in compressed ``.npz`` format.

        Provide arrays as keyword arguments to store them under the
        corresponding name in the output file: ``savez_compressed(fn, x=x, y=y)``.

        If arrays are specified as positional arguments, i.e.,
        ``savez_compressed(fn, x, y)``, their names will be `arr_0`, `arr_1`, etc.

        Parameters
        ----------
        file : file, str, or pathlib.Path
            Either the filename (string) or an open file (file-like object)
            where the data will be saved. If file is a string or a Path, the
            ``.npz`` extension will be appended to the filename if it is not
            already there.
        args : Arguments, optional
            Arrays to save to the file. Please use keyword arguments (see
            `kwds` below) to assign names to arrays.  Arrays specified as
            args will be named "arr_0", "arr_1", and so on.
        kwds : Keyword arguments, optional
            Arrays to save to the file. Each array will be saved to the
            output file with its corresponding keyword name.

        Returns
        -------
        None

        See Also
        --------
        numpy.save : Save a single array to a binary file in NumPy format.
        numpy.savetxt : Save an array to a file as plain text.
        numpy.savez : Save several arrays into an uncompressed ``.npz`` file format
        numpy.load : Load the files created by savez_compressed.

        Notes
        -----
        The ``.npz`` file format is a zipped archive of files named after the
        variables they contain.  The archive is compressed with
        ``zipfile.ZIP_DEFLATED`` and each file in the archive contains one variable
        in ``.npy`` format. For a description of the ``.npy`` format, see
        :py:mod:`numpy.lib.format`.


        When opening the saved ``.npz`` file with `load` a `~lib.npyio.NpzFile`
        object is returned. This is a dictionary-like object which can be queried
        for its list of arrays (with the ``.files`` attribute), and for the arrays
        themselves.

        Examples
        --------
        >>> import numpy as np
        >>> test_array = np.random.rand(3, 2)
        >>> test_vector = np.random.rand(4)
        >>> np.savez_compressed('/tmp/123', a=test_array, b=test_vector)
        >>> loaded = np.load('/tmp/123.npz')
        >>> print(np.array_equal(test_array, loaded['a']))
        True
        >>> print(np.array_equal(test_vector, loaded['b']))
        True

    searchsorted(a, v, side='left', sorter=None)
        Find indices where elements should be inserted to maintain order.

        Find the indices into a sorted array `a` such that, if the
        corresponding elements in `v` were inserted before the indices, the
        order of `a` would be preserved.

        Assuming that `a` is sorted:

        ======  ============================
        `side`  returned index `i` satisfies
        ======  ============================
        left    ``a[i-1] < v <= a[i]``
        right   ``a[i-1] <= v < a[i]``
        ======  ============================

        Parameters
        ----------
        a : 1-D array_like
            Input array. If `sorter` is None, then it must be sorted in
            ascending order, otherwise `sorter` must be an array of indices
            that sort it.
        v : array_like
            Values to insert into `a`.
        side : {'left', 'right'}, optional
            If 'left', the index of the first suitable location found is given.
            If 'right', return the last such index.  If there is no suitable
            index, return either 0 or N (where N is the length of `a`).
        sorter : 1-D array_like, optional
            Optional array of integer indices that sort array a into ascending
            order. They are typically the result of argsort.

            .. versionadded:: 1.7.0

        Returns
        -------
        indices : int or array of ints
            Array of insertion points with the same shape as `v`,
            or an integer if `v` is a scalar.

        See Also
        --------
        sort : Return a sorted copy of an array.
        histogram : Produce histogram from 1-D data.

        Notes
        -----
        Binary search is used to find the required insertion points.

        As of NumPy 1.4.0 `searchsorted` works with real/complex arrays containing
        `nan` values. The enhanced sort order is documented in `sort`.

        This function uses the same algorithm as the builtin python
        `bisect.bisect_left` (``side='left'``) and `bisect.bisect_right`
        (``side='right'``) functions, which is also vectorized
        in the `v` argument.

        Examples
        --------
        >>> import numpy as np
        >>> np.searchsorted([11,12,13,14,15], 13)
        2
        >>> np.searchsorted([11,12,13,14,15], 13, side='right')
        3
        >>> np.searchsorted([11,12,13,14,15], [-10, 20, 12, 13])
        array([0, 5, 1, 2])

    select(condlist, choicelist, default=0)
        Return an array drawn from elements in choicelist, depending on conditions.

        Parameters
        ----------
        condlist : list of bool ndarrays
            The list of conditions which determine from which array in `choicelist`
            the output elements are taken. When multiple conditions are satisfied,
            the first one encountered in `condlist` is used.
        choicelist : list of ndarrays
            The list of arrays from which the output elements are taken. It has
            to be of the same length as `condlist`.
        default : scalar, optional
            The element inserted in `output` when all conditions evaluate to False.

        Returns
        -------
        output : ndarray
            The output at position m is the m-th element of the array in
            `choicelist` where the m-th element of the corresponding array in
            `condlist` is True.

        See Also
        --------
        where : Return elements from one of two arrays depending on condition.
        take, choose, compress, diag, diagonal

        Examples
        --------
        >>> import numpy as np

        Beginning with an array of integers from 0 to 5 (inclusive),
        elements less than ``3`` are negated, elements greater than ``3``
        are squared, and elements not meeting either of these conditions
        (exactly ``3``) are replaced with a `default` value of ``42``.

        >>> x = np.arange(6)
        >>> condlist = [x<3, x>3]
        >>> choicelist = [x, x**2]
        >>> np.select(condlist, choicelist, 42)
        array([ 0,  1,  2, 42, 16, 25])

        When multiple conditions are satisfied, the first one encountered in
        `condlist` is used.

        >>> condlist = [x<=4, x>3]
        >>> choicelist = [x, x**2]
        >>> np.select(condlist, choicelist, 55)
        array([ 0,  1,  2,  3,  4, 25])

    set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, suppress=None, nanstr=None, infstr=None, formatter=None, sign=None, floatmode=None, *, legacy=None, override_repr=None)
        Set printing options.

        These options determine the way floating point numbers, arrays and
        other NumPy objects are displayed.

        Parameters
        ----------
        precision : int or None, optional
            Number of digits of precision for floating point output (default 8).
            May be None if `floatmode` is not `fixed`, to print as many digits as
            necessary to uniquely specify the value.
        threshold : int, optional
            Total number of array elements which trigger summarization
            rather than full repr (default 1000).
            To always use the full repr without summarization, pass `sys.maxsize`.
        edgeitems : int, optional
            Number of array items in summary at beginning and end of
            each dimension (default 3).
        linewidth : int, optional
            The number of characters per line for the purpose of inserting
            line breaks (default 75).
        suppress : bool, optional
            If True, always print floating point numbers using fixed point
            notation, in which case numbers equal to zero in the current precision
            will print as zero.  If False, then scientific notation is used when
            absolute value of the smallest number is < 1e-4 or the ratio of the
            maximum absolute value to the minimum is > 1e3. The default is False.
        nanstr : str, optional
            String representation of floating point not-a-number (default nan).
        infstr : str, optional
            String representation of floating point infinity (default inf).
        sign : string, either '-', '+', or ' ', optional
            Controls printing of the sign of floating-point types. If '+', always
            print the sign of positive values. If ' ', always prints a space
            (whitespace character) in the sign position of positive values.  If
            '-', omit the sign character of positive values. (default '-')

            .. versionchanged:: 2.0
                 The sign parameter can now be an integer type, previously
                 types were floating-point types.

        formatter : dict of callables, optional
            If not None, the keys should indicate the type(s) that the respective
            formatting function applies to.  Callables should return a string.
            Types that are not specified (by their corresponding keys) are handled
            by the default formatters.  Individual types for which a formatter
            can be set are:

            - 'bool'
            - 'int'
            - 'timedelta' : a `numpy.timedelta64`
            - 'datetime' : a `numpy.datetime64`
            - 'float'
            - 'longfloat' : 128-bit floats
            - 'complexfloat'
            - 'longcomplexfloat' : composed of two 128-bit floats
            - 'numpystr' : types `numpy.bytes_` and `numpy.str_`
            - 'object' : `np.object_` arrays

            Other keys that can be used to set a group of types at once are:

            - 'all' : sets all types
            - 'int_kind' : sets 'int'
            - 'float_kind' : sets 'float' and 'longfloat'
            - 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat'
            - 'str_kind' : sets 'numpystr'
        floatmode : str, optional
            Controls the interpretation of the `precision` option for
            floating-point types. Can take the following values
            (default maxprec_equal):

            * 'fixed': Always print exactly `precision` fractional digits,
                    even if this would print more or fewer digits than
                    necessary to specify the value uniquely.
            * 'unique': Print the minimum number of fractional digits necessary
                    to represent each value uniquely. Different elements may
                    have a different number of digits. The value of the
                    `precision` option is ignored.
            * 'maxprec': Print at most `precision` fractional digits, but if
                    an element can be uniquely represented with fewer digits
                    only print it with that many.
            * 'maxprec_equal': Print at most `precision` fractional digits,
                    but if every element in the array can be uniquely
                    represented with an equal number of fewer digits, use that
                    many digits for all elements.
        legacy : string or `False`, optional
            If set to the string ``'1.13'`` enables 1.13 legacy printing mode. This
            approximates numpy 1.13 print output by including a space in the sign
            position of floats and different behavior for 0d arrays. This also
            enables 1.21 legacy printing mode (described below).

            If set to the string ``'1.21'`` enables 1.21 legacy printing mode. This
            approximates numpy 1.21 print output of complex structured dtypes
            by not inserting spaces after commas that separate fields and after
            colons.

            If set to ``'1.25'`` approximates printing of 1.25 which mainly means
            that numeric scalars are printed without their type information, e.g.
            as ``3.0`` rather than ``np.float64(3.0)``.

            If set to `False`, disables legacy mode.

            Unrecognized strings will be ignored with a warning for forward
            compatibility.

            .. versionadded:: 1.14.0
            .. versionchanged:: 1.22.0
            .. versionchanged:: 2.0

        override_repr: callable, optional
            If set a passed function will be used for generating arrays' repr.
            Other options will be ignored.

        See Also
        --------
        get_printoptions, printoptions, array2string

        Notes
        -----
        `formatter` is always reset with a call to `set_printoptions`.

        Use `printoptions` as a context manager to set the values temporarily.

        Examples
        --------
        Floating point precision can be set:

        >>> import numpy as np
        >>> np.set_printoptions(precision=4)
        >>> np.array([1.123456789])
        [1.1235]

        Long arrays can be summarised:

        >>> np.set_printoptions(threshold=5)
        >>> np.arange(10)
        array([0, 1, 2, ..., 7, 8, 9])

        Small results can be suppressed:

        >>> eps = np.finfo(float).eps
        >>> x = np.arange(4.)
        >>> x**2 - (x + eps)**2
        array([-4.9304e-32, -4.4409e-16,  0.0000e+00,  0.0000e+00])
        >>> np.set_printoptions(suppress=True)
        >>> x**2 - (x + eps)**2
        array([-0., -0.,  0.,  0.])

        A custom formatter can be used to display array elements as desired:

        >>> np.set_printoptions(formatter={'all':lambda x: 'int: '+str(-x)})
        >>> x = np.arange(3)
        >>> x
        array([int: 0, int: -1, int: -2])
        >>> np.set_printoptions()  # formatter gets reset
        >>> x
        array([0, 1, 2])

        To put back the default options, you can use:

        >>> np.set_printoptions(edgeitems=3, infstr='inf',
        ... linewidth=75, nanstr='nan', precision=8,
        ... suppress=False, threshold=1000, formatter=None)

        Also to temporarily override options, use `printoptions`
        as a context manager:

        >>> with np.printoptions(precision=2, suppress=True, threshold=5):
        ...     np.linspace(0, 10, 10)
        array([ 0.  ,  1.11,  2.22, ...,  7.78,  8.89, 10.  ])

    setbufsize(size)
        Set the size of the buffer used in ufuncs.

        .. versionchanged:: 2.0
            The scope of setting the buffer is tied to the `numpy.errstate`
            context.  Exiting a ``with errstate():`` will also restore the bufsize.

        Parameters
        ----------
        size : int
            Size of buffer.

        Returns
        -------
        bufsize : int
            Previous size of ufunc buffer in bytes.

        Examples
        --------
        When exiting a `numpy.errstate` context manager the bufsize is restored:

        >>> import numpy as np
        >>> with np.errstate():
        ...     np.setbufsize(4096)
        ...     print(np.getbufsize())
        ...
        8192
        4096
        >>> np.getbufsize()
        8192

    setdiff1d(ar1, ar2, assume_unique=False)
        Find the set difference of two arrays.

        Return the unique values in `ar1` that are not in `ar2`.

        Parameters
        ----------
        ar1 : array_like
            Input array.
        ar2 : array_like
            Input comparison array.
        assume_unique : bool
            If True, the input arrays are both assumed to be unique, which
            can speed up the calculation.  Default is False.

        Returns
        -------
        setdiff1d : ndarray
            1D array of values in `ar1` that are not in `ar2`. The result
            is sorted when `assume_unique=False`, but otherwise only sorted
            if the input is sorted.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([1, 2, 3, 2, 4, 1])
        >>> b = np.array([3, 4, 5, 6])
        >>> np.setdiff1d(a, b)
        array([1, 2])

    seterr(all=None, divide=None, over=None, under=None, invalid=None)
        Set how floating-point errors are handled.

        Note that operations on integer scalar types (such as `int16`) are
        handled like floating point, and are affected by these settings.

        Parameters
        ----------
        all : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
            Set treatment for all types of floating-point errors at once:

            - ignore: Take no action when the exception occurs.
            - warn: Print a :exc:`RuntimeWarning` (via the Python `warnings`
              module).
            - raise: Raise a :exc:`FloatingPointError`.
            - call: Call a function specified using the `seterrcall` function.
            - print: Print a warning directly to ``stdout``.
            - log: Record error in a Log object specified by `seterrcall`.

            The default is not to change the current behavior.
        divide : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
            Treatment for division by zero.
        over : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
            Treatment for floating-point overflow.
        under : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
            Treatment for floating-point underflow.
        invalid : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional
            Treatment for invalid floating-point operation.

        Returns
        -------
        old_settings : dict
            Dictionary containing the old settings.

        See also
        --------
        seterrcall : Set a callback function for the 'call' mode.
        geterr, geterrcall, errstate

        Notes
        -----
        The floating-point exceptions are defined in the IEEE 754 standard [1]_:

        - Division by zero: infinite result obtained from finite numbers.
        - Overflow: result too large to be expressed.
        - Underflow: result so close to zero that some precision
          was lost.
        - Invalid operation: result is not an expressible number, typically
          indicates that a NaN was produced.

        .. [1] https://en.wikipedia.org/wiki/IEEE_754

        Examples
        --------
        >>> import numpy as np
        >>> orig_settings = np.seterr(all='ignore')  # seterr to known value
        >>> np.int16(32000) * np.int16(3)
        30464
        >>> np.seterr(over='raise')
        {'divide': 'ignore', 'over': 'ignore', 'under': 'ignore', 'invalid': 'ignore'}
        >>> old_settings = np.seterr(all='warn', over='raise')
        >>> np.int16(32000) * np.int16(3)
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        FloatingPointError: overflow encountered in scalar multiply

        >>> old_settings = np.seterr(all='print')
        >>> np.geterr()
        {'divide': 'print', 'over': 'print', 'under': 'print', 'invalid': 'print'}
        >>> np.int16(32000) * np.int16(3)
        30464
        >>> np.seterr(**orig_settings)  # restore original
        {'divide': 'print', 'over': 'print', 'under': 'print', 'invalid': 'print'}

    seterrcall(func)
        Set the floating-point error callback function or log object.

        There are two ways to capture floating-point error messages.  The first
        is to set the error-handler to 'call', using `seterr`.  Then, set
        the function to call using this function.

        The second is to set the error-handler to 'log', using `seterr`.
        Floating-point errors then trigger a call to the 'write' method of
        the provided object.

        Parameters
        ----------
        func : callable f(err, flag) or object with write method
            Function to call upon floating-point errors ('call'-mode) or
            object whose 'write' method is used to log such message ('log'-mode).

            The call function takes two arguments. The first is a string describing
            the type of error (such as "divide by zero", "overflow", "underflow",
            or "invalid value"), and the second is the status flag.  The flag is a
            byte, whose four least-significant bits indicate the type of error, one
            of "divide", "over", "under", "invalid"::

              [0 0 0 0 divide over under invalid]

            In other words, ``flags = divide + 2*over + 4*under + 8*invalid``.

            If an object is provided, its write method should take one argument,
            a string.

        Returns
        -------
        h : callable, log instance or None
            The old error handler.

        See Also
        --------
        seterr, geterr, geterrcall

        Examples
        --------
        Callback upon error:

        >>> def err_handler(type, flag):
        ...     print("Floating point error (%s), with flag %s" % (type, flag))
        ...

        >>> import numpy as np

        >>> orig_handler = np.seterrcall(err_handler)
        >>> orig_err = np.seterr(all='call')

        >>> np.array([1, 2, 3]) / 0.0
        Floating point error (divide by zero), with flag 1
        array([inf, inf, inf])

        >>> np.seterrcall(orig_handler)
        <function err_handler at 0x...>
        >>> np.seterr(**orig_err)
        {'divide': 'call', 'over': 'call', 'under': 'call', 'invalid': 'call'}

        Log error message:

        >>> class Log:
        ...     def write(self, msg):
        ...         print("LOG: %s" % msg)
        ...

        >>> log = Log()
        >>> saved_handler = np.seterrcall(log)
        >>> save_err = np.seterr(all='log')

        >>> np.array([1, 2, 3]) / 0.0
        LOG: Warning: divide by zero encountered in divide
        array([inf, inf, inf])

        >>> np.seterrcall(orig_handler)
        <numpy.Log object at 0x...>
        >>> np.seterr(**orig_err)
        {'divide': 'log', 'over': 'log', 'under': 'log', 'invalid': 'log'}

    setxor1d(ar1, ar2, assume_unique=False)
        Find the set exclusive-or of two arrays.

        Return the sorted, unique values that are in only one (not both) of the
        input arrays.

        Parameters
        ----------
        ar1, ar2 : array_like
            Input arrays.
        assume_unique : bool
            If True, the input arrays are both assumed to be unique, which
            can speed up the calculation. Default is False.

        Returns
        -------
        setxor1d : ndarray
            Sorted 1D array of unique values that are in only one of the input
            arrays.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([1, 2, 3, 2, 4])
        >>> b = np.array([2, 3, 5, 7, 5])
        >>> np.setxor1d(a,b)
        array([1, 4, 5, 7])

    shape(a)
        Return the shape of an array.

        Parameters
        ----------
        a : array_like
            Input array.

        Returns
        -------
        shape : tuple of ints
            The elements of the shape tuple give the lengths of the
            corresponding array dimensions.

        See Also
        --------
        len : ``len(a)`` is equivalent to ``np.shape(a)[0]`` for N-D arrays with
              ``N>=1``.
        ndarray.shape : Equivalent array method.

        Examples
        --------
        >>> import numpy as np
        >>> np.shape(np.eye(3))
        (3, 3)
        >>> np.shape([[1, 3]])
        (1, 2)
        >>> np.shape([0])
        (1,)
        >>> np.shape(0)
        ()

        >>> a = np.array([(1, 2), (3, 4), (5, 6)],
        ...              dtype=[('x', 'i4'), ('y', 'i4')])
        >>> np.shape(a)
        (3,)
        >>> a.shape
        (3,)

    shares_memory(...)
        shares_memory(a, b, /, max_work=None)

        Determine if two arrays share memory.

        .. warning::

           This function can be exponentially slow for some inputs, unless
           `max_work` is set to zero or a positive integer.
           If in doubt, use `numpy.may_share_memory` instead.

        Parameters
        ----------
        a, b : ndarray
            Input arrays
        max_work : int, optional
            Effort to spend on solving the overlap problem (maximum number
            of candidate solutions to consider). The following special
            values are recognized:

            max_work=-1 (default)
                The problem is solved exactly. In this case, the function returns
                True only if there is an element shared between the arrays. Finding
                the exact solution may take extremely long in some cases.
            max_work=0
                Only the memory bounds of a and b are checked.
                This is equivalent to using ``may_share_memory()``.

        Raises
        ------
        numpy.exceptions.TooHardError
            Exceeded max_work.

        Returns
        -------
        out : bool

        See Also
        --------
        may_share_memory

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([1, 2, 3, 4])
        >>> np.shares_memory(x, np.array([5, 6, 7]))
        False
        >>> np.shares_memory(x[::2], x)
        True
        >>> np.shares_memory(x[::2], x[1::2])
        False

        Checking whether two arrays share memory is NP-complete, and
        runtime may increase exponentially in the number of
        dimensions. Hence, `max_work` should generally be set to a finite
        number, as it is possible to construct examples that take
        extremely long to run:

        >>> from numpy.lib.stride_tricks import as_strided
        >>> x = np.zeros([192163377], dtype=np.int8)
        >>> x1 = as_strided(
        ...     x, strides=(36674, 61119, 85569), shape=(1049, 1049, 1049))
        >>> x2 = as_strided(
        ...     x[64023025:], strides=(12223, 12224, 1), shape=(1049, 1049, 1))
        >>> np.shares_memory(x1, x2, max_work=1000)
        Traceback (most recent call last):
        ...
        numpy.exceptions.TooHardError: Exceeded max_work

        Running ``np.shares_memory(x1, x2)`` without `max_work` set takes
        around 1 minute for this case. It is possible to find problems
        that take still significantly longer.

    show_config = show(mode='stdout')
        Show libraries and system information on which NumPy was built
        and is being used

        Parameters
        ----------
        mode : {`'stdout'`, `'dicts'`}, optional.
            Indicates how to display the config information.
            `'stdout'` prints to console, `'dicts'` returns a dictionary
            of the configuration.

        Returns
        -------
        out : {`dict`, `None`}
            If mode is `'dicts'`, a dict is returned, else None

        See Also
        --------
        get_include : Returns the directory containing NumPy C
                      header files.

        Notes
        -----
        1. The `'stdout'` mode will give more readable
           output if ``pyyaml`` is installed

    show_runtime()
        Print information about various resources in the system
        including available intrinsic support and BLAS/LAPACK library
        in use

        .. versionadded:: 1.24.0

        See Also
        --------
        show_config : Show libraries in the system on which NumPy was built.

        Notes
        -----
        1. Information is derived with the help of `threadpoolctl <https://pypi.org/project/threadpoolctl/>`_
           library if available.
        2. SIMD related information is derived from ``__cpu_features__``,
           ``__cpu_baseline__`` and ``__cpu_dispatch__``

    sinc(x)
        Return the normalized sinc function.

        The sinc function is equal to :math:`\sin(\pi x)/(\pi x)` for any argument
        :math:`x\ne 0`. ``sinc(0)`` takes the limit value 1, making ``sinc`` not
        only everywhere continuous but also infinitely differentiable.

        .. note::

            Note the normalization factor of ``pi`` used in the definition.
            This is the most commonly used definition in signal processing.
            Use ``sinc(x / np.pi)`` to obtain the unnormalized sinc function
            :math:`\sin(x)/x` that is more common in mathematics.

        Parameters
        ----------
        x : ndarray
            Array (possibly multi-dimensional) of values for which to calculate
            ``sinc(x)``.

        Returns
        -------
        out : ndarray
            ``sinc(x)``, which has the same shape as the input.

        Notes
        -----
        The name sinc is short for "sine cardinal" or "sinus cardinalis".

        The sinc function is used in various signal processing applications,
        including in anti-aliasing, in the construction of a Lanczos resampling
        filter, and in interpolation.

        For bandlimited interpolation of discrete-time signals, the ideal
        interpolation kernel is proportional to the sinc function.

        References
        ----------
        .. [1] Weisstein, Eric W. "Sinc Function." From MathWorld--A Wolfram Web
               Resource. https://mathworld.wolfram.com/SincFunction.html
        .. [2] Wikipedia, "Sinc function",
               https://en.wikipedia.org/wiki/Sinc_function

        Examples
        --------
        >>> import numpy as np
        >>> import matplotlib.pyplot as plt
        >>> x = np.linspace(-4, 4, 41)
        >>> np.sinc(x)
         array([-3.89804309e-17,  -4.92362781e-02,  -8.40918587e-02, # may vary
                -8.90384387e-02,  -5.84680802e-02,   3.89804309e-17,
                6.68206631e-02,   1.16434881e-01,   1.26137788e-01,
                8.50444803e-02,  -3.89804309e-17,  -1.03943254e-01,
                -1.89206682e-01,  -2.16236208e-01,  -1.55914881e-01,
                3.89804309e-17,   2.33872321e-01,   5.04551152e-01,
                7.56826729e-01,   9.35489284e-01,   1.00000000e+00,
                9.35489284e-01,   7.56826729e-01,   5.04551152e-01,
                2.33872321e-01,   3.89804309e-17,  -1.55914881e-01,
               -2.16236208e-01,  -1.89206682e-01,  -1.03943254e-01,
               -3.89804309e-17,   8.50444803e-02,   1.26137788e-01,
                1.16434881e-01,   6.68206631e-02,   3.89804309e-17,
                -5.84680802e-02,  -8.90384387e-02,  -8.40918587e-02,
                -4.92362781e-02,  -3.89804309e-17])

        >>> plt.plot(x, np.sinc(x))
        [<matplotlib.lines.Line2D object at 0x...>]
        >>> plt.title("Sinc Function")
        Text(0.5, 1.0, 'Sinc Function')
        >>> plt.ylabel("Amplitude")
        Text(0, 0.5, 'Amplitude')
        >>> plt.xlabel("X")
        Text(0.5, 0, 'X')
        >>> plt.show()

    size(a, axis=None)
        Return the number of elements along a given axis.

        Parameters
        ----------
        a : array_like
            Input data.
        axis : int, optional
            Axis along which the elements are counted.  By default, give
            the total number of elements.

        Returns
        -------
        element_count : int
            Number of elements along the specified axis.

        See Also
        --------
        shape : dimensions of array
        ndarray.shape : dimensions of array
        ndarray.size : number of elements in array

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1,2,3],[4,5,6]])
        >>> np.size(a)
        6
        >>> np.size(a,1)
        3
        >>> np.size(a,0)
        2

    sort(a, axis=-1, kind=None, order=None, *, stable=None)
        Return a sorted copy of an array.

        Parameters
        ----------
        a : array_like
            Array to be sorted.
        axis : int or None, optional
            Axis along which to sort. If None, the array is flattened before
            sorting. The default is -1, which sorts along the last axis.
        kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional
            Sorting algorithm. The default is 'quicksort'. Note that both 'stable'
            and 'mergesort' use timsort or radix sort under the covers and,
            in general, the actual implementation will vary with data type.
            The 'mergesort' option is retained for backwards compatibility.

            .. versionchanged:: 1.15.0.
               The 'stable' option was added.

        order : str or list of str, optional
            When `a` is an array with fields defined, this argument specifies
            which fields to compare first, second, etc.  A single field can
            be specified as a string, and not all fields need be specified,
            but unspecified fields will still be used, in the order in which
            they come up in the dtype, to break ties.
        stable : bool, optional
            Sort stability. If ``True``, the returned array will maintain
            the relative order of ``a`` values which compare as equal.
            If ``False`` or ``None``, this is not guaranteed. Internally,
            this option selects ``kind='stable'``. Default: ``None``.

            .. versionadded:: 2.0.0

        Returns
        -------
        sorted_array : ndarray
            Array of the same type and shape as `a`.

        See Also
        --------
        ndarray.sort : Method to sort an array in-place.
        argsort : Indirect sort.
        lexsort : Indirect stable sort on multiple keys.
        searchsorted : Find elements in a sorted array.
        partition : Partial sort.

        Notes
        -----
        The various sorting algorithms are characterized by their average speed,
        worst case performance, work space size, and whether they are stable. A
        stable sort keeps items with the same key in the same relative
        order. The four algorithms implemented in NumPy have the following
        properties:

        =========== ======= ============= ============ ========
           kind      speed   worst case    work space   stable
        =========== ======= ============= ============ ========
        'quicksort'    1     O(n^2)            0          no
        'heapsort'     3     O(n*log(n))       0          no
        'mergesort'    2     O(n*log(n))      ~n/2        yes
        'timsort'      2     O(n*log(n))      ~n/2        yes
        =========== ======= ============= ============ ========

        .. note:: The datatype determines which of 'mergesort' or 'timsort'
           is actually used, even if 'mergesort' is specified. User selection
           at a finer scale is not currently available.

        For performance, ``sort`` makes a temporary copy if needed to make the data
        `contiguous <https://numpy.org/doc/stable/glossary.html#term-contiguous>`_
        in memory along the sort axis. For even better performance and reduced
        memory consumption, ensure that the array is already contiguous along the
        sort axis.

        The sort order for complex numbers is lexicographic. If both the real
        and imaginary parts are non-nan then the order is determined by the
        real parts except when they are equal, in which case the order is
        determined by the imaginary parts.

        Previous to numpy 1.4.0 sorting real and complex arrays containing nan
        values led to undefined behaviour. In numpy versions >= 1.4.0 nan
        values are sorted to the end. The extended sort order is:

          * Real: [R, nan]
          * Complex: [R + Rj, R + nanj, nan + Rj, nan + nanj]

        where R is a non-nan real value. Complex values with the same nan
        placements are sorted according to the non-nan part if it exists.
        Non-nan values are sorted as before.

        .. versionadded:: 1.12.0

        quicksort has been changed to:
        `introsort <https://en.wikipedia.org/wiki/Introsort>`_.
        When sorting does not make enough progress it switches to
        `heapsort <https://en.wikipedia.org/wiki/Heapsort>`_.
        This implementation makes quicksort O(n*log(n)) in the worst case.

        'stable' automatically chooses the best stable sorting algorithm
        for the data type being sorted.
        It, along with 'mergesort' is currently mapped to
        `timsort <https://en.wikipedia.org/wiki/Timsort>`_
        or `radix sort <https://en.wikipedia.org/wiki/Radix_sort>`_
        depending on the data type.
        API forward compatibility currently limits the
        ability to select the implementation and it is hardwired for the different
        data types.

        .. versionadded:: 1.17.0

        Timsort is added for better performance on already or nearly
        sorted data. On random data timsort is almost identical to
        mergesort. It is now used for stable sort while quicksort is still the
        default sort if none is chosen. For timsort details, refer to
        `CPython listsort.txt
        <https://github.com/python/cpython/blob/3.7/Objects/listsort.txt>`_
        'mergesort' and 'stable' are mapped to radix sort for integer data types.
        Radix sort is an O(n) sort instead of O(n log n).

        .. versionchanged:: 1.18.0

        NaT now sorts to the end of arrays for consistency with NaN.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1,4],[3,1]])
        >>> np.sort(a)                # sort along the last axis
        array([[1, 4],
               [1, 3]])
        >>> np.sort(a, axis=None)     # sort the flattened array
        array([1, 1, 3, 4])
        >>> np.sort(a, axis=0)        # sort along the first axis
        array([[1, 1],
               [3, 4]])

        Use the `order` keyword to specify a field to use when sorting a
        structured array:

        >>> dtype = [('name', 'S10'), ('height', float), ('age', int)]
        >>> values = [('Arthur', 1.8, 41), ('Lancelot', 1.9, 38),
        ...           ('Galahad', 1.7, 38)]
        >>> a = np.array(values, dtype=dtype)       # create a structured array
        >>> np.sort(a, order='height')                        # doctest: +SKIP
        array([('Galahad', 1.7, 38), ('Arthur', 1.8, 41),
               ('Lancelot', 1.8999999999999999, 38)],
              dtype=[('name', '|S10'), ('height', '<f8'), ('age', '<i4')])

        Sort by age, then height if ages are equal:

        >>> np.sort(a, order=['age', 'height'])               # doctest: +SKIP
        array([('Galahad', 1.7, 38), ('Lancelot', 1.8999999999999999, 38),
               ('Arthur', 1.8, 41)],
              dtype=[('name', '|S10'), ('height', '<f8'), ('age', '<i4')])

    sort_complex(a)
        Sort a complex array using the real part first, then the imaginary part.

        Parameters
        ----------
        a : array_like
            Input array

        Returns
        -------
        out : complex ndarray
            Always returns a sorted complex array.

        Examples
        --------
        >>> import numpy as np
        >>> np.sort_complex([5, 3, 6, 2, 1])
        array([1.+0.j, 2.+0.j, 3.+0.j, 5.+0.j, 6.+0.j])

        >>> np.sort_complex([1 + 2j, 2 - 1j, 3 - 2j, 3 - 3j, 3 + 5j])
        array([1.+2.j,  2.-1.j,  3.-3.j,  3.-2.j,  3.+5.j])

    split(ary, indices_or_sections, axis=0)
        Split an array into multiple sub-arrays as views into `ary`.

        Parameters
        ----------
        ary : ndarray
            Array to be divided into sub-arrays.
        indices_or_sections : int or 1-D array
            If `indices_or_sections` is an integer, N, the array will be divided
            into N equal arrays along `axis`.  If such a split is not possible,
            an error is raised.

            If `indices_or_sections` is a 1-D array of sorted integers, the entries
            indicate where along `axis` the array is split.  For example,
            ``[2, 3]`` would, for ``axis=0``, result in

            - ary[:2]
            - ary[2:3]
            - ary[3:]

            If an index exceeds the dimension of the array along `axis`,
            an empty sub-array is returned correspondingly.
        axis : int, optional
            The axis along which to split, default is 0.

        Returns
        -------
        sub-arrays : list of ndarrays
            A list of sub-arrays as views into `ary`.

        Raises
        ------
        ValueError
            If `indices_or_sections` is given as an integer, but
            a split does not result in equal division.

        See Also
        --------
        array_split : Split an array into multiple sub-arrays of equal or
                      near-equal size.  Does not raise an exception if
                      an equal division cannot be made.
        hsplit : Split array into multiple sub-arrays horizontally (column-wise).
        vsplit : Split array into multiple sub-arrays vertically (row wise).
        dsplit : Split array into multiple sub-arrays along the 3rd axis (depth).
        concatenate : Join a sequence of arrays along an existing axis.
        stack : Join a sequence of arrays along a new axis.
        hstack : Stack arrays in sequence horizontally (column wise).
        vstack : Stack arrays in sequence vertically (row wise).
        dstack : Stack arrays in sequence depth wise (along third dimension).

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(9.0)
        >>> np.split(x, 3)
        [array([0.,  1.,  2.]), array([3.,  4.,  5.]), array([6.,  7.,  8.])]

        >>> x = np.arange(8.0)
        >>> np.split(x, [3, 5, 6, 10])
        [array([0.,  1.,  2.]),
         array([3.,  4.]),
         array([5.]),
         array([6.,  7.]),
         array([], dtype=float64)]

    squeeze(a, axis=None)
        Remove axes of length one from `a`.

        Parameters
        ----------
        a : array_like
            Input data.
        axis : None or int or tuple of ints, optional
            .. versionadded:: 1.7.0

            Selects a subset of the entries of length one in the
            shape. If an axis is selected with shape entry greater than
            one, an error is raised.

        Returns
        -------
        squeezed : ndarray
            The input array, but with all or a subset of the
            dimensions of length 1 removed. This is always `a` itself
            or a view into `a`. Note that if all axes are squeezed,
            the result is a 0d array and not a scalar.

        Raises
        ------
        ValueError
            If `axis` is not None, and an axis being squeezed is not of length 1

        See Also
        --------
        expand_dims : The inverse operation, adding entries of length one
        reshape : Insert, remove, and combine dimensions, and resize existing ones

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([[[0], [1], [2]]])
        >>> x.shape
        (1, 3, 1)
        >>> np.squeeze(x).shape
        (3,)
        >>> np.squeeze(x, axis=0).shape
        (3, 1)
        >>> np.squeeze(x, axis=1).shape
        Traceback (most recent call last):
        ...
        ValueError: cannot select an axis to squeeze out which has size
        not equal to one
        >>> np.squeeze(x, axis=2).shape
        (1, 3)
        >>> x = np.array([[1234]])
        >>> x.shape
        (1, 1)
        >>> np.squeeze(x)
        array(1234)  # 0d array
        >>> np.squeeze(x).shape
        ()
        >>> np.squeeze(x)[()]
        1234

    stack(arrays, axis=0, out=None, *, dtype=None, casting='same_kind')
        Join a sequence of arrays along a new axis.

        The ``axis`` parameter specifies the index of the new axis in the
        dimensions of the result. For example, if ``axis=0`` it will be the first
        dimension and if ``axis=-1`` it will be the last dimension.

        .. versionadded:: 1.10.0

        Parameters
        ----------
        arrays : sequence of array_like
            Each array must have the same shape.

        axis : int, optional
            The axis in the result array along which the input arrays are stacked.

        out : ndarray, optional
            If provided, the destination to place the result. The shape must be
            correct, matching that of what stack would have returned if no
            out argument were specified.

        dtype : str or dtype
            If provided, the destination array will have this dtype. Cannot be
            provided together with `out`.

            .. versionadded:: 1.24

        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
            Controls what kind of data casting may occur. Defaults to 'same_kind'.

            .. versionadded:: 1.24


        Returns
        -------
        stacked : ndarray
            The stacked array has one more dimension than the input arrays.

        See Also
        --------
        concatenate : Join a sequence of arrays along an existing axis.
        block : Assemble an nd-array from nested lists of blocks.
        split : Split array into a list of multiple sub-arrays of equal size.
        unstack : Split an array into a tuple of sub-arrays along an axis.

        Examples
        --------
        >>> import numpy as np
        >>> rng = np.random.default_rng()
        >>> arrays = [rng.normal(size=(3,4)) for _ in range(10)]
        >>> np.stack(arrays, axis=0).shape
        (10, 3, 4)

        >>> np.stack(arrays, axis=1).shape
        (3, 10, 4)

        >>> np.stack(arrays, axis=2).shape
        (3, 4, 10)

        >>> a = np.array([1, 2, 3])
        >>> b = np.array([4, 5, 6])
        >>> np.stack((a, b))
        array([[1, 2, 3],
               [4, 5, 6]])

        >>> np.stack((a, b), axis=-1)
        array([[1, 4],
               [2, 5],
               [3, 6]])

    std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=<no value>, *, where=<no value>, mean=<no value>, correction=<no value>)
        Compute the standard deviation along the specified axis.

        Returns the standard deviation, a measure of the spread of a distribution,
        of the array elements. The standard deviation is computed for the
        flattened array by default, otherwise over the specified axis.

        Parameters
        ----------
        a : array_like
            Calculate the standard deviation of these values.
        axis : None or int or tuple of ints, optional
            Axis or axes along which the standard deviation is computed. The
            default is to compute the standard deviation of the flattened array.

            .. versionadded:: 1.7.0

            If this is a tuple of ints, a standard deviation is performed over
            multiple axes, instead of a single axis or all the axes as before.
        dtype : dtype, optional
            Type to use in computing the standard deviation. For arrays of
            integer type the default is float64, for arrays of float types it is
            the same as the array type.
        out : ndarray, optional
            Alternative output array in which to place the result. It must have
            the same shape as the expected output but the type (of the calculated
            values) will be cast if necessary.
            See :ref:`ufuncs-output-type` for more details.
        ddof : {int, float}, optional
            Means Delta Degrees of Freedom.  The divisor used in calculations
            is ``N - ddof``, where ``N`` represents the number of elements.
            By default `ddof` is zero. See Notes for details about use of `ddof`.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the `std` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.
        where : array_like of bool, optional
            Elements to include in the standard deviation.
            See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.20.0

        mean : array_like, optional
            Provide the mean to prevent its recalculation. The mean should have
            a shape as if it was calculated with ``keepdims=True``.
            The axis for the calculation of the mean should be the same as used in
            the call to this std function.

            .. versionadded:: 1.26.0

        correction : {int, float}, optional
            Array API compatible name for the ``ddof`` parameter. Only one of them
            can be provided at the same time.

            .. versionadded:: 2.0.0

        Returns
        -------
        standard_deviation : ndarray, see dtype parameter above.
            If `out` is None, return a new array containing the standard deviation,
            otherwise return a reference to the output array.

        See Also
        --------
        var, mean, nanmean, nanstd, nanvar
        :ref:`ufuncs-output-type`

        Notes
        -----
        There are several common variants of the array standard deviation
        calculation. Assuming the input `a` is a one-dimensional NumPy array
        and ``mean`` is either provided as an argument or computed as
        ``a.mean()``, NumPy computes the standard deviation of an array as::

            N = len(a)
            d2 = abs(a - mean)**2  # abs is for complex `a`
            var = d2.sum() / (N - ddof)  # note use of `ddof`
            std = var**0.5

        Different values of the argument `ddof` are useful in different
        contexts. NumPy's default ``ddof=0`` corresponds with the expression:

        .. math::

            \sqrt{\frac{\sum_i{|a_i - \bar{a}|^2 }}{N}}

        which is sometimes called the "population standard deviation" in the field
        of statistics because it applies the definition of standard deviation to
        `a` as if `a` were a complete population of possible observations.

        Many other libraries define the standard deviation of an array
        differently, e.g.:

        .. math::

            \sqrt{\frac{\sum_i{|a_i - \bar{a}|^2 }}{N - 1}}

        In statistics, the resulting quantity is sometimed called the "sample
        standard deviation" because if `a` is a random sample from a larger
        population, this calculation provides the square root of an unbiased
        estimate of the variance of the population. The use of :math:`N-1` in the
        denominator is often called "Bessel's correction" because it corrects for
        bias (toward lower values) in the variance estimate introduced when the
        sample mean of `a` is used in place of the true mean of the population.
        The resulting estimate of the standard deviation is still biased, but less
        than it would have been without the correction. For this quantity, use
        ``ddof=1``.

        Note that, for complex numbers, `std` takes the absolute
        value before squaring, so that the result is always real and nonnegative.

        For floating-point input, the standard deviation is computed using the same
        precision the input has. Depending on the input data, this can cause
        the results to be inaccurate, especially for float32 (see example below).
        Specifying a higher-accuracy accumulator using the `dtype` keyword can
        alleviate this issue.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, 4]])
        >>> np.std(a)
        1.1180339887498949 # may vary
        >>> np.std(a, axis=0)
        array([1.,  1.])
        >>> np.std(a, axis=1)
        array([0.5,  0.5])

        In single precision, std() can be inaccurate:

        >>> a = np.zeros((2, 512*512), dtype=np.float32)
        >>> a[0, :] = 1.0
        >>> a[1, :] = 0.1
        >>> np.std(a)
        0.45000005

        Computing the standard deviation in float64 is more accurate:

        >>> np.std(a, dtype=np.float64)
        0.44999999925494177 # may vary

        Specifying a where argument:

        >>> a = np.array([[14, 8, 11, 10], [7, 9, 10, 11], [10, 15, 5, 10]])
        >>> np.std(a)
        2.614064523559687 # may vary
        >>> np.std(a, where=[[True], [True], [False]])
        2.0

        Using the mean keyword to save computation time:

        >>> import numpy as np
        >>> from timeit import timeit
        >>> a = np.array([[14, 8, 11, 10], [7, 9, 10, 11], [10, 15, 5, 10]])
        >>> mean = np.mean(a, axis=1, keepdims=True)
        >>>
        >>> g = globals()
        >>> n = 10000
        >>> t1 = timeit("std = np.std(a, axis=1, mean=mean)", globals=g, number=n)
        >>> t2 = timeit("std = np.std(a, axis=1)", globals=g, number=n)
        >>> print(f'Percentage execution time saved {100*(t2-t1)/t2:.0f}%')
        #doctest: +SKIP
        Percentage execution time saved 30%

    sum(a, axis=None, dtype=None, out=None, keepdims=<no value>, initial=<no value>, where=<no value>)
        Sum of array elements over a given axis.

        Parameters
        ----------
        a : array_like
            Elements to sum.
        axis : None or int or tuple of ints, optional
            Axis or axes along which a sum is performed.  The default,
            axis=None, will sum all of the elements of the input array.  If
            axis is negative it counts from the last to the first axis.

            .. versionadded:: 1.7.0

            If axis is a tuple of ints, a sum is performed on all of the axes
            specified in the tuple instead of a single axis or all the axes as
            before.
        dtype : dtype, optional
            The type of the returned array and of the accumulator in which the
            elements are summed.  The dtype of `a` is used by default unless `a`
            has an integer dtype of less precision than the default platform
            integer.  In that case, if `a` is signed then the platform integer
            is used while if `a` is unsigned then an unsigned integer of the
            same precision as the platform integer is used.
        out : ndarray, optional
            Alternative output array in which to place the result. It must have
            the same shape as the expected output, but the type of the output
            values will be cast if necessary.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the `sum` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.
        initial : scalar, optional
            Starting value for the sum. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.15.0

        where : array_like of bool, optional
            Elements to include in the sum. See `~numpy.ufunc.reduce` for details.

            .. versionadded:: 1.17.0

        Returns
        -------
        sum_along_axis : ndarray
            An array with the same shape as `a`, with the specified
            axis removed.   If `a` is a 0-d array, or if `axis` is None, a scalar
            is returned.  If an output array is specified, a reference to
            `out` is returned.

        See Also
        --------
        ndarray.sum : Equivalent method.
        add: ``numpy.add.reduce`` equivalent function.
        cumsum : Cumulative sum of array elements.
        trapezoid : Integration of array values using composite trapezoidal rule.

        mean, average

        Notes
        -----
        Arithmetic is modular when using integer types, and no error is
        raised on overflow.

        The sum of an empty array is the neutral element 0:

        >>> np.sum([])
        0.0

        For floating point numbers the numerical precision of sum (and
        ``np.add.reduce``) is in general limited by directly adding each number
        individually to the result causing rounding errors in every step.
        However, often numpy will use a  numerically better approach (partial
        pairwise summation) leading to improved precision in many use-cases.
        This improved precision is always provided when no ``axis`` is given.
        When ``axis`` is given, it will depend on which axis is summed.
        Technically, to provide the best speed possible, the improved precision
        is only used when the summation is along the fast axis in memory.
        Note that the exact precision may vary depending on other parameters.
        In contrast to NumPy, Python's ``math.fsum`` function uses a slower but
        more precise approach to summation.
        Especially when summing a large number of lower precision floating point
        numbers, such as ``float32``, numerical errors can become significant.
        In such cases it can be advisable to use `dtype="float64"` to use a higher
        precision for the output.

        Examples
        --------
        >>> import numpy as np
        >>> np.sum([0.5, 1.5])
        2.0
        >>> np.sum([0.5, 0.7, 0.2, 1.5], dtype=np.int32)
        1
        >>> np.sum([[0, 1], [0, 5]])
        6
        >>> np.sum([[0, 1], [0, 5]], axis=0)
        array([0, 6])
        >>> np.sum([[0, 1], [0, 5]], axis=1)
        array([1, 5])
        >>> np.sum([[0, 1], [np.nan, 5]], where=[False, True], axis=1)
        array([1., 5.])

        If the accumulator is too small, overflow occurs:

        >>> np.ones(128, dtype=np.int8).sum(dtype=np.int8)
        -128

        You can also start the sum with a value other than zero:

        >>> np.sum([10], initial=5)
        15

    swapaxes(a, axis1, axis2)
        Interchange two axes of an array.

        Parameters
        ----------
        a : array_like
            Input array.
        axis1 : int
            First axis.
        axis2 : int
            Second axis.

        Returns
        -------
        a_swapped : ndarray
            For NumPy >= 1.10.0, if `a` is an ndarray, then a view of `a` is
            returned; otherwise a new array is created. For earlier NumPy
            versions a view of `a` is returned only if the order of the
            axes is changed, otherwise the input array is returned.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([[1,2,3]])
        >>> np.swapaxes(x,0,1)
        array([[1],
               [2],
               [3]])

        >>> x = np.array([[[0,1],[2,3]],[[4,5],[6,7]]])
        >>> x
        array([[[0, 1],
                [2, 3]],
               [[4, 5],
                [6, 7]]])

        >>> np.swapaxes(x,0,2)
        array([[[0, 4],
                [2, 6]],
               [[1, 5],
                [3, 7]]])

    take(a, indices, axis=None, out=None, mode='raise')
        Take elements from an array along an axis.

        When axis is not None, this function does the same thing as "fancy"
        indexing (indexing arrays using arrays); however, it can be easier to use
        if you need elements along a given axis. A call such as
        ``np.take(arr, indices, axis=3)`` is equivalent to
        ``arr[:,:,:,indices,...]``.

        Explained without fancy indexing, this is equivalent to the following use
        of `ndindex`, which sets each of ``ii``, ``jj``, and ``kk`` to a tuple of
        indices::

            Ni, Nk = a.shape[:axis], a.shape[axis+1:]
            Nj = indices.shape
            for ii in ndindex(Ni):
                for jj in ndindex(Nj):
                    for kk in ndindex(Nk):
                        out[ii + jj + kk] = a[ii + (indices[jj],) + kk]

        Parameters
        ----------
        a : array_like (Ni..., M, Nk...)
            The source array.
        indices : array_like (Nj...)
            The indices of the values to extract.

            .. versionadded:: 1.8.0

            Also allow scalars for indices.
        axis : int, optional
            The axis over which to select values. By default, the flattened
            input array is used.
        out : ndarray, optional (Ni..., Nj..., Nk...)
            If provided, the result will be placed in this array. It should
            be of the appropriate shape and dtype. Note that `out` is always
            buffered if `mode='raise'`; use other modes for better performance.
        mode : {'raise', 'wrap', 'clip'}, optional
            Specifies how out-of-bounds indices will behave.

            * 'raise' -- raise an error (default)
            * 'wrap' -- wrap around
            * 'clip' -- clip to the range

            'clip' mode means that all indices that are too large are replaced
            by the index that addresses the last element along that axis. Note
            that this disables indexing with negative numbers.

        Returns
        -------
        out : ndarray (Ni..., Nj..., Nk...)
            The returned array has the same type as `a`.

        See Also
        --------
        compress : Take elements using a boolean mask
        ndarray.take : equivalent method
        take_along_axis : Take elements by matching the array and the index arrays

        Notes
        -----

        By eliminating the inner loop in the description above, and using `s_` to
        build simple slice objects, `take` can be expressed  in terms of applying
        fancy indexing to each 1-d slice::

            Ni, Nk = a.shape[:axis], a.shape[axis+1:]
            for ii in ndindex(Ni):
                for kk in ndindex(Nj):
                    out[ii + s_[...,] + kk] = a[ii + s_[:,] + kk][indices]

        For this reason, it is equivalent to (but faster than) the following use
        of `apply_along_axis`::

            out = np.apply_along_axis(lambda a_1d: a_1d[indices], axis, a)

        Examples
        --------
        >>> import numpy as np
        >>> a = [4, 3, 5, 7, 6, 8]
        >>> indices = [0, 1, 4]
        >>> np.take(a, indices)
        array([4, 3, 6])

        In this example if `a` is an ndarray, "fancy" indexing can be used.

        >>> a = np.array(a)
        >>> a[indices]
        array([4, 3, 6])

        If `indices` is not one dimensional, the output also has these dimensions.

        >>> np.take(a, [[0, 1], [2, 3]])
        array([[4, 3],
               [5, 7]])

    take_along_axis(arr, indices, axis)
        Take values from the input array by matching 1d index and data slices.

        This iterates over matching 1d slices oriented along the specified axis in
        the index and data arrays, and uses the former to look up values in the
        latter. These slices can be different lengths.

        Functions returning an index along an axis, like `argsort` and
        `argpartition`, produce suitable indices for this function.

        .. versionadded:: 1.15.0

        Parameters
        ----------
        arr : ndarray (Ni..., M, Nk...)
            Source array
        indices : ndarray (Ni..., J, Nk...)
            Indices to take along each 1d slice of `arr`. This must match the
            dimension of arr, but dimensions Ni and Nj only need to broadcast
            against `arr`.
        axis : int
            The axis to take 1d slices along. If axis is None, the input array is
            treated as if it had first been flattened to 1d, for consistency with
            `sort` and `argsort`.

        Returns
        -------
        out: ndarray (Ni..., J, Nk...)
            The indexed result.

        Notes
        -----
        This is equivalent to (but faster than) the following use of `ndindex` and
        `s_`, which sets each of ``ii`` and ``kk`` to a tuple of indices::

            Ni, M, Nk = a.shape[:axis], a.shape[axis], a.shape[axis+1:]
            J = indices.shape[axis]  # Need not equal M
            out = np.empty(Ni + (J,) + Nk)

            for ii in ndindex(Ni):
                for kk in ndindex(Nk):
                    a_1d       = a      [ii + s_[:,] + kk]
                    indices_1d = indices[ii + s_[:,] + kk]
                    out_1d     = out    [ii + s_[:,] + kk]
                    for j in range(J):
                        out_1d[j] = a_1d[indices_1d[j]]

        Equivalently, eliminating the inner loop, the last two lines would be::

                    out_1d[:] = a_1d[indices_1d]

        See Also
        --------
        take : Take along an axis, using the same indices for every 1d slice
        put_along_axis :
            Put values into the destination array by matching 1d index and data slices

        Examples
        --------
        >>> import numpy as np

        For this sample array

        >>> a = np.array([[10, 30, 20], [60, 40, 50]])

        We can sort either by using sort directly, or argsort and this function

        >>> np.sort(a, axis=1)
        array([[10, 20, 30],
               [40, 50, 60]])
        >>> ai = np.argsort(a, axis=1)
        >>> ai
        array([[0, 2, 1],
               [1, 2, 0]])
        >>> np.take_along_axis(a, ai, axis=1)
        array([[10, 20, 30],
               [40, 50, 60]])

        The same works for max and min, if you maintain the trivial dimension
        with ``keepdims``:

        >>> np.max(a, axis=1, keepdims=True)
        array([[30],
               [60]])
        >>> ai = np.argmax(a, axis=1, keepdims=True)
        >>> ai
        array([[1],
               [0]])
        >>> np.take_along_axis(a, ai, axis=1)
        array([[30],
               [60]])

        If we want to get the max and min at the same time, we can stack the
        indices first

        >>> ai_min = np.argmin(a, axis=1, keepdims=True)
        >>> ai_max = np.argmax(a, axis=1, keepdims=True)
        >>> ai = np.concatenate([ai_min, ai_max], axis=1)
        >>> ai
        array([[0, 1],
               [1, 0]])
        >>> np.take_along_axis(a, ai, axis=1)
        array([[10, 30],
               [40, 60]])

    tensordot(a, b, axes=2)
        Compute tensor dot product along specified axes.

        Given two tensors, `a` and `b`, and an array_like object containing
        two array_like objects, ``(a_axes, b_axes)``, sum the products of
        `a`'s and `b`'s elements (components) over the axes specified by
        ``a_axes`` and ``b_axes``. The third argument can be a single non-negative
        integer_like scalar, ``N``; if it is such, then the last ``N`` dimensions
        of `a` and the first ``N`` dimensions of `b` are summed over.

        Parameters
        ----------
        a, b : array_like
            Tensors to "dot".

        axes : int or (2,) array_like
            * integer_like
              If an int N, sum over the last N axes of `a` and the first N axes
              of `b` in order. The sizes of the corresponding axes must match.
            * (2,) array_like
              Or, a list of axes to be summed over, first sequence applying to `a`,
              second to `b`. Both elements array_like must be of the same length.

        Returns
        -------
        output : ndarray
            The tensor dot product of the input.

        See Also
        --------
        dot, einsum

        Notes
        -----
        Three common use cases are:

        * ``axes = 0`` : tensor product :math:`a\otimes b`
        * ``axes = 1`` : tensor dot product :math:`a\cdot b`
        * ``axes = 2`` : (default) tensor double contraction :math:`a:b`

        When `axes` is a positive integer ``N``, the operation starts with
        axis ``-N`` of `a` and axis ``0`` of `b`, and it continues through
        axis ``-1`` of `a` and axis ``N-1`` of `b` (inclusive).

        When there is more than one axis to sum over - and they are not the last
        (first) axes of `a` (`b`) - the argument `axes` should consist of
        two sequences of the same length, with the first axis to sum over given
        first in both sequences, the second axis second, and so forth.

        The shape of the result consists of the non-contracted axes of the
        first tensor, followed by the non-contracted axes of the second.

        Examples
        --------
        A "traditional" example:

        >>> import numpy as np
        >>> a = np.arange(60.).reshape(3,4,5)
        >>> b = np.arange(24.).reshape(4,3,2)
        >>> c = np.tensordot(a,b, axes=([1,0],[0,1]))
        >>> c.shape
        (5, 2)
        >>> c
        array([[4400., 4730.],
               [4532., 4874.],
               [4664., 5018.],
               [4796., 5162.],
               [4928., 5306.]])
        >>> # A slower but equivalent way of computing the same...
        >>> d = np.zeros((5,2))
        >>> for i in range(5):
        ...   for j in range(2):
        ...     for k in range(3):
        ...       for n in range(4):
        ...         d[i,j] += a[k,n,i] * b[n,k,j]
        >>> c == d
        array([[ True,  True],
               [ True,  True],
               [ True,  True],
               [ True,  True],
               [ True,  True]])

        An extended example taking advantage of the overloading of + and \*:

        >>> a = np.array(range(1, 9))
        >>> a.shape = (2, 2, 2)
        >>> A = np.array(('a', 'b', 'c', 'd'), dtype=object)
        >>> A.shape = (2, 2)
        >>> a; A
        array([[[1, 2],
                [3, 4]],
               [[5, 6],
                [7, 8]]])
        array([['a', 'b'],
               ['c', 'd']], dtype=object)

        >>> np.tensordot(a, A) # third argument default is 2 for double-contraction
        array(['abbcccdddd', 'aaaaabbbbbbcccccccdddddddd'], dtype=object)

        >>> np.tensordot(a, A, 1)
        array([[['acc', 'bdd'],
                ['aaacccc', 'bbbdddd']],
               [['aaaaacccccc', 'bbbbbdddddd'],
                ['aaaaaaacccccccc', 'bbbbbbbdddddddd']]], dtype=object)

        >>> np.tensordot(a, A, 0) # tensor product (result too long to incl.)
        array([[[[['a', 'b'],
                  ['c', 'd']],
                  ...

        >>> np.tensordot(a, A, (0, 1))
        array([[['abbbbb', 'cddddd'],
                ['aabbbbbb', 'ccdddddd']],
               [['aaabbbbbbb', 'cccddddddd'],
                ['aaaabbbbbbbb', 'ccccdddddddd']]], dtype=object)

        >>> np.tensordot(a, A, (2, 1))
        array([[['abb', 'cdd'],
                ['aaabbbb', 'cccdddd']],
               [['aaaaabbbbbb', 'cccccdddddd'],
                ['aaaaaaabbbbbbbb', 'cccccccdddddddd']]], dtype=object)

        >>> np.tensordot(a, A, ((0, 1), (0, 1)))
        array(['abbbcccccddddddd', 'aabbbbccccccdddddddd'], dtype=object)

        >>> np.tensordot(a, A, ((2, 1), (1, 0)))
        array(['acccbbdddd', 'aaaaacccccccbbbbbbdddddddd'], dtype=object)

    tile(A, reps)
        Construct an array by repeating A the number of times given by reps.

        If `reps` has length ``d``, the result will have dimension of
        ``max(d, A.ndim)``.

        If ``A.ndim < d``, `A` is promoted to be d-dimensional by prepending new
        axes. So a shape (3,) array is promoted to (1, 3) for 2-D replication,
        or shape (1, 1, 3) for 3-D replication. If this is not the desired
        behavior, promote `A` to d-dimensions manually before calling this
        function.

        If ``A.ndim > d``, `reps` is promoted to `A`.ndim by prepending 1's to it.
        Thus for an `A` of shape (2, 3, 4, 5), a `reps` of (2, 2) is treated as
        (1, 1, 2, 2).

        Note : Although tile may be used for broadcasting, it is strongly
        recommended to use numpy's broadcasting operations and functions.

        Parameters
        ----------
        A : array_like
            The input array.
        reps : array_like
            The number of repetitions of `A` along each axis.

        Returns
        -------
        c : ndarray
            The tiled output array.

        See Also
        --------
        repeat : Repeat elements of an array.
        broadcast_to : Broadcast an array to a new shape

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([0, 1, 2])
        >>> np.tile(a, 2)
        array([0, 1, 2, 0, 1, 2])
        >>> np.tile(a, (2, 2))
        array([[0, 1, 2, 0, 1, 2],
               [0, 1, 2, 0, 1, 2]])
        >>> np.tile(a, (2, 1, 2))
        array([[[0, 1, 2, 0, 1, 2]],
               [[0, 1, 2, 0, 1, 2]]])

        >>> b = np.array([[1, 2], [3, 4]])
        >>> np.tile(b, 2)
        array([[1, 2, 1, 2],
               [3, 4, 3, 4]])
        >>> np.tile(b, (2, 1))
        array([[1, 2],
               [3, 4],
               [1, 2],
               [3, 4]])

        >>> c = np.array([1,2,3,4])
        >>> np.tile(c,(4,1))
        array([[1, 2, 3, 4],
               [1, 2, 3, 4],
               [1, 2, 3, 4],
               [1, 2, 3, 4]])

    trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None)
        Return the sum along diagonals of the array.

        If `a` is 2-D, the sum along its diagonal with the given offset
        is returned, i.e., the sum of elements ``a[i,i+offset]`` for all i.

        If `a` has more than two dimensions, then the axes specified by axis1 and
        axis2 are used to determine the 2-D sub-arrays whose traces are returned.
        The shape of the resulting array is the same as that of `a` with `axis1`
        and `axis2` removed.

        Parameters
        ----------
        a : array_like
            Input array, from which the diagonals are taken.
        offset : int, optional
            Offset of the diagonal from the main diagonal. Can be both positive
            and negative. Defaults to 0.
        axis1, axis2 : int, optional
            Axes to be used as the first and second axis of the 2-D sub-arrays
            from which the diagonals should be taken. Defaults are the first two
            axes of `a`.
        dtype : dtype, optional
            Determines the data-type of the returned array and of the accumulator
            where the elements are summed. If dtype has the value None and `a` is
            of integer type of precision less than the default integer
            precision, then the default integer precision is used. Otherwise,
            the precision is the same as that of `a`.
        out : ndarray, optional
            Array into which the output is placed. Its type is preserved and
            it must be of the right shape to hold the output.

        Returns
        -------
        sum_along_diagonals : ndarray
            If `a` is 2-D, the sum along the diagonal is returned.  If `a` has
            larger dimensions, then an array of sums along diagonals is returned.

        See Also
        --------
        diag, diagonal, diagflat

        Examples
        --------
        >>> import numpy as np
        >>> np.trace(np.eye(3))
        3.0
        >>> a = np.arange(8).reshape((2,2,2))
        >>> np.trace(a)
        array([6, 8])

        >>> a = np.arange(24).reshape((2,2,2,3))
        >>> np.trace(a).shape
        (2, 3)

    transpose(a, axes=None)
        Returns an array with axes transposed.

        For a 1-D array, this returns an unchanged view of the original array, as a
        transposed vector is simply the same vector.
        To convert a 1-D array into a 2-D column vector, an additional dimension
        must be added, e.g., ``np.atleast_2d(a).T`` achieves this, as does
        ``a[:, np.newaxis]``.
        For a 2-D array, this is the standard matrix transpose.
        For an n-D array, if axes are given, their order indicates how the
        axes are permuted (see Examples). If axes are not provided, then
        ``transpose(a).shape == a.shape[::-1]``.

        Parameters
        ----------
        a : array_like
            Input array.
        axes : tuple or list of ints, optional
            If specified, it must be a tuple or list which contains a permutation
            of [0,1,...,N-1] where N is the number of axes of `a`. The `i`'th axis
            of the returned array will correspond to the axis numbered ``axes[i]``
            of the input. If not specified, defaults to ``range(a.ndim)[::-1]``,
            which reverses the order of the axes.

        Returns
        -------
        p : ndarray
            `a` with its axes permuted. A view is returned whenever possible.

        See Also
        --------
        ndarray.transpose : Equivalent method.
        moveaxis : Move axes of an array to new positions.
        argsort : Return the indices that would sort an array.

        Notes
        -----
        Use ``transpose(a, argsort(axes))`` to invert the transposition of tensors
        when using the `axes` keyword argument.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, 4]])
        >>> a
        array([[1, 2],
               [3, 4]])
        >>> np.transpose(a)
        array([[1, 3],
               [2, 4]])

        >>> a = np.array([1, 2, 3, 4])
        >>> a
        array([1, 2, 3, 4])
        >>> np.transpose(a)
        array([1, 2, 3, 4])

        >>> a = np.ones((1, 2, 3))
        >>> np.transpose(a, (1, 0, 2)).shape
        (2, 1, 3)

        >>> a = np.ones((2, 3, 4, 5))
        >>> np.transpose(a).shape
        (5, 4, 3, 2)

    trapezoid(y, x=None, dx=1.0, axis=-1)
        Integrate along the given axis using the composite trapezoidal rule.

        If `x` is provided, the integration happens in sequence along its
        elements - they are not sorted.

        Integrate `y` (`x`) along each 1d slice on the given axis, compute
        :math:`\int y(x) dx`.
        When `x` is specified, this integrates along the parametric curve,
        computing :math:`\int_t y(t) dt =
        \int_t y(t) \left.\frac{dx}{dt}\right|_{x=x(t)} dt`.

        .. versionadded:: 2.0.0

        Parameters
        ----------
        y : array_like
            Input array to integrate.
        x : array_like, optional
            The sample points corresponding to the `y` values. If `x` is None,
            the sample points are assumed to be evenly spaced `dx` apart. The
            default is None.
        dx : scalar, optional
            The spacing between sample points when `x` is None. The default is 1.
        axis : int, optional
            The axis along which to integrate.

        Returns
        -------
        trapezoid : float or ndarray
            Definite integral of `y` = n-dimensional array as approximated along
            a single axis by the trapezoidal rule. If `y` is a 1-dimensional array,
            then the result is a float. If `n` is greater than 1, then the result
            is an `n`-1 dimensional array.

        See Also
        --------
        sum, cumsum

        Notes
        -----
        Image [2]_ illustrates trapezoidal rule -- y-axis locations of points
        will be taken from `y` array, by default x-axis distances between
        points will be 1.0, alternatively they can be provided with `x` array
        or with `dx` scalar.  Return value will be equal to combined area under
        the red lines.


        References
        ----------
        .. [1] Wikipedia page: https://en.wikipedia.org/wiki/Trapezoidal_rule

        .. [2] Illustration image:
               https://en.wikipedia.org/wiki/File:Composite_trapezoidal_rule_illustration.png

        Examples
        --------
        >>> import numpy as np

        Use the trapezoidal rule on evenly spaced points:

        >>> np.trapezoid([1, 2, 3])
        4.0

        The spacing between sample points can be selected by either the
        ``x`` or ``dx`` arguments:

        >>> np.trapezoid([1, 2, 3], x=[4, 6, 8])
        8.0
        >>> np.trapezoid([1, 2, 3], dx=2)
        8.0

        Using a decreasing ``x`` corresponds to integrating in reverse:

        >>> np.trapezoid([1, 2, 3], x=[8, 6, 4])
        -8.0

        More generally ``x`` is used to integrate along a parametric curve. We can
        estimate the integral :math:`\int_0^1 x^2 = 1/3` using:

        >>> x = np.linspace(0, 1, num=50)
        >>> y = x**2
        >>> np.trapezoid(y, x)
        0.33340274885464394

        Or estimate the area of a circle, noting we repeat the sample which closes
        the curve:

        >>> theta = np.linspace(0, 2 * np.pi, num=1000, endpoint=True)
        >>> np.trapezoid(np.cos(theta), x=np.sin(theta))
        3.141571941375841

        ``np.trapezoid`` can be applied along a specified axis to do multiple
        computations in one call:

        >>> a = np.arange(6).reshape(2, 3)
        >>> a
        array([[0, 1, 2],
               [3, 4, 5]])
        >>> np.trapezoid(a, axis=0)
        array([1.5, 2.5, 3.5])
        >>> np.trapezoid(a, axis=1)
        array([2.,  8.])

    trapz(y, x=None, dx=1.0, axis=-1)
        `trapz` is deprecated in NumPy 2.0.

        Please use `trapezoid` instead, or one of the numerical integration
        functions in `scipy.integrate`.

    tri(N, M=None, k=0, dtype=<class 'float'>, *, like=None)
        An array with ones at and below the given diagonal and zeros elsewhere.

        Parameters
        ----------
        N : int
            Number of rows in the array.
        M : int, optional
            Number of columns in the array.
            By default, `M` is taken equal to `N`.
        k : int, optional
            The sub-diagonal at and below which the array is filled.
            `k` = 0 is the main diagonal, while `k` < 0 is below it,
            and `k` > 0 is above.  The default is 0.
        dtype : dtype, optional
            Data type of the returned array.  The default is float.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        tri : ndarray of shape (N, M)
            Array with its lower triangle filled with ones and zero elsewhere;
            in other words ``T[i,j] == 1`` for ``j <= i + k``, 0 otherwise.

        Examples
        --------
        >>> import numpy as np
        >>> np.tri(3, 5, 2, dtype=int)
        array([[1, 1, 1, 0, 0],
               [1, 1, 1, 1, 0],
               [1, 1, 1, 1, 1]])

        >>> np.tri(3, 5, -1)
        array([[0.,  0.,  0.,  0.,  0.],
               [1.,  0.,  0.,  0.,  0.],
               [1.,  1.,  0.,  0.,  0.]])

    tril(m, k=0)
        Lower triangle of an array.

        Return a copy of an array with elements above the `k`-th diagonal zeroed.
        For arrays with ``ndim`` exceeding 2, `tril` will apply to the final two
        axes.

        Parameters
        ----------
        m : array_like, shape (..., M, N)
            Input array.
        k : int, optional
            Diagonal above which to zero elements.  `k = 0` (the default) is the
            main diagonal, `k < 0` is below it and `k > 0` is above.

        Returns
        -------
        tril : ndarray, shape (..., M, N)
            Lower triangle of `m`, of same shape and data-type as `m`.

        See Also
        --------
        triu : same thing, only for the upper triangle

        Examples
        --------
        >>> import numpy as np
        >>> np.tril([[1,2,3],[4,5,6],[7,8,9],[10,11,12]], -1)
        array([[ 0,  0,  0],
               [ 4,  0,  0],
               [ 7,  8,  0],
               [10, 11, 12]])

        >>> np.tril(np.arange(3*4*5).reshape(3, 4, 5))
        array([[[ 0,  0,  0,  0,  0],
                [ 5,  6,  0,  0,  0],
                [10, 11, 12,  0,  0],
                [15, 16, 17, 18,  0]],
               [[20,  0,  0,  0,  0],
                [25, 26,  0,  0,  0],
                [30, 31, 32,  0,  0],
                [35, 36, 37, 38,  0]],
               [[40,  0,  0,  0,  0],
                [45, 46,  0,  0,  0],
                [50, 51, 52,  0,  0],
                [55, 56, 57, 58,  0]]])

    tril_indices(n, k=0, m=None)
        Return the indices for the lower-triangle of an (n, m) array.

        Parameters
        ----------
        n : int
            The row dimension of the arrays for which the returned
            indices will be valid.
        k : int, optional
            Diagonal offset (see `tril` for details).
        m : int, optional
            .. versionadded:: 1.9.0

            The column dimension of the arrays for which the returned
            arrays will be valid.
            By default `m` is taken equal to `n`.


        Returns
        -------
        inds : tuple of arrays
            The indices for the triangle. The returned tuple contains two arrays,
            each with the indices along one dimension of the array.

        See also
        --------
        triu_indices : similar function, for upper-triangular.
        mask_indices : generic function accepting an arbitrary mask function.
        tril, triu

        Notes
        -----
        .. versionadded:: 1.4.0

        Examples
        --------
        >>> import numpy as np

        Compute two different sets of indices to access 4x4 arrays, one for the
        lower triangular part starting at the main diagonal, and one starting two
        diagonals further right:

        >>> il1 = np.tril_indices(4)
        >>> il2 = np.tril_indices(4, 2)

        Here is how they can be used with a sample array:

        >>> a = np.arange(16).reshape(4, 4)
        >>> a
        array([[ 0,  1,  2,  3],
               [ 4,  5,  6,  7],
               [ 8,  9, 10, 11],
               [12, 13, 14, 15]])

        Both for indexing:

        >>> a[il1]
        array([ 0,  4,  5, ..., 13, 14, 15])

        And for assigning values:

        >>> a[il1] = -1
        >>> a
        array([[-1,  1,  2,  3],
               [-1, -1,  6,  7],
               [-1, -1, -1, 11],
               [-1, -1, -1, -1]])

        These cover almost the whole array (two diagonals right of the main one):

        >>> a[il2] = -10
        >>> a
        array([[-10, -10, -10,   3],
               [-10, -10, -10, -10],
               [-10, -10, -10, -10],
               [-10, -10, -10, -10]])

    tril_indices_from(arr, k=0)
        Return the indices for the lower-triangle of arr.

        See `tril_indices` for full details.

        Parameters
        ----------
        arr : array_like
            The indices will be valid for square arrays whose dimensions are
            the same as arr.
        k : int, optional
            Diagonal offset (see `tril` for details).

        Examples
        --------
        >>> import numpy as np

        Create a 4 by 4 array

        >>> a = np.arange(16).reshape(4, 4)
        >>> a
        array([[ 0,  1,  2,  3],
               [ 4,  5,  6,  7],
               [ 8,  9, 10, 11],
               [12, 13, 14, 15]])

        Pass the array to get the indices of the lower triangular elements.

        >>> trili = np.tril_indices_from(a)
        >>> trili
        (array([0, 1, 1, 2, 2, 2, 3, 3, 3, 3]), array([0, 0, 1, 0, 1, 2, 0, 1, 2, 3]))

        >>> a[trili]
        array([ 0,  4,  5,  8,  9, 10, 12, 13, 14, 15])

        This is syntactic sugar for tril_indices().

        >>> np.tril_indices(a.shape[0])
        (array([0, 1, 1, 2, 2, 2, 3, 3, 3, 3]), array([0, 0, 1, 0, 1, 2, 0, 1, 2, 3]))

        Use the `k` parameter to return the indices for the lower triangular array
        up to the k-th diagonal.

        >>> trili1 = np.tril_indices_from(a, k=1)
        >>> a[trili1]
        array([ 0,  1,  4,  5,  6,  8,  9, 10, 11, 12, 13, 14, 15])

        See Also
        --------
        tril_indices, tril, triu_indices_from

        Notes
        -----
        .. versionadded:: 1.4.0

    trim_zeros(filt, trim='fb')
        Trim the leading and/or trailing zeros from a 1-D array or sequence.

        Parameters
        ----------
        filt : 1-D array or sequence
            Input array.
        trim : str, optional
            A string with 'f' representing trim from front and 'b' to trim from
            back. Default is 'fb', trim zeros from both front and back of the
            array.

        Returns
        -------
        trimmed : 1-D array or sequence
            The result of trimming the input. The input data type is preserved.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array((0, 0, 0, 1, 2, 3, 0, 2, 1, 0))
        >>> np.trim_zeros(a)
        array([1, 2, 3, 0, 2, 1])

        >>> np.trim_zeros(a, 'b')
        array([0, 0, 0, ..., 0, 2, 1])

        The input data type is preserved, list/tuple in means list/tuple out.

        >>> np.trim_zeros([0, 1, 2, 0])
        [1, 2]

    triu(m, k=0)
        Upper triangle of an array.

        Return a copy of an array with the elements below the `k`-th diagonal
        zeroed. For arrays with ``ndim`` exceeding 2, `triu` will apply to the
        final two axes.

        Please refer to the documentation for `tril` for further details.

        See Also
        --------
        tril : lower triangle of an array

        Examples
        --------
        >>> import numpy as np
        >>> np.triu([[1,2,3],[4,5,6],[7,8,9],[10,11,12]], -1)
        array([[ 1,  2,  3],
               [ 4,  5,  6],
               [ 0,  8,  9],
               [ 0,  0, 12]])

        >>> np.triu(np.arange(3*4*5).reshape(3, 4, 5))
        array([[[ 0,  1,  2,  3,  4],
                [ 0,  6,  7,  8,  9],
                [ 0,  0, 12, 13, 14],
                [ 0,  0,  0, 18, 19]],
               [[20, 21, 22, 23, 24],
                [ 0, 26, 27, 28, 29],
                [ 0,  0, 32, 33, 34],
                [ 0,  0,  0, 38, 39]],
               [[40, 41, 42, 43, 44],
                [ 0, 46, 47, 48, 49],
                [ 0,  0, 52, 53, 54],
                [ 0,  0,  0, 58, 59]]])

    triu_indices(n, k=0, m=None)
        Return the indices for the upper-triangle of an (n, m) array.

        Parameters
        ----------
        n : int
            The size of the arrays for which the returned indices will
            be valid.
        k : int, optional
            Diagonal offset (see `triu` for details).
        m : int, optional
            .. versionadded:: 1.9.0

            The column dimension of the arrays for which the returned
            arrays will be valid.
            By default `m` is taken equal to `n`.


        Returns
        -------
        inds : tuple, shape(2) of ndarrays, shape(`n`)
            The indices for the triangle. The returned tuple contains two arrays,
            each with the indices along one dimension of the array.  Can be used
            to slice a ndarray of shape(`n`, `n`).

        See also
        --------
        tril_indices : similar function, for lower-triangular.
        mask_indices : generic function accepting an arbitrary mask function.
        triu, tril

        Notes
        -----
        .. versionadded:: 1.4.0

        Examples
        --------
        >>> import numpy as np

        Compute two different sets of indices to access 4x4 arrays, one for the
        upper triangular part starting at the main diagonal, and one starting two
        diagonals further right:

        >>> iu1 = np.triu_indices(4)
        >>> iu2 = np.triu_indices(4, 2)

        Here is how they can be used with a sample array:

        >>> a = np.arange(16).reshape(4, 4)
        >>> a
        array([[ 0,  1,  2,  3],
               [ 4,  5,  6,  7],
               [ 8,  9, 10, 11],
               [12, 13, 14, 15]])

        Both for indexing:

        >>> a[iu1]
        array([ 0,  1,  2, ..., 10, 11, 15])

        And for assigning values:

        >>> a[iu1] = -1
        >>> a
        array([[-1, -1, -1, -1],
               [ 4, -1, -1, -1],
               [ 8,  9, -1, -1],
               [12, 13, 14, -1]])

        These cover only a small part of the whole array (two diagonals right
        of the main one):

        >>> a[iu2] = -10
        >>> a
        array([[ -1,  -1, -10, -10],
               [  4,  -1,  -1, -10],
               [  8,   9,  -1,  -1],
               [ 12,  13,  14,  -1]])

    triu_indices_from(arr, k=0)
        Return the indices for the upper-triangle of arr.

        See `triu_indices` for full details.

        Parameters
        ----------
        arr : ndarray, shape(N, N)
            The indices will be valid for square arrays.
        k : int, optional
            Diagonal offset (see `triu` for details).

        Returns
        -------
        triu_indices_from : tuple, shape(2) of ndarray, shape(N)
            Indices for the upper-triangle of `arr`.

        Examples
        --------
        >>> import numpy as np

        Create a 4 by 4 array

        >>> a = np.arange(16).reshape(4, 4)
        >>> a
        array([[ 0,  1,  2,  3],
               [ 4,  5,  6,  7],
               [ 8,  9, 10, 11],
               [12, 13, 14, 15]])

        Pass the array to get the indices of the upper triangular elements.

        >>> triui = np.triu_indices_from(a)
        >>> triui
        (array([0, 0, 0, 0, 1, 1, 1, 2, 2, 3]), array([0, 1, 2, 3, 1, 2, 3, 2, 3, 3]))

        >>> a[triui]
        array([ 0,  1,  2,  3,  5,  6,  7, 10, 11, 15])

        This is syntactic sugar for triu_indices().

        >>> np.triu_indices(a.shape[0])
        (array([0, 0, 0, 0, 1, 1, 1, 2, 2, 3]), array([0, 1, 2, 3, 1, 2, 3, 2, 3, 3]))

        Use the `k` parameter to return the indices for the upper triangular array
        from the k-th diagonal.

        >>> triuim1 = np.triu_indices_from(a, k=1)
        >>> a[triuim1]
        array([ 1,  2,  3,  6,  7, 11])


        See Also
        --------
        triu_indices, triu, tril_indices_from

        Notes
        -----
        .. versionadded:: 1.4.0

    typename(char)
        Return a description for the given data type code.

        Parameters
        ----------
        char : str
            Data type code.

        Returns
        -------
        out : str
            Description of the input data type code.

        See Also
        --------
        dtype

        Examples
        --------
        >>> import numpy as np
        >>> typechars = ['S1', '?', 'B', 'D', 'G', 'F', 'I', 'H', 'L', 'O', 'Q',
        ...              'S', 'U', 'V', 'b', 'd', 'g', 'f', 'i', 'h', 'l', 'q']
        >>> for typechar in typechars:
        ...     print(typechar, ' : ', np.typename(typechar))
        ...
        S1  :  character
        ?  :  bool
        B  :  unsigned char
        D  :  complex double precision
        G  :  complex long double precision
        F  :  complex single precision
        I  :  unsigned integer
        H  :  unsigned short
        L  :  unsigned long integer
        O  :  object
        Q  :  unsigned long long integer
        S  :  string
        U  :  unicode
        V  :  void
        b  :  signed char
        d  :  double precision
        g  :  long precision
        f  :  single precision
        i  :  integer
        h  :  short
        l  :  long integer
        q  :  long long integer

    union1d(ar1, ar2)
        Find the union of two arrays.

        Return the unique, sorted array of values that are in either of the two
        input arrays.

        Parameters
        ----------
        ar1, ar2 : array_like
            Input arrays. They are flattened if they are not already 1D.

        Returns
        -------
        union1d : ndarray
            Unique, sorted union of the input arrays.

        Examples
        --------
        >>> import numpy as np
        >>> np.union1d([-1, 0, 1], [-2, 0, 2])
        array([-2, -1,  0,  1,  2])

        To find the union of more than two arrays, use functools.reduce:

        >>> from functools import reduce
        >>> reduce(np.union1d, ([1, 3, 4, 3], [3, 1, 2, 1], [6, 3, 4, 2]))
        array([1, 2, 3, 4, 6])

    unique(ar, return_index=False, return_inverse=False, return_counts=False, axis=None, *, equal_nan=True)
        Find the unique elements of an array.

        Returns the sorted unique elements of an array. There are three optional
        outputs in addition to the unique elements:

        * the indices of the input array that give the unique values
        * the indices of the unique array that reconstruct the input array
        * the number of times each unique value comes up in the input array

        Parameters
        ----------
        ar : array_like
            Input array. Unless `axis` is specified, this will be flattened if it
            is not already 1-D.
        return_index : bool, optional
            If True, also return the indices of `ar` (along the specified axis,
            if provided, or in the flattened array) that result in the unique array.
        return_inverse : bool, optional
            If True, also return the indices of the unique array (for the specified
            axis, if provided) that can be used to reconstruct `ar`.
        return_counts : bool, optional
            If True, also return the number of times each unique item appears
            in `ar`.
        axis : int or None, optional
            The axis to operate on. If None, `ar` will be flattened. If an integer,
            the subarrays indexed by the given axis will be flattened and treated
            as the elements of a 1-D array with the dimension of the given axis,
            see the notes for more details.  Object arrays or structured arrays
            that contain objects are not supported if the `axis` kwarg is used. The
            default is None.

            .. versionadded:: 1.13.0

        equal_nan : bool, optional
            If True, collapses multiple NaN values in the return array into one.

            .. versionadded:: 1.24

        Returns
        -------
        unique : ndarray
            The sorted unique values.
        unique_indices : ndarray, optional
            The indices of the first occurrences of the unique values in the
            original array. Only provided if `return_index` is True.
        unique_inverse : ndarray, optional
            The indices to reconstruct the original array from the
            unique array. Only provided if `return_inverse` is True.
        unique_counts : ndarray, optional
            The number of times each of the unique values comes up in the
            original array. Only provided if `return_counts` is True.

            .. versionadded:: 1.9.0

        See Also
        --------
        repeat : Repeat elements of an array.

        Notes
        -----
        When an axis is specified the subarrays indexed by the axis are sorted.
        This is done by making the specified axis the first dimension of the array
        (move the axis to the first dimension to keep the order of the other axes)
        and then flattening the subarrays in C order. The flattened subarrays are
        then viewed as a structured type with each element given a label, with the
        effect that we end up with a 1-D array of structured types that can be
        treated in the same way as any other 1-D array. The result is that the
        flattened subarrays are sorted in lexicographic order starting with the
        first element.

        .. versionchanged: 1.21
            If nan values are in the input array, a single nan is put
            to the end of the sorted unique values.

            Also for complex arrays all NaN values are considered equivalent
            (no matter whether the NaN is in the real or imaginary part).
            As the representant for the returned array the smallest one in the
            lexicographical order is chosen - see np.sort for how the lexicographical
            order is defined for complex arrays.

        .. versionchanged: 2.0
            For multi-dimensional inputs, ``unique_inverse`` is reshaped
            such that the input can be reconstructed using
            ``np.take(unique, unique_inverse, axis=axis)``. The result is
            now not 1-dimensional when ``axis=None``.

            Note that in NumPy 2.0.0 a higher dimensional array was returned also
            when ``axis`` was not ``None``.  This was reverted, but
            ``inverse.reshape(-1)`` can be used to ensure compatibility with both
            versions.

        Examples
        --------
        >>> import numpy as np
        >>> np.unique([1, 1, 2, 2, 3, 3])
        array([1, 2, 3])
        >>> a = np.array([[1, 1], [2, 3]])
        >>> np.unique(a)
        array([1, 2, 3])

        Return the unique rows of a 2D array

        >>> a = np.array([[1, 0, 0], [1, 0, 0], [2, 3, 4]])
        >>> np.unique(a, axis=0)
        array([[1, 0, 0], [2, 3, 4]])

        Return the indices of the original array that give the unique values:

        >>> a = np.array(['a', 'b', 'b', 'c', 'a'])
        >>> u, indices = np.unique(a, return_index=True)
        >>> u
        array(['a', 'b', 'c'], dtype='<U1')
        >>> indices
        array([0, 1, 3])
        >>> a[indices]
        array(['a', 'b', 'c'], dtype='<U1')

        Reconstruct the input array from the unique values and inverse:

        >>> a = np.array([1, 2, 6, 4, 2, 3, 2])
        >>> u, indices = np.unique(a, return_inverse=True)
        >>> u
        array([1, 2, 3, 4, 6])
        >>> indices
        array([0, 1, 4, 3, 1, 2, 1])
        >>> u[indices]
        array([1, 2, 6, 4, 2, 3, 2])

        Reconstruct the input values from the unique values and counts:

        >>> a = np.array([1, 2, 6, 4, 2, 3, 2])
        >>> values, counts = np.unique(a, return_counts=True)
        >>> values
        array([1, 2, 3, 4, 6])
        >>> counts
        array([1, 3, 1, 1, 1])
        >>> np.repeat(values, counts)
        array([1, 2, 2, 2, 3, 4, 6])    # original order not preserved

    unique_all(x)
        Find the unique elements of an array, and counts, inverse and indices.

        This function is an Array API compatible alternative to:

        >>> x = np.array([1, 1, 2])
        >>> np.unique(x, return_index=True, return_inverse=True,
        ...           return_counts=True, equal_nan=False)
        (array([1, 2]), array([0, 2]), array([0, 0, 1]), array([2, 1]))

        Parameters
        ----------
        x : array_like
            Input array. It will be flattened if it is not already 1-D.

        Returns
        -------
        out : namedtuple
            The result containing:

            * values - The unique elements of an input array.
            * indices - The first occurring indices for each unique element.
            * inverse_indices - The indices from the set of unique elements
              that reconstruct `x`.
            * counts - The corresponding counts for each unique element.

        See Also
        --------
        unique : Find the unique elements of an array.

        Examples
        --------
        >>> import numpy as np
        >>> np.unique_all([1, 1, 2])
        UniqueAllResult(values=array([1, 2]),
                        indices=array([0, 2]),
                        inverse_indices=array([0, 0, 1]),
                        counts=array([2, 1]))

    unique_counts(x)
        Find the unique elements and counts of an input array `x`.

        This function is an Array API compatible alternative to:

        >>> x = np.array([1, 1, 2])
        >>> np.unique(x, return_counts=True, equal_nan=False)
        (array([1, 2]), array([2, 1]))

        Parameters
        ----------
        x : array_like
            Input array. It will be flattened if it is not already 1-D.

        Returns
        -------
        out : namedtuple
            The result containing:

            * values - The unique elements of an input array.
            * counts - The corresponding counts for each unique element.

        See Also
        --------
        unique : Find the unique elements of an array.

        Examples
        --------
        >>> import numpy as np
        >>> np.unique_counts([1, 1, 2])
        UniqueCountsResult(values=array([1, 2]), counts=array([2, 1]))

    unique_inverse(x)
        Find the unique elements of `x` and indices to reconstruct `x`.

        This function is Array API compatible alternative to:

        >>> x = np.array([1, 1, 2])
        >>> np.unique(x, return_inverse=True, equal_nan=False)
        (array([1, 2]), array([0, 0, 1]))

        Parameters
        ----------
        x : array_like
            Input array. It will be flattened if it is not already 1-D.

        Returns
        -------
        out : namedtuple
            The result containing:

            * values - The unique elements of an input array.
            * inverse_indices - The indices from the set of unique elements
              that reconstruct `x`.

        See Also
        --------
        unique : Find the unique elements of an array.

        Examples
        --------
        >>> import numpy as np
        >>> np.unique_inverse([1, 1, 2])
        UniqueInverseResult(values=array([1, 2]), inverse_indices=array([0, 0, 1]))

    unique_values(x)
        Returns the unique elements of an input array `x`.

        This function is Array API compatible alternative to:

        >>> x = np.array([1, 1, 2])
        >>> np.unique(x, equal_nan=False)
        array([1, 2])

        Parameters
        ----------
        x : array_like
            Input array. It will be flattened if it is not already 1-D.

        Returns
        -------
        out : ndarray
            The unique elements of an input array.

        See Also
        --------
        unique : Find the unique elements of an array.

        Examples
        --------
        >>> import numpy as np
        >>> np.unique_values([1, 1, 2])
        array([1, 2])

    unpackbits(...)
        unpackbits(a, /, axis=None, count=None, bitorder='big')

        Unpacks elements of a uint8 array into a binary-valued output array.

        Each element of `a` represents a bit-field that should be unpacked
        into a binary-valued output array. The shape of the output array is
        either 1-D (if `axis` is ``None``) or the same shape as the input
        array with unpacking done along the axis specified.

        Parameters
        ----------
        a : ndarray, uint8 type
           Input array.
        axis : int, optional
            The dimension over which bit-unpacking is done.
            ``None`` implies unpacking the flattened array.
        count : int or None, optional
            The number of elements to unpack along `axis`, provided as a way
            of undoing the effect of packing a size that is not a multiple
            of eight. A non-negative number means to only unpack `count`
            bits. A negative number means to trim off that many bits from
            the end. ``None`` means to unpack the entire array (the
            default). Counts larger than the available number of bits will
            add zero padding to the output. Negative counts must not
            exceed the available number of bits.

            .. versionadded:: 1.17.0

        bitorder : {'big', 'little'}, optional
            The order of the returned bits. 'big' will mimic bin(val),
            ``3 = 0b00000011 => [0, 0, 0, 0, 0, 0, 1, 1]``, 'little' will reverse
            the order to ``[1, 1, 0, 0, 0, 0, 0, 0]``.
            Defaults to 'big'.

            .. versionadded:: 1.17.0

        Returns
        -------
        unpacked : ndarray, uint8 type
           The elements are binary-valued (0 or 1).

        See Also
        --------
        packbits : Packs the elements of a binary-valued array into bits in
                   a uint8 array.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[2], [7], [23]], dtype=np.uint8)
        >>> a
        array([[ 2],
               [ 7],
               [23]], dtype=uint8)
        >>> b = np.unpackbits(a, axis=1)
        >>> b
        array([[0, 0, 0, 0, 0, 0, 1, 0],
               [0, 0, 0, 0, 0, 1, 1, 1],
               [0, 0, 0, 1, 0, 1, 1, 1]], dtype=uint8)
        >>> c = np.unpackbits(a, axis=1, count=-3)
        >>> c
        array([[0, 0, 0, 0, 0],
               [0, 0, 0, 0, 0],
               [0, 0, 0, 1, 0]], dtype=uint8)

        >>> p = np.packbits(b, axis=0)
        >>> np.unpackbits(p, axis=0)
        array([[0, 0, 0, 0, 0, 0, 1, 0],
               [0, 0, 0, 0, 0, 1, 1, 1],
               [0, 0, 0, 1, 0, 1, 1, 1],
               [0, 0, 0, 0, 0, 0, 0, 0],
               [0, 0, 0, 0, 0, 0, 0, 0],
               [0, 0, 0, 0, 0, 0, 0, 0],
               [0, 0, 0, 0, 0, 0, 0, 0],
               [0, 0, 0, 0, 0, 0, 0, 0]], dtype=uint8)
        >>> np.array_equal(b, np.unpackbits(p, axis=0, count=b.shape[0]))
        True

    unravel_index(...)
        unravel_index(indices, shape, order='C')

        Converts a flat index or array of flat indices into a tuple
        of coordinate arrays.

        Parameters
        ----------
        indices : array_like
            An integer array whose elements are indices into the flattened
            version of an array of dimensions ``shape``. Before version 1.6.0,
            this function accepted just one index value.
        shape : tuple of ints
            The shape of the array to use for unraveling ``indices``.

            .. versionchanged:: 1.16.0
                Renamed from ``dims`` to ``shape``.

        order : {'C', 'F'}, optional
            Determines whether the indices should be viewed as indexing in
            row-major (C-style) or column-major (Fortran-style) order.

            .. versionadded:: 1.6.0

        Returns
        -------
        unraveled_coords : tuple of ndarray
            Each array in the tuple has the same shape as the ``indices``
            array.

        See Also
        --------
        ravel_multi_index

        Examples
        --------
        >>> import numpy as np
        >>> np.unravel_index([22, 41, 37], (7,6))
        (array([3, 6, 6]), array([4, 5, 1]))
        >>> np.unravel_index([31, 41, 13], (7,6), order='F')
        (array([3, 6, 6]), array([4, 5, 1]))

        >>> np.unravel_index(1621, (6,7,8,9))
        (3, 1, 4, 1)

    unstack(x, /, *, axis=0)
        Split an array into a sequence of arrays along the given axis.

        The ``axis`` parameter specifies the dimension along which the array will
        be split. For example, if ``axis=0`` (the default) it will be the first
        dimension and if ``axis=-1`` it will be the last dimension.

        The result is a tuple of arrays split along ``axis``.

        .. versionadded:: 2.1.0

        Parameters
        ----------
        x : ndarray
            The array to be unstacked.
        axis : int, optional
            Axis along which the array will be split. Default: ``0``.

        Returns
        -------
        unstacked : tuple of ndarrays
            The unstacked arrays.

        See Also
        --------
        stack : Join a sequence of arrays along a new axis.
        concatenate : Join a sequence of arrays along an existing axis.
        block : Assemble an nd-array from nested lists of blocks.
        split : Split array into a list of multiple sub-arrays of equal size.

        Notes
        -----
        ``unstack`` serves as the reverse operation of :py:func:`stack`, i.e.,
        ``stack(unstack(x, axis=axis), axis=axis) == x``.

        This function is equivalent to ``tuple(np.moveaxis(x, axis, 0))``, since
        iterating on an array iterates along the first axis.

        Examples
        --------
        >>> arr = np.arange(24).reshape((2, 3, 4))
        >>> np.unstack(arr)
        (array([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]]),
         array([[12, 13, 14, 15],
                [16, 17, 18, 19],
                [20, 21, 22, 23]]))
        >>> np.unstack(arr, axis=1)
        (array([[ 0,  1,  2,  3],
                [12, 13, 14, 15]]),
         array([[ 4,  5,  6,  7],
                [16, 17, 18, 19]]),
         array([[ 8,  9, 10, 11],
                [20, 21, 22, 23]]))
        >>> arr2 = np.stack(np.unstack(arr, axis=1), axis=1)
        >>> arr2.shape
        (2, 3, 4)
        >>> np.all(arr == arr2)
        np.True_

    unwrap(p, discont=None, axis=-1, *, period=6.283185307179586)
        Unwrap by taking the complement of large deltas with respect to the period.

        This unwraps a signal `p` by changing elements which have an absolute
        difference from their predecessor of more than ``max(discont, period/2)``
        to their `period`-complementary values.

        For the default case where `period` is :math:`2\pi` and `discont` is
        :math:`\pi`, this unwraps a radian phase `p` such that adjacent differences
        are never greater than :math:`\pi` by adding :math:`2k\pi` for some
        integer :math:`k`.

        Parameters
        ----------
        p : array_like
            Input array.
        discont : float, optional
            Maximum discontinuity between values, default is ``period/2``.
            Values below ``period/2`` are treated as if they were ``period/2``.
            To have an effect different from the default, `discont` should be
            larger than ``period/2``.
        axis : int, optional
            Axis along which unwrap will operate, default is the last axis.
        period : float, optional
            Size of the range over which the input wraps. By default, it is
            ``2 pi``.

            .. versionadded:: 1.21.0

        Returns
        -------
        out : ndarray
            Output array.

        See Also
        --------
        rad2deg, deg2rad

        Notes
        -----
        If the discontinuity in `p` is smaller than ``period/2``,
        but larger than `discont`, no unwrapping is done because taking
        the complement would only make the discontinuity larger.

        Examples
        --------
        >>> import numpy as np
        >>> phase = np.linspace(0, np.pi, num=5)
        >>> phase[3:] += np.pi
        >>> phase
        array([ 0.        ,  0.78539816,  1.57079633,  5.49778714,  6.28318531]) # may vary
        >>> np.unwrap(phase)
        array([ 0.        ,  0.78539816,  1.57079633, -0.78539816,  0.        ]) # may vary
        >>> np.unwrap([0, 1, 2, -1, 0], period=4)
        array([0, 1, 2, 3, 4])
        >>> np.unwrap([ 1, 2, 3, 4, 5, 6, 1, 2, 3], period=6)
        array([1, 2, 3, 4, 5, 6, 7, 8, 9])
        >>> np.unwrap([2, 3, 4, 5, 2, 3, 4, 5], period=4)
        array([2, 3, 4, 5, 6, 7, 8, 9])
        >>> phase_deg = np.mod(np.linspace(0 ,720, 19), 360) - 180
        >>> np.unwrap(phase_deg, period=360)
        array([-180., -140., -100.,  -60.,  -20.,   20.,   60.,  100.,  140.,
                180.,  220.,  260.,  300.,  340.,  380.,  420.,  460.,  500.,
                540.])

    vander(x, N=None, increasing=False)
        Generate a Vandermonde matrix.

        The columns of the output matrix are powers of the input vector. The
        order of the powers is determined by the `increasing` boolean argument.
        Specifically, when `increasing` is False, the `i`-th output column is
        the input vector raised element-wise to the power of ``N - i - 1``. Such
        a matrix with a geometric progression in each row is named for Alexandre-
        Theophile Vandermonde.

        Parameters
        ----------
        x : array_like
            1-D input array.
        N : int, optional
            Number of columns in the output.  If `N` is not specified, a square
            array is returned (``N = len(x)``).
        increasing : bool, optional
            Order of the powers of the columns.  If True, the powers increase
            from left to right, if False (the default) they are reversed.

            .. versionadded:: 1.9.0

        Returns
        -------
        out : ndarray
            Vandermonde matrix.  If `increasing` is False, the first column is
            ``x^(N-1)``, the second ``x^(N-2)`` and so forth. If `increasing` is
            True, the columns are ``x^0, x^1, ..., x^(N-1)``.

        See Also
        --------
        polynomial.polynomial.polyvander

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([1, 2, 3, 5])
        >>> N = 3
        >>> np.vander(x, N)
        array([[ 1,  1,  1],
               [ 4,  2,  1],
               [ 9,  3,  1],
               [25,  5,  1]])

        >>> np.column_stack([x**(N-1-i) for i in range(N)])
        array([[ 1,  1,  1],
               [ 4,  2,  1],
               [ 9,  3,  1],
               [25,  5,  1]])

        >>> x = np.array([1, 2, 3, 5])
        >>> np.vander(x)
        array([[  1,   1,   1,   1],
               [  8,   4,   2,   1],
               [ 27,   9,   3,   1],
               [125,  25,   5,   1]])
        >>> np.vander(x, increasing=True)
        array([[  1,   1,   1,   1],
               [  1,   2,   4,   8],
               [  1,   3,   9,  27],
               [  1,   5,  25, 125]])

        The determinant of a square Vandermonde matrix is the product
        of the differences between the values of the input vector:

        >>> np.linalg.det(np.vander(x))
        48.000000000000043 # may vary
        >>> (5-3)*(5-2)*(5-1)*(3-2)*(3-1)*(2-1)
        48

    var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=<no value>, *, where=<no value>, mean=<no value>, correction=<no value>)
        Compute the variance along the specified axis.

        Returns the variance of the array elements, a measure of the spread of a
        distribution.  The variance is computed for the flattened array by
        default, otherwise over the specified axis.

        Parameters
        ----------
        a : array_like
            Array containing numbers whose variance is desired.  If `a` is not an
            array, a conversion is attempted.
        axis : None or int or tuple of ints, optional
            Axis or axes along which the variance is computed.  The default is to
            compute the variance of the flattened array.

            .. versionadded:: 1.7.0

            If this is a tuple of ints, a variance is performed over multiple axes,
            instead of a single axis or all the axes as before.
        dtype : data-type, optional
            Type to use in computing the variance.  For arrays of integer type
            the default is `float64`; for arrays of float types it is the same as
            the array type.
        out : ndarray, optional
            Alternate output array in which to place the result.  It must have
            the same shape as the expected output, but the type is cast if
            necessary.
        ddof : {int, float}, optional
            "Delta Degrees of Freedom": the divisor used in the calculation is
            ``N - ddof``, where ``N`` represents the number of elements. By
            default `ddof` is zero. See notes for details about use of `ddof`.
        keepdims : bool, optional
            If this is set to True, the axes which are reduced are left
            in the result as dimensions with size one. With this option,
            the result will broadcast correctly against the input array.

            If the default value is passed, then `keepdims` will not be
            passed through to the `var` method of sub-classes of
            `ndarray`, however any non-default value will be.  If the
            sub-class' method does not implement `keepdims` any
            exceptions will be raised.
        where : array_like of bool, optional
            Elements to include in the variance. See `~numpy.ufunc.reduce` for
            details.

            .. versionadded:: 1.20.0

        mean : array like, optional
            Provide the mean to prevent its recalculation. The mean should have
            a shape as if it was calculated with ``keepdims=True``.
            The axis for the calculation of the mean should be the same as used in
            the call to this var function.

            .. versionadded:: 1.26.0

        correction : {int, float}, optional
            Array API compatible name for the ``ddof`` parameter. Only one of them
            can be provided at the same time.

            .. versionadded:: 2.0.0

        Returns
        -------
        variance : ndarray, see dtype parameter above
            If ``out=None``, returns a new array containing the variance;
            otherwise, a reference to the output array is returned.

        See Also
        --------
        std, mean, nanmean, nanstd, nanvar
        :ref:`ufuncs-output-type`

        Notes
        -----
        There are several common variants of the array variance calculation.
        Assuming the input `a` is a one-dimensional NumPy array and ``mean`` is
        either provided as an argument or computed as ``a.mean()``, NumPy
        computes the variance of an array as::

            N = len(a)
            d2 = abs(a - mean)**2  # abs is for complex `a`
            var = d2.sum() / (N - ddof)  # note use of `ddof`

        Different values of the argument `ddof` are useful in different
        contexts. NumPy's default ``ddof=0`` corresponds with the expression:

        .. math::

            \frac{\sum_i{|a_i - \bar{a}|^2 }}{N}

        which is sometimes called the "population variance" in the field of
        statistics because it applies the definition of variance to `a` as if `a`
        were a complete population of possible observations.

        Many other libraries define the variance of an array differently, e.g.:

        .. math::

            \frac{\sum_i{|a_i - \bar{a}|^2}}{N - 1}

        In statistics, the resulting quantity is sometimed called the "sample
        variance" because if `a` is a random sample from a larger population,
        this calculation provides an unbiased estimate of the variance of the
        population.  The use of :math:`N-1` in the denominator is often called
        "Bessel's correction" because it corrects for bias (toward lower values)
        in the variance estimate introduced when the sample mean of `a` is used
        in place of the true mean of the population. For this quantity, use
        ``ddof=1``.

        Note that for complex numbers, the absolute value is taken before
        squaring, so that the result is always real and nonnegative.

        For floating-point input, the variance is computed using the same
        precision the input has.  Depending on the input data, this can cause
        the results to be inaccurate, especially for `float32` (see example
        below).  Specifying a higher-accuracy accumulator using the ``dtype``
        keyword can alleviate this issue.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([[1, 2], [3, 4]])
        >>> np.var(a)
        1.25
        >>> np.var(a, axis=0)
        array([1.,  1.])
        >>> np.var(a, axis=1)
        array([0.25,  0.25])

        In single precision, var() can be inaccurate:

        >>> a = np.zeros((2, 512*512), dtype=np.float32)
        >>> a[0, :] = 1.0
        >>> a[1, :] = 0.1
        >>> np.var(a)
        0.20250003

        Computing the variance in float64 is more accurate:

        >>> np.var(a, dtype=np.float64)
        0.20249999932944759 # may vary
        >>> ((1-0.55)**2 + (0.1-0.55)**2)/2
        0.2025

        Specifying a where argument:

        >>> a = np.array([[14, 8, 11, 10], [7, 9, 10, 11], [10, 15, 5, 10]])
        >>> np.var(a)
        6.833333333333333 # may vary
        >>> np.var(a, where=[[True], [True], [False]])
        4.0

        Using the mean keyword to save computation time:

        >>> import numpy as np
        >>> from timeit import timeit
        >>>
        >>> a = np.array([[14, 8, 11, 10], [7, 9, 10, 11], [10, 15, 5, 10]])
        >>> mean = np.mean(a, axis=1, keepdims=True)
        >>>
        >>> g = globals()
        >>> n = 10000
        >>> t1 = timeit("var = np.var(a, axis=1, mean=mean)", globals=g, number=n)
        >>> t2 = timeit("var = np.var(a, axis=1)", globals=g, number=n)
        >>> print(f'Percentage execution time saved {100*(t2-t1)/t2:.0f}%')
        #doctest: +SKIP
        Percentage execution time saved 32%

    vdot(...)
        vdot(a, b, /)

        Return the dot product of two vectors.

        The vdot(`a`, `b`) function handles complex numbers differently than
        dot(`a`, `b`).  If the first argument is complex the complex conjugate
        of the first argument is used for the calculation of the dot product.

        Note that `vdot` handles multidimensional arrays differently than `dot`:
        it does *not* perform a matrix product, but flattens input arguments
        to 1-D vectors first. Consequently, it should only be used for vectors.

        Parameters
        ----------
        a : array_like
            If `a` is complex the complex conjugate is taken before calculation
            of the dot product.
        b : array_like
            Second argument to the dot product.

        Returns
        -------
        output : ndarray
            Dot product of `a` and `b`.  Can be an int, float, or
            complex depending on the types of `a` and `b`.

        See Also
        --------
        dot : Return the dot product without using the complex conjugate of the
              first argument.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([1+2j,3+4j])
        >>> b = np.array([5+6j,7+8j])
        >>> np.vdot(a, b)
        (70-8j)
        >>> np.vdot(b, a)
        (70+8j)

        Note that higher-dimensional arrays are flattened!

        >>> a = np.array([[1, 4], [5, 6]])
        >>> b = np.array([[4, 1], [2, 2]])
        >>> np.vdot(a, b)
        30
        >>> np.vdot(b, a)
        30
        >>> 1*4 + 4*1 + 5*2 + 6*2
        30

    vsplit(ary, indices_or_sections)
        Split an array into multiple sub-arrays vertically (row-wise).

        Please refer to the ``split`` documentation.  ``vsplit`` is equivalent
        to ``split`` with `axis=0` (default), the array is always split along the
        first axis regardless of the array dimension.

        See Also
        --------
        split : Split an array into multiple sub-arrays of equal size.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(16.0).reshape(4, 4)
        >>> x
        array([[ 0.,   1.,   2.,   3.],
               [ 4.,   5.,   6.,   7.],
               [ 8.,   9.,  10.,  11.],
               [12.,  13.,  14.,  15.]])
        >>> np.vsplit(x, 2)
        [array([[0., 1., 2., 3.],
                [4., 5., 6., 7.]]),
         array([[ 8.,  9., 10., 11.],
                [12., 13., 14., 15.]])]
        >>> np.vsplit(x, np.array([3, 6]))
        [array([[ 0.,  1.,  2.,  3.],
                [ 4.,  5.,  6.,  7.],
                [ 8.,  9., 10., 11.]]),
         array([[12., 13., 14., 15.]]),
         array([], shape=(0, 4), dtype=float64)]

        With a higher dimensional array the split is still along the first axis.

        >>> x = np.arange(8.0).reshape(2, 2, 2)
        >>> x
        array([[[0.,  1.],
                [2.,  3.]],
               [[4.,  5.],
                [6.,  7.]]])
        >>> np.vsplit(x, 2)
        [array([[[0., 1.],
                 [2., 3.]]]),
         array([[[4., 5.],
                 [6., 7.]]])]

    vstack(tup, *, dtype=None, casting='same_kind')
        Stack arrays in sequence vertically (row wise).

        This is equivalent to concatenation along the first axis after 1-D arrays
        of shape `(N,)` have been reshaped to `(1,N)`. Rebuilds arrays divided by
        `vsplit`.

        This function makes most sense for arrays with up to 3 dimensions. For
        instance, for pixel-data with a height (first axis), width (second axis),
        and r/g/b channels (third axis). The functions `concatenate`, `stack` and
        `block` provide more general stacking and concatenation operations.

        Parameters
        ----------
        tup : sequence of ndarrays
            The arrays must have the same shape along all but the first axis.
            1-D arrays must have the same length.

        dtype : str or dtype
            If provided, the destination array will have this dtype. Cannot be
            provided together with `out`.

            .. versionadded:: 1.24

        casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
            Controls what kind of data casting may occur. Defaults to 'same_kind'.

            .. versionadded:: 1.24

        Returns
        -------
        stacked : ndarray
            The array formed by stacking the given arrays, will be at least 2-D.

        See Also
        --------
        concatenate : Join a sequence of arrays along an existing axis.
        stack : Join a sequence of arrays along a new axis.
        block : Assemble an nd-array from nested lists of blocks.
        hstack : Stack arrays in sequence horizontally (column wise).
        dstack : Stack arrays in sequence depth wise (along third axis).
        column_stack : Stack 1-D arrays as columns into a 2-D array.
        vsplit : Split an array into multiple sub-arrays vertically (row-wise).
        unstack : Split an array into a tuple of sub-arrays along an axis.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([1, 2, 3])
        >>> b = np.array([4, 5, 6])
        >>> np.vstack((a,b))
        array([[1, 2, 3],
               [4, 5, 6]])

        >>> a = np.array([[1], [2], [3]])
        >>> b = np.array([[4], [5], [6]])
        >>> np.vstack((a,b))
        array([[1],
               [2],
               [3],
               [4],
               [5],
               [6]])

    where(...)
        where(condition, [x, y], /)

        Return elements chosen from `x` or `y` depending on `condition`.

        .. note::
            When only `condition` is provided, this function is a shorthand for
            ``np.asarray(condition).nonzero()``. Using `nonzero` directly should be
            preferred, as it behaves correctly for subclasses. The rest of this
            documentation covers only the case where all three arguments are
            provided.

        Parameters
        ----------
        condition : array_like, bool
            Where True, yield `x`, otherwise yield `y`.
        x, y : array_like
            Values from which to choose. `x`, `y` and `condition` need to be
            broadcastable to some shape.

        Returns
        -------
        out : ndarray
            An array with elements from `x` where `condition` is True, and elements
            from `y` elsewhere.

        See Also
        --------
        choose
        nonzero : The function that is called when x and y are omitted

        Notes
        -----
        If all the arrays are 1-D, `where` is equivalent to::

            [xv if c else yv
             for c, xv, yv in zip(condition, x, y)]

        Examples
        --------
        >>> import numpy as np
        >>> a = np.arange(10)
        >>> a
        array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
        >>> np.where(a < 5, a, 10*a)
        array([ 0,  1,  2,  3,  4, 50, 60, 70, 80, 90])

        This can be used on multidimensional arrays too:

        >>> np.where([[True, False], [True, True]],
        ...          [[1, 2], [3, 4]],
        ...          [[9, 8], [7, 6]])
        array([[1, 8],
               [3, 4]])

        The shapes of x, y, and the condition are broadcast together:

        >>> x, y = np.ogrid[:3, :4]
        >>> np.where(x < y, x, 10 + y)  # both x and 10+y are broadcast
        array([[10,  0,  0,  0],
               [10, 11,  1,  1],
               [10, 11, 12,  2]])

        >>> a = np.array([[0, 1, 2],
        ...               [0, 2, 4],
        ...               [0, 3, 6]])
        >>> np.where(a < 4, a, -1)  # -1 is broadcast
        array([[ 0,  1,  2],
               [ 0,  2, -1],
               [ 0,  3, -1]])

    zeros(...)
        zeros(shape, dtype=float, order='C', *, like=None)

        Return a new array of given shape and type, filled with zeros.

        Parameters
        ----------
        shape : int or tuple of ints
            Shape of the new array, e.g., ``(2, 3)`` or ``2``.
        dtype : data-type, optional
            The desired data-type for the array, e.g., `numpy.int8`.  Default is
            `numpy.float64`.
        order : {'C', 'F'}, optional, default: 'C'
            Whether to store multi-dimensional data in row-major
            (C-style) or column-major (Fortran-style) order in
            memory.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            Array of zeros with the given shape, dtype, and order.

        See Also
        --------
        zeros_like : Return an array of zeros with shape and type of input.
        empty : Return a new uninitialized array.
        ones : Return a new array setting values to one.
        full : Return a new array of given shape filled with value.

        Examples
        --------
        >>> import numpy as np
        >>> np.zeros(5)
        array([ 0.,  0.,  0.,  0.,  0.])

        >>> np.zeros((5,), dtype=int)
        array([0, 0, 0, 0, 0])

        >>> np.zeros((2, 1))
        array([[ 0.],
               [ 0.]])

        >>> s = (2,2)
        >>> np.zeros(s)
        array([[ 0.,  0.],
               [ 0.,  0.]])

        >>> np.zeros((2,), dtype=[('x', 'i4'), ('y', 'i4')]) # custom dtype
        array([(0, 0), (0, 0)],
              dtype=[('x', '<i4'), ('y', '<i4')])

    zeros_like(a, dtype=None, order='K', subok=True, shape=None, *, device=None)
        Return an array of zeros with the same shape and type as a given array.

        Parameters
        ----------
        a : array_like
            The shape and data-type of `a` define these same attributes of
            the returned array.
        dtype : data-type, optional
            Overrides the data type of the result.

            .. versionadded:: 1.6.0
        order : {'C', 'F', 'A', or 'K'}, optional
            Overrides the memory layout of the result. 'C' means C-order,
            'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
            'C' otherwise. 'K' means match the layout of `a` as closely
            as possible.

            .. versionadded:: 1.6.0
        subok : bool, optional.
            If True, then the newly created array will use the sub-class
            type of `a`, otherwise it will be a base-class array. Defaults
            to True.
        shape : int or sequence of ints, optional.
            Overrides the shape of the result. If order='K' and the number of
            dimensions is unchanged, will try to keep order, otherwise,
            order='C' is implied.

            .. versionadded:: 1.17.0
        device : str, optional
            The device on which to place the created array. Default: None.
            For Array-API interoperability only, so must be ``"cpu"`` if passed.

            .. versionadded:: 2.0.0

        Returns
        -------
        out : ndarray
            Array of zeros with the same shape and type as `a`.

        See Also
        --------
        empty_like : Return an empty array with shape and type of input.
        ones_like : Return an array of ones with shape and type of input.
        full_like : Return a new array with shape of input filled with value.
        zeros : Return a new array setting values to zero.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(6)
        >>> x = x.reshape((2, 3))
        >>> x
        array([[0, 1, 2],
               [3, 4, 5]])
        >>> np.zeros_like(x)
        array([[0, 0, 0],
               [0, 0, 0]])

        >>> y = np.arange(3, dtype=float)
        >>> y
        array([0., 1., 2.])
        >>> np.zeros_like(y)
        array([0.,  0.,  0.])

DATA
    False_ = np.False_
    ScalarType = (<class 'int'>, <class 'float'>, <class 'complex'>, <clas...
    True_ = np.True_
    __NUMPY_SETUP__ = False
    __all__ = ['polydiv', 'dot', 'stack', 'signedinteger', 'cov', 'float16...
    __array_api_version__ = '2023.12'
    __expired_attributes__ = {'DataSource': "It's still available as `np.l...
    __former_attrs__ = {'complex': "module 'numpy' has no attribute 'compl...
    __future_scalars__ = {'bytes', 'object', 'str'}
    __numpy_submodules__ = {'char', 'core', 'ctypeslib', 'dtypes', 'except...
    abs = <ufunc 'absolute'>
        absolute(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Calculate the absolute value element-wise.

        ``np.abs`` is a shorthand for this function.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        absolute : ndarray
            An ndarray containing the absolute value of
            each element in `x`.  For complex input, ``a + ib``, the
            absolute value is :math:`\sqrt{ a^2 + b^2 }`.
            This is a scalar if `x` is a scalar.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([-1.2, 1.2])
        >>> np.absolute(x)
        array([ 1.2,  1.2])
        >>> np.absolute(1.2 + 1j)
        1.5620499351813308

        Plot the function over ``[-10, 10]``:

        >>> import matplotlib.pyplot as plt

        >>> x = np.linspace(start=-10, stop=10, num=101)
        >>> plt.plot(x, np.absolute(x))
        >>> plt.show()

        Plot the function over the complex plane:

        >>> xx = x + 1j * x[:, np.newaxis]
        >>> plt.imshow(np.abs(xx), extent=[-10, 10, -10, 10], cmap='gray')
        >>> plt.show()

        The `abs` function can be used as a shorthand for ``np.absolute`` on
        ndarrays.

        >>> x = np.array([-1.2, 1.2])
        >>> abs(x)
        array([1.2, 1.2])

    absolute = <ufunc 'absolute'>
        absolute(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Calculate the absolute value element-wise.

        ``np.abs`` is a shorthand for this function.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        absolute : ndarray
            An ndarray containing the absolute value of
            each element in `x`.  For complex input, ``a + ib``, the
            absolute value is :math:`\sqrt{ a^2 + b^2 }`.
            This is a scalar if `x` is a scalar.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([-1.2, 1.2])
        >>> np.absolute(x)
        array([ 1.2,  1.2])
        >>> np.absolute(1.2 + 1j)
        1.5620499351813308

        Plot the function over ``[-10, 10]``:

        >>> import matplotlib.pyplot as plt

        >>> x = np.linspace(start=-10, stop=10, num=101)
        >>> plt.plot(x, np.absolute(x))
        >>> plt.show()

        Plot the function over the complex plane:

        >>> xx = x + 1j * x[:, np.newaxis]
        >>> plt.imshow(np.abs(xx), extent=[-10, 10, -10, 10], cmap='gray')
        >>> plt.show()

        The `abs` function can be used as a shorthand for ``np.absolute`` on
        ndarrays.

        >>> x = np.array([-1.2, 1.2])
        >>> abs(x)
        array([1.2, 1.2])

    acos = <ufunc 'arccos'>
        arccos(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Trigonometric inverse cosine, element-wise.

        The inverse of `cos` so that, if ``y = cos(x)``, then ``x = arccos(y)``.

        Parameters
        ----------
        x : array_like
            `x`-coordinate on the unit circle.
            For real arguments, the domain is [-1, 1].
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        angle : ndarray
            The angle of the ray intersecting the unit circle at the given
            `x`-coordinate in radians [0, pi].
            This is a scalar if `x` is a scalar.

        See Also
        --------
        cos, arctan, arcsin, emath.arccos

        Notes
        -----
        `arccos` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that ``cos(z) = x``. The convention is to return
        the angle `z` whose real part lies in `[0, pi]`.

        For real-valued input data types, `arccos` always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arccos` is a complex analytic function that
        has branch cuts ``[-inf, -1]`` and `[1, inf]` and is continuous from
        above on the former and from below on the latter.

        The inverse `cos` is also known as `acos` or cos^-1.

        References
        ----------
        M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
        10th printing, 1964, pp. 79.
        https://personal.math.ubc.ca/~cbm/aands/page_79.htm

        Examples
        --------
        >>> import numpy as np

        We expect the arccos of 1 to be 0, and of -1 to be pi:

        >>> np.arccos([1, -1])
        array([ 0.        ,  3.14159265])

        Plot arccos:

        >>> import matplotlib.pyplot as plt
        >>> x = np.linspace(-1, 1, num=100)
        >>> plt.plot(x, np.arccos(x))
        >>> plt.axis('tight')
        >>> plt.show()

    acosh = <ufunc 'arccosh'>
        arccosh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Inverse hyperbolic cosine, element-wise.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        arccosh : ndarray
            Array of the same shape as `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------

        cosh, arcsinh, sinh, arctanh, tanh

        Notes
        -----
        `arccosh` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that `cosh(z) = x`. The convention is to return the
        `z` whose imaginary part lies in ``[-pi, pi]`` and the real part in
        ``[0, inf]``.

        For real-valued input data types, `arccosh` always returns real output.
        For each value that cannot be expressed as a real number or infinity, it
        yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arccosh` is a complex analytical function that
        has a branch cut `[-inf, 1]` and is continuous from above on it.

        References
        ----------
        .. [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
               10th printing, 1964, pp. 86.
               https://personal.math.ubc.ca/~cbm/aands/page_86.htm
        .. [2] Wikipedia, "Inverse hyperbolic function",
               https://en.wikipedia.org/wiki/Arccosh

        Examples
        --------
        >>> import numpy as np
        >>> np.arccosh([np.e, 10.0])
        array([ 1.65745445,  2.99322285])
        >>> np.arccosh(1)
        0.0

    add = <ufunc 'add'>
        add(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Add arguments element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            The arrays to be added.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        add : ndarray or scalar
            The sum of `x1` and `x2`, element-wise.
            This is a scalar if both `x1` and `x2` are scalars.

        Notes
        -----
        Equivalent to `x1` + `x2` in terms of array broadcasting.

        Examples
        --------
        >>> import numpy as np
        >>> np.add(1.0, 4.0)
        5.0
        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = np.arange(3.0)
        >>> np.add(x1, x2)
        array([[  0.,   2.,   4.],
               [  3.,   5.,   7.],
               [  6.,   8.,  10.]])

        The ``+`` operator can be used as a shorthand for ``np.add`` on ndarrays.

        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = np.arange(3.0)
        >>> x1 + x2
        array([[ 0.,  2.,  4.],
               [ 3.,  5.,  7.],
               [ 6.,  8., 10.]])

    arccos = <ufunc 'arccos'>
        arccos(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Trigonometric inverse cosine, element-wise.

        The inverse of `cos` so that, if ``y = cos(x)``, then ``x = arccos(y)``.

        Parameters
        ----------
        x : array_like
            `x`-coordinate on the unit circle.
            For real arguments, the domain is [-1, 1].
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        angle : ndarray
            The angle of the ray intersecting the unit circle at the given
            `x`-coordinate in radians [0, pi].
            This is a scalar if `x` is a scalar.

        See Also
        --------
        cos, arctan, arcsin, emath.arccos

        Notes
        -----
        `arccos` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that ``cos(z) = x``. The convention is to return
        the angle `z` whose real part lies in `[0, pi]`.

        For real-valued input data types, `arccos` always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arccos` is a complex analytic function that
        has branch cuts ``[-inf, -1]`` and `[1, inf]` and is continuous from
        above on the former and from below on the latter.

        The inverse `cos` is also known as `acos` or cos^-1.

        References
        ----------
        M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
        10th printing, 1964, pp. 79.
        https://personal.math.ubc.ca/~cbm/aands/page_79.htm

        Examples
        --------
        >>> import numpy as np

        We expect the arccos of 1 to be 0, and of -1 to be pi:

        >>> np.arccos([1, -1])
        array([ 0.        ,  3.14159265])

        Plot arccos:

        >>> import matplotlib.pyplot as plt
        >>> x = np.linspace(-1, 1, num=100)
        >>> plt.plot(x, np.arccos(x))
        >>> plt.axis('tight')
        >>> plt.show()

    arccosh = <ufunc 'arccosh'>
        arccosh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Inverse hyperbolic cosine, element-wise.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        arccosh : ndarray
            Array of the same shape as `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------

        cosh, arcsinh, sinh, arctanh, tanh

        Notes
        -----
        `arccosh` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that `cosh(z) = x`. The convention is to return the
        `z` whose imaginary part lies in ``[-pi, pi]`` and the real part in
        ``[0, inf]``.

        For real-valued input data types, `arccosh` always returns real output.
        For each value that cannot be expressed as a real number or infinity, it
        yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arccosh` is a complex analytical function that
        has a branch cut `[-inf, 1]` and is continuous from above on it.

        References
        ----------
        .. [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
               10th printing, 1964, pp. 86.
               https://personal.math.ubc.ca/~cbm/aands/page_86.htm
        .. [2] Wikipedia, "Inverse hyperbolic function",
               https://en.wikipedia.org/wiki/Arccosh

        Examples
        --------
        >>> import numpy as np
        >>> np.arccosh([np.e, 10.0])
        array([ 1.65745445,  2.99322285])
        >>> np.arccosh(1)
        0.0

    arcsin = <ufunc 'arcsin'>
        arcsin(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Inverse sine, element-wise.

        Parameters
        ----------
        x : array_like
            `y`-coordinate on the unit circle.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        angle : ndarray
            The inverse sine of each element in `x`, in radians and in the
            closed interval ``[-pi/2, pi/2]``.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        sin, cos, arccos, tan, arctan, arctan2, emath.arcsin

        Notes
        -----
        `arcsin` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that :math:`sin(z) = x`.  The convention is to
        return the angle `z` whose real part lies in [-pi/2, pi/2].

        For real-valued input data types, *arcsin* always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arcsin` is a complex analytic function that
        has, by convention, the branch cuts [-inf, -1] and [1, inf]  and is
        continuous from above on the former and from below on the latter.

        The inverse sine is also known as `asin` or sin^{-1}.

        References
        ----------
        Abramowitz, M. and Stegun, I. A., *Handbook of Mathematical Functions*,
        10th printing, New York: Dover, 1964, pp. 79ff.
        https://personal.math.ubc.ca/~cbm/aands/page_79.htm

        Examples
        --------
        >>> import numpy as np
        >>> np.arcsin(1)     # pi/2
        1.5707963267948966
        >>> np.arcsin(-1)    # -pi/2
        -1.5707963267948966
        >>> np.arcsin(0)
        0.0

    arcsinh = <ufunc 'arcsinh'>
        arcsinh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Inverse hyperbolic sine element-wise.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Array of the same shape as `x`.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        `arcsinh` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that `sinh(z) = x`. The convention is to return the
        `z` whose imaginary part lies in `[-pi/2, pi/2]`.

        For real-valued input data types, `arcsinh` always returns real output.
        For each value that cannot be expressed as a real number or infinity, it
        returns ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arcsinh` is a complex analytical function that
        has branch cuts `[1j, infj]` and `[-1j, -infj]` and is continuous from
        the right on the former and from the left on the latter.

        The inverse hyperbolic sine is also known as `asinh` or ``sinh^-1``.

        References
        ----------
        .. [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
               10th printing, 1964, pp. 86.
               https://personal.math.ubc.ca/~cbm/aands/page_86.htm
        .. [2] Wikipedia, "Inverse hyperbolic function",
               https://en.wikipedia.org/wiki/Arcsinh

        Examples
        --------
        >>> import numpy as np
        >>> np.arcsinh(np.array([np.e, 10.0]))
        array([ 1.72538256,  2.99822295])

    arctan = <ufunc 'arctan'>
        arctan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Trigonometric inverse tangent, element-wise.

        The inverse of tan, so that if ``y = tan(x)`` then ``x = arctan(y)``.

        Parameters
        ----------
        x : array_like
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Out has the same shape as `x`.  Its real part is in
            ``[-pi/2, pi/2]`` (``arctan(+/-inf)`` returns ``+/-pi/2``).
            This is a scalar if `x` is a scalar.

        See Also
        --------
        arctan2 : The "four quadrant" arctan of the angle formed by (`x`, `y`)
            and the positive `x`-axis.
        angle : Argument of complex values.

        Notes
        -----
        `arctan` is a multi-valued function: for each `x` there are infinitely
        many numbers `z` such that tan(`z`) = `x`.  The convention is to return
        the angle `z` whose real part lies in [-pi/2, pi/2].

        For real-valued input data types, `arctan` always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arctan` is a complex analytic function that
        has [``1j, infj``] and [``-1j, -infj``] as branch cuts, and is continuous
        from the left on the former and from the right on the latter.

        The inverse tangent is also known as `atan` or tan^{-1}.

        References
        ----------
        Abramowitz, M. and Stegun, I. A., *Handbook of Mathematical Functions*,
        10th printing, New York: Dover, 1964, pp. 79.
        https://personal.math.ubc.ca/~cbm/aands/page_79.htm

        Examples
        --------
        We expect the arctan of 0 to be 0, and of 1 to be pi/4:

        >>> import numpy as np

        >>> np.arctan([0, 1])
        array([ 0.        ,  0.78539816])

        >>> np.pi/4
        0.78539816339744828

        Plot arctan:

        >>> import matplotlib.pyplot as plt
        >>> x = np.linspace(-10, 10)
        >>> plt.plot(x, np.arctan(x))
        >>> plt.axis('tight')
        >>> plt.show()

    arctan2 = <ufunc 'arctan2'>
        arctan2(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Element-wise arc tangent of ``x1/x2`` choosing the quadrant correctly.

        The quadrant (i.e., branch) is chosen so that ``arctan2(x1, x2)`` is
        the signed angle in radians between the ray ending at the origin and
        passing through the point (1,0), and the ray ending at the origin and
        passing through the point (`x2`, `x1`).  (Note the role reversal: the
        "`y`-coordinate" is the first function parameter, the "`x`-coordinate"
        is the second.)  By IEEE convention, this function is defined for
        `x2` = +/-0 and for either or both of `x1` and `x2` = +/-inf (see
        Notes for specific values).

        This function is not defined for complex-valued arguments; for the
        so-called argument of complex values, use `angle`.

        Parameters
        ----------
        x1 : array_like, real-valued
            `y`-coordinates.
        x2 : array_like, real-valued
            `x`-coordinates.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        angle : ndarray
            Array of angles in radians, in the range ``[-pi, pi]``.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        arctan, tan, angle

        Notes
        -----
        *arctan2* is identical to the `atan2` function of the underlying
        C library.  The following special values are defined in the C
        standard: [1]_

        ====== ====== ================
        `x1`   `x2`   `arctan2(x1,x2)`
        ====== ====== ================
        +/- 0  +0     +/- 0
        +/- 0  -0     +/- pi
         > 0   +/-inf +0 / +pi
         < 0   +/-inf -0 / -pi
        +/-inf +inf   +/- (pi/4)
        +/-inf -inf   +/- (3*pi/4)
        ====== ====== ================

        Note that +0 and -0 are distinct floating point numbers, as are +inf
        and -inf.

        References
        ----------
        .. [1] ISO/IEC standard 9899:1999, "Programming language C."

        Examples
        --------
        Consider four points in different quadrants:

        >>> import numpy as np

        >>> x = np.array([-1, +1, +1, -1])
        >>> y = np.array([-1, -1, +1, +1])
        >>> np.arctan2(y, x) * 180 / np.pi
        array([-135.,  -45.,   45.,  135.])

        Note the order of the parameters. `arctan2` is defined also when `x2` = 0
        and at several other special points, obtaining values in
        the range ``[-pi, pi]``:

        >>> np.arctan2([1., -1.], [0., 0.])
        array([ 1.57079633, -1.57079633])
        >>> np.arctan2([0., 0., np.inf], [+0., -0., np.inf])
        array([0.        , 3.14159265, 0.78539816])

    arctanh = <ufunc 'arctanh'>
        arctanh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Inverse hyperbolic tangent element-wise.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Array of the same shape as `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        emath.arctanh

        Notes
        -----
        `arctanh` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that ``tanh(z) = x``. The convention is to return
        the `z` whose imaginary part lies in `[-pi/2, pi/2]`.

        For real-valued input data types, `arctanh` always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arctanh` is a complex analytical function
        that has branch cuts `[-1, -inf]` and `[1, inf]` and is continuous from
        above on the former and from below on the latter.

        The inverse hyperbolic tangent is also known as `atanh` or ``tanh^-1``.

        References
        ----------
        .. [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
               10th printing, 1964, pp. 86.
               https://personal.math.ubc.ca/~cbm/aands/page_86.htm
        .. [2] Wikipedia, "Inverse hyperbolic function",
               https://en.wikipedia.org/wiki/Arctanh

        Examples
        --------
        >>> import numpy as np
        >>> np.arctanh([0, -0.5])
        array([ 0.        , -0.54930614])

    asin = <ufunc 'arcsin'>
        arcsin(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Inverse sine, element-wise.

        Parameters
        ----------
        x : array_like
            `y`-coordinate on the unit circle.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        angle : ndarray
            The inverse sine of each element in `x`, in radians and in the
            closed interval ``[-pi/2, pi/2]``.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        sin, cos, arccos, tan, arctan, arctan2, emath.arcsin

        Notes
        -----
        `arcsin` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that :math:`sin(z) = x`.  The convention is to
        return the angle `z` whose real part lies in [-pi/2, pi/2].

        For real-valued input data types, *arcsin* always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arcsin` is a complex analytic function that
        has, by convention, the branch cuts [-inf, -1] and [1, inf]  and is
        continuous from above on the former and from below on the latter.

        The inverse sine is also known as `asin` or sin^{-1}.

        References
        ----------
        Abramowitz, M. and Stegun, I. A., *Handbook of Mathematical Functions*,
        10th printing, New York: Dover, 1964, pp. 79ff.
        https://personal.math.ubc.ca/~cbm/aands/page_79.htm

        Examples
        --------
        >>> import numpy as np
        >>> np.arcsin(1)     # pi/2
        1.5707963267948966
        >>> np.arcsin(-1)    # -pi/2
        -1.5707963267948966
        >>> np.arcsin(0)
        0.0

    asinh = <ufunc 'arcsinh'>
        arcsinh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Inverse hyperbolic sine element-wise.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Array of the same shape as `x`.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        `arcsinh` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that `sinh(z) = x`. The convention is to return the
        `z` whose imaginary part lies in `[-pi/2, pi/2]`.

        For real-valued input data types, `arcsinh` always returns real output.
        For each value that cannot be expressed as a real number or infinity, it
        returns ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arcsinh` is a complex analytical function that
        has branch cuts `[1j, infj]` and `[-1j, -infj]` and is continuous from
        the right on the former and from the left on the latter.

        The inverse hyperbolic sine is also known as `asinh` or ``sinh^-1``.

        References
        ----------
        .. [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
               10th printing, 1964, pp. 86.
               https://personal.math.ubc.ca/~cbm/aands/page_86.htm
        .. [2] Wikipedia, "Inverse hyperbolic function",
               https://en.wikipedia.org/wiki/Arcsinh

        Examples
        --------
        >>> import numpy as np
        >>> np.arcsinh(np.array([np.e, 10.0]))
        array([ 1.72538256,  2.99822295])

    atan = <ufunc 'arctan'>
        arctan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Trigonometric inverse tangent, element-wise.

        The inverse of tan, so that if ``y = tan(x)`` then ``x = arctan(y)``.

        Parameters
        ----------
        x : array_like
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Out has the same shape as `x`.  Its real part is in
            ``[-pi/2, pi/2]`` (``arctan(+/-inf)`` returns ``+/-pi/2``).
            This is a scalar if `x` is a scalar.

        See Also
        --------
        arctan2 : The "four quadrant" arctan of the angle formed by (`x`, `y`)
            and the positive `x`-axis.
        angle : Argument of complex values.

        Notes
        -----
        `arctan` is a multi-valued function: for each `x` there are infinitely
        many numbers `z` such that tan(`z`) = `x`.  The convention is to return
        the angle `z` whose real part lies in [-pi/2, pi/2].

        For real-valued input data types, `arctan` always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arctan` is a complex analytic function that
        has [``1j, infj``] and [``-1j, -infj``] as branch cuts, and is continuous
        from the left on the former and from the right on the latter.

        The inverse tangent is also known as `atan` or tan^{-1}.

        References
        ----------
        Abramowitz, M. and Stegun, I. A., *Handbook of Mathematical Functions*,
        10th printing, New York: Dover, 1964, pp. 79.
        https://personal.math.ubc.ca/~cbm/aands/page_79.htm

        Examples
        --------
        We expect the arctan of 0 to be 0, and of 1 to be pi/4:

        >>> import numpy as np

        >>> np.arctan([0, 1])
        array([ 0.        ,  0.78539816])

        >>> np.pi/4
        0.78539816339744828

        Plot arctan:

        >>> import matplotlib.pyplot as plt
        >>> x = np.linspace(-10, 10)
        >>> plt.plot(x, np.arctan(x))
        >>> plt.axis('tight')
        >>> plt.show()

    atan2 = <ufunc 'arctan2'>
        arctan2(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Element-wise arc tangent of ``x1/x2`` choosing the quadrant correctly.

        The quadrant (i.e., branch) is chosen so that ``arctan2(x1, x2)`` is
        the signed angle in radians between the ray ending at the origin and
        passing through the point (1,0), and the ray ending at the origin and
        passing through the point (`x2`, `x1`).  (Note the role reversal: the
        "`y`-coordinate" is the first function parameter, the "`x`-coordinate"
        is the second.)  By IEEE convention, this function is defined for
        `x2` = +/-0 and for either or both of `x1` and `x2` = +/-inf (see
        Notes for specific values).

        This function is not defined for complex-valued arguments; for the
        so-called argument of complex values, use `angle`.

        Parameters
        ----------
        x1 : array_like, real-valued
            `y`-coordinates.
        x2 : array_like, real-valued
            `x`-coordinates.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        angle : ndarray
            Array of angles in radians, in the range ``[-pi, pi]``.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        arctan, tan, angle

        Notes
        -----
        *arctan2* is identical to the `atan2` function of the underlying
        C library.  The following special values are defined in the C
        standard: [1]_

        ====== ====== ================
        `x1`   `x2`   `arctan2(x1,x2)`
        ====== ====== ================
        +/- 0  +0     +/- 0
        +/- 0  -0     +/- pi
         > 0   +/-inf +0 / +pi
         < 0   +/-inf -0 / -pi
        +/-inf +inf   +/- (pi/4)
        +/-inf -inf   +/- (3*pi/4)
        ====== ====== ================

        Note that +0 and -0 are distinct floating point numbers, as are +inf
        and -inf.

        References
        ----------
        .. [1] ISO/IEC standard 9899:1999, "Programming language C."

        Examples
        --------
        Consider four points in different quadrants:

        >>> import numpy as np

        >>> x = np.array([-1, +1, +1, -1])
        >>> y = np.array([-1, -1, +1, +1])
        >>> np.arctan2(y, x) * 180 / np.pi
        array([-135.,  -45.,   45.,  135.])

        Note the order of the parameters. `arctan2` is defined also when `x2` = 0
        and at several other special points, obtaining values in
        the range ``[-pi, pi]``:

        >>> np.arctan2([1., -1.], [0., 0.])
        array([ 1.57079633, -1.57079633])
        >>> np.arctan2([0., 0., np.inf], [+0., -0., np.inf])
        array([0.        , 3.14159265, 0.78539816])

    atanh = <ufunc 'arctanh'>
        arctanh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Inverse hyperbolic tangent element-wise.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Array of the same shape as `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        emath.arctanh

        Notes
        -----
        `arctanh` is a multivalued function: for each `x` there are infinitely
        many numbers `z` such that ``tanh(z) = x``. The convention is to return
        the `z` whose imaginary part lies in `[-pi/2, pi/2]`.

        For real-valued input data types, `arctanh` always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `arctanh` is a complex analytical function
        that has branch cuts `[-1, -inf]` and `[1, inf]` and is continuous from
        above on the former and from below on the latter.

        The inverse hyperbolic tangent is also known as `atanh` or ``tanh^-1``.

        References
        ----------
        .. [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
               10th printing, 1964, pp. 86.
               https://personal.math.ubc.ca/~cbm/aands/page_86.htm
        .. [2] Wikipedia, "Inverse hyperbolic function",
               https://en.wikipedia.org/wiki/Arctanh

        Examples
        --------
        >>> import numpy as np
        >>> np.arctanh([0, -0.5])
        array([ 0.        , -0.54930614])

    bitwise_and = <ufunc 'bitwise_and'>
        bitwise_and(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute the bit-wise AND of two arrays element-wise.

        Computes the bit-wise AND of the underlying binary representation of
        the integers in the input arrays. This ufunc implements the C/Python
        operator ``&``.

        Parameters
        ----------
        x1, x2 : array_like
            Only integer and boolean types are handled.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Result.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        logical_and
        bitwise_or
        bitwise_xor
        binary_repr :
            Return the binary representation of the input number as a string.

        Examples
        --------
        >>> import numpy as np

        The number 13 is represented by ``00001101``.  Likewise, 17 is
        represented by ``00010001``.  The bit-wise AND of 13 and 17 is
        therefore ``000000001``, or 1:

        >>> np.bitwise_and(13, 17)
        1

        >>> np.bitwise_and(14, 13)
        12
        >>> np.binary_repr(12)
        '1100'
        >>> np.bitwise_and([14,3], 13)
        array([12,  1])

        >>> np.bitwise_and([11,7], [4,25])
        array([0, 1])
        >>> np.bitwise_and(np.array([2,5,255]), np.array([3,14,16]))
        array([ 2,  4, 16])
        >>> np.bitwise_and([True, True], [False, True])
        array([False,  True])

        The ``&`` operator can be used as a shorthand for ``np.bitwise_and`` on
        ndarrays.

        >>> x1 = np.array([2, 5, 255])
        >>> x2 = np.array([3, 14, 16])
        >>> x1 & x2
        array([ 2,  4, 16])

    bitwise_count = <ufunc 'bitwise_count'>
        bitwise_count(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Computes the number of 1-bits in the absolute value of ``x``.
        Analogous to the builtin `int.bit_count` or ``popcount`` in C++.

        Parameters
        ----------
        x : array_like, unsigned int
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The corresponding number of 1-bits in the input.
            Returns uint8 for all integer types
            This is a scalar if `x` is a scalar.

        References
        ----------
        .. [1] https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

        .. [2] Wikipedia, "Hamming weight",
               https://en.wikipedia.org/wiki/Hamming_weight

        .. [3] http://aggregate.ee.engr.uky.edu/MAGIC/#Population%20Count%20(Ones%20Count)

        Examples
        --------
        >>> import numpy as np
        >>> np.bitwise_count(1023)
        10
        >>> a = np.array([2**i - 1 for i in range(16)])
        >>> np.bitwise_count(a)
        array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15],
              dtype=uint8)

    bitwise_invert = <ufunc 'invert'>
        invert(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute bit-wise inversion, or bit-wise NOT, element-wise.

        Computes the bit-wise NOT of the underlying binary representation of
        the integers in the input arrays. This ufunc implements the C/Python
        operator ``~``.

        For signed integer inputs, the bit-wise NOT of the absolute value is
        returned. In a two's-complement system, this operation effectively flips
        all the bits, resulting in a representation that corresponds to the
        negative of the input plus one. This is the most common method of
        representing signed integers on computers [1]_. A N-bit two's-complement
        system can represent every integer in the range :math:`-2^{N-1}` to
        :math:`+2^{N-1}-1`.

        Parameters
        ----------
        x : array_like
            Only integer and boolean types are handled.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Result.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        bitwise_and, bitwise_or, bitwise_xor
        logical_not
        binary_repr :
            Return the binary representation of the input number as a string.

        Notes
        -----
        ``numpy.bitwise_not`` is an alias for `invert`:

        >>> np.bitwise_not is np.invert
        True

        References
        ----------
        .. [1] Wikipedia, "Two's complement",
            https://en.wikipedia.org/wiki/Two's_complement

        Examples
        --------
        >>> import numpy as np

        We've seen that 13 is represented by ``00001101``.
        The invert or bit-wise NOT of 13 is then:

        >>> x = np.invert(np.array(13, dtype=np.uint8))
        >>> x
        242
        >>> np.binary_repr(x, width=8)
        '11110010'

        The result depends on the bit-width:

        >>> x = np.invert(np.array(13, dtype=np.uint16))
        >>> x
        65522
        >>> np.binary_repr(x, width=16)
        '1111111111110010'

        When using signed integer types, the result is the bit-wise NOT of
        the unsigned type, interpreted as a signed integer:

        >>> np.invert(np.array([13], dtype=np.int8))
        array([-14], dtype=int8)
        >>> np.binary_repr(-14, width=8)
        '11110010'

        Booleans are accepted as well:

        >>> np.invert(np.array([True, False]))
        array([False,  True])

        The ``~`` operator can be used as a shorthand for ``np.invert`` on
        ndarrays.

        >>> x1 = np.array([True, False])
        >>> ~x1
        array([False,  True])

    bitwise_left_shift = <ufunc 'left_shift'>
        left_shift(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Shift the bits of an integer to the left.

        Bits are shifted to the left by appending `x2` 0s at the right of `x1`.
        Since the internal representation of numbers is in binary format, this
        operation is equivalent to multiplying `x1` by ``2**x2``.

        Parameters
        ----------
        x1 : array_like of integer type
            Input values.
        x2 : array_like of integer type
            Number of zeros to append to `x1`. Has to be non-negative.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : array of integer type
            Return `x1` with bits shifted `x2` times to the left.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        right_shift : Shift the bits of an integer to the right.
        binary_repr : Return the binary representation of the input number
            as a string.

        Examples
        --------
        >>> import numpy as np
        >>> np.binary_repr(5)
        '101'
        >>> np.left_shift(5, 2)
        20
        >>> np.binary_repr(20)
        '10100'

        >>> np.left_shift(5, [1,2,3])
        array([10, 20, 40])

        Note that the dtype of the second argument may change the dtype of the
        result and can lead to unexpected results in some cases (see
        :ref:`Casting Rules <ufuncs.casting>`):

        >>> a = np.left_shift(np.uint8(255), np.int64(1))  # Expect 254
        >>> print(a, type(a)) # Unexpected result due to upcasting
        510 <class 'numpy.int64'>
        >>> b = np.left_shift(np.uint8(255), np.uint8(1))
        >>> print(b, type(b))
        254 <class 'numpy.uint8'>

        The ``<<`` operator can be used as a shorthand for ``np.left_shift`` on
        ndarrays.

        >>> x1 = 5
        >>> x2 = np.array([1, 2, 3])
        >>> x1 << x2
        array([10, 20, 40])

    bitwise_not = <ufunc 'invert'>
        invert(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute bit-wise inversion, or bit-wise NOT, element-wise.

        Computes the bit-wise NOT of the underlying binary representation of
        the integers in the input arrays. This ufunc implements the C/Python
        operator ``~``.

        For signed integer inputs, the bit-wise NOT of the absolute value is
        returned. In a two's-complement system, this operation effectively flips
        all the bits, resulting in a representation that corresponds to the
        negative of the input plus one. This is the most common method of
        representing signed integers on computers [1]_. A N-bit two's-complement
        system can represent every integer in the range :math:`-2^{N-1}` to
        :math:`+2^{N-1}-1`.

        Parameters
        ----------
        x : array_like
            Only integer and boolean types are handled.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Result.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        bitwise_and, bitwise_or, bitwise_xor
        logical_not
        binary_repr :
            Return the binary representation of the input number as a string.

        Notes
        -----
        ``numpy.bitwise_not`` is an alias for `invert`:

        >>> np.bitwise_not is np.invert
        True

        References
        ----------
        .. [1] Wikipedia, "Two's complement",
            https://en.wikipedia.org/wiki/Two's_complement

        Examples
        --------
        >>> import numpy as np

        We've seen that 13 is represented by ``00001101``.
        The invert or bit-wise NOT of 13 is then:

        >>> x = np.invert(np.array(13, dtype=np.uint8))
        >>> x
        242
        >>> np.binary_repr(x, width=8)
        '11110010'

        The result depends on the bit-width:

        >>> x = np.invert(np.array(13, dtype=np.uint16))
        >>> x
        65522
        >>> np.binary_repr(x, width=16)
        '1111111111110010'

        When using signed integer types, the result is the bit-wise NOT of
        the unsigned type, interpreted as a signed integer:

        >>> np.invert(np.array([13], dtype=np.int8))
        array([-14], dtype=int8)
        >>> np.binary_repr(-14, width=8)
        '11110010'

        Booleans are accepted as well:

        >>> np.invert(np.array([True, False]))
        array([False,  True])

        The ``~`` operator can be used as a shorthand for ``np.invert`` on
        ndarrays.

        >>> x1 = np.array([True, False])
        >>> ~x1
        array([False,  True])

    bitwise_or = <ufunc 'bitwise_or'>
        bitwise_or(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute the bit-wise OR of two arrays element-wise.

        Computes the bit-wise OR of the underlying binary representation of
        the integers in the input arrays. This ufunc implements the C/Python
        operator ``|``.

        Parameters
        ----------
        x1, x2 : array_like
            Only integer and boolean types are handled.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Result.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        logical_or
        bitwise_and
        bitwise_xor
        binary_repr :
            Return the binary representation of the input number as a string.

        Examples
        --------
        >>> import numpy as np

        The number 13 has the binary representation ``00001101``. Likewise,
        16 is represented by ``00010000``.  The bit-wise OR of 13 and 16 is
        then ``00011101``, or 29:

        >>> np.bitwise_or(13, 16)
        29
        >>> np.binary_repr(29)
        '11101'

        >>> np.bitwise_or(32, 2)
        34
        >>> np.bitwise_or([33, 4], 1)
        array([33,  5])
        >>> np.bitwise_or([33, 4], [1, 2])
        array([33,  6])

        >>> np.bitwise_or(np.array([2, 5, 255]), np.array([4, 4, 4]))
        array([  6,   5, 255])
        >>> np.array([2, 5, 255]) | np.array([4, 4, 4])
        array([  6,   5, 255])
        >>> np.bitwise_or(np.array([2, 5, 255, 2147483647], dtype=np.int32),
        ...               np.array([4, 4, 4, 2147483647], dtype=np.int32))
        array([         6,          5,        255, 2147483647])
        >>> np.bitwise_or([True, True], [False, True])
        array([ True,  True])

        The ``|`` operator can be used as a shorthand for ``np.bitwise_or`` on
        ndarrays.

        >>> x1 = np.array([2, 5, 255])
        >>> x2 = np.array([4, 4, 4])
        >>> x1 | x2
        array([  6,   5, 255])

    bitwise_right_shift = <ufunc 'right_shift'>
        right_shift(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Shift the bits of an integer to the right.

        Bits are shifted to the right `x2`.  Because the internal
        representation of numbers is in binary format, this operation is
        equivalent to dividing `x1` by ``2**x2``.

        Parameters
        ----------
        x1 : array_like, int
            Input values.
        x2 : array_like, int
            Number of bits to remove at the right of `x1`.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray, int
            Return `x1` with bits shifted `x2` times to the right.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        left_shift : Shift the bits of an integer to the left.
        binary_repr : Return the binary representation of the input number
            as a string.

        Examples
        --------
        >>> import numpy as np
        >>> np.binary_repr(10)
        '1010'
        >>> np.right_shift(10, 1)
        5
        >>> np.binary_repr(5)
        '101'

        >>> np.right_shift(10, [1,2,3])
        array([5, 2, 1])

        The ``>>`` operator can be used as a shorthand for ``np.right_shift`` on
        ndarrays.

        >>> x1 = 10
        >>> x2 = np.array([1,2,3])
        >>> x1 >> x2
        array([5, 2, 1])

    bitwise_xor = <ufunc 'bitwise_xor'>
        bitwise_xor(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute the bit-wise XOR of two arrays element-wise.

        Computes the bit-wise XOR of the underlying binary representation of
        the integers in the input arrays. This ufunc implements the C/Python
        operator ``^``.

        Parameters
        ----------
        x1, x2 : array_like
            Only integer and boolean types are handled.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Result.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        logical_xor
        bitwise_and
        bitwise_or
        binary_repr :
            Return the binary representation of the input number as a string.

        Examples
        --------
        >>> import numpy as np

        The number 13 is represented by ``00001101``. Likewise, 17 is
        represented by ``00010001``.  The bit-wise XOR of 13 and 17 is
        therefore ``00011100``, or 28:

        >>> np.bitwise_xor(13, 17)
        28
        >>> np.binary_repr(28)
        '11100'

        >>> np.bitwise_xor(31, 5)
        26
        >>> np.bitwise_xor([31,3], 5)
        array([26,  6])

        >>> np.bitwise_xor([31,3], [5,6])
        array([26,  5])
        >>> np.bitwise_xor([True, True], [False, True])
        array([ True, False])

        The ``^`` operator can be used as a shorthand for ``np.bitwise_xor`` on
        ndarrays.

        >>> x1 = np.array([True, True])
        >>> x2 = np.array([False, True])
        >>> x1 ^ x2
        array([ True, False])

    c_ = <numpy.lib._index_tricks_impl.CClass object>
    cbrt = <ufunc 'cbrt'>
        cbrt(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the cube-root of an array, element-wise.

        .. versionadded:: 1.10.0

        Parameters
        ----------
        x : array_like
            The values whose cube-roots are required.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            An array of the same shape as `x`, containing the
            cube root of each element in `x`.
            If `out` was provided, `y` is a reference to it.
            This is a scalar if `x` is a scalar.


        Examples
        --------
        >>> import numpy as np
        >>> np.cbrt([1,8,27])
        array([ 1.,  2.,  3.])

    ceil = <ufunc 'ceil'>
        ceil(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the ceiling of the input, element-wise.

        The ceil of the scalar `x` is the smallest integer `i`, such that
        ``i >= x``.  It is often denoted as :math:`\lceil x \rceil`.

        Parameters
        ----------
        x : array_like
            Input data.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The ceiling of each element in `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        floor, trunc, rint, fix

        Examples
        --------
        >>> import numpy as np

        >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
        >>> np.ceil(a)
        array([-1., -1., -0.,  1.,  2.,  2.,  2.])

    conj = <ufunc 'conjugate'>
        conjugate(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the complex conjugate, element-wise.

        The complex conjugate of a complex number is obtained by changing the
        sign of its imaginary part.

        Parameters
        ----------
        x : array_like
            Input value.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The complex conjugate of `x`, with same dtype as `y`.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        `conj` is an alias for `conjugate`:

        >>> np.conj is np.conjugate
        True

        Examples
        --------
        >>> import numpy as np
        >>> np.conjugate(1+2j)
        (1-2j)

        >>> x = np.eye(2) + 1j * np.eye(2)
        >>> np.conjugate(x)
        array([[ 1.-1.j,  0.-0.j],
               [ 0.-0.j,  1.-1.j]])

    conjugate = <ufunc 'conjugate'>
        conjugate(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the complex conjugate, element-wise.

        The complex conjugate of a complex number is obtained by changing the
        sign of its imaginary part.

        Parameters
        ----------
        x : array_like
            Input value.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The complex conjugate of `x`, with same dtype as `y`.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        `conj` is an alias for `conjugate`:

        >>> np.conj is np.conjugate
        True

        Examples
        --------
        >>> import numpy as np
        >>> np.conjugate(1+2j)
        (1-2j)

        >>> x = np.eye(2) + 1j * np.eye(2)
        >>> np.conjugate(x)
        array([[ 1.-1.j,  0.-0.j],
               [ 0.-0.j,  1.-1.j]])

    copysign = <ufunc 'copysign'>
        copysign(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Change the sign of x1 to that of x2, element-wise.

        If `x2` is a scalar, its sign will be copied to all elements of `x1`.

        Parameters
        ----------
        x1 : array_like
            Values to change the sign of.
        x2 : array_like
            The sign of `x2` is copied to `x1`.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            The values of `x1` with the sign of `x2`.
            This is a scalar if both `x1` and `x2` are scalars.

        Examples
        --------
        >>> import numpy as np
        >>> np.copysign(1.3, -1)
        -1.3
        >>> 1/np.copysign(0, 1)
        inf
        >>> 1/np.copysign(0, -1)
        -inf

        >>> np.copysign([-1, 0, 1], -1.1)
        array([-1., -0., -1.])
        >>> np.copysign([-1, 0, 1], np.arange(3)-1)
        array([-1.,  0.,  1.])

    cos = <ufunc 'cos'>
        cos(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Cosine element-wise.

        Parameters
        ----------
        x : array_like
            Input array in radians.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The corresponding cosine values.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        If `out` is provided, the function writes the result into it,
        and returns a reference to `out`.  (See Examples)

        References
        ----------
        M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions.
        New York, NY: Dover, 1972.

        Examples
        --------
        >>> import numpy as np
        >>> np.cos(np.array([0, np.pi/2, np.pi]))
        array([  1.00000000e+00,   6.12303177e-17,  -1.00000000e+00])
        >>>
        >>> # Example of providing the optional output parameter
        >>> out1 = np.array([0], dtype='d')
        >>> out2 = np.cos([0.1], out1)
        >>> out2 is out1
        True
        >>>
        >>> # Example of ValueError due to provision of shape mis-matched `out`
        >>> np.cos(np.zeros((3,3)),np.zeros((2,2)))
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ValueError: operands could not be broadcast together with shapes (3,3) (2,2)

    cosh = <ufunc 'cosh'>
        cosh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Hyperbolic cosine, element-wise.

        Equivalent to ``1/2 * (np.exp(x) + np.exp(-x))`` and ``np.cos(1j*x)``.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Output array of same shape as `x`.
            This is a scalar if `x` is a scalar.

        Examples
        --------
        >>> import numpy as np
        >>> np.cosh(0)
        1.0

        The hyperbolic cosine describes the shape of a hanging cable:

        >>> import matplotlib.pyplot as plt
        >>> x = np.linspace(-4, 4, 1000)
        >>> plt.plot(x, np.cosh(x))
        >>> plt.show()

    deg2rad = <ufunc 'deg2rad'>
        deg2rad(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Convert angles from degrees to radians.

        Parameters
        ----------
        x : array_like
            Angles in degrees.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The corresponding angle in radians.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        rad2deg : Convert angles from radians to degrees.
        unwrap : Remove large jumps in angle by wrapping.

        Notes
        -----
        .. versionadded:: 1.3.0

        ``deg2rad(x)`` is ``x * pi / 180``.

        Examples
        --------
        >>> import numpy as np
        >>> np.deg2rad(180)
        3.1415926535897931

    degrees = <ufunc 'degrees'>
        degrees(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Convert angles from radians to degrees.

        Parameters
        ----------
        x : array_like
            Input array in radians.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray of floats
            The corresponding degree values; if `out` was supplied this is a
            reference to it.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        rad2deg : equivalent function

        Examples
        --------
        Convert a radian array to degrees

        >>> import numpy as np

        >>> rad = np.arange(12.)*np.pi/6
        >>> np.degrees(rad)
        array([   0.,   30.,   60.,   90.,  120.,  150.,  180.,  210.,  240.,
                270.,  300.,  330.])

        >>> out = np.zeros((rad.shape))
        >>> r = np.degrees(rad, out)
        >>> np.all(r == out)
        True

    divide = <ufunc 'divide'>
        divide(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Divide arguments element-wise.

        Parameters
        ----------
        x1 : array_like
            Dividend array.
        x2 : array_like
            Divisor array.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The quotient ``x1/x2``, element-wise.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        seterr : Set whether to raise or warn on overflow, underflow and
                 division by zero.

        Notes
        -----
        Equivalent to ``x1`` / ``x2`` in terms of array-broadcasting.

        The ``true_divide(x1, x2)`` function is an alias for
        ``divide(x1, x2)``.

        Examples
        --------
        >>> import numpy as np
        >>> np.divide(2.0, 4.0)
        0.5
        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = np.arange(3.0)
        >>> np.divide(x1, x2)
        array([[nan, 1. , 1. ],
               [inf, 4. , 2.5],
               [inf, 7. , 4. ]])

        The ``/`` operator can be used as a shorthand for ``np.divide`` on
        ndarrays.

        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = 2 * np.ones(3)
        >>> x1 / x2
        array([[0. , 0.5, 1. ],
               [1.5, 2. , 2.5],
               [3. , 3.5, 4. ]])

    divmod = <ufunc 'divmod'>
        divmod(x1, x2[, out1, out2], / [, out=(None, None)], *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return element-wise quotient and remainder simultaneously.

        .. versionadded:: 1.13.0

        ``np.divmod(x, y)`` is equivalent to ``(x // y, x % y)``, but faster
        because it avoids redundant work. It is used to implement the Python
        built-in function ``divmod`` on NumPy arrays.

        Parameters
        ----------
        x1 : array_like
            Dividend array.
        x2 : array_like
            Divisor array.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out1 : ndarray
            Element-wise quotient resulting from floor division.
            This is a scalar if both `x1` and `x2` are scalars.
        out2 : ndarray
            Element-wise remainder from floor division.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        floor_divide : Equivalent to Python's ``//`` operator.
        remainder : Equivalent to Python's ``%`` operator.
        modf : Equivalent to ``divmod(x, 1)`` for positive ``x`` with the return
               values switched.

        Examples
        --------
        >>> import numpy as np
        >>> np.divmod(np.arange(5), 3)
        (array([0, 0, 0, 1, 1]), array([0, 1, 2, 0, 1]))

        The `divmod` function can be used as a shorthand for ``np.divmod`` on
        ndarrays.

        >>> x = np.arange(5)
        >>> divmod(x, 3)
        (array([0, 0, 0, 1, 1]), array([0, 1, 2, 0, 1]))

    e = 2.718281828459045
    equal = <ufunc 'equal'>
        equal(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return (x1 == x2) element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Output array, element-wise comparison of `x1` and `x2`.
            Typically of type bool, unless ``dtype=object`` is passed.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        not_equal, greater_equal, less_equal, greater, less

        Examples
        --------
        >>> import numpy as np
        >>> np.equal([0, 1, 3], np.arange(3))
        array([ True,  True, False])

        What is compared are values, not types. So an int (1) and an array of
        length one can evaluate as True:

        >>> np.equal(1, np.ones(1))
        array([ True])

        The ``==`` operator can be used as a shorthand for ``np.equal`` on
        ndarrays.

        >>> a = np.array([2, 4, 6])
        >>> b = np.array([2, 4, 2])
        >>> a == b
        array([ True,  True, False])

    euler_gamma = 0.5772156649015329
    exp = <ufunc 'exp'>
        exp(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Calculate the exponential of all elements in the input array.

        Parameters
        ----------
        x : array_like
            Input values.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Output array, element-wise exponential of `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        expm1 : Calculate ``exp(x) - 1`` for all elements in the array.
        exp2  : Calculate ``2**x`` for all elements in the array.

        Notes
        -----
        The irrational number ``e`` is also known as Euler's number.  It is
        approximately 2.718281, and is the base of the natural logarithm,
        ``ln`` (this means that, if :math:`x = \ln y = \log_e y`,
        then :math:`e^x = y`. For real input, ``exp(x)`` is always positive.

        For complex arguments, ``x = a + ib``, we can write
        :math:`e^x = e^a e^{ib}`.  The first term, :math:`e^a`, is already
        known (it is the real argument, described above).  The second term,
        :math:`e^{ib}`, is :math:`\cos b + i \sin b`, a function with
        magnitude 1 and a periodic phase.

        References
        ----------
        .. [1] Wikipedia, "Exponential function",
               https://en.wikipedia.org/wiki/Exponential_function
        .. [2] M. Abramovitz and I. A. Stegun, "Handbook of Mathematical Functions
               with Formulas, Graphs, and Mathematical Tables," Dover, 1964, p. 69,
               https://personal.math.ubc.ca/~cbm/aands/page_69.htm

        Examples
        --------
        Plot the magnitude and phase of ``exp(x)`` in the complex plane:

        >>> import numpy as np

        >>> import matplotlib.pyplot as plt

        >>> x = np.linspace(-2*np.pi, 2*np.pi, 100)
        >>> xx = x + 1j * x[:, np.newaxis] # a + ib over complex plane
        >>> out = np.exp(xx)

        >>> plt.subplot(121)
        >>> plt.imshow(np.abs(out),
        ...            extent=[-2*np.pi, 2*np.pi, -2*np.pi, 2*np.pi], cmap='gray')
        >>> plt.title('Magnitude of exp(x)')

        >>> plt.subplot(122)
        >>> plt.imshow(np.angle(out),
        ...            extent=[-2*np.pi, 2*np.pi, -2*np.pi, 2*np.pi], cmap='hsv')
        >>> plt.title('Phase (angle) of exp(x)')
        >>> plt.show()

    exp2 = <ufunc 'exp2'>
        exp2(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Calculate `2**p` for all `p` in the input array.

        Parameters
        ----------
        x : array_like
            Input values.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Element-wise 2 to the power `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        power

        Notes
        -----
        .. versionadded:: 1.3.0



        Examples
        --------
        >>> import numpy as np
        >>> np.exp2([2, 3])
        array([ 4.,  8.])

    expm1 = <ufunc 'expm1'>
        expm1(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Calculate ``exp(x) - 1`` for all elements in the array.

        Parameters
        ----------
        x : array_like
            Input values.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Element-wise exponential minus one: ``out = exp(x) - 1``.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        log1p : ``log(1 + x)``, the inverse of expm1.


        Notes
        -----
        This function provides greater precision than ``exp(x) - 1``
        for small values of ``x``.

        Examples
        --------
        The true value of ``exp(1e-10) - 1`` is ``1.00000000005e-10`` to
        about 32 significant digits. This example shows the superiority of
        expm1 in this case.

        >>> import numpy as np

        >>> np.expm1(1e-10)
        1.00000000005e-10
        >>> np.exp(1e-10) - 1
        1.000000082740371e-10

    fabs = <ufunc 'fabs'>
        fabs(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute the absolute values element-wise.

        This function returns the absolute values (positive magnitude) of the
        data in `x`. Complex values are not handled, use `absolute` to find the
        absolute values of complex data.

        Parameters
        ----------
        x : array_like
            The array of numbers for which the absolute values are required. If
            `x` is a scalar, the result `y` will also be a scalar.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The absolute values of `x`, the returned values are always floats.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        absolute : Absolute values including `complex` types.

        Examples
        --------
        >>> import numpy as np
        >>> np.fabs(-1)
        1.0
        >>> np.fabs([-1.2, 1.2])
        array([ 1.2,  1.2])

    float_power = <ufunc 'float_power'>
        float_power(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        First array elements raised to powers from second array, element-wise.

        Raise each base in `x1` to the positionally-corresponding power in `x2`.
        `x1` and `x2` must be broadcastable to the same shape. This differs from
        the power function in that integers, float16, and float32  are promoted to
        floats with a minimum precision of float64 so that the result is always
        inexact.  The intent is that the function will return a usable result for
        negative powers and seldom overflow for positive powers.

        Negative values raised to a non-integral value will return ``nan``.
        To get complex results, cast the input to complex, or specify the
        ``dtype`` to be ``complex`` (see the example below).

        .. versionadded:: 1.12.0

        Parameters
        ----------
        x1 : array_like
            The bases.
        x2 : array_like
            The exponents.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The bases in `x1` raised to the exponents in `x2`.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        power : power function that preserves type

        Examples
        --------
        >>> import numpy as np

        Cube each element in a list.

        >>> x1 = range(6)
        >>> x1
        [0, 1, 2, 3, 4, 5]
        >>> np.float_power(x1, 3)
        array([   0.,    1.,    8.,   27.,   64.,  125.])

        Raise the bases to different exponents.

        >>> x2 = [1.0, 2.0, 3.0, 3.0, 2.0, 1.0]
        >>> np.float_power(x1, x2)
        array([  0.,   1.,   8.,  27.,  16.,   5.])

        The effect of broadcasting.

        >>> x2 = np.array([[1, 2, 3, 3, 2, 1], [1, 2, 3, 3, 2, 1]])
        >>> x2
        array([[1, 2, 3, 3, 2, 1],
               [1, 2, 3, 3, 2, 1]])
        >>> np.float_power(x1, x2)
        array([[  0.,   1.,   8.,  27.,  16.,   5.],
               [  0.,   1.,   8.,  27.,  16.,   5.]])

        Negative values raised to a non-integral value will result in ``nan``
        (and a warning will be generated).

        >>> x3 = np.array([-1, -4])
        >>> with np.errstate(invalid='ignore'):
        ...     p = np.float_power(x3, 1.5)
        ...
        >>> p
        array([nan, nan])

        To get complex results, give the argument ``dtype=complex``.

        >>> np.float_power(x3, 1.5, dtype=complex)
        array([-1.83697020e-16-1.j, -1.46957616e-15-8.j])

    floor = <ufunc 'floor'>
        floor(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the floor of the input, element-wise.

        The floor of the scalar `x` is the largest integer `i`, such that
        `i <= x`.  It is often denoted as :math:`\lfloor x \rfloor`.

        Parameters
        ----------
        x : array_like
            Input data.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The floor of each element in `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        ceil, trunc, rint, fix

        Notes
        -----
        Some spreadsheet programs calculate the "floor-towards-zero", where
        ``floor(-2.5) == -2``.  NumPy instead uses the definition of
        `floor` where `floor(-2.5) == -3`. The "floor-towards-zero"
        function is called ``fix`` in NumPy.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
        >>> np.floor(a)
        array([-2., -2., -1.,  0.,  1.,  1.,  2.])

    floor_divide = <ufunc 'floor_divide'>
        floor_divide(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the largest integer smaller or equal to the division of the inputs.
        It is equivalent to the Python ``//`` operator and pairs with the
        Python ``%`` (`remainder`), function so that ``a = a % b + b * (a // b)``
        up to roundoff.

        Parameters
        ----------
        x1 : array_like
            Numerator.
        x2 : array_like
            Denominator.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            y = floor(`x1`/`x2`)
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        remainder : Remainder complementary to floor_divide.
        divmod : Simultaneous floor division and remainder.
        divide : Standard division.
        floor : Round a number to the nearest integer toward minus infinity.
        ceil : Round a number to the nearest integer toward infinity.

        Examples
        --------
        >>> import numpy as np
        >>> np.floor_divide(7,3)
        2
        >>> np.floor_divide([1., 2., 3., 4.], 2.5)
        array([ 0.,  0.,  1.,  1.])

        The ``//`` operator can be used as a shorthand for ``np.floor_divide``
        on ndarrays.

        >>> x1 = np.array([1., 2., 3., 4.])
        >>> x1 // 2.5
        array([0., 0., 1., 1.])

    fmax = <ufunc 'fmax'>
        fmax(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Element-wise maximum of array elements.

        Compare two arrays and return a new array containing the element-wise
        maxima. If one of the elements being compared is a NaN, then the
        non-nan element is returned. If both elements are NaNs then the first
        is returned.  The latter distinction is important for complex NaNs,
        which are defined as at least one of the real or imaginary parts being
        a NaN. The net effect is that NaNs are ignored when possible.

        Parameters
        ----------
        x1, x2 : array_like
            The arrays holding the elements to be compared.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The maximum of `x1` and `x2`, element-wise.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        fmin :
            Element-wise minimum of two arrays, ignores NaNs.
        maximum :
            Element-wise maximum of two arrays, propagates NaNs.
        amax :
            The maximum value of an array along a given axis, propagates NaNs.
        nanmax :
            The maximum value of an array along a given axis, ignores NaNs.

        minimum, amin, nanmin

        Notes
        -----
        .. versionadded:: 1.3.0

        The fmax is equivalent to ``np.where(x1 >= x2, x1, x2)`` when neither
        x1 nor x2 are NaNs, but it is faster and does proper broadcasting.

        Examples
        --------
        >>> import numpy as np
        >>> np.fmax([2, 3, 4], [1, 5, 2])
        array([ 2.,  5.,  4.])

        >>> np.fmax(np.eye(2), [0.5, 2])
        array([[ 1. ,  2. ],
               [ 0.5,  2. ]])

        >>> np.fmax([np.nan, 0, np.nan],[0, np.nan, np.nan])
        array([ 0.,  0., nan])

    fmin = <ufunc 'fmin'>
        fmin(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Element-wise minimum of array elements.

        Compare two arrays and return a new array containing the element-wise
        minima. If one of the elements being compared is a NaN, then the
        non-nan element is returned. If both elements are NaNs then the first
        is returned.  The latter distinction is important for complex NaNs,
        which are defined as at least one of the real or imaginary parts being
        a NaN. The net effect is that NaNs are ignored when possible.

        Parameters
        ----------
        x1, x2 : array_like
            The arrays holding the elements to be compared.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The minimum of `x1` and `x2`, element-wise.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        fmax :
            Element-wise maximum of two arrays, ignores NaNs.
        minimum :
            Element-wise minimum of two arrays, propagates NaNs.
        amin :
            The minimum value of an array along a given axis, propagates NaNs.
        nanmin :
            The minimum value of an array along a given axis, ignores NaNs.

        maximum, amax, nanmax

        Notes
        -----
        .. versionadded:: 1.3.0

        The fmin is equivalent to ``np.where(x1 <= x2, x1, x2)`` when neither
        x1 nor x2 are NaNs, but it is faster and does proper broadcasting.

        Examples
        --------
        >>> import numpy as np
        >>> np.fmin([2, 3, 4], [1, 5, 2])
        array([1, 3, 2])

        >>> np.fmin(np.eye(2), [0.5, 2])
        array([[ 0.5,  0. ],
               [ 0. ,  1. ]])

        >>> np.fmin([np.nan, 0, np.nan],[0, np.nan, np.nan])
        array([ 0.,  0., nan])

    fmod = <ufunc 'fmod'>
        fmod(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Returns the element-wise remainder of division.

        This is the NumPy implementation of the C library function fmod, the
        remainder has the same sign as the dividend `x1`. It is equivalent to
        the Matlab(TM) ``rem`` function and should not be confused with the
        Python modulus operator ``x1 % x2``.

        Parameters
        ----------
        x1 : array_like
            Dividend.
        x2 : array_like
            Divisor.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : array_like
            The remainder of the division of `x1` by `x2`.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        remainder : Equivalent to the Python ``%`` operator.
        divide

        Notes
        -----
        The result of the modulo operation for negative dividend and divisors
        is bound by conventions. For `fmod`, the sign of result is the sign of
        the dividend, while for `remainder` the sign of the result is the sign
        of the divisor. The `fmod` function is equivalent to the Matlab(TM)
        ``rem`` function.

        Examples
        --------
        >>> import numpy as np
        >>> np.fmod([-3, -2, -1, 1, 2, 3], 2)
        array([-1,  0, -1,  1,  0,  1])
        >>> np.remainder([-3, -2, -1, 1, 2, 3], 2)
        array([1, 0, 1, 1, 0, 1])

        >>> np.fmod([5, 3], [2, 2.])
        array([ 1.,  1.])
        >>> a = np.arange(-3, 3).reshape(3, 2)
        >>> a
        array([[-3, -2],
               [-1,  0],
               [ 1,  2]])
        >>> np.fmod(a, [2,2])
        array([[-1,  0],
               [-1,  0],
               [ 1,  0]])

    frexp = <ufunc 'frexp'>
        frexp(x[, out1, out2], / [, out=(None, None)], *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Decompose the elements of x into mantissa and twos exponent.

        Returns (`mantissa`, `exponent`), where ``x = mantissa * 2**exponent``.
        The mantissa lies in the open interval(-1, 1), while the twos
        exponent is a signed integer.

        Parameters
        ----------
        x : array_like
            Array of numbers to be decomposed.
        out1 : ndarray, optional
            Output array for the mantissa. Must have the same shape as `x`.
        out2 : ndarray, optional
            Output array for the exponent. Must have the same shape as `x`.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        mantissa : ndarray
            Floating values between -1 and 1.
            This is a scalar if `x` is a scalar.
        exponent : ndarray
            Integer exponents of 2.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        ldexp : Compute ``y = x1 * 2**x2``, the inverse of `frexp`.

        Notes
        -----
        Complex dtypes are not supported, they will raise a TypeError.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.arange(9)
        >>> y1, y2 = np.frexp(x)
        >>> y1
        array([ 0.   ,  0.5  ,  0.5  ,  0.75 ,  0.5  ,  0.625,  0.75 ,  0.875,
                0.5  ])
        >>> y2
        array([0, 1, 2, 2, 3, 3, 3, 3, 4])
        >>> y1 * 2**y2
        array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.])

    gcd = <ufunc 'gcd'>
        gcd(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Returns the greatest common divisor of ``|x1|`` and ``|x2|``

        Parameters
        ----------
        x1, x2 : array_like, int
            Arrays of values.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).

        Returns
        -------
        y : ndarray or scalar
            The greatest common divisor of the absolute value of the inputs
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        lcm : The lowest common multiple

        Examples
        --------
        >>> import numpy as np
        >>> np.gcd(12, 20)
        4
        >>> np.gcd.reduce([15, 25, 35])
        5
        >>> np.gcd(np.arange(6), 20)
        array([20,  1,  2,  1,  4,  5])

    greater = <ufunc 'greater'>
        greater(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the truth value of (x1 > x2) element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Output array, element-wise comparison of `x1` and `x2`.
            Typically of type bool, unless ``dtype=object`` is passed.
            This is a scalar if both `x1` and `x2` are scalars.


        See Also
        --------
        greater_equal, less, less_equal, equal, not_equal

        Examples
        --------
        >>> import numpy as np
        >>> np.greater([4,2],[2,2])
        array([ True, False])

        The ``>`` operator can be used as a shorthand for ``np.greater`` on
        ndarrays.

        >>> a = np.array([4, 2])
        >>> b = np.array([2, 2])
        >>> a > b
        array([ True, False])

    greater_equal = <ufunc 'greater_equal'>
        greater_equal(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the truth value of (x1 >= x2) element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : bool or ndarray of bool
            Output array, element-wise comparison of `x1` and `x2`.
            Typically of type bool, unless ``dtype=object`` is passed.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        greater, less, less_equal, equal, not_equal

        Examples
        --------
        >>> import numpy as np
        >>> np.greater_equal([4, 2, 1], [2, 2, 2])
        array([ True, True, False])

        The ``>=`` operator can be used as a shorthand for ``np.greater_equal``
        on ndarrays.

        >>> a = np.array([4, 2, 1])
        >>> b = np.array([2, 2, 2])
        >>> a >= b
        array([ True,  True, False])

    heaviside = <ufunc 'heaviside'>
        heaviside(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute the Heaviside step function.

        The Heaviside step function [1]_ is defined as::

                                  0   if x1 < 0
            heaviside(x1, x2) =  x2   if x1 == 0
                                  1   if x1 > 0

        where `x2` is often taken to be 0.5, but 0 and 1 are also sometimes used.

        Parameters
        ----------
        x1 : array_like
            Input values.
        x2 : array_like
            The value of the function when x1 is 0.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            The output array, element-wise Heaviside step function of `x1`.
            This is a scalar if both `x1` and `x2` are scalars.

        Notes
        -----
        .. versionadded:: 1.13.0

        References
        ----------
        .. [1] Wikipedia, "Heaviside step function",
               https://en.wikipedia.org/wiki/Heaviside_step_function

        Examples
        --------
        >>> import numpy as np
        >>> np.heaviside([-1.5, 0, 2.0], 0.5)
        array([ 0. ,  0.5,  1. ])
        >>> np.heaviside([-1.5, 0, 2.0], 1)
        array([ 0.,  1.,  1.])

    hypot = <ufunc 'hypot'>
        hypot(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Given the "legs" of a right triangle, return its hypotenuse.

        Equivalent to ``sqrt(x1**2 + x2**2)``, element-wise.  If `x1` or
        `x2` is scalar_like (i.e., unambiguously cast-able to a scalar type),
        it is broadcast for use with each element of the other argument.
        (See Examples)

        Parameters
        ----------
        x1, x2 : array_like
            Leg of the triangle(s).
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        z : ndarray
            The hypotenuse of the triangle(s).
            This is a scalar if both `x1` and `x2` are scalars.

        Examples
        --------
        >>> import numpy as np
        >>> np.hypot(3*np.ones((3, 3)), 4*np.ones((3, 3)))
        array([[ 5.,  5.,  5.],
               [ 5.,  5.,  5.],
               [ 5.,  5.,  5.]])

        Example showing broadcast of scalar_like argument:

        >>> np.hypot(3*np.ones((3, 3)), [4])
        array([[ 5.,  5.,  5.],
               [ 5.,  5.,  5.],
               [ 5.,  5.,  5.]])

    index_exp = <numpy.lib._index_tricks_impl.IndexExpression object>
    inf = inf
    invert = <ufunc 'invert'>
        invert(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute bit-wise inversion, or bit-wise NOT, element-wise.

        Computes the bit-wise NOT of the underlying binary representation of
        the integers in the input arrays. This ufunc implements the C/Python
        operator ``~``.

        For signed integer inputs, the bit-wise NOT of the absolute value is
        returned. In a two's-complement system, this operation effectively flips
        all the bits, resulting in a representation that corresponds to the
        negative of the input plus one. This is the most common method of
        representing signed integers on computers [1]_. A N-bit two's-complement
        system can represent every integer in the range :math:`-2^{N-1}` to
        :math:`+2^{N-1}-1`.

        Parameters
        ----------
        x : array_like
            Only integer and boolean types are handled.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Result.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        bitwise_and, bitwise_or, bitwise_xor
        logical_not
        binary_repr :
            Return the binary representation of the input number as a string.

        Notes
        -----
        ``numpy.bitwise_not`` is an alias for `invert`:

        >>> np.bitwise_not is np.invert
        True

        References
        ----------
        .. [1] Wikipedia, "Two's complement",
            https://en.wikipedia.org/wiki/Two's_complement

        Examples
        --------
        >>> import numpy as np

        We've seen that 13 is represented by ``00001101``.
        The invert or bit-wise NOT of 13 is then:

        >>> x = np.invert(np.array(13, dtype=np.uint8))
        >>> x
        242
        >>> np.binary_repr(x, width=8)
        '11110010'

        The result depends on the bit-width:

        >>> x = np.invert(np.array(13, dtype=np.uint16))
        >>> x
        65522
        >>> np.binary_repr(x, width=16)
        '1111111111110010'

        When using signed integer types, the result is the bit-wise NOT of
        the unsigned type, interpreted as a signed integer:

        >>> np.invert(np.array([13], dtype=np.int8))
        array([-14], dtype=int8)
        >>> np.binary_repr(-14, width=8)
        '11110010'

        Booleans are accepted as well:

        >>> np.invert(np.array([True, False]))
        array([False,  True])

        The ``~`` operator can be used as a shorthand for ``np.invert`` on
        ndarrays.

        >>> x1 = np.array([True, False])
        >>> ~x1
        array([False,  True])

    isfinite = <ufunc 'isfinite'>
        isfinite(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Test element-wise for finiteness (not infinity and not Not a Number).

        The result is returned as a boolean array.

        Parameters
        ----------
        x : array_like
            Input values.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray, bool
            True where ``x`` is not positive infinity, negative infinity,
            or NaN; false otherwise.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        isinf, isneginf, isposinf, isnan

        Notes
        -----
        Not a Number, positive infinity and negative infinity are considered
        to be non-finite.

        NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
        (IEEE 754). This means that Not a Number is not equivalent to infinity.
        Also that positive infinity is not equivalent to negative infinity. But
        infinity is equivalent to positive infinity.  Errors result if the
        second argument is also supplied when `x` is a scalar input, or if
        first and second arguments have different shapes.

        Examples
        --------
        >>> import numpy as np
        >>> np.isfinite(1)
        True
        >>> np.isfinite(0)
        True
        >>> np.isfinite(np.nan)
        False
        >>> np.isfinite(np.inf)
        False
        >>> np.isfinite(-np.inf)
        False
        >>> np.isfinite([np.log(-1.),1.,np.log(0)])
        array([False,  True, False])

        >>> x = np.array([-np.inf, 0., np.inf])
        >>> y = np.array([2, 2, 2])
        >>> np.isfinite(x, y)
        array([0, 1, 0])
        >>> y
        array([0, 1, 0])

    isinf = <ufunc 'isinf'>
        isinf(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Test element-wise for positive or negative infinity.

        Returns a boolean array of the same shape as `x`, True where ``x ==
        +/-inf``, otherwise False.

        Parameters
        ----------
        x : array_like
            Input values
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : bool (scalar) or boolean ndarray
            True where ``x`` is positive or negative infinity, false otherwise.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        isneginf, isposinf, isnan, isfinite

        Notes
        -----
        NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
        (IEEE 754).

        Errors result if the second argument is supplied when the first
        argument is a scalar, or if the first and second arguments have
        different shapes.

        Examples
        --------
        >>> import numpy as np
        >>> np.isinf(np.inf)
        True
        >>> np.isinf(np.nan)
        False
        >>> np.isinf(-np.inf)
        True
        >>> np.isinf([np.inf, -np.inf, 1.0, np.nan])
        array([ True,  True, False, False])

        >>> x = np.array([-np.inf, 0., np.inf])
        >>> y = np.array([2, 2, 2])
        >>> np.isinf(x, y)
        array([1, 0, 1])
        >>> y
        array([1, 0, 1])

    isnan = <ufunc 'isnan'>
        isnan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Test element-wise for NaN and return result as a boolean array.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or bool
            True where ``x`` is NaN, false otherwise.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        isinf, isneginf, isposinf, isfinite, isnat

        Notes
        -----
        NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
        (IEEE 754). This means that Not a Number is not equivalent to infinity.

        Examples
        --------
        >>> import numpy as np
        >>> np.isnan(np.nan)
        True
        >>> np.isnan(np.inf)
        False
        >>> np.isnan([np.log(-1.),1.,np.log(0)])
        array([ True, False, False])

    isnat = <ufunc 'isnat'>
        isnat(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Test element-wise for NaT (not a time) and return result as a boolean array.

        .. versionadded:: 1.13.0

        Parameters
        ----------
        x : array_like
            Input array with datetime or timedelta data type.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or bool
            True where ``x`` is NaT, false otherwise.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        isnan, isinf, isneginf, isposinf, isfinite

        Examples
        --------
        >>> import numpy as np
        >>> np.isnat(np.datetime64("NaT"))
        True
        >>> np.isnat(np.datetime64("2016-01-01"))
        False
        >>> np.isnat(np.array(["NaT", "2016-01-01"], dtype="datetime64[ns]"))
        array([ True, False])

    lcm = <ufunc 'lcm'>
        lcm(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Returns the lowest common multiple of ``|x1|`` and ``|x2|``

        Parameters
        ----------
        x1, x2 : array_like, int
            Arrays of values.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).

        Returns
        -------
        y : ndarray or scalar
            The lowest common multiple of the absolute value of the inputs
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        gcd : The greatest common divisor

        Examples
        --------
        >>> import numpy as np
        >>> np.lcm(12, 20)
        60
        >>> np.lcm.reduce([3, 12, 20])
        60
        >>> np.lcm.reduce([40, 12, 20])
        120
        >>> np.lcm(np.arange(6), 20)
        array([ 0, 20, 20, 60, 20, 20])

    ldexp = <ufunc 'ldexp'>
        ldexp(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Returns x1 * 2**x2, element-wise.

        The mantissas `x1` and twos exponents `x2` are used to construct
        floating point numbers ``x1 * 2**x2``.

        Parameters
        ----------
        x1 : array_like
            Array of multipliers.
        x2 : array_like, int
            Array of twos exponents.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The result of ``x1 * 2**x2``.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        frexp : Return (y1, y2) from ``x = y1 * 2**y2``, inverse to `ldexp`.

        Notes
        -----
        Complex dtypes are not supported, they will raise a TypeError.

        `ldexp` is useful as the inverse of `frexp`, if used by itself it is
        more clear to simply use the expression ``x1 * 2**x2``.

        Examples
        --------
        >>> import numpy as np
        >>> np.ldexp(5, np.arange(4))
        array([ 5., 10., 20., 40.], dtype=float16)

        >>> x = np.arange(6)
        >>> np.ldexp(*np.frexp(x))
        array([ 0.,  1.,  2.,  3.,  4.,  5.])

    left_shift = <ufunc 'left_shift'>
        left_shift(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Shift the bits of an integer to the left.

        Bits are shifted to the left by appending `x2` 0s at the right of `x1`.
        Since the internal representation of numbers is in binary format, this
        operation is equivalent to multiplying `x1` by ``2**x2``.

        Parameters
        ----------
        x1 : array_like of integer type
            Input values.
        x2 : array_like of integer type
            Number of zeros to append to `x1`. Has to be non-negative.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : array of integer type
            Return `x1` with bits shifted `x2` times to the left.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        right_shift : Shift the bits of an integer to the right.
        binary_repr : Return the binary representation of the input number
            as a string.

        Examples
        --------
        >>> import numpy as np
        >>> np.binary_repr(5)
        '101'
        >>> np.left_shift(5, 2)
        20
        >>> np.binary_repr(20)
        '10100'

        >>> np.left_shift(5, [1,2,3])
        array([10, 20, 40])

        Note that the dtype of the second argument may change the dtype of the
        result and can lead to unexpected results in some cases (see
        :ref:`Casting Rules <ufuncs.casting>`):

        >>> a = np.left_shift(np.uint8(255), np.int64(1))  # Expect 254
        >>> print(a, type(a)) # Unexpected result due to upcasting
        510 <class 'numpy.int64'>
        >>> b = np.left_shift(np.uint8(255), np.uint8(1))
        >>> print(b, type(b))
        254 <class 'numpy.uint8'>

        The ``<<`` operator can be used as a shorthand for ``np.left_shift`` on
        ndarrays.

        >>> x1 = 5
        >>> x2 = np.array([1, 2, 3])
        >>> x1 << x2
        array([10, 20, 40])

    less = <ufunc 'less'>
        less(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the truth value of (x1 < x2) element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Output array, element-wise comparison of `x1` and `x2`.
            Typically of type bool, unless ``dtype=object`` is passed.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        greater, less_equal, greater_equal, equal, not_equal

        Examples
        --------
        >>> import numpy as np
        >>> np.less([1, 2], [2, 2])
        array([ True, False])

        The ``<`` operator can be used as a shorthand for ``np.less`` on ndarrays.

        >>> a = np.array([1, 2])
        >>> b = np.array([2, 2])
        >>> a < b
        array([ True, False])

    less_equal = <ufunc 'less_equal'>
        less_equal(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the truth value of (x1 <= x2) element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Output array, element-wise comparison of `x1` and `x2`.
            Typically of type bool, unless ``dtype=object`` is passed.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        greater, less, greater_equal, equal, not_equal

        Examples
        --------
        >>> import numpy as np
        >>> np.less_equal([4, 2, 1], [2, 2, 2])
        array([False,  True,  True])

        The ``<=`` operator can be used as a shorthand for ``np.less_equal`` on
        ndarrays.

        >>> a = np.array([4, 2, 1])
        >>> b = np.array([2, 2, 2])
        >>> a <= b
        array([False,  True,  True])

    little_endian = True
    log = <ufunc 'log'>
        log(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Natural logarithm, element-wise.

        The natural logarithm `log` is the inverse of the exponential function,
        so that `log(exp(x)) = x`. The natural logarithm is logarithm in base
        `e`.

        Parameters
        ----------
        x : array_like
            Input value.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The natural logarithm of `x`, element-wise.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        log10, log2, log1p, emath.log

        Notes
        -----
        Logarithm is a multivalued function: for each `x` there is an infinite
        number of `z` such that `exp(z) = x`. The convention is to return the
        `z` whose imaginary part lies in `(-pi, pi]`.

        For real-valued input data types, `log` always returns real output. For
        each value that cannot be expressed as a real number or infinity, it
        yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `log` is a complex analytical function that
        has a branch cut `[-inf, 0]` and is continuous from above on it. `log`
        handles the floating-point negative zero as an infinitesimal negative
        number, conforming to the C99 standard.

        In the cases where the input has a negative real part and a very small
        negative complex part (approaching 0), the result is so close to `-pi`
        that it evaluates to exactly `-pi`.

        References
        ----------
        .. [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
               10th printing, 1964, pp. 67.
               https://personal.math.ubc.ca/~cbm/aands/page_67.htm
        .. [2] Wikipedia, "Logarithm". https://en.wikipedia.org/wiki/Logarithm

        Examples
        --------
        >>> import numpy as np
        >>> np.log([1, np.e, np.e**2, 0])
        array([  0.,   1.,   2., -inf])

    log10 = <ufunc 'log10'>
        log10(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the base 10 logarithm of the input array, element-wise.

        Parameters
        ----------
        x : array_like
            Input values.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The logarithm to the base 10 of `x`, element-wise. NaNs are
            returned where x is negative.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        emath.log10

        Notes
        -----
        Logarithm is a multivalued function: for each `x` there is an infinite
        number of `z` such that `10**z = x`. The convention is to return the
        `z` whose imaginary part lies in `(-pi, pi]`.

        For real-valued input data types, `log10` always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `log10` is a complex analytical function that
        has a branch cut `[-inf, 0]` and is continuous from above on it.
        `log10` handles the floating-point negative zero as an infinitesimal
        negative number, conforming to the C99 standard.

        In the cases where the input has a negative real part and a very small
        negative complex part (approaching 0), the result is so close to `-pi`
        that it evaluates to exactly `-pi`.

        References
        ----------
        .. [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
               10th printing, 1964, pp. 67.
               https://personal.math.ubc.ca/~cbm/aands/page_67.htm
        .. [2] Wikipedia, "Logarithm". https://en.wikipedia.org/wiki/Logarithm

        Examples
        --------
        >>> import numpy as np
        >>> np.log10([1e-15, -3.])
        array([-15.,  nan])

    log1p = <ufunc 'log1p'>
        log1p(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the natural logarithm of one plus the input array, element-wise.

        Calculates ``log(1 + x)``.

        Parameters
        ----------
        x : array_like
            Input values.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            Natural logarithm of `1 + x`, element-wise.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        expm1 : ``exp(x) - 1``, the inverse of `log1p`.

        Notes
        -----
        For real-valued input, `log1p` is accurate also for `x` so small
        that `1 + x == 1` in floating-point accuracy.

        Logarithm is a multivalued function: for each `x` there is an infinite
        number of `z` such that `exp(z) = 1 + x`. The convention is to return
        the `z` whose imaginary part lies in `[-pi, pi]`.

        For real-valued input data types, `log1p` always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `log1p` is a complex analytical function that
        has a branch cut `[-inf, -1]` and is continuous from above on it.
        `log1p` handles the floating-point negative zero as an infinitesimal
        negative number, conforming to the C99 standard.

        References
        ----------
        .. [1] M. Abramowitz and I.A. Stegun, "Handbook of Mathematical Functions",
               10th printing, 1964, pp. 67.
               https://personal.math.ubc.ca/~cbm/aands/page_67.htm
        .. [2] Wikipedia, "Logarithm". https://en.wikipedia.org/wiki/Logarithm

        Examples
        --------
        >>> import numpy as np
        >>> np.log1p(1e-99)
        1e-99
        >>> np.log(1 + 1e-99)
        0.0

    log2 = <ufunc 'log2'>
        log2(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Base-2 logarithm of `x`.

        Parameters
        ----------
        x : array_like
            Input values.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            Base-2 logarithm of `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        log, log10, log1p, emath.log2

        Notes
        -----
        .. versionadded:: 1.3.0

        Logarithm is a multivalued function: for each `x` there is an infinite
        number of `z` such that `2**z = x`. The convention is to return the `z`
        whose imaginary part lies in `(-pi, pi]`.

        For real-valued input data types, `log2` always returns real output.
        For each value that cannot be expressed as a real number or infinity,
        it yields ``nan`` and sets the `invalid` floating point error flag.

        For complex-valued input, `log2` is a complex analytical function that
        has a branch cut `[-inf, 0]` and is continuous from above on it. `log2`
        handles the floating-point negative zero as an infinitesimal negative
        number, conforming to the C99 standard.

        In the cases where the input has a negative real part and a very small
        negative complex part (approaching 0), the result is so close to `-pi`
        that it evaluates to exactly `-pi`.

        Examples
        --------
        >>> import numpy as np
        >>> x = np.array([0, 1, 2, 2**4])
        >>> np.log2(x)
        array([-inf,   0.,   1.,   4.])

        >>> xi = np.array([0+1.j, 1, 2+0.j, 4.j])
        >>> np.log2(xi)
        array([ 0.+2.26618007j,  0.+0.j        ,  1.+0.j        ,  2.+2.26618007j])

    logaddexp = <ufunc 'logaddexp'>
        logaddexp(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Logarithm of the sum of exponentiations of the inputs.

        Calculates ``log(exp(x1) + exp(x2))``. This function is useful in
        statistics where the calculated probabilities of events may be so small
        as to exceed the range of normal floating point numbers.  In such cases
        the logarithm of the calculated probability is stored. This function
        allows adding probabilities stored in such a fashion.

        Parameters
        ----------
        x1, x2 : array_like
            Input values.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        result : ndarray
            Logarithm of ``exp(x1) + exp(x2)``.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        logaddexp2: Logarithm of the sum of exponentiations of inputs in base 2.

        Notes
        -----
        .. versionadded:: 1.3.0

        Examples
        --------
        >>> import numpy as np
        >>> prob1 = np.log(1e-50)
        >>> prob2 = np.log(2.5e-50)
        >>> prob12 = np.logaddexp(prob1, prob2)
        >>> prob12
        -113.87649168120691
        >>> np.exp(prob12)
        3.5000000000000057e-50

    logaddexp2 = <ufunc 'logaddexp2'>
        logaddexp2(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Logarithm of the sum of exponentiations of the inputs in base-2.

        Calculates ``log2(2**x1 + 2**x2)``. This function is useful in machine
        learning when the calculated probabilities of events may be so small as
        to exceed the range of normal floating point numbers.  In such cases
        the base-2 logarithm of the calculated probability can be used instead.
        This function allows adding probabilities stored in such a fashion.

        Parameters
        ----------
        x1, x2 : array_like
            Input values.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        result : ndarray
            Base-2 logarithm of ``2**x1 + 2**x2``.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        logaddexp: Logarithm of the sum of exponentiations of the inputs.

        Notes
        -----
        .. versionadded:: 1.3.0

        Examples
        --------
        >>> import numpy as np
        >>> prob1 = np.log2(1e-50)
        >>> prob2 = np.log2(2.5e-50)
        >>> prob12 = np.logaddexp2(prob1, prob2)
        >>> prob1, prob2, prob12
        (-166.09640474436813, -164.77447664948076, -164.28904982231052)
        >>> 2**prob12
        3.4999999999999914e-50

    logical_and = <ufunc 'logical_and'>
        logical_and(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute the truth value of x1 AND x2 element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or bool
            Boolean result of the logical AND operation applied to the elements
            of `x1` and `x2`; the shape is determined by broadcasting.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        logical_or, logical_not, logical_xor
        bitwise_and

        Examples
        --------
        >>> import numpy as np
        >>> np.logical_and(True, False)
        False
        >>> np.logical_and([True, False], [False, False])
        array([False, False])

        >>> x = np.arange(5)
        >>> np.logical_and(x>1, x<4)
        array([False, False,  True,  True, False])


        The ``&`` operator can be used as a shorthand for ``np.logical_and`` on
        boolean ndarrays.

        >>> a = np.array([True, False])
        >>> b = np.array([False, False])
        >>> a & b
        array([False, False])

    logical_not = <ufunc 'logical_not'>
        logical_not(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute the truth value of NOT x element-wise.

        Parameters
        ----------
        x : array_like
            Logical NOT is applied to the elements of `x`.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : bool or ndarray of bool
            Boolean result with the same shape as `x` of the NOT operation
            on elements of `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        logical_and, logical_or, logical_xor

        Examples
        --------
        >>> import numpy as np
        >>> np.logical_not(3)
        False
        >>> np.logical_not([True, False, 0, 1])
        array([False,  True,  True, False])

        >>> x = np.arange(5)
        >>> np.logical_not(x<3)
        array([False, False, False,  True,  True])

    logical_or = <ufunc 'logical_or'>
        logical_or(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute the truth value of x1 OR x2 element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Logical OR is applied to the elements of `x1` and `x2`.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or bool
            Boolean result of the logical OR operation applied to the elements
            of `x1` and `x2`; the shape is determined by broadcasting.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        logical_and, logical_not, logical_xor
        bitwise_or

        Examples
        --------
        >>> import numpy as np
        >>> np.logical_or(True, False)
        True
        >>> np.logical_or([True, False], [False, False])
        array([ True, False])

        >>> x = np.arange(5)
        >>> np.logical_or(x < 1, x > 3)
        array([ True, False, False, False,  True])

        The ``|`` operator can be used as a shorthand for ``np.logical_or`` on
        boolean ndarrays.

        >>> a = np.array([True, False])
        >>> b = np.array([False, False])
        >>> a | b
        array([ True, False])

    logical_xor = <ufunc 'logical_xor'>
        logical_xor(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute the truth value of x1 XOR x2, element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Logical XOR is applied to the elements of `x1` and `x2`.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : bool or ndarray of bool
            Boolean result of the logical XOR operation applied to the elements
            of `x1` and `x2`; the shape is determined by broadcasting.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        logical_and, logical_or, logical_not, bitwise_xor

        Examples
        --------
        >>> import numpy as np
        >>> np.logical_xor(True, False)
        True
        >>> np.logical_xor([True, True, False, False], [True, False, True, False])
        array([False,  True,  True, False])

        >>> x = np.arange(5)
        >>> np.logical_xor(x < 1, x > 3)
        array([ True, False, False, False,  True])

        Simple example showing support of broadcasting

        >>> np.logical_xor(0, np.eye(2))
        array([[ True, False],
               [False,  True]])

    matmul = <ufunc 'matmul'>
        matmul(x1, x2, /, out=None, *, casting='same_kind', order='K', dtype=None, subok=True[, signature, axes, axis])

        Matrix product of two arrays.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays, scalars not allowed.
        out : ndarray, optional
            A location into which the result is stored. If provided, it must have
            a shape that matches the signature `(n,k),(k,m)->(n,m)`. If not
            provided or None, a freshly-allocated array is returned.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

            .. versionadded:: 1.16
               Now handles ufunc kwargs

        Returns
        -------
        y : ndarray
            The matrix product of the inputs.
            This is a scalar only when both x1, x2 are 1-d vectors.

        Raises
        ------
        ValueError
            If the last dimension of `x1` is not the same size as
            the second-to-last dimension of `x2`.

            If a scalar value is passed in.

        See Also
        --------
        vdot : Complex-conjugating dot product.
        tensordot : Sum products over arbitrary axes.
        einsum : Einstein summation convention.
        dot : alternative matrix product with different broadcasting rules.

        Notes
        -----

        The behavior depends on the arguments in the following way.

        - If both arguments are 2-D they are multiplied like conventional
          matrices.
        - If either argument is N-D, N > 2, it is treated as a stack of
          matrices residing in the last two indexes and broadcast accordingly.
        - If the first argument is 1-D, it is promoted to a matrix by
          prepending a 1 to its dimensions. After matrix multiplication
          the prepended 1 is removed.
        - If the second argument is 1-D, it is promoted to a matrix by
          appending a 1 to its dimensions. After matrix multiplication
          the appended 1 is removed.

        ``matmul`` differs from ``dot`` in two important ways:

        - Multiplication by scalars is not allowed, use ``*`` instead.
        - Stacks of matrices are broadcast together as if the matrices
          were elements, respecting the signature ``(n,k),(k,m)->(n,m)``:

          >>> a = np.ones([9, 5, 7, 4])
          >>> c = np.ones([9, 5, 4, 3])
          >>> np.dot(a, c).shape
          (9, 5, 7, 9, 5, 3)
          >>> np.matmul(a, c).shape
          (9, 5, 7, 3)
          >>> # n is 7, k is 4, m is 3

        The matmul function implements the semantics of the ``@`` operator
        introduced in Python 3.5 following :pep:`465`.

        It uses an optimized BLAS library when possible (see `numpy.linalg`).

        Examples
        --------
        For 2-D arrays it is the matrix product:

        >>> import numpy as np

        >>> a = np.array([[1, 0],
        ...               [0, 1]])
        >>> b = np.array([[4, 1],
        ...               [2, 2]])
        >>> np.matmul(a, b)
        array([[4, 1],
               [2, 2]])

        For 2-D mixed with 1-D, the result is the usual.

        >>> a = np.array([[1, 0],
        ...               [0, 1]])
        >>> b = np.array([1, 2])
        >>> np.matmul(a, b)
        array([1, 2])
        >>> np.matmul(b, a)
        array([1, 2])


        Broadcasting is conventional for stacks of arrays

        >>> a = np.arange(2 * 2 * 4).reshape((2, 2, 4))
        >>> b = np.arange(2 * 2 * 4).reshape((2, 4, 2))
        >>> np.matmul(a,b).shape
        (2, 2, 2)
        >>> np.matmul(a, b)[0, 1, 1]
        98
        >>> sum(a[0, 1, :] * b[0 , :, 1])
        98

        Vector, vector returns the scalar inner product, but neither argument
        is complex-conjugated:

        >>> np.matmul([2j, 3j], [2j, 3j])
        (-13+0j)

        Scalar multiplication raises an error.

        >>> np.matmul([1,2], 3)
        Traceback (most recent call last):
        ...
        ValueError: matmul: Input operand 1 does not have enough dimensions ...

        The ``@`` operator can be used as a shorthand for ``np.matmul`` on
        ndarrays.

        >>> x1 = np.array([2j, 3j])
        >>> x2 = np.array([2j, 3j])
        >>> x1 @ x2
        (-13+0j)

        .. versionadded:: 1.10.0

    maximum = <ufunc 'maximum'>
        maximum(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Element-wise maximum of array elements.

        Compare two arrays and return a new array containing the element-wise
        maxima. If one of the elements being compared is a NaN, then that
        element is returned. If both elements are NaNs then the first is
        returned. The latter distinction is important for complex NaNs, which
        are defined as at least one of the real or imaginary parts being a NaN.
        The net effect is that NaNs are propagated.

        Parameters
        ----------
        x1, x2 : array_like
            The arrays holding the elements to be compared.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The maximum of `x1` and `x2`, element-wise.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        minimum :
            Element-wise minimum of two arrays, propagates NaNs.
        fmax :
            Element-wise maximum of two arrays, ignores NaNs.
        amax :
            The maximum value of an array along a given axis, propagates NaNs.
        nanmax :
            The maximum value of an array along a given axis, ignores NaNs.

        fmin, amin, nanmin

        Notes
        -----
        The maximum is equivalent to ``np.where(x1 >= x2, x1, x2)`` when
        neither x1 nor x2 are nans, but it is faster and does proper
        broadcasting.

        Examples
        --------
        >>> import numpy as np
        >>> np.maximum([2, 3, 4], [1, 5, 2])
        array([2, 5, 4])

        >>> np.maximum(np.eye(2), [0.5, 2]) # broadcasting
        array([[ 1. ,  2. ],
               [ 0.5,  2. ]])

        >>> np.maximum([np.nan, 0, np.nan], [0, np.nan, np.nan])
        array([nan, nan, nan])
        >>> np.maximum(np.inf, 1)
        inf

    mgrid = <numpy.lib._index_tricks_impl.MGridClass object>
    minimum = <ufunc 'minimum'>
        minimum(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Element-wise minimum of array elements.

        Compare two arrays and return a new array containing the element-wise
        minima. If one of the elements being compared is a NaN, then that
        element is returned. If both elements are NaNs then the first is
        returned. The latter distinction is important for complex NaNs, which
        are defined as at least one of the real or imaginary parts being a NaN.
        The net effect is that NaNs are propagated.

        Parameters
        ----------
        x1, x2 : array_like
            The arrays holding the elements to be compared.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The minimum of `x1` and `x2`, element-wise.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        maximum :
            Element-wise maximum of two arrays, propagates NaNs.
        fmin :
            Element-wise minimum of two arrays, ignores NaNs.
        amin :
            The minimum value of an array along a given axis, propagates NaNs.
        nanmin :
            The minimum value of an array along a given axis, ignores NaNs.

        fmax, amax, nanmax

        Notes
        -----
        The minimum is equivalent to ``np.where(x1 <= x2, x1, x2)`` when
        neither x1 nor x2 are NaNs, but it is faster and does proper
        broadcasting.

        Examples
        --------
        >>> import numpy as np
        >>> np.minimum([2, 3, 4], [1, 5, 2])
        array([1, 3, 2])

        >>> np.minimum(np.eye(2), [0.5, 2]) # broadcasting
        array([[ 0.5,  0. ],
               [ 0. ,  1. ]])

        >>> np.minimum([np.nan, 0, np.nan],[0, np.nan, np.nan])
        array([nan, nan, nan])
        >>> np.minimum(-np.inf, 1)
        -inf

    mod = <ufunc 'remainder'>
        remainder(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Returns the element-wise remainder of division.

        Computes the remainder complementary to the `floor_divide` function.  It is
        equivalent to the Python modulus operator ``x1 % x2`` and has the same sign
        as the divisor `x2`. The MATLAB function equivalent to ``np.remainder``
        is ``mod``.

        .. warning::

            This should not be confused with:

            * Python 3.7's `math.remainder` and C's ``remainder``, which
              computes the IEEE remainder, which are the complement to
              ``round(x1 / x2)``.
            * The MATLAB ``rem`` function and or the C ``%`` operator which is the
              complement to ``int(x1 / x2)``.

        Parameters
        ----------
        x1 : array_like
            Dividend array.
        x2 : array_like
            Divisor array.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The element-wise remainder of the quotient ``floor_divide(x1, x2)``.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        floor_divide : Equivalent of Python ``//`` operator.
        divmod : Simultaneous floor division and remainder.
        fmod : Equivalent of the MATLAB ``rem`` function.
        divide, floor

        Notes
        -----
        Returns 0 when `x2` is 0 and both `x1` and `x2` are (arrays of)
        integers.
        ``mod`` is an alias of ``remainder``.

        Examples
        --------
        >>> import numpy as np
        >>> np.remainder([4, 7], [2, 3])
        array([0, 1])
        >>> np.remainder(np.arange(7), 5)
        array([0, 1, 2, 3, 4, 0, 1])

        The ``%`` operator can be used as a shorthand for ``np.remainder`` on
        ndarrays.

        >>> x1 = np.arange(7)
        >>> x1 % 5
        array([0, 1, 2, 3, 4, 0, 1])

    modf = <ufunc 'modf'>
        modf(x[, out1, out2], / [, out=(None, None)], *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the fractional and integral parts of an array, element-wise.

        The fractional and integral parts are negative if the given number is
        negative.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y1 : ndarray
            Fractional part of `x`.
            This is a scalar if `x` is a scalar.
        y2 : ndarray
            Integral part of `x`.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        For integer input the return values are floats.

        See Also
        --------
        divmod : ``divmod(x, 1)`` is equivalent to ``modf`` with the return values
                 switched, except it always has a positive remainder.

        Examples
        --------
        >>> import numpy as np
        >>> np.modf([0, 3.5])
        (array([ 0. ,  0.5]), array([ 0.,  3.]))
        >>> np.modf(-0.5)
        (-0.5, -0)

    multiply = <ufunc 'multiply'>
        multiply(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Multiply arguments element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays to be multiplied.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The product of `x1` and `x2`, element-wise.
            This is a scalar if both `x1` and `x2` are scalars.

        Notes
        -----
        Equivalent to `x1` * `x2` in terms of array broadcasting.

        Examples
        --------
        >>> import numpy as np
        >>> np.multiply(2.0, 4.0)
        8.0

        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = np.arange(3.0)
        >>> np.multiply(x1, x2)
        array([[  0.,   1.,   4.],
               [  0.,   4.,  10.],
               [  0.,   7.,  16.]])

        The ``*`` operator can be used as a shorthand for ``np.multiply`` on
        ndarrays.

        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = np.arange(3.0)
        >>> x1 * x2
        array([[  0.,   1.,   4.],
               [  0.,   4.,  10.],
               [  0.,   7.,  16.]])

    nan = nan
    negative = <ufunc 'negative'>
        negative(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Numerical negative, element-wise.

        Parameters
        ----------
        x : array_like or scalar
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            Returned array or scalar: `y = -x`.
            This is a scalar if `x` is a scalar.

        Examples
        --------
        >>> import numpy as np
        >>> np.negative([1.,-1.])
        array([-1.,  1.])

        The unary ``-`` operator can be used as a shorthand for ``np.negative`` on
        ndarrays.

        >>> x1 = np.array(([1., -1.]))
        >>> -x1
        array([-1.,  1.])

    newaxis = None
    nextafter = <ufunc 'nextafter'>
        nextafter(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the next floating-point value after x1 towards x2, element-wise.

        Parameters
        ----------
        x1 : array_like
            Values to find the next representable value of.
        x2 : array_like
            The direction where to look for the next representable value of `x1`.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            The next representable values of `x1` in the direction of `x2`.
            This is a scalar if both `x1` and `x2` are scalars.

        Examples
        --------
        >>> import numpy as np
        >>> eps = np.finfo(np.float64).eps
        >>> np.nextafter(1, 2) == eps + 1
        True
        >>> np.nextafter([1, 2], [2, 1]) == [eps + 1, 2 - eps]
        array([ True,  True])

    not_equal = <ufunc 'not_equal'>
        not_equal(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return (x1 != x2) element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Output array, element-wise comparison of `x1` and `x2`.
            Typically of type bool, unless ``dtype=object`` is passed.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        equal, greater, greater_equal, less, less_equal

        Examples
        --------
        >>> import numpy as np
        >>> np.not_equal([1.,2.], [1., 3.])
        array([False,  True])
        >>> np.not_equal([1, 2], [[1, 3],[1, 4]])
        array([[False,  True],
               [False,  True]])

        The ``!=`` operator can be used as a shorthand for ``np.not_equal`` on
        ndarrays.

        >>> a = np.array([1., 2.])
        >>> b = np.array([1., 3.])
        >>> a != b
        array([False,  True])

    ogrid = <numpy.lib._index_tricks_impl.OGridClass object>
    pi = 3.141592653589793
    positive = <ufunc 'positive'>
        positive(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Numerical positive, element-wise.

        .. versionadded:: 1.13.0

        Parameters
        ----------
        x : array_like or scalar
            Input array.

        Returns
        -------
        y : ndarray or scalar
            Returned array or scalar: `y = +x`.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        Equivalent to `x.copy()`, but only defined for types that support
        arithmetic.

        Examples
        --------
        >>> import numpy as np

        >>> x1 = np.array(([1., -1.]))
        >>> np.positive(x1)
        array([ 1., -1.])

        The unary ``+`` operator can be used as a shorthand for ``np.positive`` on
        ndarrays.

        >>> x1 = np.array(([1., -1.]))
        >>> +x1
        array([ 1., -1.])

    pow = <ufunc 'power'>
        power(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        First array elements raised to powers from second array, element-wise.

        Raise each base in `x1` to the positionally-corresponding power in
        `x2`.  `x1` and `x2` must be broadcastable to the same shape.

        An integer type raised to a negative integer power will raise a
        ``ValueError``.

        Negative values raised to a non-integral value will return ``nan``.
        To get complex results, cast the input to complex, or specify the
        ``dtype`` to be ``complex`` (see the example below).

        Parameters
        ----------
        x1 : array_like
            The bases.
        x2 : array_like
            The exponents.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The bases in `x1` raised to the exponents in `x2`.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        float_power : power function that promotes integers to float

        Examples
        --------
        >>> import numpy as np

        Cube each element in an array.

        >>> x1 = np.arange(6)
        >>> x1
        [0, 1, 2, 3, 4, 5]
        >>> np.power(x1, 3)
        array([  0,   1,   8,  27,  64, 125])

        Raise the bases to different exponents.

        >>> x2 = [1.0, 2.0, 3.0, 3.0, 2.0, 1.0]
        >>> np.power(x1, x2)
        array([  0.,   1.,   8.,  27.,  16.,   5.])

        The effect of broadcasting.

        >>> x2 = np.array([[1, 2, 3, 3, 2, 1], [1, 2, 3, 3, 2, 1]])
        >>> x2
        array([[1, 2, 3, 3, 2, 1],
               [1, 2, 3, 3, 2, 1]])
        >>> np.power(x1, x2)
        array([[ 0,  1,  8, 27, 16,  5],
               [ 0,  1,  8, 27, 16,  5]])

        The ``**`` operator can be used as a shorthand for ``np.power`` on
        ndarrays.

        >>> x2 = np.array([1, 2, 3, 3, 2, 1])
        >>> x1 = np.arange(6)
        >>> x1 ** x2
        array([ 0,  1,  8, 27, 16,  5])

        Negative values raised to a non-integral value will result in ``nan``
        (and a warning will be generated).

        >>> x3 = np.array([-1.0, -4.0])
        >>> with np.errstate(invalid='ignore'):
        ...     p = np.power(x3, 1.5)
        ...
        >>> p
        array([nan, nan])

        To get complex results, give the argument ``dtype=complex``.

        >>> np.power(x3, 1.5, dtype=complex)
        array([-1.83697020e-16-1.j, -1.46957616e-15-8.j])

    power = <ufunc 'power'>
        power(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        First array elements raised to powers from second array, element-wise.

        Raise each base in `x1` to the positionally-corresponding power in
        `x2`.  `x1` and `x2` must be broadcastable to the same shape.

        An integer type raised to a negative integer power will raise a
        ``ValueError``.

        Negative values raised to a non-integral value will return ``nan``.
        To get complex results, cast the input to complex, or specify the
        ``dtype`` to be ``complex`` (see the example below).

        Parameters
        ----------
        x1 : array_like
            The bases.
        x2 : array_like
            The exponents.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The bases in `x1` raised to the exponents in `x2`.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        float_power : power function that promotes integers to float

        Examples
        --------
        >>> import numpy as np

        Cube each element in an array.

        >>> x1 = np.arange(6)
        >>> x1
        [0, 1, 2, 3, 4, 5]
        >>> np.power(x1, 3)
        array([  0,   1,   8,  27,  64, 125])

        Raise the bases to different exponents.

        >>> x2 = [1.0, 2.0, 3.0, 3.0, 2.0, 1.0]
        >>> np.power(x1, x2)
        array([  0.,   1.,   8.,  27.,  16.,   5.])

        The effect of broadcasting.

        >>> x2 = np.array([[1, 2, 3, 3, 2, 1], [1, 2, 3, 3, 2, 1]])
        >>> x2
        array([[1, 2, 3, 3, 2, 1],
               [1, 2, 3, 3, 2, 1]])
        >>> np.power(x1, x2)
        array([[ 0,  1,  8, 27, 16,  5],
               [ 0,  1,  8, 27, 16,  5]])

        The ``**`` operator can be used as a shorthand for ``np.power`` on
        ndarrays.

        >>> x2 = np.array([1, 2, 3, 3, 2, 1])
        >>> x1 = np.arange(6)
        >>> x1 ** x2
        array([ 0,  1,  8, 27, 16,  5])

        Negative values raised to a non-integral value will result in ``nan``
        (and a warning will be generated).

        >>> x3 = np.array([-1.0, -4.0])
        >>> with np.errstate(invalid='ignore'):
        ...     p = np.power(x3, 1.5)
        ...
        >>> p
        array([nan, nan])

        To get complex results, give the argument ``dtype=complex``.

        >>> np.power(x3, 1.5, dtype=complex)
        array([-1.83697020e-16-1.j, -1.46957616e-15-8.j])

    r_ = <numpy.lib._index_tricks_impl.RClass object>
    rad2deg = <ufunc 'rad2deg'>
        rad2deg(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Convert angles from radians to degrees.

        Parameters
        ----------
        x : array_like
            Angle in radians.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The corresponding angle in degrees.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        deg2rad : Convert angles from degrees to radians.
        unwrap : Remove large jumps in angle by wrapping.

        Notes
        -----
        .. versionadded:: 1.3.0

        rad2deg(x) is ``180 * x / pi``.

        Examples
        --------
        >>> import numpy as np
        >>> np.rad2deg(np.pi/2)
        90.0

    radians = <ufunc 'radians'>
        radians(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Convert angles from degrees to radians.

        Parameters
        ----------
        x : array_like
            Input array in degrees.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The corresponding radian values.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        deg2rad : equivalent function

        Examples
        --------
        >>> import numpy as np

        Convert a degree array to radians

        >>> deg = np.arange(12.) * 30.
        >>> np.radians(deg)
        array([ 0.        ,  0.52359878,  1.04719755,  1.57079633,  2.0943951 ,
                2.61799388,  3.14159265,  3.66519143,  4.1887902 ,  4.71238898,
                5.23598776,  5.75958653])

        >>> out = np.zeros((deg.shape))
        >>> ret = np.radians(deg, out)
        >>> ret is out
        True

    reciprocal = <ufunc 'reciprocal'>
        reciprocal(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the reciprocal of the argument, element-wise.

        Calculates ``1/x``.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            Return array.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        .. note::
            This function is not designed to work with integers.

        For integer arguments with absolute value larger than 1 the result is
        always zero because of the way Python handles integer division.  For
        integer zero the result is an overflow.

        Examples
        --------
        >>> import numpy as np
        >>> np.reciprocal(2.)
        0.5
        >>> np.reciprocal([1, 2., 3.33])
        array([ 1.       ,  0.5      ,  0.3003003])

    remainder = <ufunc 'remainder'>
        remainder(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Returns the element-wise remainder of division.

        Computes the remainder complementary to the `floor_divide` function.  It is
        equivalent to the Python modulus operator ``x1 % x2`` and has the same sign
        as the divisor `x2`. The MATLAB function equivalent to ``np.remainder``
        is ``mod``.

        .. warning::

            This should not be confused with:

            * Python 3.7's `math.remainder` and C's ``remainder``, which
              computes the IEEE remainder, which are the complement to
              ``round(x1 / x2)``.
            * The MATLAB ``rem`` function and or the C ``%`` operator which is the
              complement to ``int(x1 / x2)``.

        Parameters
        ----------
        x1 : array_like
            Dividend array.
        x2 : array_like
            Divisor array.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The element-wise remainder of the quotient ``floor_divide(x1, x2)``.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        floor_divide : Equivalent of Python ``//`` operator.
        divmod : Simultaneous floor division and remainder.
        fmod : Equivalent of the MATLAB ``rem`` function.
        divide, floor

        Notes
        -----
        Returns 0 when `x2` is 0 and both `x1` and `x2` are (arrays of)
        integers.
        ``mod`` is an alias of ``remainder``.

        Examples
        --------
        >>> import numpy as np
        >>> np.remainder([4, 7], [2, 3])
        array([0, 1])
        >>> np.remainder(np.arange(7), 5)
        array([0, 1, 2, 3, 4, 0, 1])

        The ``%`` operator can be used as a shorthand for ``np.remainder`` on
        ndarrays.

        >>> x1 = np.arange(7)
        >>> x1 % 5
        array([0, 1, 2, 3, 4, 0, 1])

    right_shift = <ufunc 'right_shift'>
        right_shift(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Shift the bits of an integer to the right.

        Bits are shifted to the right `x2`.  Because the internal
        representation of numbers is in binary format, this operation is
        equivalent to dividing `x1` by ``2**x2``.

        Parameters
        ----------
        x1 : array_like, int
            Input values.
        x2 : array_like, int
            Number of bits to remove at the right of `x1`.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray, int
            Return `x1` with bits shifted `x2` times to the right.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        left_shift : Shift the bits of an integer to the left.
        binary_repr : Return the binary representation of the input number
            as a string.

        Examples
        --------
        >>> import numpy as np
        >>> np.binary_repr(10)
        '1010'
        >>> np.right_shift(10, 1)
        5
        >>> np.binary_repr(5)
        '101'

        >>> np.right_shift(10, [1,2,3])
        array([5, 2, 1])

        The ``>>`` operator can be used as a shorthand for ``np.right_shift`` on
        ndarrays.

        >>> x1 = 10
        >>> x2 = np.array([1,2,3])
        >>> x1 >> x2
        array([5, 2, 1])

    rint = <ufunc 'rint'>
        rint(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Round elements of the array to the nearest integer.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Output array is same shape and type as `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        fix, ceil, floor, trunc

        Notes
        -----
        For values exactly halfway between rounded decimal values, NumPy
        rounds to the nearest even value. Thus 1.5 and 2.5 round to 2.0,
        -0.5 and 0.5 round to 0.0, etc.

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
        >>> np.rint(a)
        array([-2., -2., -0.,  0.,  2.,  2.,  2.])

    s_ = <numpy.lib._index_tricks_impl.IndexExpression object>
    sctypeDict = {'a': <class 'numpy.bytes_'>, 'bool': <class 'numpy.bool'...
    sign = <ufunc 'sign'>
        sign(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Returns an element-wise indication of the sign of a number.

        The `sign` function returns ``-1 if x < 0, 0 if x==0, 1 if x > 0``.  nan
        is returned for nan inputs.

        For complex inputs, the `sign` function returns ``x / abs(x)``, the
        generalization of the above (and ``0 if x==0``).

        .. versionchanged:: 2.0.0
            Definition of complex sign changed to follow the Array API standard.

        Parameters
        ----------
        x : array_like
            Input values.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The sign of `x`.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        There is more than one definition of sign in common use for complex
        numbers.  The definition used here, :math:`x/|x|`, is the more common
        and useful one, but is different from the one used in numpy prior to
        version 2.0, :math:`x/\sqrt{x*x}`, which is equivalent to
        ``sign(x.real) + 0j if x.real != 0 else sign(x.imag) + 0j``.

        Examples
        --------
        >>> import numpy as np
        >>> np.sign([-5., 4.5])
        array([-1.,  1.])
        >>> np.sign(0)
        0
        >>> np.sign([3-4j, 8j])
        array([0.6-0.8j, 0. +1.j ])

    signbit = <ufunc 'signbit'>
        signbit(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Returns element-wise True where signbit is set (less than zero).

        Parameters
        ----------
        x : array_like
            The input value(s).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        result : ndarray of bool
            Output array, or reference to `out` if that was supplied.
            This is a scalar if `x` is a scalar.

        Examples
        --------
        >>> import numpy as np
        >>> np.signbit(-1.2)
        True
        >>> np.signbit(np.array([1, -2.3, 2.1]))
        array([False,  True, False])

    sin = <ufunc 'sin'>
        sin(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Trigonometric sine, element-wise.

        Parameters
        ----------
        x : array_like
            Angle, in radians (:math:`2 \pi` rad equals 360 degrees).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : array_like
            The sine of each element of x.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        arcsin, sinh, cos

        Notes
        -----
        The sine is one of the fundamental functions of trigonometry (the
        mathematical study of triangles).  Consider a circle of radius 1
        centered on the origin.  A ray comes in from the :math:`+x` axis, makes
        an angle at the origin (measured counter-clockwise from that axis), and
        departs from the origin.  The :math:`y` coordinate of the outgoing
        ray's intersection with the unit circle is the sine of that angle.  It
        ranges from -1 for :math:`x=3\pi / 2` to +1 for :math:`\pi / 2.`  The
        function has zeroes where the angle is a multiple of :math:`\pi`.
        Sines of angles between :math:`\pi` and :math:`2\pi` are negative.
        The numerous properties of the sine and related functions are included
        in any standard trigonometry text.

        Examples
        --------
        >>> import numpy as np

        Print sine of one angle:

        >>> np.sin(np.pi/2.)
        1.0

        Print sines of an array of angles given in degrees:

        >>> np.sin(np.array((0., 30., 45., 60., 90.)) * np.pi / 180. )
        array([ 0.        ,  0.5       ,  0.70710678,  0.8660254 ,  1.        ])

        Plot the sine function:

        >>> import matplotlib.pylab as plt
        >>> x = np.linspace(-np.pi, np.pi, 201)
        >>> plt.plot(x, np.sin(x))
        >>> plt.xlabel('Angle [rad]')
        >>> plt.ylabel('sin(x)')
        >>> plt.axis('tight')
        >>> plt.show()

    sinh = <ufunc 'sinh'>
        sinh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Hyperbolic sine, element-wise.

        Equivalent to ``1/2 * (np.exp(x) - np.exp(-x))`` or
        ``-1j * np.sin(1j*x)``.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The corresponding hyperbolic sine values.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        If `out` is provided, the function writes the result into it,
        and returns a reference to `out`.  (See Examples)

        References
        ----------
        M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions.
        New York, NY: Dover, 1972, pg. 83.

        Examples
        --------
        >>> import numpy as np
        >>> np.sinh(0)
        0.0
        >>> np.sinh(np.pi*1j/2)
        1j
        >>> np.sinh(np.pi*1j) # (exact value is 0)
        1.2246063538223773e-016j
        >>> # Discrepancy due to vagaries of floating point arithmetic.

        >>> # Example of providing the optional output parameter
        >>> out1 = np.array([0], dtype='d')
        >>> out2 = np.sinh([0.1], out1)
        >>> out2 is out1
        True

        >>> # Example of ValueError due to provision of shape mis-matched `out`
        >>> np.sinh(np.zeros((3,3)),np.zeros((2,2)))
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ValueError: operands could not be broadcast together with shapes (3,3) (2,2)

    spacing = <ufunc 'spacing'>
        spacing(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the distance between x and the nearest adjacent number.

        Parameters
        ----------
        x : array_like
            Values to find the spacing of.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            The spacing of values of `x`.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        It can be considered as a generalization of EPS:
        ``spacing(np.float64(1)) == np.finfo(np.float64).eps``, and there
        should not be any representable number between ``x + spacing(x)`` and
        x for any finite x.

        Spacing of +- inf and NaN is NaN.

        Examples
        --------
        >>> import numpy as np
        >>> np.spacing(1) == np.finfo(np.float64).eps
        True

    sqrt = <ufunc 'sqrt'>
        sqrt(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the non-negative square-root of an array, element-wise.

        Parameters
        ----------
        x : array_like
            The values whose square-roots are required.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            An array of the same shape as `x`, containing the positive
            square-root of each element in `x`.  If any element in `x` is
            complex, a complex array is returned (and the square-roots of
            negative reals are calculated).  If all of the elements in `x`
            are real, so is `y`, with negative elements returning ``nan``.
            If `out` was provided, `y` is a reference to it.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        emath.sqrt
            A version which returns complex numbers when given negative reals.
            Note that 0.0 and -0.0 are handled differently for complex inputs.

        Notes
        -----
        *sqrt* has--consistent with common convention--as its branch cut the
        real "interval" [`-inf`, 0), and is continuous from above on it.
        A branch cut is a curve in the complex plane across which a given
        complex function fails to be continuous.

        Examples
        --------
        >>> import numpy as np
        >>> np.sqrt([1,4,9])
        array([ 1.,  2.,  3.])

        >>> np.sqrt([4, -1, -3+4J])
        array([ 2.+0.j,  0.+1.j,  1.+2.j])

        >>> np.sqrt([4, -1, np.inf])
        array([ 2., nan, inf])

    square = <ufunc 'square'>
        square(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the element-wise square of the input.

        Parameters
        ----------
        x : array_like
            Input data.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        out : ndarray or scalar
            Element-wise `x*x`, of the same shape and dtype as `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        numpy.linalg.matrix_power
        sqrt
        power

        Examples
        --------
        >>> import numpy as np
        >>> np.square([-1j, 1])
        array([-1.-0.j,  1.+0.j])

    subtract = <ufunc 'subtract'>
        subtract(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Subtract arguments, element-wise.

        Parameters
        ----------
        x1, x2 : array_like
            The arrays to be subtracted from each other.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The difference of `x1` and `x2`, element-wise.
            This is a scalar if both `x1` and `x2` are scalars.

        Notes
        -----
        Equivalent to ``x1 - x2`` in terms of array broadcasting.

        Examples
        --------
        >>> import numpy as np
        >>> np.subtract(1.0, 4.0)
        -3.0

        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = np.arange(3.0)
        >>> np.subtract(x1, x2)
        array([[ 0.,  0.,  0.],
               [ 3.,  3.,  3.],
               [ 6.,  6.,  6.]])

        The ``-`` operator can be used as a shorthand for ``np.subtract`` on
        ndarrays.

        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = np.arange(3.0)
        >>> x1 - x2
        array([[0., 0., 0.],
               [3., 3., 3.],
               [6., 6., 6.]])

    tan = <ufunc 'tan'>
        tan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute tangent element-wise.

        Equivalent to ``np.sin(x)/np.cos(x)`` element-wise.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The corresponding tangent values.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        If `out` is provided, the function writes the result into it,
        and returns a reference to `out`.  (See Examples)

        References
        ----------
        M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions.
        New York, NY: Dover, 1972.

        Examples
        --------
        >>> import numpy as np
        >>> from math import pi
        >>> np.tan(np.array([-pi,pi/2,pi]))
        array([  1.22460635e-16,   1.63317787e+16,  -1.22460635e-16])
        >>>
        >>> # Example of providing the optional output parameter illustrating
        >>> # that what is returned is a reference to said parameter
        >>> out1 = np.array([0], dtype='d')
        >>> out2 = np.cos([0.1], out1)
        >>> out2 is out1
        True
        >>>
        >>> # Example of ValueError due to provision of shape mis-matched `out`
        >>> np.cos(np.zeros((3,3)),np.zeros((2,2)))
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ValueError: operands could not be broadcast together with shapes (3,3) (2,2)

    tanh = <ufunc 'tanh'>
        tanh(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Compute hyperbolic tangent element-wise.

        Equivalent to ``np.sinh(x)/np.cosh(x)`` or ``-1j * np.tan(1j*x)``.

        Parameters
        ----------
        x : array_like
            Input array.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The corresponding hyperbolic tangent values.
            This is a scalar if `x` is a scalar.

        Notes
        -----
        If `out` is provided, the function writes the result into it,
        and returns a reference to `out`.  (See Examples)

        References
        ----------
        .. [1] M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions.
               New York, NY: Dover, 1972, pg. 83.
               https://personal.math.ubc.ca/~cbm/aands/page_83.htm

        .. [2] Wikipedia, "Hyperbolic function",
               https://en.wikipedia.org/wiki/Hyperbolic_function

        Examples
        --------
        >>> import numpy as np
        >>> np.tanh((0, np.pi*1j, np.pi*1j/2))
        array([ 0. +0.00000000e+00j,  0. -1.22460635e-16j,  0. +1.63317787e+16j])

        >>> # Example of providing the optional output parameter illustrating
        >>> # that what is returned is a reference to said parameter
        >>> out1 = np.array([0], dtype='d')
        >>> out2 = np.tanh([0.1], out1)
        >>> out2 is out1
        True

        >>> # Example of ValueError due to provision of shape mis-matched `out`
        >>> np.tanh(np.zeros((3,3)),np.zeros((2,2)))
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ValueError: operands could not be broadcast together with shapes (3,3) (2,2)

    test = <numpy._pytesttester.PytestTester object>
    true_divide = <ufunc 'divide'>
        divide(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Divide arguments element-wise.

        Parameters
        ----------
        x1 : array_like
            Dividend array.
        x2 : array_like
            Divisor array.
            If ``x1.shape != x2.shape``, they must be broadcastable to a common
            shape (which becomes the shape of the output).
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The quotient ``x1/x2``, element-wise.
            This is a scalar if both `x1` and `x2` are scalars.

        See Also
        --------
        seterr : Set whether to raise or warn on overflow, underflow and
                 division by zero.

        Notes
        -----
        Equivalent to ``x1`` / ``x2`` in terms of array-broadcasting.

        The ``true_divide(x1, x2)`` function is an alias for
        ``divide(x1, x2)``.

        Examples
        --------
        >>> import numpy as np
        >>> np.divide(2.0, 4.0)
        0.5
        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = np.arange(3.0)
        >>> np.divide(x1, x2)
        array([[nan, 1. , 1. ],
               [inf, 4. , 2.5],
               [inf, 7. , 4. ]])

        The ``/`` operator can be used as a shorthand for ``np.divide`` on
        ndarrays.

        >>> x1 = np.arange(9.0).reshape((3, 3))
        >>> x2 = 2 * np.ones(3)
        >>> x1 / x2
        array([[0. , 0.5, 1. ],
               [1.5, 2. , 2.5],
               [3. , 3.5, 4. ]])

    trunc = <ufunc 'trunc'>
        trunc(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

        Return the truncated value of the input, element-wise.

        The truncated value of the scalar `x` is the nearest integer `i` which
        is closer to zero than `x` is. In short, the fractional part of the
        signed number `x` is discarded.

        Parameters
        ----------
        x : array_like
            Input data.
        out : ndarray, None, or tuple of ndarray and None, optional
            A location into which the result is stored. If provided, it must have
            a shape that the inputs broadcast to. If not provided or None,
            a freshly-allocated array is returned. A tuple (possible only as a
            keyword argument) must have length equal to the number of outputs.
        where : array_like, optional
            This condition is broadcast over the input. At locations where the
            condition is True, the `out` array will be set to the ufunc result.
            Elsewhere, the `out` array will retain its original value.
            Note that if an uninitialized `out` array is created via the default
            ``out=None``, locations within it where the condition is False will
            remain uninitialized.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray or scalar
            The truncated value of each element in `x`.
            This is a scalar if `x` is a scalar.

        See Also
        --------
        ceil, floor, rint, fix

        Notes
        -----
        .. versionadded:: 1.3.0

        Examples
        --------
        >>> import numpy as np
        >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
        >>> np.trunc(a)
        array([-1., -1., -0.,  0.,  1.,  1.,  2.])

    typecodes = {'All': '?bhilqnpBHILQNPefdgFDGSUVOMm', 'AllFloat': 'efdgF...
    vecdot = <ufunc 'vecdot'>
        vecdot(x1, x2, /, out=None, *, casting='same_kind', order='K', dtype=None, subok=True[, signature, axes, axis])

        Vector dot product of two arrays.

        Let :math:`\mathbf{a}` be a vector in `x1` and :math:`\mathbf{b}` be
        a corresponding vector in `x2`. The dot product is defined as:

        .. math::
           \mathbf{a} \cdot \mathbf{b} = \sum_{i=0}^{n-1} \overline{a_i}b_i

        where the sum is over the last dimension (unless `axis` is specified) and
        where :math:`\overline{a_i}` denotes the complex conjugate if :math:`a_i`
        is complex and the identity otherwise.

        Parameters
        ----------
        x1, x2 : array_like
            Input arrays, scalars not allowed.
        out : ndarray, optional
            A location into which the result is stored. If provided, it must have
            a shape that the broadcasted shape of `x1` and `x2` with the last axis
            removed. If not provided or None, a freshly-allocated array is used.
        **kwargs
            For other keyword-only arguments, see the
            :ref:`ufunc docs <ufuncs.kwargs>`.

        Returns
        -------
        y : ndarray
            The vector dot product of the inputs.
            This is a scalar only when both x1, x2 are 1-d vectors.

        Raises
        ------
        ValueError
            If the last dimension of `x1` is not the same size as
            the last dimension of `x2`.

            If a scalar value is passed in.

        See Also
        --------
        vdot : same but flattens arguments first
        einsum : Einstein summation convention.

        Examples
        --------
        >>> import numpy as np

        Get the projected size along a given normal for an array of vectors.

        >>> v = np.array([[0., 5., 0.], [0., 0., 10.], [0., 6., 8.]])
        >>> n = np.array([0., 0.6, 0.8])
        >>> np.vecdot(v, n)
        array([ 3.,  8., 10.])

        .. versionadded:: 2.0.0

VERSION
    2.1.3

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\numpy\__init__.py

nltk.os
Python Library Documentation: module os

NAME
    os - OS routines for NT or Posix depending on what system we're on.

MODULE REFERENCE
    https://docs.python.org/3.12/library/os.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION
    This exports:
      - all functions from posix or nt, e.g. unlink, stat, etc.
      - os.path is either posixpath or ntpath
      - os.name is either 'posix' or 'nt'
      - os.curdir is a string representing the current directory (always '.')
      - os.pardir is a string representing the parent directory (always '..')
      - os.sep is the (or a most common) pathname separator ('/' or '\\')
      - os.extsep is the extension separator (always '.')
      - os.altsep is the alternate pathname separator (None or '/')
      - os.pathsep is the component separator used in $PATH etc
      - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
      - os.defpath is the default search path for executables
      - os.devnull is the file path of the null device ('/dev/null', etc.)

    Programs that import and use 'os' stand a better chance of being
    portable between different platforms.  Of course, they must then
    only use functions that are defined by all platforms (e.g., unlink
    and opendir), and leave all pathname manipulation to os.path
    (e.g., split and join).

CLASSES
    builtins.Exception(builtins.BaseException)
        builtins.OSError
    builtins.object
        nt.DirEntry
    builtins.tuple(builtins.object)
        nt.times_result
        nt.uname_result
        stat_result
        statvfs_result
        terminal_size

    class DirEntry(builtins.object)
     |  Methods defined here:
     |
     |  __fspath__(self, /)
     |      Returns the path for the entry.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  inode(self, /)
     |      Return inode of the entry; cached per entry.
     |
     |  is_dir(self, /, *, follow_symlinks=True)
     |      Return True if the entry is a directory; cached per entry.
     |
     |  is_file(self, /, *, follow_symlinks=True)
     |      Return True if the entry is a file; cached per entry.
     |
     |  is_junction(self, /)
     |      Return True if the entry is a junction; cached per entry.
     |
     |  is_symlink(self, /)
     |      Return True if the entry is a symbolic link; cached per entry.
     |
     |  stat(self, /, *, follow_symlinks=True)
     |      Return stat_result object for the entry; cached per entry.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  name
     |      the entry's base filename, relative to scandir() "path" argument
     |
     |  path
     |      the entry's full path name; equivalent to os.path.join(scandir_path, entry.name)

    error = class OSError(Exception)
     |  Base class for I/O related errors.
     |
     |  Method resolution order:
     |      OSError
     |      Exception
     |      BaseException
     |      object
     |
     |  Built-in subclasses:
     |      BlockingIOError
     |      ChildProcessError
     |      ConnectionError
     |      FileExistsError
     |      ... and 7 other subclasses
     |
     |  Methods defined here:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  characters_written
     |
     |  errno
     |      POSIX exception code
     |
     |  filename
     |      exception filename
     |
     |  filename2
     |      second exception filename
     |
     |  strerror
     |      exception strerror
     |
     |  winerror
     |      Win32 exception code
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class stat_result(builtins.tuple)
     |  stat_result(iterable=(), /)
     |
     |  stat_result: Result from stat, fstat, or lstat.
     |
     |  This object may be accessed either as a tuple of
     |    (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)
     |  or via the attributes st_mode, st_ino, st_dev, st_nlink, st_uid, and so on.
     |
     |  Posix/windows: If your platform supports st_blksize, st_blocks, st_rdev,
     |  or st_flags, they are available as attributes only.
     |
     |  See os.stat for more information.
     |
     |  Method resolution order:
     |      stat_result
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  st_atime
     |      time of last access
     |
     |  st_atime_ns
     |      time of last access in nanoseconds
     |
     |  st_birthtime
     |      time of creation
     |
     |  st_birthtime_ns
     |      time of creation in nanoseconds
     |
     |  st_ctime
     |      time of last change
     |
     |  st_ctime_ns
     |      time of last change in nanoseconds
     |
     |  st_dev
     |      device
     |
     |  st_file_attributes
     |      Windows file attribute bits
     |
     |  st_gid
     |      group ID of owner
     |
     |  st_ino
     |      inode
     |
     |  st_mode
     |      protection bits
     |
     |  st_mtime
     |      time of last modification
     |
     |  st_mtime_ns
     |      time of last modification in nanoseconds
     |
     |  st_nlink
     |      number of hard links
     |
     |  st_reparse_tag
     |      Windows reparse tag
     |
     |  st_size
     |      total size, in bytes
     |
     |  st_uid
     |      user ID of owner
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('st_mode', 'st_ino', 'st_dev', 'st_nlink', 'st_uid',...
     |
     |  n_fields = 20
     |
     |  n_sequence_fields = 10
     |
     |  n_unnamed_fields = 3
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(self, /)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class statvfs_result(builtins.tuple)
     |  statvfs_result(iterable=(), /)
     |
     |  statvfs_result: Result from statvfs or fstatvfs.
     |
     |  This object may be accessed either as a tuple of
     |    (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax),
     |  or via the attributes f_bsize, f_frsize, f_blocks, f_bfree, and so on.
     |
     |  See os.statvfs for more information.
     |
     |  Method resolution order:
     |      statvfs_result
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  f_bavail
     |
     |  f_bfree
     |
     |  f_blocks
     |
     |  f_bsize
     |
     |  f_favail
     |
     |  f_ffree
     |
     |  f_files
     |
     |  f_flag
     |
     |  f_frsize
     |
     |  f_fsid
     |
     |  f_namemax
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('f_bsize', 'f_frsize', 'f_blocks', 'f_bfree', 'f_bav...
     |
     |  n_fields = 11
     |
     |  n_sequence_fields = 10
     |
     |  n_unnamed_fields = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(self, /)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class terminal_size(builtins.tuple)
     |  terminal_size(iterable=(), /)
     |
     |  A tuple of (columns, lines) for holding terminal window size
     |
     |  Method resolution order:
     |      terminal_size
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  columns
     |      width of the terminal window in characters
     |
     |  lines
     |      height of the terminal window in characters
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('columns', 'lines')
     |
     |  n_fields = 2
     |
     |  n_sequence_fields = 2
     |
     |  n_unnamed_fields = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(self, /)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class times_result(builtins.tuple)
     |  times_result(iterable=(), /)
     |
     |  times_result: Result from os.times().
     |
     |  This object may be accessed either as a tuple of
     |    (user, system, children_user, children_system, elapsed),
     |  or via the attributes user, system, children_user, children_system,
     |  and elapsed.
     |
     |  See os.times for more information.
     |
     |  Method resolution order:
     |      times_result
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  children_system
     |      system time of children
     |
     |  children_user
     |      user time of children
     |
     |  elapsed
     |      elapsed time since an arbitrary point in the past
     |
     |  system
     |      system time
     |
     |  user
     |      user time
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('user', 'system', 'children_user', 'children_system'...
     |
     |  n_fields = 5
     |
     |  n_sequence_fields = 5
     |
     |  n_unnamed_fields = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(self, /)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

    class uname_result(builtins.tuple)
     |  uname_result(iterable=(), /)
     |
     |  uname_result: Result from os.uname().
     |
     |  This object may be accessed either as a tuple of
     |    (sysname, nodename, release, version, machine),
     |  or via the attributes sysname, nodename, release, version, and machine.
     |
     |  See os.uname for more information.
     |
     |  Method resolution order:
     |      uname_result
     |      builtins.tuple
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  __new__(*args, **kwargs)
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  machine
     |      hardware identifier
     |
     |  nodename
     |      name of machine on network (implementation-defined)
     |
     |  release
     |      operating system release
     |
     |  sysname
     |      operating system name
     |
     |  version
     |      operating system version
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __match_args__ = ('sysname', 'nodename', 'release', 'version', 'machin...
     |
     |  n_fields = 5
     |
     |  n_sequence_fields = 5
     |
     |  n_unnamed_fields = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.tuple:
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __getnewargs__(self, /)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.tuple:
     |
     |  __class_getitem__(...)
     |      See PEP 585

FUNCTIONS
    _exit(status)
        Exit to the system with specified status, without normal exit processing.

    abort()
        Abort the interpreter immediately.

        This function 'dumps core' or otherwise fails in the hardest way possible
        on the hosting operating system.  This function never returns.

    access(path, mode, *, dir_fd=None, effective_ids=False, follow_symlinks=True)
        Use the real uid/gid to test for access to a path.

          path
            Path to be tested; can be string, bytes, or a path-like object.
          mode
            Operating-system mode bitfield.  Can be F_OK to test existence,
            or the inclusive-OR of R_OK, W_OK, and X_OK.
          dir_fd
            If not None, it should be a file descriptor open to a directory,
            and path should be relative; path will then be relative to that
            directory.
          effective_ids
            If True, access will use the effective uid/gid instead of
            the real uid/gid.
          follow_symlinks
            If False, and the last element of the path is a symbolic link,
            access will examine the symbolic link itself instead of the file
            the link points to.

        dir_fd, effective_ids, and follow_symlinks may not be implemented
          on your platform.  If they are unavailable, using them will raise a
          NotImplementedError.

        Note that most operations will use the effective uid/gid, therefore this
          routine can be used in a suid/sgid environment to test if the invoking user
          has the specified access to the path.

    chdir(path)
        Change the current working directory to the specified path.

        path may always be specified as a string.
        On some platforms, path may also be specified as an open file descriptor.
          If this functionality is unavailable, using it raises an exception.

    chmod(path, mode, *, dir_fd=None, follow_symlinks=True)
        Change the access permissions of a file.

          path
            Path to be modified.  May always be specified as a str, bytes, or a path-like object.
            On some platforms, path may also be specified as an open file descriptor.
            If this functionality is unavailable, using it raises an exception.
          mode
            Operating-system mode bitfield.
            Be careful when using number literals for *mode*. The conventional UNIX notation for
            numeric modes uses an octal base, which needs to be indicated with a ``0o`` prefix in
            Python.
          dir_fd
            If not None, it should be a file descriptor open to a directory,
            and path should be relative; path will then be relative to that
            directory.
          follow_symlinks
            If False, and the last element of the path is a symbolic link,
            chmod will modify the symbolic link itself instead of the file
            the link points to.

        It is an error to use dir_fd or follow_symlinks when specifying path as
          an open file descriptor.
        dir_fd and follow_symlinks may not be implemented on your platform.
          If they are unavailable, using them will raise a NotImplementedError.

    close(fd)
        Close a file descriptor.

    closerange(fd_low, fd_high, /)
        Closes all file descriptors in [fd_low, fd_high), ignoring errors.

    cpu_count()
        Return the number of CPUs in the system; return None if indeterminable.

        This number is not equivalent to the number of CPUs the current process can
        use.  The number of usable CPUs can be obtained with
        ``len(os.sched_getaffinity(0))``

    device_encoding(fd)
        Return a string describing the encoding of a terminal's file descriptor.

        The file descriptor must be attached to a terminal.
        If the device is not a terminal, return None.

    dup(fd, /)
        Return a duplicate of a file descriptor.

    dup2(fd, fd2, inheritable=True)
        Duplicate file descriptor.

    execl(file, *args)
        execl(file, *args)

        Execute the executable file with argument list args, replacing the
        current process.

    execle(file, *args)
        execle(file, *args, env)

        Execute the executable file with argument list args and
        environment env, replacing the current process.

    execlp(file, *args)
        execlp(file, *args)

        Execute the executable file (which is searched for along $PATH)
        with argument list args, replacing the current process.

    execlpe(file, *args)
        execlpe(file, *args, env)

        Execute the executable file (which is searched for along $PATH)
        with argument list args and environment env, replacing the current
        process.

    execv(path, argv, /)
        Execute an executable path with arguments, replacing current process.

        path
          Path of executable file.
        argv
          Tuple or list of strings.

    execve(path, argv, env)
        Execute an executable path with arguments, replacing current process.

        path
          Path of executable file.
        argv
          Tuple or list of strings.
        env
          Dictionary of strings mapping to strings.

    execvp(file, args)
        execvp(file, args)

        Execute the executable file (which is searched for along $PATH)
        with argument list args, replacing the current process.
        args may be a list or tuple of strings.

    execvpe(file, args, env)
        execvpe(file, args, env)

        Execute the executable file (which is searched for along $PATH)
        with argument list args and environment env, replacing the
        current process.
        args may be a list or tuple of strings.

    fdopen(fd, mode='r', buffering=-1, encoding=None, *args, **kwargs)

    fsdecode(filename)
        Decode filename (an os.PathLike, bytes, or str) from the filesystem
        encoding with 'surrogateescape' error handler, return str unchanged. On
        Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).

    fsencode(filename)
        Encode filename (an os.PathLike, bytes, or str) to the filesystem
        encoding with 'surrogateescape' error handler, return bytes unchanged.
        On Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).

    fspath(path)
        Return the file system path representation of the object.

        If the object is str or bytes, then allow it to pass through as-is. If the
        object defines __fspath__(), then return the result of that method. All other
        types raise a TypeError.

    fstat(fd)
        Perform a stat system call on the given file descriptor.

        Like stat(), but for an open file descriptor.
        Equivalent to os.stat(fd).

    fsync(fd)
        Force write of fd to disk.

    ftruncate(fd, length, /)
        Truncate a file, specified by file descriptor, to a specific length.

    get_blocking(fd, /)
        Get the blocking mode of the file descriptor.

        Return False if the O_NONBLOCK flag is set, True if the flag is cleared.

    get_exec_path(env=None)
        Returns the sequence of directories that will be searched for the
        named executable (similar to a shell) when launching a process.

        *env* must be an environment variable dict or None.  If *env* is None,
        os.environ will be used.

    get_handle_inheritable(handle, /)
        Get the close-on-exe flag of the specified file descriptor.

    get_inheritable(fd, /)
        Get the close-on-exe flag of the specified file descriptor.

    get_terminal_size(...)
        Return the size of the terminal window as (columns, lines).

        The optional argument fd (default standard output) specifies
        which file descriptor should be queried.

        If the file descriptor is not connected to a terminal, an OSError
        is thrown.

        This function will only be defined if an implementation is
        available for this system.

        shutil.get_terminal_size is the high-level function which should
        normally be used, os.get_terminal_size is the low-level implementation.

    getcwd()
        Return a unicode string representing the current working directory.

    getcwdb()
        Return a bytes string representing the current working directory.

    getenv(key, default=None)
        Get an environment variable, return None if it doesn't exist.
        The optional second argument can specify an alternate default.
        key, default and the result are str.

    getlogin()
        Return the actual login name.

    getpid()
        Return the current process id.

    getppid()
        Return the parent's process id.

        If the parent process has already exited, Windows machines will still
        return its id; others systems will return the id of the 'init' process (1).

    isatty(fd, /)
        Return True if the fd is connected to a terminal.

        Return True if the file descriptor is an open file descriptor
        connected to the slave end of a terminal.

    kill(pid, signal, /)
        Kill a process with a signal.

    link(src, dst, *, src_dir_fd=None, dst_dir_fd=None, follow_symlinks=True)
        Create a hard link to a file.

        If either src_dir_fd or dst_dir_fd is not None, it should be a file
          descriptor open to a directory, and the respective path string (src or dst)
          should be relative; the path will then be relative to that directory.
        If follow_symlinks is False, and the last element of src is a symbolic
          link, link will create a link to the symbolic link itself instead of the
          file the link points to.
        src_dir_fd, dst_dir_fd, and follow_symlinks may not be implemented on your
          platform.  If they are unavailable, using them will raise a
          NotImplementedError.

    listdir(path=None)
        Return a list containing the names of the files in the directory.

        path can be specified as either str, bytes, or a path-like object.  If path is bytes,
          the filenames returned will also be bytes; in all other circumstances
          the filenames returned will be str.
        If path is None, uses the path='.'.
        On some platforms, path may also be specified as an open file descriptor;\
          the file descriptor must refer to a directory.
          If this functionality is unavailable, using it raises NotImplementedError.

        The list is in arbitrary order.  It does not include the special
        entries '.' and '..' even if they are present in the directory.

    listdrives()
        Return a list containing the names of drives in the system.

        A drive name typically looks like 'C:\\'.

    listmounts(volume)
        Return a list containing mount points for a particular volume.

        'volume' should be a GUID path as returned from os.listvolumes.

    listvolumes()
        Return a list containing the volumes in the system.

        Volumes are typically represented as a GUID path.

    lseek(fd, position, whence, /)
        Set the position of a file descriptor.  Return the new position.

          fd
            An open file descriptor, as returned by os.open().
          position
            Position, interpreted relative to 'whence'.
          whence
            The relative position to seek from. Valid values are:
            - SEEK_SET: seek from the start of the file.
            - SEEK_CUR: seek from the current file position.
            - SEEK_END: seek from the end of the file.

        The return value is the number of bytes relative to the beginning of the file.

    lstat(path, *, dir_fd=None)
        Perform a stat system call on the given path, without following symbolic links.

        Like stat(), but do not follow symbolic links.
        Equivalent to stat(path, follow_symlinks=False).

    makedirs(name, mode=511, exist_ok=False)
        makedirs(name [, mode=0o777][, exist_ok=False])

        Super-mkdir; create a leaf directory and all intermediate ones.  Works like
        mkdir, except that any intermediate path segment (not just the rightmost)
        will be created if it does not exist. If the target directory already
        exists, raise an OSError if exist_ok is False. Otherwise no exception is
        raised.  This is recursive.

    mkdir(path, mode=511, *, dir_fd=None)
        Create a directory.

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and path should be relative; path will then be relative to that directory.
        dir_fd may not be implemented on your platform.
          If it is unavailable, using it will raise a NotImplementedError.

        The mode argument is ignored on Windows. Where it is used, the current umask
        value is first masked out.

    open(path, flags, mode=511, *, dir_fd=None)
        Open a file for low level IO.  Returns a file descriptor (integer).

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and path should be relative; path will then be relative to that directory.
        dir_fd may not be implemented on your platform.
          If it is unavailable, using it will raise a NotImplementedError.

    pipe()
        Create a pipe.

        Returns a tuple of two file descriptors:
          (read_fd, write_fd)

    popen(cmd, mode='r', buffering=-1)

    putenv(name, value, /)
        Change or add an environment variable.

    read(fd, length, /)
        Read from a file descriptor.  Returns a bytes object.

    readlink(path, *, dir_fd=None)
        Return a string representing the path to which the symbolic link points.

        If dir_fd is not None, it should be a file descriptor open to a directory,
        and path should be relative; path will then be relative to that directory.

        dir_fd may not be implemented on your platform.  If it is unavailable,
        using it will raise a NotImplementedError.

    remove(path, *, dir_fd=None)
        Remove a file (same as unlink()).

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and path should be relative; path will then be relative to that directory.
        dir_fd may not be implemented on your platform.
          If it is unavailable, using it will raise a NotImplementedError.

    removedirs(name)
        removedirs(name)

        Super-rmdir; remove a leaf directory and all empty intermediate
        ones.  Works like rmdir except that, if the leaf directory is
        successfully removed, directories corresponding to rightmost path
        segments will be pruned away until either the whole path is
        consumed or an error occurs.  Errors during this latter phase are
        ignored -- they generally mean that a directory was not empty.

    rename(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
        Rename a file or directory.

        If either src_dir_fd or dst_dir_fd is not None, it should be a file
          descriptor open to a directory, and the respective path string (src or dst)
          should be relative; the path will then be relative to that directory.
        src_dir_fd and dst_dir_fd, may not be implemented on your platform.
          If they are unavailable, using them will raise a NotImplementedError.

    renames(old, new)
        renames(old, new)

        Super-rename; create directories as necessary and delete any left
        empty.  Works like rename, except creation of any intermediate
        directories needed to make the new pathname good is attempted
        first.  After the rename, directories corresponding to rightmost
        path segments of the old name will be pruned until either the
        whole path is consumed or a nonempty directory is found.

        Note: this function can fail with the new directory structure made
        if you lack permissions needed to unlink the leaf directory or
        file.

    replace(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
        Rename a file or directory, overwriting the destination.

        If either src_dir_fd or dst_dir_fd is not None, it should be a file
          descriptor open to a directory, and the respective path string (src or dst)
          should be relative; the path will then be relative to that directory.
        src_dir_fd and dst_dir_fd, may not be implemented on your platform.
          If they are unavailable, using them will raise a NotImplementedError.

    rmdir(path, *, dir_fd=None)
        Remove a directory.

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and path should be relative; path will then be relative to that directory.
        dir_fd may not be implemented on your platform.
          If it is unavailable, using it will raise a NotImplementedError.

    scandir(path=None)
        Return an iterator of DirEntry objects for given path.

        path can be specified as either str, bytes, or a path-like object.  If path
        is bytes, the names of yielded DirEntry objects will also be bytes; in
        all other circumstances they will be str.

        If path is None, uses the path='.'.

    set_blocking(fd, blocking, /)
        Set the blocking mode of the specified file descriptor.

        Set the O_NONBLOCK flag if blocking is False,
        clear the O_NONBLOCK flag otherwise.

    set_handle_inheritable(handle, inheritable, /)
        Set the inheritable flag of the specified handle.

    set_inheritable(fd, inheritable, /)
        Set the inheritable flag of the specified file descriptor.

    spawnl(mode, file, *args)
        spawnl(mode, file, *args) -> integer

        Execute file with arguments from args in a subprocess.
        If mode == P_NOWAIT return the pid of the process.
        If mode == P_WAIT return the process's exit code if it exits normally;
        otherwise return -SIG, where SIG is the signal that killed it.

    spawnle(mode, file, *args)
        spawnle(mode, file, *args, env) -> integer

        Execute file with arguments from args in a subprocess with the
        supplied environment.
        If mode == P_NOWAIT return the pid of the process.
        If mode == P_WAIT return the process's exit code if it exits normally;
        otherwise return -SIG, where SIG is the signal that killed it.

    spawnv(mode, path, argv, /)
        Execute the program specified by path in a new process.

        mode
          Mode of process creation.
        path
          Path of executable file.
        argv
          Tuple or list of strings.

    spawnve(mode, path, argv, env, /)
        Execute the program specified by path in a new process.

        mode
          Mode of process creation.
        path
          Path of executable file.
        argv
          Tuple or list of strings.
        env
          Dictionary of strings mapping to strings.

    startfile(...)
        Start a file with its associated application.

        When "operation" is not specified or "open", this acts like
        double-clicking the file in Explorer, or giving the file name as an
        argument to the DOS "start" command: the file is opened with whatever
        application (if any) its extension is associated.
        When another "operation" is given, it specifies what should be done with
        the file.  A typical operation is "print".

        "arguments" is passed to the application, but should be omitted if the
        file is a document.

        "cwd" is the working directory for the operation. If "filepath" is
        relative, it will be resolved against this directory. This argument
        should usually be an absolute path.

        "show_cmd" can be used to override the recommended visibility option.
        See the Windows ShellExecute documentation for values.

        startfile returns as soon as the associated application is launched.
        There is no option to wait for the application to close, and no way
        to retrieve the application's exit status.

        The filepath is relative to the current directory.  If you want to use
        an absolute path, make sure the first character is not a slash ("/");
        the underlying Win32 ShellExecute function doesn't work if it is.

    stat(path, *, dir_fd=None, follow_symlinks=True)
        Perform a stat system call on the given path.

          path
            Path to be examined; can be string, bytes, a path-like object or
            open-file-descriptor int.
          dir_fd
            If not None, it should be a file descriptor open to a directory,
            and path should be a relative string; path will then be relative to
            that directory.
          follow_symlinks
            If False, and the last element of the path is a symbolic link,
            stat will examine the symbolic link itself instead of the file
            the link points to.

        dir_fd and follow_symlinks may not be implemented
          on your platform.  If they are unavailable, using them will raise a
          NotImplementedError.

        It's an error to use dir_fd or follow_symlinks when specifying path as
          an open file descriptor.

    strerror(code, /)
        Translate an error code to a message string.

    symlink(src, dst, target_is_directory=False, *, dir_fd=None)
        Create a symbolic link pointing to src named dst.

        target_is_directory is required on Windows if the target is to be
          interpreted as a directory.  (On Windows, symlink requires
          Windows 6.0 or greater, and raises a NotImplementedError otherwise.)
          target_is_directory is ignored on non-Windows platforms.

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and path should be relative; path will then be relative to that directory.
        dir_fd may not be implemented on your platform.
          If it is unavailable, using it will raise a NotImplementedError.

    system(command)
        Execute the command in a subshell.

    times()
        Return a collection containing process timing information.

        The object returned behaves like a named tuple with these fields:
          (utime, stime, cutime, cstime, elapsed_time)
        All fields are floating-point numbers.

    truncate(path, length)
        Truncate a file, specified by path, to a specific length.

        On some platforms, path may also be specified as an open file descriptor.
          If this functionality is unavailable, using it raises an exception.

    umask(mask, /)
        Set the current numeric umask and return the previous umask.

    unlink(path, *, dir_fd=None)
        Remove a file (same as remove()).

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and path should be relative; path will then be relative to that directory.
        dir_fd may not be implemented on your platform.
          If it is unavailable, using it will raise a NotImplementedError.

    unsetenv(name, /)
        Delete an environment variable.

    urandom(size, /)
        Return a bytes object containing random bytes suitable for cryptographic use.

    utime(...)
        Set the access and modified time of path.

        path may always be specified as a string.
        On some platforms, path may also be specified as an open file descriptor.
          If this functionality is unavailable, using it raises an exception.

        If times is not None, it must be a tuple (atime, mtime);
            atime and mtime should be expressed as float seconds since the epoch.
        If ns is specified, it must be a tuple (atime_ns, mtime_ns);
            atime_ns and mtime_ns should be expressed as integer nanoseconds
            since the epoch.
        If times is None and ns is unspecified, utime uses the current time.
        Specifying tuples for both times and ns is an error.

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and path should be relative; path will then be relative to that directory.
        If follow_symlinks is False, and the last element of the path is a symbolic
          link, utime will modify the symbolic link itself instead of the file the
          link points to.
        It is an error to use dir_fd or follow_symlinks when specifying path
          as an open file descriptor.
        dir_fd and follow_symlinks may not be available on your platform.
          If they are unavailable, using them will raise a NotImplementedError.

    waitpid(pid, options, /)
        Wait for completion of a given process.

        Returns a tuple of information regarding the process:
            (pid, status << 8)

        The options argument is ignored on Windows.

    waitstatus_to_exitcode(status)
        Convert a wait status to an exit code.

        On Unix:

        * If WIFEXITED(status) is true, return WEXITSTATUS(status).
        * If WIFSIGNALED(status) is true, return -WTERMSIG(status).
        * Otherwise, raise a ValueError.

        On Windows, return status shifted right by 8 bits.

        On Unix, if the process is being traced or if waitpid() was called with
        WUNTRACED option, the caller must first check if WIFSTOPPED(status) is true.
        This function must not be called if WIFSTOPPED(status) is true.

    walk(top, topdown=True, onerror=None, followlinks=False)
        Directory tree generator.

        For each directory in the directory tree rooted at top (including top
        itself, but excluding '.' and '..'), yields a 3-tuple

            dirpath, dirnames, filenames

        dirpath is a string, the path to the directory.  dirnames is a list of
        the names of the subdirectories in dirpath (including symlinks to directories,
        and excluding '.' and '..').
        filenames is a list of the names of the non-directory files in dirpath.
        Note that the names in the lists are just names, with no path components.
        To get a full path (which begins with top) to a file or directory in
        dirpath, do os.path.join(dirpath, name).

        If optional arg 'topdown' is true or not specified, the triple for a
        directory is generated before the triples for any of its subdirectories
        (directories are generated top down).  If topdown is false, the triple
        for a directory is generated after the triples for all of its
        subdirectories (directories are generated bottom up).

        When topdown is true, the caller can modify the dirnames list in-place
        (e.g., via del or slice assignment), and walk will only recurse into the
        subdirectories whose names remain in dirnames; this can be used to prune the
        search, or to impose a specific order of visiting.  Modifying dirnames when
        topdown is false has no effect on the behavior of os.walk(), since the
        directories in dirnames have already been generated by the time dirnames
        itself is generated. No matter the value of topdown, the list of
        subdirectories is retrieved before the tuples for the directory and its
        subdirectories are generated.

        By default errors from the os.scandir() call are ignored.  If
        optional arg 'onerror' is specified, it should be a function; it
        will be called with one argument, an OSError instance.  It can
        report the error to continue with the walk, or raise the exception
        to abort the walk.  Note that the filename is available as the
        filename attribute of the exception object.

        By default, os.walk does not follow symbolic links to subdirectories on
        systems that support them.  In order to get this functionality, set the
        optional argument 'followlinks' to true.

        Caution:  if you pass a relative pathname for top, don't change the
        current working directory between resumptions of walk.  walk never
        changes the current directory, and assumes that the client doesn't
        either.

        Example:

        import os
        from os.path import join, getsize
        for root, dirs, files in os.walk('python/Lib/email'):
            print(root, "consumes ")
            print(sum(getsize(join(root, name)) for name in files), end=" ")
            print("bytes in", len(files), "non-directory files")
            if 'CVS' in dirs:
                dirs.remove('CVS')  # don't visit CVS directories

    write(fd, data, /)
        Write a bytes object to a file descriptor.

DATA
    EX_OK = 0
    F_OK = 0
    O_APPEND = 8
    O_BINARY = 32768
    O_CREAT = 256
    O_EXCL = 1024
    O_NOINHERIT = 128
    O_RANDOM = 16
    O_RDONLY = 0
    O_RDWR = 2
    O_SEQUENTIAL = 32
    O_SHORT_LIVED = 4096
    O_TEMPORARY = 64
    O_TEXT = 16384
    O_TRUNC = 512
    O_WRONLY = 1
    P_DETACH = 4
    P_NOWAIT = 1
    P_NOWAITO = 3
    P_OVERLAY = 2
    P_WAIT = 0
    R_OK = 4
    SEEK_CUR = 1
    SEEK_END = 2
    SEEK_SET = 0
    TMP_MAX = 2147483647
    W_OK = 2
    X_OK = 1
    __all__ = ['altsep', 'curdir', 'pardir', 'sep', 'pathsep', 'linesep', ...
    altsep = '/'
    curdir = '.'
    defpath = r'.;C:\bin'
    devnull = 'nul'
    environ = environ({'ALLUSERSPROFILE': 'C:\\ProgramData', '...TE_LIB_OK...
    extsep = '.'
    linesep = '\r\n'
    name = 'nt'
    pardir = '..'
    pathsep = ';'
    sep = r'\'
    supports_bytes_environ = False

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\os.py

nltk.pad_sequence
Python Library Documentation: function pad_sequence in module nltk.util

pad_sequence(sequence, n, pad_left=False, pad_right=False, left_pad_symbol=None, right_pad_symbol=None)
    Returns a padded sequence of items before ngram extraction.

        >>> list(pad_sequence([1,2,3,4,5], 2, pad_left=True, pad_right=True, left_pad_symbol='<s>', right_pad_symbol='</s>'))
        ['<s>', 1, 2, 3, 4, 5, '</s>']
        >>> list(pad_sequence([1,2,3,4,5], 2, pad_left=True, left_pad_symbol='<s>'))
        ['<s>', 1, 2, 3, 4, 5]
        >>> list(pad_sequence([1,2,3,4,5], 2, pad_right=True, right_pad_symbol='</s>'))
        [1, 2, 3, 4, 5, '</s>']

    :param sequence: the source data to be padded
    :type sequence: sequence or iter
    :param n: the degree of the ngrams
    :type n: int
    :param pad_left: whether the ngrams should be left-padded
    :type pad_left: bool
    :param pad_right: whether the ngrams should be right-padded
    :type pad_right: bool
    :param left_pad_symbol: the symbol to use for left padding (default is None)
    :type left_pad_symbol: any
    :param right_pad_symbol: the symbol to use for right padding (default is None)
    :type right_pad_symbol: any
    :rtype: sequence or iter
nltk.paice
Python Library Documentation: module nltk.metrics.paice in nltk.metrics

NAME
    nltk.metrics.paice - Counts Paice's performance statistics for evaluating stemming algorithms.

DESCRIPTION
    What is required:
     - A dictionary of words grouped by their real lemmas
     - A dictionary of words grouped by stems from a stemming algorithm

    When these are given, Understemming Index (UI), Overstemming Index (OI),
    Stemming Weight (SW) and Error-rate relative to truncation (ERRT) are counted.

    References:
    Chris D. Paice (1994). An evaluation method for stemming algorithms.
    In Proceedings of SIGIR, 42--50.

CLASSES
    builtins.object
        Paice

    class Paice(builtins.object)
     |  Paice(lemmas, stems)
     |
     |  Class for storing lemmas, stems and evaluation metrics.
     |
     |  Methods defined here:
     |
     |  __init__(self, lemmas, stems)
     |      :param lemmas: A dictionary where keys are lemmas and values are sets
     |          or lists of words corresponding to that lemma.
     |      :param stems: A dictionary where keys are stems and values are sets
     |          or lists of words corresponding to that stem.
     |      :type lemmas: dict(str): list(str)
     |      :type stems: dict(str): set(str)
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  update(self)
     |      Update statistics after lemmas and stems have been set.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()
        Demonstration of the module.

    get_words_from_dictionary(lemmas)
        Get original set of words used for analysis.

        :param lemmas: A dictionary where keys are lemmas and values are sets
            or lists of words corresponding to that lemma.
        :type lemmas: dict(str): list(str)
        :return: Set of words that exist as values in the dictionary
        :rtype: set(str)

    sqrt(x, /)
        Return the square root of x.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\metrics\paice.py

nltk.pairwise
Python Library Documentation: function pairwise in module nltk.util

pairwise(iterable)
    s -> (s0,s1), (s1,s2), (s2, s3), ...
nltk.parallelize_preprocess
Python Library Documentation: function parallelize_preprocess in module nltk.util

parallelize_preprocess(func, iterator, processes, progress_bar=False)
nltk.parse
Python Library Documentation: package nltk.parse in nltk

NAME
    nltk.parse - NLTK Parsers

DESCRIPTION
    Classes and interfaces for producing tree structures that represent
    the internal organization of a text.  This task is known as "parsing"
    the text, and the resulting tree structures are called the text's
    "parses".  Typically, the text is a single sentence, and the tree
    structure represents the syntactic structure of the sentence.
    However, parsers can also be used in other domains.  For example,
    parsers can be used to derive the morphological structure of the
    morphemes that make up a word, or to derive the discourse structure
    for a set of utterances.

    Sometimes, a single piece of text can be represented by more than one
    tree structure.  Texts represented by more than one tree structure are
    called "ambiguous" texts.  Note that there are actually two ways in
    which a text can be ambiguous:

        - The text has multiple correct parses.
        - There is not enough information to decide which of several
          candidate parses is correct.

    However, the parser module does *not* distinguish these two types of
    ambiguity.

    The parser module defines ``ParserI``, a standard interface for parsing
    texts; and two simple implementations of that interface,
    ``ShiftReduceParser`` and ``RecursiveDescentParser``.  It also contains
    three sub-modules for specialized kinds of parsing:

      - ``nltk.parser.chart`` defines chart parsing, which uses dynamic
        programming to efficiently parse texts.
      - ``nltk.parser.probabilistic`` defines probabilistic parsing, which
        associates a probability with each parse.

PACKAGE CONTENTS
    api
    bllip
    chart
    corenlp
    dependencygraph
    earleychart
    evaluate
    featurechart
    generate
    malt
    nonprojectivedependencyparser
    pchart
    projectivedependencyparser
    recursivedescent
    shiftreduce
    stanford
    transitionparser
    util
    viterbi

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\__init__.py

nltk.parse_sents
Python Library Documentation: function parse_sents in module nltk.sem.util

parse_sents(inputs, grammar, trace=0)
    Convert input sentences into syntactic trees.

    :param inputs: sentences to be parsed
    :type inputs: list(str)
    :param grammar: ``FeatureGrammar`` or name of feature-based grammar
    :type grammar: nltk.grammar.FeatureGrammar
    :rtype: list(nltk.tree.Tree) or dict(list(str)): list(Tree)
    :return: a mapping from input sentences to a list of ``Tree`` instances.
nltk.pathsec
Python Library Documentation: module nltk.pathsec in nltk

NAME
    nltk.pathsec - Centralized I/O security sentinel for NLTK.

CLASSES
    zipfile.ZipFile(builtins.object)
        ZipFile

    class ZipFile(zipfile.ZipFile)
     |  ZipFile(file, *args, **kwargs)
     |
     |  Secure wrapper for zipfile.ZipFile.
     |
     |  Method resolution order:
     |      ZipFile
     |      zipfile.ZipFile
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, file, *args, **kwargs)
     |      Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
     |      or append 'a'.
     |
     |  extract(self, member, path=None, pwd=None)
     |      Extract a member from the archive to the current working directory,
     |      using its full name. Its file information is extracted as accurately
     |      as possible. `member' may be a filename or a ZipInfo object. You can
     |      specify a different directory using `path'. You can specify the
     |      password to decrypt the file using 'pwd'.
     |
     |  extractall(self, path=None, members=None, pwd=None)
     |      Extract all members from the archive to the current working
     |      directory. `path' specifies a different directory to extract to.
     |      `members' is optional and must be a subset of the list returned
     |      by namelist(). You can specify the password to decrypt all files
     |      using 'pwd'.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from zipfile.ZipFile:
     |
     |  __del__(self)
     |      Call the "close()" method in case the user forgot.
     |
     |  __enter__(self)
     |
     |  __exit__(self, type, value, traceback)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  close(self)
     |      Close the file, and for mode 'w', 'x' and 'a' write the ending
     |      records.
     |
     |  getinfo(self, name)
     |      Return the instance of ZipInfo given 'name'.
     |
     |  infolist(self)
     |      Return a list of class ZipInfo instances for files in the
     |      archive.
     |
     |  mkdir(self, zinfo_or_directory_name, mode=511)
     |      Creates a directory inside the zip archive.
     |
     |  namelist(self)
     |      Return a list of file names in the archive.
     |
     |  open(self, name, mode='r', pwd=None, *, force_zip64=False)
     |      Return file-like object for 'name'.
     |
     |      name is a string for the file name within the ZIP file, or a ZipInfo
     |      object.
     |
     |      mode should be 'r' to read a file already in the ZIP file, or 'w' to
     |      write to a file newly added to the archive.
     |
     |      pwd is the password to decrypt files (only used for reading).
     |
     |      When writing, if the file size is not known in advance but may exceed
     |      2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large
     |      files.  If the size is known in advance, it is best to pass a ZipInfo
     |      instance for name, with zinfo.file_size set.
     |
     |  printdir(self, file=None)
     |      Print a table of contents for the zip file.
     |
     |  read(self, name, pwd=None)
     |      Return file bytes for name. 'pwd' is the password to decrypt
     |      encrypted files.
     |
     |  setpassword(self, pwd)
     |      Set default password for encrypted files.
     |
     |  testzip(self)
     |      Read all the files and check the CRC.
     |
     |      Return None if all files could be read successfully, or the name
     |      of the offending file otherwise.
     |
     |  write(self, filename, arcname=None, compress_type=None, compresslevel=None)
     |      Put the bytes from filename into the archive under the name
     |      arcname.
     |
     |  writestr(self, zinfo_or_arcname, data, compress_type=None, compresslevel=None)
     |      Write a file into the archive.  The contents is 'data', which
     |      may be either a 'str' or a 'bytes' instance; if it is a 'str',
     |      it is encoded as UTF-8 first.
     |      'zinfo_or_arcname' is either a ZipInfo instance or
     |      the name of the file in the archive.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from zipfile.ZipFile:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  comment
     |      The comment text associated with the ZIP file.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from zipfile.ZipFile:
     |
     |  fp = None

FUNCTIONS
    open(file, mode='r', *, context='pathsec.open', required_root=None, **kwargs)
        Secure wrapper for builtins.open.

    urlopen(url, *args, **kwargs)
        Secure wrapper for urllib.request.urlopen with redirect validation.
        Inherits NLTK proxy settings, but intentionally ignores other custom
        global handlers to strictly enforce the security sandbox.

    validate_network_url(url_input, context='NetworkIO')
        Hardened URL validation with SSRF protection.

    validate_path(path_input, context='NLTK', required_root=None)
        Ensures file access is restricted to allowed data directories.

        :param path_input: The path to validate.
        :param context: Diagnostic context for warnings/errors.
        :param required_root: If provided, enforces that the path is strictly
                              within this specific directory (scoped sandbox).

    validate_zip_archive(zip_obj_or_path, target_root, specific_member=None, context='ZipAudit')
        Enhanced Zip-Slip protection using Pathlib for cross-platform safety.

DATA
    ENFORCE = True
    __all__ = ['validate_path', 'validate_network_url', 'validate_zip_arch...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\pathsec.py

nltk.pchart
Python Library Documentation: module nltk.parse.pchart in nltk.parse

NAME
    nltk.parse.pchart

DESCRIPTION
    Classes and interfaces for associating probabilities with tree
    structures that represent the internal organization of a text.  The
    probabilistic parser module defines ``BottomUpProbabilisticChartParser``.

    ``BottomUpProbabilisticChartParser`` is an abstract class that implements
    a bottom-up chart parser for ``PCFG`` grammars.  It maintains a queue of edges,
    and adds them to the chart one at a time.  The ordering of this queue
    is based on the probabilities associated with the edges, allowing the
    parser to expand more likely edges before less likely ones.  Each
    subclass implements a different queue ordering, producing different
    search strategies.  Currently the following subclasses are defined:

      - ``InsideChartParser`` searches edges in decreasing order of
        their trees' inside probabilities.
      - ``RandomChartParser`` searches edges in random order.
      - ``LongestChartParser`` searches edges in decreasing order of their
        location's length.

    The ``BottomUpProbabilisticChartParser`` constructor has an optional
    argument beam_size.  If non-zero, this controls the size of the beam
    (aka the edge queue).  This option is most useful with InsideChartParser.

CLASSES
    nltk.parse.api.ParserI(builtins.object)
        BottomUpProbabilisticChartParser
            InsideChartParser
            LongestChartParser
            RandomChartParser
            UnsortedChartParser
    nltk.parse.chart.AbstractChartRule(nltk.parse.chart.ChartRuleI)
        ProbabilisticBottomUpInitRule
        ProbabilisticBottomUpPredictRule
        ProbabilisticFundamentalRule
        SingleEdgeProbabilisticFundamentalRule
    nltk.parse.chart.LeafEdge(nltk.parse.chart.EdgeI)
        ProbabilisticLeafEdge
    nltk.parse.chart.TreeEdge(nltk.parse.chart.EdgeI)
        ProbabilisticTreeEdge

    class BottomUpProbabilisticChartParser(nltk.parse.api.ParserI)
     |  BottomUpProbabilisticChartParser(grammar, beam_size=0, trace=0)
     |
     |  An abstract bottom-up parser for ``PCFG`` grammars that uses a ``Chart`` to
     |  record partial results.  ``BottomUpProbabilisticChartParser`` maintains
     |  a queue of edges that can be added to the chart.  This queue is
     |  initialized with edges for each token in the text that is being
     |  parsed.  ``BottomUpProbabilisticChartParser`` inserts these edges into
     |  the chart one at a time, starting with the most likely edges, and
     |  proceeding to less likely edges.  For each edge that is added to
     |  the chart, it may become possible to insert additional edges into
     |  the chart; these are added to the queue.  This process continues
     |  until enough complete parses have been generated, or until the
     |  queue is empty.
     |
     |  The sorting order for the queue is not specified by
     |  ``BottomUpProbabilisticChartParser``.  Different sorting orders will
     |  result in different search strategies.  The sorting order for the
     |  queue is defined by the method ``sort_queue``; subclasses are required
     |  to provide a definition for this method.
     |
     |  :type _grammar: PCFG
     |  :ivar _grammar: The grammar used to parse sentences.
     |  :type _trace: int
     |  :ivar _trace: The level of tracing output that should be generated
     |      when parsing a text.
     |
     |  Method resolution order:
     |      BottomUpProbabilisticChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, beam_size=0, trace=0)
     |      Create a new ``BottomUpProbabilisticChartParser``, that uses
     |      ``grammar`` to parse texts.
     |
     |      :type grammar: PCFG
     |      :param grammar: The grammar used to parse texts.
     |      :type beam_size: int
     |      :param beam_size: The maximum length for the parser's edge queue.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  sort_queue(self, queue, chart)
     |      Sort the given queue of ``Edge`` objects, placing the edge that should
     |      be tried first at the beginning of the queue.  This method
     |      will be called after each ``Edge`` is added to the queue.
     |
     |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
     |          this queue is an edge that could be added to the chart by
     |          the fundamental rule; but that has not yet been added.
     |      :type queue: list(Edge)
     |      :param chart: The chart being used to parse the text.  This
     |          chart can be used to provide extra information for sorting
     |          the queue.
     |      :type chart: Chart
     |      :rtype: None
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class InsideChartParser(BottomUpProbabilisticChartParser)
     |  InsideChartParser(grammar, beam_size=0, trace=0)
     |
     |  A bottom-up parser for ``PCFG`` grammars that tries edges in descending
     |  order of the inside probabilities of their trees.  The "inside
     |  probability" of a tree is simply the
     |  probability of the entire tree, ignoring its context.  In
     |  particular, the inside probability of a tree generated by
     |  production *p* with children *c[1], c[2], ..., c[n]* is
     |  *P(p)P(c[1])P(c[2])...P(c[n])*; and the inside
     |  probability of a token is 1 if it is present in the text, and 0 if
     |  it is absent.
     |
     |  This sorting order results in a type of lowest-cost-first search
     |  strategy.
     |
     |  Method resolution order:
     |      InsideChartParser
     |      BottomUpProbabilisticChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  sort_queue(self, queue, chart)
     |      Sort the given queue of edges, in descending order of the
     |      inside probabilities of the edges' trees.
     |
     |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
     |          this queue is an edge that could be added to the chart by
     |          the fundamental rule; but that has not yet been added.
     |      :type queue: list(Edge)
     |      :param chart: The chart being used to parse the text.  This
     |          chart can be used to provide extra information for sorting
     |          the queue.
     |      :type chart: Chart
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BottomUpProbabilisticChartParser:
     |
     |  __init__(self, grammar, beam_size=0, trace=0)
     |      Create a new ``BottomUpProbabilisticChartParser``, that uses
     |      ``grammar`` to parse texts.
     |
     |      :type grammar: PCFG
     |      :param grammar: The grammar used to parse texts.
     |      :type beam_size: int
     |      :param beam_size: The maximum length for the parser's edge queue.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LongestChartParser(BottomUpProbabilisticChartParser)
     |  LongestChartParser(grammar, beam_size=0, trace=0)
     |
     |  A bottom-up parser for ``PCFG`` grammars that tries longer edges before
     |  shorter ones.  This sorting order results in a type of best-first
     |  search strategy.
     |
     |  Method resolution order:
     |      LongestChartParser
     |      BottomUpProbabilisticChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  sort_queue(self, queue, chart)
     |      Sort the given queue of ``Edge`` objects, placing the edge that should
     |      be tried first at the beginning of the queue.  This method
     |      will be called after each ``Edge`` is added to the queue.
     |
     |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
     |          this queue is an edge that could be added to the chart by
     |          the fundamental rule; but that has not yet been added.
     |      :type queue: list(Edge)
     |      :param chart: The chart being used to parse the text.  This
     |          chart can be used to provide extra information for sorting
     |          the queue.
     |      :type chart: Chart
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BottomUpProbabilisticChartParser:
     |
     |  __init__(self, grammar, beam_size=0, trace=0)
     |      Create a new ``BottomUpProbabilisticChartParser``, that uses
     |      ``grammar`` to parse texts.
     |
     |      :type grammar: PCFG
     |      :param grammar: The grammar used to parse texts.
     |      :type beam_size: int
     |      :param beam_size: The maximum length for the parser's edge queue.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProbabilisticBottomUpInitRule(nltk.parse.chart.AbstractChartRule)
     |  # Rules using probabilistic edges
     |
     |  Method resolution order:
     |      ProbabilisticBottomUpInitRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 0
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProbabilisticBottomUpPredictRule(nltk.parse.chart.AbstractChartRule)
     |  Method resolution order:
     |      ProbabilisticBottomUpPredictRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProbabilisticFundamentalRule(nltk.parse.chart.AbstractChartRule)
     |  Method resolution order:
     |      ProbabilisticFundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  apply(self, chart, grammar, left_edge, right_edge)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 2
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProbabilisticLeafEdge(nltk.parse.chart.LeafEdge)
     |  ProbabilisticLeafEdge(leaf, index)
     |
     |  # Probabilistic edges
     |
     |  Method resolution order:
     |      ProbabilisticLeafEdge
     |      nltk.parse.chart.LeafEdge
     |      nltk.parse.chart.EdgeI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  prob(self)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.LeafEdge:
     |
     |  __init__(self, leaf, index)
     |      Construct a new ``LeafEdge``.
     |
     |      :param leaf: The new edge's leaf value, specifying the word
     |          that is recorded by this edge.
     |      :param index: The new edge's index, specifying the position of
     |          the word that is recorded by this edge.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  dot(self)
     |      Return this edge's dot position, which indicates how much of
     |      the hypothesized structure is consistent with the
     |      sentence.  In particular, ``self.rhs[:dot]`` is consistent
     |      with ``tokens[self.start():self.end()]``.
     |
     |      :rtype: int
     |
     |  end(self)
     |      Return the end index of this edge's span.
     |
     |      :rtype: int
     |
     |  is_complete(self)
     |      Return True if this edge's structure is fully consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  is_incomplete(self)
     |      Return True if this edge's structure is partially consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  length(self)
     |      Return the length of this edge's span.
     |
     |      :rtype: int
     |
     |  lhs(self)
     |      Return this edge's left-hand side, which specifies what kind
     |      of structure is hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the left-hand side values for each edge type.
     |
     |  nextsym(self)
     |      Return the element of this edge's right-hand side that
     |      immediately follows its dot.
     |
     |      :rtype: Nonterminal or terminal or None
     |
     |  rhs(self)
     |      Return this edge's right-hand side, which specifies
     |      the content of the structure hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the right-hand side values for each edge type.
     |
     |  span(self)
     |      Return a tuple ``(s, e)``, where ``tokens[s:e]`` is the
     |      portion of the sentence that is consistent with this
     |      edge's structure.
     |
     |      :rtype: tuple(int, int)
     |
     |  start(self)
     |      Return the start index of this edge's span.
     |
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.EdgeI:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.EdgeI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProbabilisticTreeEdge(nltk.parse.chart.TreeEdge)
     |  ProbabilisticTreeEdge(prob, *args, **kwargs)
     |
     |  Method resolution order:
     |      ProbabilisticTreeEdge
     |      nltk.parse.chart.TreeEdge
     |      nltk.parse.chart.EdgeI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, prob, *args, **kwargs)
     |      Construct a new ``TreeEdge``.
     |
     |      :type span: tuple(int, int)
     |      :param span: A tuple ``(s, e)``, where ``tokens[s:e]`` is the
     |          portion of the sentence that is consistent with the new
     |          edge's structure.
     |      :type lhs: Nonterminal
     |      :param lhs: The new edge's left-hand side, specifying the
     |          hypothesized tree's node value.
     |      :type rhs: list(Nonterminal and str)
     |      :param rhs: The new edge's right-hand side, specifying the
     |          hypothesized tree's children.
     |      :type dot: int
     |      :param dot: The position of the new edge's dot.  This position
     |          specifies what prefix of the production's right hand side
     |          is consistent with the text.  In particular, if
     |          ``sentence`` is the list of tokens in the sentence, then
     |          ``okens[span[0]:span[1]]`` can be spanned by the
     |          children specified by ``rhs[:dot]``.
     |
     |  prob(self)
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  from_production(production, index, p)
     |      Return a new ``TreeEdge`` formed from the given production.
     |      The new edge's left-hand side and right-hand side will
     |      be taken from ``production``; its span will be
     |      ``(index,index)``; and its dot position will be ``0``.
     |
     |      :rtype: TreeEdge
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.TreeEdge:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  dot(self)
     |      Return this edge's dot position, which indicates how much of
     |      the hypothesized structure is consistent with the
     |      sentence.  In particular, ``self.rhs[:dot]`` is consistent
     |      with ``tokens[self.start():self.end()]``.
     |
     |      :rtype: int
     |
     |  end(self)
     |      Return the end index of this edge's span.
     |
     |      :rtype: int
     |
     |  is_complete(self)
     |      Return True if this edge's structure is fully consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  is_incomplete(self)
     |      Return True if this edge's structure is partially consistent
     |      with the text.
     |
     |      :rtype: bool
     |
     |  length(self)
     |      Return the length of this edge's span.
     |
     |      :rtype: int
     |
     |  lhs(self)
     |      Return this edge's left-hand side, which specifies what kind
     |      of structure is hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the left-hand side values for each edge type.
     |
     |  move_dot_forward(self, new_end)
     |      Return a new ``TreeEdge`` formed from this edge.
     |      The new edge's dot position is increased by ``1``,
     |      and its end index will be replaced by ``new_end``.
     |
     |      :param new_end: The new end index.
     |      :type new_end: int
     |      :rtype: TreeEdge
     |
     |  nextsym(self)
     |      Return the element of this edge's right-hand side that
     |      immediately follows its dot.
     |
     |      :rtype: Nonterminal or terminal or None
     |
     |  rhs(self)
     |      Return this edge's right-hand side, which specifies
     |      the content of the structure hypothesized by this edge.
     |
     |      :see: ``TreeEdge`` and ``LeafEdge`` for a description of
     |          the right-hand side values for each edge type.
     |
     |  span(self)
     |      Return a tuple ``(s, e)``, where ``tokens[s:e]`` is the
     |      portion of the sentence that is consistent with this
     |      edge's structure.
     |
     |      :rtype: tuple(int, int)
     |
     |  start(self)
     |      Return the start index of this edge's span.
     |
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.EdgeI:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.EdgeI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class RandomChartParser(BottomUpProbabilisticChartParser)
     |  RandomChartParser(grammar, beam_size=0, trace=0)
     |
     |  A bottom-up parser for ``PCFG`` grammars that tries edges in random order.
     |  This sorting order results in a random search strategy.
     |
     |  Method resolution order:
     |      RandomChartParser
     |      BottomUpProbabilisticChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  sort_queue(self, queue, chart)
     |      Sort the given queue of ``Edge`` objects, placing the edge that should
     |      be tried first at the beginning of the queue.  This method
     |      will be called after each ``Edge`` is added to the queue.
     |
     |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
     |          this queue is an edge that could be added to the chart by
     |          the fundamental rule; but that has not yet been added.
     |      :type queue: list(Edge)
     |      :param chart: The chart being used to parse the text.  This
     |          chart can be used to provide extra information for sorting
     |          the queue.
     |      :type chart: Chart
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BottomUpProbabilisticChartParser:
     |
     |  __init__(self, grammar, beam_size=0, trace=0)
     |      Create a new ``BottomUpProbabilisticChartParser``, that uses
     |      ``grammar`` to parse texts.
     |
     |      :type grammar: PCFG
     |      :param grammar: The grammar used to parse texts.
     |      :type beam_size: int
     |      :param beam_size: The maximum length for the parser's edge queue.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SingleEdgeProbabilisticFundamentalRule(nltk.parse.chart.AbstractChartRule)
     |  Method resolution order:
     |      SingleEdgeProbabilisticFundamentalRule
     |      nltk.parse.chart.AbstractChartRule
     |      nltk.parse.chart.ChartRuleI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  apply(self, chart, grammar, edge1)
     |      Return a generator that will add edges licensed by this rule
     |      and the given edges to the chart, one at a time.  Each
     |      time the generator is resumed, it will either add a new
     |      edge and yield that edge; or return.
     |
     |      :type edges: list(EdgeI)
     |      :param edges: A set of existing edges.  The number of edges
     |          that should be passed to ``apply()`` is specified by the
     |          ``NUM_EDGES`` class variable.
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  NUM_EDGES = 1
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.chart.AbstractChartRule:
     |
     |  apply_everywhere(self, chart, grammar)
     |      Return a generator that will add all edges licensed by
     |      this rule, given the edges that are currently in the
     |      chart, one at a time.  Each time the generator is resumed,
     |      it will either add a new edge and yield that edge; or return.
     |
     |      :rtype: iter(EdgeI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.chart.ChartRuleI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class UnsortedChartParser(BottomUpProbabilisticChartParser)
     |  UnsortedChartParser(grammar, beam_size=0, trace=0)
     |
     |  A bottom-up parser for ``PCFG`` grammars that tries edges in whatever order.
     |
     |  Method resolution order:
     |      UnsortedChartParser
     |      BottomUpProbabilisticChartParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  sort_queue(self, queue, chart)
     |      Sort the given queue of ``Edge`` objects, placing the edge that should
     |      be tried first at the beginning of the queue.  This method
     |      will be called after each ``Edge`` is added to the queue.
     |
     |      :param queue: The queue of ``Edge`` objects to sort.  Each edge in
     |          this queue is an edge that could be added to the chart by
     |          the fundamental rule; but that has not yet been added.
     |      :type queue: list(Edge)
     |      :param chart: The chart being used to parse the text.  This
     |          chart can be used to provide extra information for sorting
     |          the queue.
     |      :type chart: Chart
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from BottomUpProbabilisticChartParser:
     |
     |  __init__(self, grammar, beam_size=0, trace=0)
     |      Create a new ``BottomUpProbabilisticChartParser``, that uses
     |      ``grammar`` to parse texts.
     |
     |      :type grammar: PCFG
     |      :param grammar: The grammar used to parse texts.
     |      :type beam_size: int
     |      :param beam_size: The maximum length for the parser's edge queue.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo(choice=None, draw_parses=None, print_parses=None)
        A demonstration of the probabilistic parsers.  The user is
        prompted to select which demo to run, and how many parses should
        be found; and then each parser is run on the same demo, and a
        summary of the results are displayed.

    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\pchart.py

nltk.perceptron
Python Library Documentation: module nltk.tag.perceptron in nltk.tag

NAME
    nltk.tag.perceptron

DESCRIPTION
    # This module is a port of the Textblob Averaged Perceptron Tagger
    # Author: Matthew Honnibal <honnibal+gh@gmail.com>,
    #         Long Duong <longdt219@gmail.com> (NLTK port)
    # URL: <https://github.com/sloria/textblob-aptagger>
    #      <https://www.nltk.org/>
    # Copyright 2013 Matthew Honnibal
    # NLTK modifications Copyright 2015 The NLTK Project
    #
    # This module is provided under the terms of the MIT License.

CLASSES
    builtins.object
        AveragedPerceptron
    nltk.tag.api.TaggerI(builtins.object)
        PerceptronTagger

    class AveragedPerceptron(builtins.object)
     |  AveragedPerceptron(weights=None)
     |
     |  An averaged perceptron, as implemented by Matthew Honnibal.
     |
     |  See more implementation details here:
     |      https://explosion.ai/blog/part-of-speech-pos-tagger-in-python
     |
     |  Methods defined here:
     |
     |  __init__(self, weights=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  average_weights(self)
     |      Average weights from all iterations.
     |
     |  encode_json_obj(self)
     |
     |  load(self, path)
     |      Load the json model weights.
     |
     |  predict(self, features, return_conf=False)
     |      Dot-product the features and current weights and return the best label.
     |
     |  save(self, path)
     |      Save the model weights as json
     |
     |  update(self, truth, guess, features)
     |      Update the feature weights.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  json_tag = 'nltk.tag.perceptron.AveragedPerceptron'

    class PerceptronTagger(nltk.tag.api.TaggerI)
     |  PerceptronTagger(load=True, lang='eng', loc=None)
     |
     |  Greedy Averaged Perceptron tagger, as implemented by Matthew Honnibal.
     |  See more implementation details here:
     |  https://explosion.ai/blog/part-of-speech-pos-tagger-in-python
     |
     |  >>> from nltk.tag.perceptron import PerceptronTagger
     |  >>> tagger = PerceptronTagger(load=False)
     |
     |  Train and save the model:
     |
     |  >>> tagger.train([[('today','NN'),('is','VBZ'),('good','JJ'),('day','NN')],
     |  ... [('yes','NNS'),('it','PRP'),('beautiful','JJ')]], save_loc=tagger.save_dir)
     |
     |  Load the saved model:
     |
     |  >>> from nltk.data import FileSystemPathPointer
     |  >>> tagger2 = PerceptronTagger(loc=FileSystemPathPointer(tagger.save_dir))
     |  >>> print(sorted(list(tagger2.classes)))
     |  ['JJ', 'NN', 'NNS', 'PRP', 'VBZ']
     |
     |  >>> print(tagger2.classes == tagger.classes)
     |  True
     |
     |  >>> tagger2.tag(['today','is','a','beautiful','day'])
     |  [('today', 'NN'), ('is', 'PRP'), ('a', 'PRP'), ('beautiful', 'JJ'), ('day', 'NN')]
     |
     |  Use the pretrain model (the default constructor)
     |
     |  >>> pretrain = PerceptronTagger()
     |
     |  >>> pretrain.tag('The quick brown fox jumps over the lazy dog'.split())
     |  [('The', 'DT'), ('quick', 'JJ'), ('brown', 'NN'), ('fox', 'NN'), ('jumps', 'VBZ'), ('over', 'IN'), ('the', 'DT'), ('lazy', 'JJ'), ('dog', 'NN')]
     |
     |  >>> pretrain.tag("The red cat".split())
     |  [('The', 'DT'), ('red', 'JJ'), ('cat', 'NN')]
     |
     |  Method resolution order:
     |      PerceptronTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, load=True, lang='eng', loc=None)
     |      :param load: Load the json model upon instantiation.
     |
     |  decode_json_params(self, params)
     |
     |  encode_json_obj(self)
     |
     |  load_from_json(self, lang='eng', loc=None)
     |
     |  normalize(self, word)
     |      Normalization used in pre-processing.
     |      - All words are lower cased
     |      - Groups of digits of length 4 are represented as !YEAR;
     |      - Other digits are represented as !DIGITS
     |
     |      :rtype: str
     |
     |  param_files(self, lang='eng')
     |
     |  save_to_json(self, lang='xxx', loc=None)
     |
     |  tag(self, tokens, return_conf=False, use_tagdict=True)
     |      Tag tokenized sentences.
     |      :params tokens: list of word
     |      :type tokens: list(str)
     |
     |  train(self, sentences, save_loc=None, nr_iter=5)
     |      Train a model from sentences, and save it at ``save_loc``. ``nr_iter``
     |      controls the number of Perceptron training iterations.
     |
     |      :param sentences: A list or iterator of sentences, where each sentence
     |          is a list of (words, tags) tuples.
     |      :param save_loc: If not ``None``, saves a json model in this location.
     |      :param nr_iter: Number of training iterations.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  END = ['-END-', '-END2-']
     |
     |  START = ['-START-', '-START2-']
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.perceptron.PerceptronTagger'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\perceptron.py

nltk.phrase_based
Python Library Documentation: module nltk.translate.phrase_based in nltk.translate

NAME
    nltk.translate.phrase_based

DESCRIPTION
    # Natural Language Toolkit: Phrase Extraction Algorithm
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Authors: Liling Tan, Fredrik Hedman, Petra Barancikova
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

FUNCTIONS
    extract(f_start, f_end, e_start, e_end, alignment, f_aligned, srctext, trgtext, srclen, trglen, max_phrase_length)
        This function checks for alignment point consistency and extracts
        phrases using the chunk of consistent phrases.

        A phrase pair (e, f ) is consistent with an alignment A if and only if:

        (i) No English words in the phrase pair are aligned to words outside it.

               ∀e i ∈ e, (e i , f j ) ∈ A ⇒ f j ∈ f

        (ii) No Foreign words in the phrase pair are aligned to words outside it.

                ∀f j ∈ f , (e i , f j ) ∈ A ⇒ e i ∈ e

        (iii) The phrase pair contains at least one alignment point.

                ∃e i ∈ e  ̄ , f j ∈ f  ̄ s.t. (e i , f j ) ∈ A

        :type f_start: int
        :param f_start: Starting index of the possible foreign language phrases
        :type f_end: int
        :param f_end: End index of the possible foreign language phrases
        :type e_start: int
        :param e_start: Starting index of the possible source language phrases
        :type e_end: int
        :param e_end: End index of the possible source language phrases
        :type srctext: list
        :param srctext: The source language tokens, a list of string.
        :type trgtext: list
        :param trgtext: The target language tokens, a list of string.
        :type srclen: int
        :param srclen: The number of tokens in the source language tokens.
        :type trglen: int
        :param trglen: The number of tokens in the target language tokens.

    phrase_extraction(srctext, trgtext, alignment, max_phrase_length=0)
        Phrase extraction algorithm extracts all consistent phrase pairs from
        a word-aligned sentence pair.

        The idea is to loop over all possible source language (e) phrases and find
        the minimal foreign phrase (f) that matches each of them. Matching is done
        by identifying all alignment points for the source phrase and finding the
        shortest foreign phrase that includes all the foreign counterparts for the
        source words.

        In short, a phrase alignment has to
        (a) contain all alignment points for all covered words
        (b) contain at least one alignment point

        >>> srctext = "michael assumes that he will stay in the house"
        >>> trgtext = "michael geht davon aus , dass er im haus bleibt"
        >>> alignment = [(0,0), (1,1), (1,2), (1,3), (2,5), (3,6), (4,9),
        ... (5,9), (6,7), (7,7), (8,8)]
        >>> phrases = phrase_extraction(srctext, trgtext, alignment)
        >>> for i in sorted(phrases):
        ...    print(i)
        ...
        ((0, 1), (0, 1), 'michael', 'michael')
        ((0, 2), (0, 4), 'michael assumes', 'michael geht davon aus')
        ((0, 2), (0, 5), 'michael assumes', 'michael geht davon aus ,')
        ((0, 3), (0, 6), 'michael assumes that', 'michael geht davon aus , dass')
        ((0, 4), (0, 7), 'michael assumes that he', 'michael geht davon aus , dass er')
        ((0, 9), (0, 10), 'michael assumes that he will stay in the house', 'michael geht davon aus , dass er im haus bleibt')
        ((1, 2), (1, 4), 'assumes', 'geht davon aus')
        ((1, 2), (1, 5), 'assumes', 'geht davon aus ,')
        ((1, 3), (1, 6), 'assumes that', 'geht davon aus , dass')
        ((1, 4), (1, 7), 'assumes that he', 'geht davon aus , dass er')
        ((1, 9), (1, 10), 'assumes that he will stay in the house', 'geht davon aus , dass er im haus bleibt')
        ((2, 3), (4, 6), 'that', ', dass')
        ((2, 3), (5, 6), 'that', 'dass')
        ((2, 4), (4, 7), 'that he', ', dass er')
        ((2, 4), (5, 7), 'that he', 'dass er')
        ((2, 9), (4, 10), 'that he will stay in the house', ', dass er im haus bleibt')
        ((2, 9), (5, 10), 'that he will stay in the house', 'dass er im haus bleibt')
        ((3, 4), (6, 7), 'he', 'er')
        ((3, 9), (6, 10), 'he will stay in the house', 'er im haus bleibt')
        ((4, 6), (9, 10), 'will stay', 'bleibt')
        ((4, 9), (7, 10), 'will stay in the house', 'im haus bleibt')
        ((6, 8), (7, 8), 'in the', 'im')
        ((6, 9), (7, 9), 'in the house', 'im haus')
        ((8, 9), (8, 9), 'house', 'haus')

        :type srctext: str
        :param srctext: The sentence string from the source language.
        :type trgtext: str
        :param trgtext: The sentence string from the target language.
        :type alignment: list(tuple)
        :param alignment: The word alignment outputs as list of tuples, where
            the first elements of tuples are the source words' indices and
            second elements are the target words' indices. This is also the output
            format of nltk.translate.ibm1
        :rtype: list(tuple)
        :return: A list of tuples, each element in a list is a phrase and each
            phrase is a tuple made up of (i) its source location, (ii) its target
            location, (iii) the source phrase and (iii) the target phrase. The phrase
            list of tuples represents all the possible phrases extracted from the
            word alignments.
        :type max_phrase_length: int
        :param max_phrase_length: maximal phrase length, if 0 or not specified
            it is set to a length of the longer sentence (srctext or trgtext).
        :raise ValueError: if ``max_phrase_length`` is left at its default and the
            longer sentence exceeds ``MAX_PHRASE_EXTRACTION_DEFAULT_LEN``, since
            enumerating every phrase pair up to the full length is O(n**3) in work
            and memory and can exhaust the process (CWE-770). Pass an explicit
            ``max_phrase_length`` to bound the phrase length.

DATA
    MAX_PHRASE_EXTRACTION_DEFAULT_LEN = 256

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\phrase_based.py

nltk.picklesec
Python Library Documentation: module nltk.picklesec in nltk

NAME
    nltk.picklesec - Helpers for safer and/or more explicit pickle usage in NLTK.

DESCRIPTION
    - RestrictedUnpickler: blocks unpickling of *any* globals (classes/functions).
      Intended for loading NLTK data packages where we control the serialization.
    - WarningUnpickler: emits a security warning before unpickling (does not make
      unpickling safe).
    - AllowlistUnpickler: only reconstructs an explicit, audited allowlist of
      globals. Use it for loading objects whose set of legitimate classes is known
      (e.g. a trained model) so that arbitrary-code gadgets such as ``os.system``
      can never be reconstructed from an untrusted file.

CLASSES
    _pickle.Unpickler(builtins.object)
        AllowlistUnpickler
        RestrictedUnpickler
        WarningUnpickler

    class AllowlistUnpickler(_pickle.Unpickler)
     |  AllowlistUnpickler(file: 'BinaryIO', *, allowed_globals: 'Iterable[tuple[str, str]]' = (), allowed_modules: 'Iterable[str]' = (), **kwargs: 'Any')
     |
     |  Unpickler that only reconstructs an explicit, audited allowlist of globals.
     |
     |  Two complementary allowlists are supported:
     |
     |  - ``allowed_globals``: a set of exact ``(module, qualname)`` pairs.
     |  - ``allowed_modules``: a set of module names; a global is permitted when its
     |    module equals an allowed name or is a submodule of one (i.e. ``module``
     |    equals ``name`` or starts with ``name + "."``).
     |
     |  Anything not covered by either allowlist raises ``UnpicklingError`` before
     |  the global is resolved, so dangerous callables such as ``os.system`` or
     |  ``builtins.eval`` can never be reconstructed from an untrusted pickle. This
     |  is stricter than :func:`pickle_load` (which only warns and then executes)
     |  but, unlike :class:`RestrictedUnpickler` (which blocks *all* globals), it
     |  still allows the known-good classes a saved object legitimately needs.
     |
     |  Method resolution order:
     |      AllowlistUnpickler
     |      _pickle.Unpickler
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, file: 'BinaryIO', *, allowed_globals: 'Iterable[tuple[str, str]]' = (), allowed_modules: 'Iterable[str]' = (), **kwargs: 'Any')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  find_class(self, module: 'str', name: 'str') -> 'Any'
     |      Return an object from a specified module.
     |
     |      If necessary, the module will be imported. Subclasses may override
     |      this method (e.g. to restrict unpickling of arbitrary classes and
     |      functions).
     |
     |      This method is called whenever a class or a function object is
     |      needed.  Both arguments passed are str objects.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _pickle.Unpickler:
     |
     |  __sizeof__(self, /)
     |      Returns size in memory, in bytes.
     |
     |  load(self, /)
     |      Load a pickle.
     |
     |      Read a pickled object representation from the open file object given
     |      in the constructor, and return the reconstituted object hierarchy
     |      specified therein.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from _pickle.Unpickler:
     |
     |  __new__(*args, **kwargs) class method of _pickle.Unpickler
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from _pickle.Unpickler:
     |
     |  memo
     |
     |  persistent_load

    class RestrictedUnpickler(_pickle.Unpickler)
     |  RestrictedUnpickler(file, *, fix_imports=True, encoding='ASCII', errors='strict', buffers=())
     |
     |  Unpickler that prevents any class or function from being used during loading.
     |
     |  Method resolution order:
     |      RestrictedUnpickler
     |      _pickle.Unpickler
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  find_class(self, module: 'str', name: 'str') -> 'Any'
     |      Return an object from a specified module.
     |
     |      If necessary, the module will be imported. Subclasses may override
     |      this method (e.g. to restrict unpickling of arbitrary classes and
     |      functions).
     |
     |      This method is called whenever a class or a function object is
     |      needed.  Both arguments passed are str objects.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _pickle.Unpickler:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __sizeof__(self, /)
     |      Returns size in memory, in bytes.
     |
     |  load(self, /)
     |      Load a pickle.
     |
     |      Read a pickled object representation from the open file object given
     |      in the constructor, and return the reconstituted object hierarchy
     |      specified therein.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from _pickle.Unpickler:
     |
     |  __new__(*args, **kwargs) class method of _pickle.Unpickler
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from _pickle.Unpickler:
     |
     |  memo
     |
     |  persistent_load

    class WarningUnpickler(_pickle.Unpickler)
     |  WarningUnpickler(file: 'BinaryIO', *, context: 'str | None' = None, **kwargs: 'Any')
     |
     |  Unpickler that emits PICKLE_WARNING once per instance.
     |
     |  Method resolution order:
     |      WarningUnpickler
     |      _pickle.Unpickler
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, file: 'BinaryIO', *, context: 'str | None' = None, **kwargs: 'Any')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  load(self) -> 'Any'
     |      Load a pickle.
     |
     |      Read a pickled object representation from the open file object given
     |      in the constructor, and return the reconstituted object hierarchy
     |      specified therein.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _pickle.Unpickler:
     |
     |  __sizeof__(self, /)
     |      Returns size in memory, in bytes.
     |
     |  find_class(self, module_name, global_name, /)
     |      Return an object from a specified module.
     |
     |      If necessary, the module will be imported. Subclasses may override
     |      this method (e.g. to restrict unpickling of arbitrary classes and
     |      functions).
     |
     |      This method is called whenever a class or a function object is
     |      needed.  Both arguments passed are str objects.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from _pickle.Unpickler:
     |
     |  __new__(*args, **kwargs) class method of _pickle.Unpickler
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from _pickle.Unpickler:
     |
     |  memo
     |
     |  persistent_load

FUNCTIONS
    allowlisted_pickle_load(file: 'BinaryIO', *, allowed_globals: 'Iterable[tuple[str, str]]' = (), allowed_modules: 'Iterable[str]' = ()) -> 'Any'
        Load a pickle while only permitting an explicit allowlist of globals.

        See :class:`AllowlistUnpickler` for the meaning of ``allowed_globals`` and
        ``allowed_modules``. Prefer this over the warn-only :func:`pickle_load` when
        the set of legitimate classes in the file is known (e.g. a trained model),
        because :func:`pickle_load` still executes arbitrary code.

    pickle_load(file: 'BinaryIO', *, context: 'str | None' = None, restricted: 'bool' = False) -> 'Any'
        Convenience wrapper similar to pickle.load(file).

        - If restricted=True, uses RestrictedUnpickler (no warning by default).
        - If restricted=False, uses WarningUnpickler and emits a warning.

DATA
    PICKLE_WARNING = 'Security warning: loading pickles can execute ar...e...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\picklesec.py

nltk.pk
Python Library Documentation: function pk in module nltk.metrics.segmentation

pk(ref, hyp, k=None, boundary='1')
    Compute the Pk metric for a pair of segmentations A segmentation
    is any sequence over a vocabulary of two items (e.g. "0", "1"),
    where the specified boundary value is used to mark the edge of a
    segmentation.

    >>> '%.2f' % pk('0100'*100, '1'*400, 2)
    '0.50'
    >>> '%.2f' % pk('0100'*100, '0'*400, 2)
    '0.50'
    >>> '%.2f' % pk('0100'*100, '0100'*100, 2)
    '0.00'

    :param ref: the reference segmentation
    :type ref: str or list
    :param hyp: the segmentation to evaluate
    :type hyp: str or list
    :param k: window size, if None, set to half of the average reference segment length
    :type boundary: str or int or bool
    :param boundary: boundary value
    :type boundary: str or int or bool
    :rtype: float
nltk.porter
Python Library Documentation: module nltk.stem.porter in nltk.stem

NAME
    nltk.stem.porter - Porter Stemmer

DESCRIPTION
    This is the Porter stemming algorithm. It follows the algorithm
    presented in

    Porter, M. "An algorithm for suffix stripping." Program 14.3 (1980): 130-137.

    with some optional deviations that can be turned on or off with the
    `mode` argument to the constructor.

    Martin Porter, the algorithm's inventor, maintains a web page about the
    algorithm at

        https://www.tartarus.org/~martin/PorterStemmer/

    which includes another Python implementation and other implementations
    in many languages.

CLASSES
    nltk.stem.api.StemmerI(builtins.object)
        PorterStemmer

    class PorterStemmer(nltk.stem.api.StemmerI)
     |  PorterStemmer(mode='NLTK_EXTENSIONS')
     |
     |  A word stemmer based on the Porter stemming algorithm.
     |
     |      Porter, M. "An algorithm for suffix stripping."
     |      Program 14.3 (1980): 130-137.
     |
     |  See https://www.tartarus.org/~martin/PorterStemmer/ for the homepage
     |  of the algorithm.
     |
     |  Martin Porter has endorsed several modifications to the Porter
     |  algorithm since writing his original paper, and those extensions are
     |  included in the implementations on his website. Additionally, others
     |  have proposed further improvements to the algorithm, including NLTK
     |  contributors. There are thus three modes that can be selected by
     |  passing the appropriate constant to the class constructor's `mode`
     |  attribute:
     |
     |  - PorterStemmer.ORIGINAL_ALGORITHM
     |
     |      An implementation that is faithful to the original paper.
     |
     |      Note that Martin Porter has deprecated this version of the
     |      algorithm. Martin distributes implementations of the Porter
     |      Stemmer in many languages, hosted at:
     |
     |      https://www.tartarus.org/~martin/PorterStemmer/
     |
     |      and all of these implementations include his extensions. He
     |      strongly recommends against using the original, published
     |      version of the algorithm; only use this mode if you clearly
     |      understand why you are choosing to do so.
     |
     |  - PorterStemmer.MARTIN_EXTENSIONS
     |
     |      An implementation that only uses the modifications to the
     |      algorithm that are included in the implementations on Martin
     |      Porter's website. He has declared Porter frozen, so the
     |      behaviour of those implementations should never change.
     |
     |  - PorterStemmer.NLTK_EXTENSIONS (default)
     |
     |      An implementation that includes further improvements devised by
     |      NLTK contributors or taken from other modified implementations
     |      found on the web.
     |
     |  For the best stemming, you should use the default NLTK_EXTENSIONS
     |  version. However, if you need to get the same results as either the
     |  original algorithm or one of Martin Porter's hosted versions for
     |  compatibility with an existing implementation or dataset, you can use
     |  one of the other modes instead.
     |
     |  Method resolution order:
     |      PorterStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, mode='NLTK_EXTENSIONS')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  stem(self, word, to_lowercase=True)
     |      :param to_lowercase: if `to_lowercase=True` the word always lowercase
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MARTIN_EXTENSIONS = 'MARTIN_EXTENSIONS'
     |
     |  NLTK_EXTENSIONS = 'NLTK_EXTENSIONS'
     |
     |  ORIGINAL_ALGORITHM = 'ORIGINAL_ALGORITHM'
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()
        A demonstration of the porter stemmer on a sample from
        the Penn Treebank corpus.

DATA
    __docformat__ = 'plaintext'

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\porter.py

nltk.pos_tag
Python Library Documentation: function pos_tag in module nltk.tag

pos_tag(tokens, tagset=None, lang='eng')
    Use NLTK's currently recommended part of speech tagger to
    tag the given list of tokens.

        >>> from nltk.tag import pos_tag
        >>> from nltk.tokenize import word_tokenize
        >>> pos_tag(word_tokenize("John's big idea isn't all that bad.")) # doctest: +NORMALIZE_WHITESPACE
        [('John', 'NNP'), ("'s", 'POS'), ('big', 'JJ'), ('idea', 'NN'), ('is', 'VBZ'),
        ("n't", 'RB'), ('all', 'PDT'), ('that', 'DT'), ('bad', 'JJ'), ('.', '.')]
        >>> pos_tag(word_tokenize("John's big idea isn't all that bad."), tagset='universal') # doctest: +NORMALIZE_WHITESPACE
        [('John', 'NOUN'), ("'s", 'PRT'), ('big', 'ADJ'), ('idea', 'NOUN'), ('is', 'VERB'),
        ("n't", 'ADV'), ('all', 'DET'), ('that', 'DET'), ('bad', 'ADJ'), ('.', '.')]

    NB. Use `pos_tag_sents()` for efficient tagging of more than one sentence.

    :param tokens: Sequence of tokens to be tagged
    :type tokens: list(str)
    :param tagset: the tagset to be used, e.g. universal, wsj, brown
    :type tagset: str
    :param lang: the ISO 639 code of the language, e.g. 'eng' for English, 'rus' for Russian
    :type lang: str
    :return: The tagged tokens
    :rtype: list(tuple(str, str))
nltk.pos_tag_sents
Python Library Documentation: function pos_tag_sents in module nltk.tag

pos_tag_sents(sentences, tagset=None, lang='eng')
    Use NLTK's currently recommended part of speech tagger to tag the
    given list of sentences, each consisting of a list of tokens.

    :param sentences: List of sentences to be tagged
    :type sentences: list(list(str))
    :param tagset: the tagset to be used, e.g. universal, wsj, brown
    :type tagset: str
    :param lang: the ISO 639 code of the language, e.g. 'eng' for English, 'rus' for Russian
    :type lang: str
    :return: The list of tagged sentences
    :rtype: list(list(tuple(str, str)))
nltk.positivenaivebayes
Python Library Documentation: module nltk.classify.positivenaivebayes in nltk.classify

NAME
    nltk.classify.positivenaivebayes

DESCRIPTION
    A variant of the Naive Bayes Classifier that performs binary classification with
    partially-labeled training sets. In other words, assume we want to build a classifier
    that assigns each example to one of two complementary classes (e.g., male names and
    female names).
    If we have a training set with labeled examples for both classes, we can use a
    standard Naive Bayes Classifier. However, consider the case when we only have labeled
    examples for one of the classes, and other, unlabeled, examples.
    Then, assuming a prior distribution on the two labels, we can use the unlabeled set
    to estimate the frequencies of the various features.

    Let the two possible labels be 1 and 0, and let's say we only have examples labeled 1
    and unlabeled examples. We are also given an estimate of P(1).

    We compute P(feature|1) exactly as in the standard case.

    To compute P(feature|0), we first estimate P(feature) from the unlabeled set (we are
    assuming that the unlabeled examples are drawn according to the given prior distribution)
    and then express the conditional probability as:

    |                  P(feature) - P(feature|1) * P(1)
    |  P(feature|0) = ----------------------------------
    |                               P(0)

    Example:

        >>> from nltk.classify import PositiveNaiveBayesClassifier

    Some sentences about sports:

        >>> sports_sentences = [ 'The team dominated the game',
        ...                      'They lost the ball',
        ...                      'The game was intense',
        ...                      'The goalkeeper catched the ball',
        ...                      'The other team controlled the ball' ]

    Mixed topics, including sports:

        >>> various_sentences = [ 'The President did not comment',
        ...                       'I lost the keys',
        ...                       'The team won the game',
        ...                       'Sara has two kids',
        ...                       'The ball went off the court',
        ...                       'They had the ball for the whole game',
        ...                       'The show is over' ]

    The features of a sentence are simply the words it contains:

        >>> def features(sentence):
        ...     words = sentence.lower().split()
        ...     return dict(('contains(%s)' % w, True) for w in words)

    We use the sports sentences as positive examples, the mixed ones ad unlabeled examples:

        >>> positive_featuresets = map(features, sports_sentences)
        >>> unlabeled_featuresets = map(features, various_sentences)
        >>> classifier = PositiveNaiveBayesClassifier.train(positive_featuresets,
        ...                                                 unlabeled_featuresets)

    Is the following sentence about sports?

        >>> classifier.classify(features('The cat is on the table'))
        False

    What about this one?

        >>> classifier.classify(features('My team lost the game'))
        True

CLASSES
    nltk.classify.naivebayes.NaiveBayesClassifier(nltk.classify.api.ClassifierI)
        PositiveNaiveBayesClassifier

    class PositiveNaiveBayesClassifier(nltk.classify.naivebayes.NaiveBayesClassifier)
     |  PositiveNaiveBayesClassifier(label_probdist, feature_probdist)
     |
     |  Method resolution order:
     |      PositiveNaiveBayesClassifier
     |      nltk.classify.naivebayes.NaiveBayesClassifier
     |      nltk.classify.api.ClassifierI
     |      builtins.object
     |
     |  Static methods defined here:
     |
     |  train(positive_featuresets, unlabeled_featuresets, positive_prob_prior=0.5, estimator=<class 'nltk.probability.ELEProbDist'>)
     |      :param positive_featuresets: An iterable of featuresets that are known as positive
     |          examples (i.e., their label is ``True``).
     |
     |      :param unlabeled_featuresets: An iterable of featuresets whose label is unknown.
     |
     |      :param positive_prob_prior: A prior estimate of the probability of the label
     |          ``True`` (default 0.5).
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.naivebayes.NaiveBayesClassifier:
     |
     |  __init__(self, label_probdist, feature_probdist)
     |      :param label_probdist: P(label), the probability distribution
     |          over labels.  It is expressed as a ``ProbDistI`` whose
     |          samples are labels.  I.e., P(label) =
     |          ``label_probdist.prob(label)``.
     |
     |      :param feature_probdist: P(fname=fval|label), the probability
     |          distribution for feature values, given labels.  It is
     |          expressed as a dictionary whose keys are ``(label, fname)``
     |          pairs and whose values are ``ProbDistI`` objects over feature
     |          values.  I.e., P(fname=fval|label) =
     |          ``feature_probdist[label,fname].prob(fval)``.  If a given
     |          ``(label,fname)`` is not a key in ``feature_probdist``, then
     |          it is assumed that the corresponding P(fname=fval|label)
     |          is 0 for all values of ``fval``.
     |
     |  classify(self, featureset)
     |      :return: the most appropriate label for the given featureset.
     |      :rtype: label
     |
     |  labels(self)
     |      :return: the list of category labels used by this classifier.
     |      :rtype: list of (immutable)
     |
     |  most_informative_features(self, n=100)
     |      Return a list of the 'most informative' features used by this
     |      classifier.  For the purpose of this function, the
     |      informativeness of a feature ``(fname,fval)`` is equal to the
     |      highest value of P(fname=fval|label), for any label, divided by
     |      the lowest value of P(fname=fval|label), for any label:
     |
     |      |  max[ P(fname=fval|label1) / P(fname=fval|label2) ]
     |
     |  prob_classify(self, featureset)
     |      :return: a probability distribution over labels for the given
     |          featureset.
     |      :rtype: ProbDistI
     |
     |  show_most_informative_features(self, n=10)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.api.ClassifierI:
     |
     |  classify_many(self, featuresets)
     |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.classify(fs) for fs in featuresets]
     |
     |      :rtype: list(label)
     |
     |  prob_classify_many(self, featuresets)
     |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.prob_classify(fs) for fs in featuresets]
     |
     |      :rtype: list(ProbDistI)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.classify.api.ClassifierI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\positivenaivebayes.py

nltk.pprint
Python Library Documentation: function pprint in module pprint

pprint(object, stream=None, indent=1, width=80, depth=None, *, compact=False, sort_dicts=True, underscore_numbers=False)
    Pretty-print a Python object to a stream [default is sys.stdout].
nltk.pr
Python Library Documentation: function pr in module nltk.util

pr(data, start=0, end=None)
    Pretty print a sequence of data items

    :param data: the data stream to print
    :type data: sequence or iter
    :param start: the start position
    :type start: int
    :param end: the end position
    :type end: int
nltk.precision
Python Library Documentation: function precision in module nltk.metrics.scores

precision(reference, test)
    Given a set of reference values and a set of test values, return
    the fraction of test values that appear in the reference set.
    In particular, return card(``reference`` intersection ``test``)/card(``test``).
    If ``test`` is empty, then return None.

    :type reference: set
    :param reference: A set of reference values.
    :type test: set
    :param test: A set of values to compare against the reference set.
    :rtype: float or None
nltk.presence
Python Library Documentation: function presence in module nltk.metrics.distance

presence(label)
    Higher-order function to test presence of a given label
nltk.print_string
Python Library Documentation: function print_string in module nltk.util

print_string(s, width=70)
    Pretty print a string, breaking lines on whitespace

    :param s: the string to print, consisting of words and spaces
    :type s: str
    :param width: the display width
    :type width: int
nltk.probability
Python Library Documentation: module nltk.probability in nltk

NAME
    nltk.probability - Classes for representing and processing probabilistic information.

DESCRIPTION
    The ``FreqDist`` class is used to encode "frequency distributions",
    which count the number of times that each outcome of an experiment
    occurs.

    The ``ProbDistI`` class defines a standard interface for "probability
    distributions", which encode the probability of each outcome for an
    experiment.  There are two types of probability distribution:

      - "derived probability distributions" are created from frequency
        distributions.  They attempt to model the probability distribution
        that generated the frequency distribution.
      - "analytic probability distributions" are created directly from
        parameters (such as variance).

    The ``ConditionalFreqDist`` class and ``ConditionalProbDistI`` interface
    are used to encode conditional distributions.  Conditional probability
    distributions can be derived or analytic; but currently the only
    implementation of the ``ConditionalProbDistI`` interface is
    ``ConditionalProbDist``, a derived distribution.

CLASSES
    builtins.dict(builtins.object)
        ConditionalProbDistI
            ConditionalProbDist
            DictionaryConditionalProbDist
    builtins.object
        ProbDistI
            CrossValidationProbDist
            DictionaryProbDist
            HeldoutProbDist
            KneserNeyProbDist
            LidstoneProbDist
                ELEProbDist
                LaplaceProbDist
            MLEProbDist
            MutableProbDist
            SimpleGoodTuringProbDist
            UniformProbDist
            WittenBellProbDist
        ProbabilisticMixIn
            ImmutableProbabilisticMixIn
    collections.Counter(builtins.dict)
        FreqDist
    collections.defaultdict(builtins.dict)
        ConditionalFreqDist

    class ConditionalFreqDist(collections.defaultdict)
     |  ConditionalFreqDist(cond_samples=None)
     |
     |  A collection of frequency distributions for a single experiment
     |  run under different conditions.  Conditional frequency
     |  distributions are used to record the number of times each sample
     |  occurred, given the condition under which the experiment was run.
     |  For example, a conditional frequency distribution could be used to
     |  record the frequency of each word (type) in a document, given its
     |  length.  Formally, a conditional frequency distribution can be
     |  defined as a function that maps from each condition to the
     |  FreqDist for the experiment under that condition.
     |
     |  Conditional frequency distributions are typically constructed by
     |  repeatedly running an experiment under a variety of conditions,
     |  and incrementing the sample outcome counts for the appropriate
     |  conditions.  For example, the following code will produce a
     |  conditional frequency distribution that encodes how often each
     |  word type occurs, given the length of that word type:
     |
     |      >>> from nltk.probability import ConditionalFreqDist
     |      >>> from nltk.tokenize import word_tokenize
     |      >>> sent = "the the the dog dog some other words that we do not care about"
     |      >>> cfdist = ConditionalFreqDist()
     |      >>> for word in word_tokenize(sent):
     |      ...     condition = len(word)
     |      ...     cfdist[condition][word] += 1
     |
     |  An equivalent way to do this is with the initializer:
     |
     |      >>> cfdist = ConditionalFreqDist((len(word), word) for word in word_tokenize(sent))
     |
     |  The frequency distribution for each condition is accessed using
     |  the indexing operator:
     |
     |      >>> cfdist[3]
     |      FreqDist({'the': 3, 'dog': 2, 'not': 1})
     |      >>> cfdist[3].freq('the')
     |      0.5
     |      >>> cfdist[3]['dog']
     |      2
     |
     |  When the indexing operator is used to access the frequency
     |  distribution for a condition that has not been accessed before,
     |  ``ConditionalFreqDist`` creates a new empty FreqDist for that
     |  condition.
     |
     |  Method resolution order:
     |      ConditionalFreqDist
     |      collections.defaultdict
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  N(self)
     |      Return the total number of sample outcomes that have been
     |      recorded by this ``ConditionalFreqDist``.
     |
     |      :rtype: int
     |
     |  __add__(self, other)
     |      Add counts from two ConditionalFreqDists.
     |
     |  __and__(self, other)
     |      Intersection is the minimum of corresponding counts.
     |
     |  __ge__(self, other)
     |      Return self>=value.
     |
     |  __gt__(self, other)
     |      Return self>value.
     |
     |  __init__(self, cond_samples=None)
     |      Construct a new empty conditional frequency distribution.  In
     |      particular, the count for every sample, under every condition,
     |      is zero.
     |
     |      :param cond_samples: The samples to initialize the conditional
     |          frequency distribution with
     |      :type cond_samples: Sequence of (condition, sample) tuples
     |
     |  __le__(self, other)
     |      Return self<=value.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __or__(self, other)
     |      Union is the maximum of value in either of the input counters.
     |
     |  __reduce__(self)
     |      Return state information for pickling.
     |
     |  __repr__(self)
     |      Return a string representation of this ``ConditionalFreqDist``.
     |
     |      :rtype: str
     |
     |  __sub__(self, other)
     |      Subtract count, but keep only results with positive counts.
     |
     |  conditions(self)
     |      Return a list of the conditions that have been accessed for
     |      this ``ConditionalFreqDist``.  Use the indexing operator to
     |      access the frequency distribution for a given condition.
     |      Note that the frequency distributions for some conditions
     |      may contain zero sample outcomes.
     |
     |      :rtype: list
     |
     |  copy = deepcopy(self)
     |
     |  deepcopy(self)
     |
     |  plot(self, *args, samples=None, title='', cumulative=False, percents=False, conditions=None, show=False, **kwargs)
     |      Plot the given samples from the conditional frequency distribution.
     |      For a cumulative plot, specify cumulative=True. Additional ``*args`` and
     |      ``**kwargs`` are passed to matplotlib's plot function.
     |      (Requires Matplotlib to be installed.)
     |
     |      :param samples: The samples to plot
     |      :type samples: list
     |      :param title: The title for the graph
     |      :type title: str
     |      :param cumulative: Whether the plot is cumulative. (default = False)
     |      :type cumulative: bool
     |      :param percents: Whether the plot uses percents instead of counts. (default = False)
     |      :type percents: bool
     |      :param conditions: The conditions to plot (default is all)
     |      :type conditions: list
     |      :param show: Whether to show the plot, or only return the ax.
     |      :type show: bool
     |
     |  tabulate(self, *args, **kwargs)
     |      Tabulate the given samples from the conditional frequency distribution.
     |
     |      :param samples: The samples to plot
     |      :type samples: list
     |      :param conditions: The conditions to plot (default is all)
     |      :type conditions: list
     |      :param cumulative: A flag to specify whether the freqs are cumulative (default = False)
     |      :type title: bool
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from collections.defaultdict:
     |
     |  __copy__(...)
     |      D.copy() -> a shallow copy of D.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __missing__(...)
     |      __missing__(key) # Called by __getitem__ for missing key; pseudo-code:
     |      if self.default_factory is None: raise KeyError((key,))
     |      self[key] = value = self.default_factory()
     |      return value
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from collections.defaultdict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from collections.defaultdict:
     |
     |  default_factory
     |      Factory for default value called by __missing__().
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

    class ConditionalProbDist(ConditionalProbDistI)
     |  ConditionalProbDist(cfdist, probdist_factory, *factory_args, **factory_kw_args)
     |
     |  A conditional probability distribution modeling the experiments
     |  that were used to generate a conditional frequency distribution.
     |  A ConditionalProbDist is constructed from a
     |  ``ConditionalFreqDist`` and a ``ProbDist`` factory:
     |
     |  - The ``ConditionalFreqDist`` specifies the frequency
     |    distribution for each condition.
     |  - The ``ProbDist`` factory is a function that takes a
     |    condition's frequency distribution, and returns its
     |    probability distribution.  A ``ProbDist`` class's name (such as
     |    ``MLEProbDist`` or ``HeldoutProbDist``) can be used to specify
     |    that class's constructor.
     |
     |  The first argument to the ``ProbDist`` factory is the frequency
     |  distribution that it should model; and the remaining arguments are
     |  specified by the ``factory_args`` parameter to the
     |  ``ConditionalProbDist`` constructor.  For example, the following
     |  code constructs a ``ConditionalProbDist``, where the probability
     |  distribution for each condition is an ``ELEProbDist`` with 10 bins:
     |
     |      >>> from nltk.corpus import brown
     |      >>> from nltk.probability import ConditionalFreqDist
     |      >>> from nltk.probability import ConditionalProbDist, ELEProbDist
     |      >>> cfdist = ConditionalFreqDist(brown.tagged_words()[:5000])
     |      >>> cpdist = ConditionalProbDist(cfdist, ELEProbDist, 10)
     |      >>> cpdist['passed'].max()
     |      'VBD'
     |      >>> cpdist['passed'].prob('VBD') #doctest: +ELLIPSIS
     |      0.423...
     |
     |  Method resolution order:
     |      ConditionalProbDist
     |      ConditionalProbDistI
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, cfdist, probdist_factory, *factory_args, **factory_kw_args)
     |      Construct a new conditional probability distribution, based on
     |      the given conditional frequency distribution and ``ProbDist``
     |      factory.
     |
     |      :type cfdist: ConditionalFreqDist
     |      :param cfdist: The ``ConditionalFreqDist`` specifying the
     |          frequency distribution for each condition.
     |      :type probdist_factory: class or function
     |      :param probdist_factory: The function or class that maps
     |          a condition's frequency distribution to its probability
     |          distribution.  The function is called with the frequency
     |          distribution as its first argument,
     |          ``factory_args`` as its remaining arguments, and
     |          ``factory_kw_args`` as keyword arguments.
     |      :type factory_args: (any)
     |      :param factory_args: Extra arguments for ``probdist_factory``.
     |          These arguments are usually used to specify extra
     |          properties for the probability distributions of individual
     |          conditions, such as the number of bins they contain.
     |      :type factory_kw_args: (any)
     |      :param factory_kw_args: Extra keyword arguments for ``probdist_factory``.
     |
     |  __missing__(self, key)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ConditionalProbDistI:
     |
     |  __repr__(self)
     |      Return a string representation of this ``ConditionalProbDist``.
     |
     |      :rtype: str
     |
     |  conditions(self)
     |      Return a list of the conditions that are represented by
     |      this ``ConditionalProbDist``.  Use the indexing operator to
     |      access the probability distribution for a given condition.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ConditionalProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  copy(...)
     |      D.copy() -> a shallow copy of D
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

    class ConditionalProbDistI(builtins.dict)
     |  A collection of probability distributions for a single experiment
     |  run under different conditions.  Conditional probability
     |  distributions are used to estimate the likelihood of each sample,
     |  given the condition under which the experiment was run.  For
     |  example, a conditional probability distribution could be used to
     |  estimate the probability of each word type in a document, given
     |  the length of the word type.  Formally, a conditional probability
     |  distribution can be defined as a function that maps from each
     |  condition to the ``ProbDist`` for the experiment under that
     |  condition.
     |
     |  Method resolution order:
     |      ConditionalProbDistI
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Classes inheriting from ConditionalProbDistI should implement __init__.
     |
     |  __repr__(self)
     |      Return a string representation of this ``ConditionalProbDist``.
     |
     |      :rtype: str
     |
     |  conditions(self)
     |      Return a list of the conditions that are represented by
     |      this ``ConditionalProbDist``.  Use the indexing operator to
     |      access the probability distribution for a given condition.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset({'__init__'})
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  copy(...)
     |      D.copy() -> a shallow copy of D
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

    class CrossValidationProbDist(ProbDistI)
     |  CrossValidationProbDist(freqdists, bins)
     |
     |  The cross-validation estimate for the probability distribution of
     |  the experiment used to generate a set of frequency distribution.
     |  The "cross-validation estimate" for the probability of a sample
     |  is found by averaging the held-out estimates for the sample in
     |  each pair of frequency distributions.
     |
     |  Method resolution order:
     |      CrossValidationProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, freqdists, bins)
     |      Use the cross-validation estimate to create a probability
     |      distribution for the experiment used to generate
     |      ``freqdists``.
     |
     |      :type freqdists: list(FreqDist)
     |      :param freqdists: A list of the frequency distributions
     |          generated by the experiment.
     |      :type bins: int
     |      :param bins: The number of sample values that can be generated
     |          by the experiment that is described by the probability
     |          distribution.  This value must be correctly set for the
     |          probabilities of the sample values to sum to one.  If
     |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
     |
     |  __repr__(self)
     |      Return a string representation of this ``ProbDist``.
     |
     |      :rtype: str
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  freqdists(self)
     |      Return the list of frequency distributions that this ``ProbDist`` is based on.
     |
     |      :rtype: list(FreqDist)
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  SUM_TO_ONE = False
     |
     |  __abstractmethods__ = frozenset({'max'})
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DictionaryConditionalProbDist(ConditionalProbDistI)
     |  DictionaryConditionalProbDist(probdist_dict)
     |
     |  An alternative ConditionalProbDist that simply wraps a dictionary of
     |  ProbDists rather than creating these from FreqDists.
     |
     |  Method resolution order:
     |      DictionaryConditionalProbDist
     |      ConditionalProbDistI
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, probdist_dict)
     |      :param probdist_dict: a dictionary containing the probdists indexed
     |          by the conditions
     |      :type probdist_dict: dict any -> probdist
     |
     |  __missing__(self, key)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ConditionalProbDistI:
     |
     |  __repr__(self)
     |      Return a string representation of this ``ConditionalProbDist``.
     |
     |      :rtype: str
     |
     |  conditions(self)
     |      Return a list of the conditions that are represented by
     |      this ``ConditionalProbDist``.  Use the indexing operator to
     |      access the probability distribution for a given condition.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ConditionalProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __ior__(self, value, /)
     |      Return self|=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __or__(self, value, /)
     |      Return self|value.
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  copy(...)
     |      D.copy() -> a shallow copy of D
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  setdefault(self, key, default=None, /)
     |      Insert key with a value of default if key is not in the dictionary.
     |
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  update(...)
     |      D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
     |      If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
     |      If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
     |      In either case, this is followed by: for k in F:  D[k] = F[k]
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  fromkeys(iterable, value=None, /)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.dict:
     |
     |  __hash__ = None

    class DictionaryProbDist(ProbDistI)
     |  DictionaryProbDist(prob_dict=None, log=False, normalize=False)
     |
     |  A probability distribution whose probabilities are directly
     |  specified by a given dictionary.  The given dictionary maps
     |  samples to probabilities.
     |
     |  Method resolution order:
     |      DictionaryProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, prob_dict=None, log=False, normalize=False)
     |      Construct a new probability distribution from the given
     |      dictionary, which maps values to probabilities (or to log
     |      probabilities, if ``log`` is true).  If ``normalize`` is
     |      true, then the probability values are scaled by a constant
     |      factor such that they sum to 1.
     |
     |      If called without arguments, the resulting probability
     |      distribution assigns zero probability to all values.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from ProbDistI:
     |
     |  SUM_TO_ONE = True

    class ELEProbDist(LidstoneProbDist)
     |  ELEProbDist(freqdist, bins=None)
     |
     |  The expected likelihood estimate for the probability distribution
     |  of the experiment used to generate a frequency distribution.  The
     |  "expected likelihood estimate" approximates the probability of a
     |  sample with count *c* from an experiment with *N* outcomes and
     |  *B* bins as *(c+0.5)/(N+B/2)*.  This is equivalent to adding 0.5
     |  to the count for each bin, and taking the maximum likelihood
     |  estimate of the resulting frequency distribution.
     |
     |  Method resolution order:
     |      ELEProbDist
     |      LidstoneProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, freqdist, bins=None)
     |      Use the expected likelihood estimate to create a probability
     |      distribution for the experiment used to generate ``freqdist``.
     |
     |      :type freqdist: FreqDist
     |      :param freqdist: The frequency distribution that the
     |          probability estimates should be based on.
     |      :type bins: int
     |      :param bins: The number of sample values that can be generated
     |          by the experiment that is described by the probability
     |          distribution.  This value must be correctly set for the
     |          probabilities of the sample values to sum to one.  If
     |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
     |
     |  __repr__(self)
     |      Return a string representation of this ``ProbDist``.
     |
     |      :rtype: str
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from LidstoneProbDist:
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  freqdist(self)
     |      Return the frequency distribution that this probability
     |      distribution is based on.
     |
     |      :rtype: FreqDist
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from LidstoneProbDist:
     |
     |  SUM_TO_ONE = False
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FreqDist(collections.Counter)
     |  FreqDist(samples=None)
     |
     |  A frequency distribution for the outcomes of an experiment.  A
     |  frequency distribution records the number of times each outcome of
     |  an experiment has occurred.  For example, a frequency distribution
     |  could be used to record the frequency of each word type in a
     |  document.  Formally, a frequency distribution can be defined as a
     |  function mapping from each sample to the number of times that
     |  sample occurred as an outcome.
     |
     |  Frequency distributions are generally constructed by running a
     |  number of experiments, and incrementing the count for a sample
     |  every time it is an outcome of an experiment.  For example, the
     |  following code will produce a frequency distribution that encodes
     |  how often each word occurs in a text:
     |
     |      >>> from nltk.tokenize import word_tokenize
     |      >>> from nltk.probability import FreqDist
     |      >>> sent = 'This is an example sentence'
     |      >>> fdist = FreqDist()
     |      >>> for word in word_tokenize(sent):
     |      ...    fdist[word.lower()] += 1
     |
     |  An equivalent way to do this is with the initializer:
     |
     |      >>> fdist = FreqDist(word.lower() for word in word_tokenize(sent))
     |
     |  Method resolution order:
     |      FreqDist
     |      collections.Counter
     |      builtins.dict
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  B(self)
     |      Return the total number of sample values (or "bins") that
     |      have counts greater than zero.  For the total
     |      number of sample outcomes recorded, use ``FreqDist.N()``.
     |      (FreqDist.B() is the same as len(FreqDist).)
     |
     |      :rtype: int
     |
     |  N(self)
     |      Return the total number of sample outcomes that have been
     |      recorded by this FreqDist.  For the number of unique
     |      sample values (or bins) with counts greater than zero, use
     |      ``FreqDist.B()``.
     |
     |      :rtype: int
     |
     |  Nr(self, r, bins=None)
     |
     |  __add__(self, other)
     |      Add counts from two counters.
     |
     |      >>> FreqDist('abbb') + FreqDist('bcc')
     |      FreqDist({'b': 4, 'c': 2, 'a': 1})
     |
     |  __and__(self, other)
     |      Intersection is the minimum of corresponding counts.
     |
     |      >>> FreqDist('abbb') & FreqDist('bcc')
     |      FreqDist({'b': 1})
     |
     |  __delitem__(self, key)
     |      Override ``Counter.__delitem__()`` to invalidate the cached N
     |
     |  __ge__(self, other)
     |      True if all counts in self are a superset of those in other.
     |
     |  __gt__ lambda self, other
     |
     |  __init__(self, samples=None)
     |      Construct a new frequency distribution.  If ``samples`` is
     |      given, then the frequency distribution will be initialized
     |      with the count of each object in ``samples``; otherwise, it
     |      will be initialized to be empty.
     |
     |      In particular, ``FreqDist()`` returns an empty frequency
     |      distribution; and ``FreqDist(samples)`` first creates an empty
     |      frequency distribution, and then calls ``update`` with the
     |      list ``samples``.
     |
     |      :param samples: The samples to initialize the frequency
     |          distribution with.
     |      :type samples: Sequence
     |
     |  __iter__(self)
     |      Return an iterator which yields tokens ordered by frequency.
     |
     |      :rtype: iterator
     |
     |  __le__(self, other)
     |      Returns True if this frequency distribution is a subset of the other
     |      and for no key the value exceeds the value of the same key from
     |      the other frequency distribution.
     |
     |      The <= operator forms partial order and satisfying the axioms
     |      reflexivity, antisymmetry and transitivity.
     |
     |      >>> FreqDist('a') <= FreqDist('a')
     |      True
     |      >>> a = FreqDist('abc')
     |      >>> b = FreqDist('aabc')
     |      >>> (a <= b, b <= a)
     |      (True, False)
     |      >>> FreqDist('a') <= FreqDist('abcd')
     |      True
     |      >>> FreqDist('abc') <= FreqDist('xyz')
     |      False
     |      >>> FreqDist('xyz') <= FreqDist('abc')
     |      False
     |      >>> c = FreqDist('a')
     |      >>> d = FreqDist('aa')
     |      >>> e = FreqDist('aaa')
     |      >>> c <= d and d <= e and c <= e
     |      True
     |
     |  __lt__ lambda self, other
     |
     |  __or__(self, other)
     |      Union is the maximum of value in either of the input counters.
     |
     |      >>> FreqDist('abbb') | FreqDist('bcc')
     |      FreqDist({'b': 3, 'c': 2, 'a': 1})
     |
     |  __repr__(self)
     |      Return a string representation of this FreqDist.
     |
     |      :rtype: string
     |
     |  __setitem__(self, key, val)
     |      Override ``Counter.__setitem__()`` to invalidate the cached N
     |
     |  __str__(self)
     |      Return a string representation of this FreqDist.
     |
     |      :rtype: string
     |
     |  __sub__(self, other)
     |      Subtract count, but keep only results with positive counts.
     |
     |      >>> FreqDist('abbbc') - FreqDist('bccd')
     |      FreqDist({'b': 2, 'a': 1})
     |
     |  copy(self)
     |      Create a copy of this frequency distribution.
     |
     |      :rtype: FreqDist
     |
     |  freq(self, sample)
     |      Return the frequency of a given sample.  The frequency of a
     |      sample is defined as the count of that sample divided by the
     |      total number of sample outcomes that have been recorded by
     |      this FreqDist.  The count of a sample is defined as the
     |      number of times that sample outcome was recorded by this
     |      FreqDist.  Frequencies are always real numbers in the range
     |      [0, 1].
     |
     |      :param sample: the sample whose frequency
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  hapaxes(self)
     |      Return a list of all samples that occur once (hapax legomena)
     |
     |      :rtype: list
     |
     |  max(self)
     |      Return the sample with the greatest number of outcomes in this
     |      frequency distribution.  If two or more samples have the same
     |      number of outcomes, return one of them; which sample is
     |      returned is undefined.  If no outcomes have occurred in this
     |      frequency distribution, return None.
     |
     |      :return: The sample with the maximum number of outcomes in this
     |              frequency distribution.
     |      :rtype: any or None
     |
     |  pformat(self, maxlen=10)
     |      Return a string representation of this FreqDist.
     |
     |      :param maxlen: The maximum number of items to display
     |      :type maxlen: int
     |      :rtype: string
     |
     |  plot(self, *args, title='', cumulative=False, percents=False, show=False, **kwargs)
     |      Plot samples from the frequency distribution
     |      displaying the most frequent sample first.  If an integer
     |      parameter is supplied, stop after this many samples have been
     |      plotted.  For a cumulative plot, specify cumulative=True. Additional
     |      ``**kwargs`` are passed to matplotlib's plot function.
     |      (Requires Matplotlib to be installed.)
     |
     |      :param title: The title for the graph.
     |      :type title: str
     |      :param cumulative: Whether the plot is cumulative. (default = False)
     |      :type cumulative: bool
     |      :param percents: Whether the plot uses percents instead of counts. (default = False)
     |      :type percents: bool
     |      :param show: Whether to show the plot, or only return the ax.
     |      :type show: bool
     |
     |  pprint(self, maxlen=10, stream=None)
     |      Print a string representation of this FreqDist to 'stream'
     |
     |      :param maxlen: The maximum number of items to print
     |      :type maxlen: int
     |      :param stream: The stream to print to. stdout by default
     |
     |  r_Nr(self, bins=None)
     |      Return the dictionary mapping r to Nr, the number of samples with frequency r, where Nr > 0.
     |
     |      :type bins: int
     |      :param bins: The number of possible sample outcomes.  ``bins``
     |          is used to calculate Nr(0).  In particular, Nr(0) is
     |          ``bins-self.B()``.  If ``bins`` is not specified, it
     |          defaults to ``self.B()`` (so Nr(0) will be 0).
     |      :rtype: int
     |
     |  setdefault(self, key, val)
     |      Override ``Counter.setdefault()`` to invalidate the cached N
     |
     |  tabulate(self, *args, **kwargs)
     |      Tabulate the given samples from the frequency distribution (cumulative),
     |      displaying the most frequent sample first.  If an integer
     |      parameter is supplied, stop after this many samples have been
     |      plotted.
     |
     |      :param samples: The samples to plot (default is all samples)
     |      :type samples: list
     |      :param cumulative: A flag to specify whether the freqs are cumulative (default = False)
     |      :type title: bool
     |
     |  update(self, *args, **kwargs)
     |      Override ``Counter.update()`` to invalidate the cached N
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from collections.Counter:
     |
     |  __eq__(self, other)
     |      True if all counts agree. Missing counts are treated as zero.
     |
     |  __iadd__(self, other)
     |      Inplace add from another counter, keeping only positive counts.
     |
     |      >>> c = Counter('abbb')
     |      >>> c += Counter('bcc')
     |      >>> c
     |      Counter({'b': 4, 'c': 2, 'a': 1})
     |
     |  __iand__(self, other)
     |      Inplace intersection is the minimum of corresponding counts.
     |
     |      >>> c = Counter('abbb')
     |      >>> c &= Counter('bcc')
     |      >>> c
     |      Counter({'b': 1})
     |
     |  __ior__(self, other)
     |      Inplace union is the maximum of value from either counter.
     |
     |      >>> c = Counter('abbb')
     |      >>> c |= Counter('bcc')
     |      >>> c
     |      Counter({'b': 3, 'c': 2, 'a': 1})
     |
     |  __isub__(self, other)
     |      Inplace subtract counter, but keep only results with positive counts.
     |
     |      >>> c = Counter('abbbc')
     |      >>> c -= Counter('bccd')
     |      >>> c
     |      Counter({'b': 2, 'a': 1})
     |
     |  __missing__(self, key)
     |      The count of elements not in the Counter is zero.
     |
     |  __ne__(self, other)
     |      True if any counts disagree. Missing counts are treated as zero.
     |
     |  __neg__(self)
     |      Subtracts from an empty counter.  Strips positive and zero counts,
     |      and flips the sign on negative counts.
     |
     |  __pos__(self)
     |      Adds an empty counter, effectively stripping negative and zero counts
     |
     |  __reduce__(self)
     |      Helper for pickle.
     |
     |  elements(self)
     |      Iterator over elements repeating each as many times as its count.
     |
     |      >>> c = Counter('ABCABC')
     |      >>> sorted(c.elements())
     |      ['A', 'A', 'B', 'B', 'C', 'C']
     |
     |      Knuth's example for prime factors of 1836:  2**2 * 3**3 * 17**1
     |
     |      >>> import math
     |      >>> prime_factors = Counter({2: 2, 3: 3, 17: 1})
     |      >>> math.prod(prime_factors.elements())
     |      1836
     |
     |      Note, if an element's count has been set to zero or is a negative
     |      number, elements() will ignore it.
     |
     |  most_common(self, n=None)
     |      List the n most common elements and their counts from the most
     |      common to the least.  If n is None, then list all element counts.
     |
     |      >>> Counter('abracadabra').most_common(3)
     |      [('a', 5), ('b', 2), ('r', 2)]
     |
     |  subtract(self, iterable=None, /, **kwds)
     |      Like dict.update() but subtracts counts instead of replacing them.
     |      Counts can be reduced below zero.  Both the inputs and outputs are
     |      allowed to contain zero and negative counts.
     |
     |      Source can be an iterable, a dictionary, or another Counter instance.
     |
     |      >>> c = Counter('which')
     |      >>> c.subtract('witch')             # subtract elements from another iterable
     |      >>> c.subtract(Counter('watch'))    # subtract elements from another counter
     |      >>> c['h']                          # 2 in which, minus 1 in witch, minus 1 in watch
     |      0
     |      >>> c['w']                          # 1 in which, minus 1 in witch, minus 1 in watch
     |      -1
     |
     |  total(self)
     |      Sum of the counts
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from collections.Counter:
     |
     |  fromkeys(iterable, v=None)
     |      Create a new dictionary with keys from iterable and values set to value.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from collections.Counter:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from collections.Counter:
     |
     |  __hash__ = None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.dict:
     |
     |  __contains__(self, key, /)
     |      True if the dictionary has the specified key, else False.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the dict keys.
     |
     |  __ror__(self, value, /)
     |      Return value|self.
     |
     |  __sizeof__(...)
     |      D.__sizeof__() -> size of D in memory, in bytes
     |
     |  clear(...)
     |      D.clear() -> None.  Remove all items from D.
     |
     |  get(self, key, default=None, /)
     |      Return the value for key if key is in the dictionary, else default.
     |
     |  items(...)
     |      D.items() -> a set-like object providing a view on D's items
     |
     |  keys(...)
     |      D.keys() -> a set-like object providing a view on D's keys
     |
     |  pop(...)
     |      D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
     |
     |      If the key is not found, return the default if given; otherwise,
     |      raise a KeyError.
     |
     |  popitem(self, /)
     |      Remove and return a (key, value) pair as a 2-tuple.
     |
     |      Pairs are returned in LIFO (last-in, first-out) order.
     |      Raises KeyError if the dict is empty.
     |
     |  values(...)
     |      D.values() -> an object providing a view on D's values
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.dict:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.dict:
     |
     |  __new__(*args, **kwargs) class method of builtins.dict
     |      Create and return a new object.  See help(type) for accurate signature.

    class HeldoutProbDist(ProbDistI)
     |  HeldoutProbDist(base_fdist, heldout_fdist, bins=None)
     |
     |  The heldout estimate for the probability distribution of the
     |  experiment used to generate two frequency distributions.  These
     |  two frequency distributions are called the "heldout frequency
     |  distribution" and the "base frequency distribution."  The
     |  "heldout estimate" uses uses the "heldout frequency
     |  distribution" to predict the probability of each sample, given its
     |  frequency in the "base frequency distribution".
     |
     |  In particular, the heldout estimate approximates the probability
     |  for a sample that occurs *r* times in the base distribution as
     |  the average frequency in the heldout distribution of all samples
     |  that occur *r* times in the base distribution.
     |
     |  This average frequency is *Tr[r]/(Nr[r].N)*, where:
     |
     |  - *Tr[r]* is the total count in the heldout distribution for
     |    all samples that occur *r* times in the base distribution.
     |  - *Nr[r]* is the number of samples that occur *r* times in
     |    the base distribution.
     |  - *N* is the number of outcomes recorded by the heldout
     |    frequency distribution.
     |
     |  In order to increase the efficiency of the ``prob`` member
     |  function, *Tr[r]/(Nr[r].N)* is precomputed for each value of *r*
     |  when the ``HeldoutProbDist`` is created.
     |
     |  :type _estimate: list(float)
     |  :ivar _estimate: A list mapping from *r*, the number of
     |      times that a sample occurs in the base distribution, to the
     |      probability estimate for that sample.  ``_estimate[r]`` is
     |      calculated by finding the average frequency in the heldout
     |      distribution of all samples that occur *r* times in the base
     |      distribution.  In particular, ``_estimate[r]`` =
     |      *Tr[r]/(Nr[r].N)*.
     |  :type _max_r: int
     |  :ivar _max_r: The maximum number of times that any sample occurs
     |      in the base distribution.  ``_max_r`` is used to decide how
     |      large ``_estimate`` must be.
     |
     |  Method resolution order:
     |      HeldoutProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, base_fdist, heldout_fdist, bins=None)
     |      Use the heldout estimate to create a probability distribution
     |      for the experiment used to generate ``base_fdist`` and
     |      ``heldout_fdist``.
     |
     |      :type base_fdist: FreqDist
     |      :param base_fdist: The base frequency distribution.
     |      :type heldout_fdist: FreqDist
     |      :param heldout_fdist: The heldout frequency distribution.
     |      :type bins: int
     |      :param bins: The number of sample values that can be generated
     |          by the experiment that is described by the probability
     |          distribution.  This value must be correctly set for the
     |          probabilities of the sample values to sum to one.  If
     |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
     |
     |  __repr__(self)
     |      :rtype: str
     |      :return: A string representation of this ``ProbDist``.
     |
     |  base_fdist(self)
     |      Return the base frequency distribution that this probability
     |      distribution is based on.
     |
     |      :rtype: FreqDist
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  heldout_fdist(self)
     |      Return the heldout frequency distribution that this
     |      probability distribution is based on.
     |
     |      :rtype: FreqDist
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  SUM_TO_ONE = False
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ImmutableProbabilisticMixIn(ProbabilisticMixIn)
     |  ImmutableProbabilisticMixIn(**kwargs)
     |
     |  Method resolution order:
     |      ImmutableProbabilisticMixIn
     |      ProbabilisticMixIn
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  set_logprob(self, prob)
     |      Set the log probability associated with this object to
     |      ``logprob``.  I.e., set the probability associated with this
     |      object to ``2**(logprob)``.
     |
     |      :param logprob: The new log probability
     |      :type logprob: float
     |
     |  set_prob(self, prob)
     |      Set the probability associated with this object to ``prob``.
     |
     |      :param prob: The new probability
     |      :type prob: float
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbabilisticMixIn:
     |
     |  __init__(self, **kwargs)
     |      Initialize this object's probability.  This initializer should
     |      be called by subclass constructors.  ``prob`` should generally be
     |      the first argument for those constructors.
     |
     |      :param prob: The probability associated with the object.
     |      :type prob: float
     |      :param logprob: The log of the probability associated with
     |          the object.
     |      :type logprob: float
     |
     |  logprob(self)
     |      Return ``log(p)``, where ``p`` is the probability associated
     |      with this object.
     |
     |      :rtype: float
     |
     |  prob(self)
     |      Return the probability associated with this object.
     |
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbabilisticMixIn:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class KneserNeyProbDist(ProbDistI)
     |  KneserNeyProbDist(freqdist, bins=None, discount=0.75)
     |
     |  Kneser-Ney estimate of a probability distribution. This is a version of
     |  back-off that counts how likely an n-gram is provided the n-1-gram had
     |  been seen in training. Extends the ProbDistI interface, requires a trigram
     |  FreqDist instance to train on. Optionally, a different from default discount
     |  value can be specified. The default discount is set to 0.75.
     |
     |  Method resolution order:
     |      KneserNeyProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, freqdist, bins=None, discount=0.75)
     |      :param freqdist: The trigram frequency distribution upon which to base
     |          the estimation
     |      :type freqdist: FreqDist
     |      :param bins: Included for compatibility with nltk.tag.hmm
     |      :type bins: int or float
     |      :param discount: The discount applied when retrieving counts of
     |          trigrams
     |      :type discount: float (preferred, but can be set to int)
     |
     |  __repr__(self)
     |      Return a string representation of this ProbDist
     |
     |      :rtype: str
     |
     |  discount(self)
     |      Return the value by which counts are discounted. By default set to 0.75.
     |
     |      :rtype: float
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, trigram)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  set_discount(self, discount)
     |      Set the value by which counts are discounted to the value of discount.
     |
     |      :param discount: the new value to discount counts by
     |      :type discount: float (preferred, but int possible)
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from ProbDistI:
     |
     |  SUM_TO_ONE = True

    class LaplaceProbDist(LidstoneProbDist)
     |  LaplaceProbDist(freqdist, bins=None)
     |
     |  The Laplace estimate for the probability distribution of the
     |  experiment used to generate a frequency distribution.  The
     |  "Laplace estimate" approximates the probability of a sample with
     |  count *c* from an experiment with *N* outcomes and *B* bins as
     |  *(c+1)/(N+B)*.  This is equivalent to adding one to the count for
     |  each bin, and taking the maximum likelihood estimate of the
     |  resulting frequency distribution.
     |
     |  Method resolution order:
     |      LaplaceProbDist
     |      LidstoneProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, freqdist, bins=None)
     |      Use the Laplace estimate to create a probability distribution
     |      for the experiment used to generate ``freqdist``.
     |
     |      :type freqdist: FreqDist
     |      :param freqdist: The frequency distribution that the
     |          probability estimates should be based on.
     |      :type bins: int
     |      :param bins: The number of sample values that can be generated
     |          by the experiment that is described by the probability
     |          distribution.  This value must be correctly set for the
     |          probabilities of the sample values to sum to one.  If
     |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
     |
     |  __repr__(self)
     |      :rtype: str
     |      :return: A string representation of this ``ProbDist``.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from LidstoneProbDist:
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  freqdist(self)
     |      Return the frequency distribution that this probability
     |      distribution is based on.
     |
     |      :rtype: FreqDist
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from LidstoneProbDist:
     |
     |  SUM_TO_ONE = False
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LidstoneProbDist(ProbDistI)
     |  LidstoneProbDist(freqdist, gamma, bins=None)
     |
     |  The Lidstone estimate for the probability distribution of the
     |  experiment used to generate a frequency distribution.  The
     |  "Lidstone estimate" is parameterized by a real number *gamma*,
     |  which typically ranges from 0 to 1.  The Lidstone estimate
     |  approximates the probability of a sample with count *c* from an
     |  experiment with *N* outcomes and *B* bins as
     |  ``c+gamma)/(N+B*gamma)``.  This is equivalent to adding
     |  *gamma* to the count for each bin, and taking the maximum
     |  likelihood estimate of the resulting frequency distribution.
     |
     |  Method resolution order:
     |      LidstoneProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, freqdist, gamma, bins=None)
     |      Use the Lidstone estimate to create a probability distribution
     |      for the experiment used to generate ``freqdist``.
     |
     |      :type freqdist: FreqDist
     |      :param freqdist: The frequency distribution that the
     |          probability estimates should be based on.
     |      :type gamma: float
     |      :param gamma: A real number used to parameterize the
     |          estimate.  The Lidstone estimate is equivalent to adding
     |          *gamma* to the count for each bin, and taking the
     |          maximum likelihood estimate of the resulting frequency
     |          distribution.
     |      :type bins: int
     |      :param bins: The number of sample values that can be generated
     |          by the experiment that is described by the probability
     |          distribution.  This value must be correctly set for the
     |          probabilities of the sample values to sum to one.  If
     |          ``bins`` is not specified, it defaults to ``freqdist.B()``.
     |
     |  __repr__(self)
     |      Return a string representation of this ``ProbDist``.
     |
     |      :rtype: str
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  freqdist(self)
     |      Return the frequency distribution that this probability
     |      distribution is based on.
     |
     |      :rtype: FreqDist
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  SUM_TO_ONE = False
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class MLEProbDist(ProbDistI)
     |  MLEProbDist(freqdist, bins=None)
     |
     |  The maximum likelihood estimate for the probability distribution
     |  of the experiment used to generate a frequency distribution.  The
     |  "maximum likelihood estimate" approximates the probability of
     |  each sample as the frequency of that sample in the frequency
     |  distribution.
     |
     |  Method resolution order:
     |      MLEProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, freqdist, bins=None)
     |      Use the maximum likelihood estimate to create a probability
     |      distribution for the experiment used to generate ``freqdist``.
     |
     |      :type freqdist: FreqDist
     |      :param freqdist: The frequency distribution that the
     |          probability estimates should be based on.
     |
     |  __repr__(self)
     |      :rtype: str
     |      :return: A string representation of this ``ProbDist``.
     |
     |  freqdist(self)
     |      Return the frequency distribution that this probability
     |      distribution is based on.
     |
     |      :rtype: FreqDist
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from ProbDistI:
     |
     |  SUM_TO_ONE = True

    class MutableProbDist(ProbDistI)
     |  MutableProbDist(prob_dist, samples, store_logs=True)
     |
     |  An mutable probdist where the probabilities may be easily modified. This
     |  simply copies an existing probdist, storing the probability values in a
     |  mutable dictionary and providing an update method.
     |
     |  Method resolution order:
     |      MutableProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, prob_dist, samples, store_logs=True)
     |      Creates the mutable probdist based on the given prob_dist and using
     |      the list of samples given. These values are stored as log
     |      probabilities if the store_logs flag is set.
     |
     |      :param prob_dist: the distribution from which to garner the
     |          probabilities
     |      :type prob_dist: ProbDist
     |      :param samples: the complete set of samples
     |      :type samples: sequence of any
     |      :param store_logs: whether to store the probabilities as logarithms
     |      :type store_logs: bool
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  update(self, sample, prob, log=True)
     |      Update the probability for the given sample. This may cause the object
     |      to stop being the valid probability distribution - the user must
     |      ensure that they update the sample probabilities such that all samples
     |      have probabilities between 0 and 1 and that all probabilities sum to
     |      one.
     |
     |      :param sample: the sample for which to update the probability
     |      :type sample: any
     |      :param prob: the new probability
     |      :type prob: float
     |      :param log: is the probability already logged
     |      :type log: bool
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from ProbDistI:
     |
     |  SUM_TO_ONE = True

    class ProbDistI(builtins.object)
     |  A probability distribution for the outcomes of an experiment.  A
     |  probability distribution specifies how likely it is that an
     |  experiment will have any given outcome.  For example, a
     |  probability distribution could be used to predict the probability
     |  that a token in a document will have a given type.  Formally, a
     |  probability distribution can be defined as a function mapping from
     |  samples to nonnegative real numbers, such that the sum of every
     |  number in the function's range is 1.0.  A ``ProbDist`` is often
     |  used to model the probability distribution of the experiment used
     |  to generate a frequency distribution.
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Classes inheriting from ProbDistI should implement __init__.
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  SUM_TO_ONE = True
     |
     |  __abstractmethods__ = frozenset({'__init__', 'max', 'prob', 'samples'}...

    class ProbabilisticMixIn(builtins.object)
     |  ProbabilisticMixIn(**kwargs)
     |
     |  A mix-in class to associate probabilities with other classes
     |  (trees, rules, etc.).  To use the ``ProbabilisticMixIn`` class,
     |  define a new class that derives from an existing class and from
     |  ProbabilisticMixIn.  You will need to define a new constructor for
     |  the new class, which explicitly calls the constructors of both its
     |  parent classes.  For example:
     |
     |      >>> from nltk.probability import ProbabilisticMixIn
     |      >>> class A:
     |      ...     def __init__(self, x, y): self.data = (x,y)
     |      ...
     |      >>> class ProbabilisticA(A, ProbabilisticMixIn):
     |      ...     def __init__(self, x, y, **prob_kwarg):
     |      ...         A.__init__(self, x, y)
     |      ...         ProbabilisticMixIn.__init__(self, **prob_kwarg)
     |
     |  See the documentation for the ProbabilisticMixIn
     |  ``constructor<__init__>`` for information about the arguments it
     |  expects.
     |
     |  You should generally also redefine the string representation
     |  methods, the comparison methods, and the hashing method.
     |
     |  Methods defined here:
     |
     |  __init__(self, **kwargs)
     |      Initialize this object's probability.  This initializer should
     |      be called by subclass constructors.  ``prob`` should generally be
     |      the first argument for those constructors.
     |
     |      :param prob: The probability associated with the object.
     |      :type prob: float
     |      :param logprob: The log of the probability associated with
     |          the object.
     |      :type logprob: float
     |
     |  logprob(self)
     |      Return ``log(p)``, where ``p`` is the probability associated
     |      with this object.
     |
     |      :rtype: float
     |
     |  prob(self)
     |      Return the probability associated with this object.
     |
     |      :rtype: float
     |
     |  set_logprob(self, logprob)
     |      Set the log probability associated with this object to
     |      ``logprob``.  I.e., set the probability associated with this
     |      object to ``2**(logprob)``.
     |
     |      :param logprob: The new log probability
     |      :type logprob: float
     |
     |  set_prob(self, prob)
     |      Set the probability associated with this object to ``prob``.
     |
     |      :param prob: The new probability
     |      :type prob: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SimpleGoodTuringProbDist(ProbDistI)
     |  SimpleGoodTuringProbDist(freqdist, bins=None)
     |
     |  SimpleGoodTuring ProbDist approximates from frequency to frequency of
     |  frequency into a linear line under log space by linear regression.
     |  Details of Simple Good-Turing algorithm can be found in:
     |
     |  - Good Turing smoothing without tears" (Gale & Sampson 1995),
     |    Journal of Quantitative Linguistics, vol. 2 pp. 217-237.
     |  - "Speech and Language Processing (Jurafsky & Martin),
     |    2nd Edition, Chapter 4.5 p103 (log(Nc) =  a + b*log(c))
     |  - https://www.grsampson.net/RGoodTur.html
     |
     |  Given a set of pair (xi, yi),  where the xi denotes the frequency and
     |  yi denotes the frequency of frequency, we want to minimize their
     |  square variation. E(x) and E(y) represent the mean of xi and yi.
     |
     |  - slope: b = sigma ((xi-E(x)(yi-E(y))) / sigma ((xi-E(x))(xi-E(x)))
     |  - intercept: a = E(y) - b.E(x)
     |
     |  Method resolution order:
     |      SimpleGoodTuringProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, freqdist, bins=None)
     |      :param freqdist: The frequency counts upon which to base the
     |          estimation.
     |      :type freqdist: FreqDist
     |      :param bins: The number of possible event types. This must be
     |          larger than the number of bins in the ``freqdist``. If None,
     |          then it's assumed to be equal to ``freqdist``.B() + 1
     |      :type bins: int
     |
     |  __repr__(self)
     |      Return a string representation of this ``ProbDist``.
     |
     |      :rtype: str
     |
     |  check(self)
     |
     |  discount(self)
     |      This function returns the total mass of probability transfers from the
     |      seen samples to the unseen samples.
     |
     |  find_best_fit(self, r, nr)
     |      Use simple linear regression to tune parameters self._slope and
     |      self._intercept in the log-log space based on count and Nr(count)
     |      (Work in log space to avoid floating point underflow.)
     |
     |  freqdist(self)
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the sample's probability.
     |
     |      :param sample: sample of the event
     |      :type sample: str
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  smoothedNr(self, r)
     |      Return the number of samples with count r.
     |
     |      :param r: The amount of frequency.
     |      :type r: int
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  SUM_TO_ONE = False
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class UniformProbDist(ProbDistI)
     |  UniformProbDist(samples)
     |
     |  A probability distribution that assigns equal probability to each
     |  sample in a given set; and a zero probability to all other
     |  samples.
     |
     |  Method resolution order:
     |      UniformProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, samples)
     |      Construct a new uniform probability distribution, that assigns
     |      equal probability to each sample in ``samples``.
     |
     |      :param samples: The samples that should be given uniform
     |          probability.
     |      :type samples: list
     |      :raise ValueError: If ``samples`` is empty.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from ProbDistI:
     |
     |  SUM_TO_ONE = True

    class WittenBellProbDist(ProbDistI)
     |  WittenBellProbDist(freqdist, bins=None)
     |
     |  The Witten-Bell estimate of a probability distribution. This distribution
     |  allocates uniform probability mass to as yet unseen events by using the
     |  number of events that have only been seen once. The probability mass
     |  reserved for unseen events is equal to *T / (N + T)*
     |  where *T* is the number of observed event types and *N* is the total
     |  number of observed events. This equates to the maximum likelihood estimate
     |  of a new type event occurring. The remaining probability mass is discounted
     |  such that all probability estimates sum to one, yielding:
     |
     |      - *p = T / Z (N + T)*, if count = 0
     |      - *p = c / (N + T)*, otherwise
     |
     |  Method resolution order:
     |      WittenBellProbDist
     |      ProbDistI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, freqdist, bins=None)
     |      Creates a distribution of Witten-Bell probability estimates.  This
     |      distribution allocates uniform probability mass to as yet unseen
     |      events by using the number of events that have only been seen once. The
     |      probability mass reserved for unseen events is equal to *T / (N + T)*
     |      where *T* is the number of observed event types and *N* is the total
     |      number of observed events. This equates to the maximum likelihood
     |      estimate of a new type event occurring. The remaining probability mass
     |      is discounted such that all probability estimates sum to one,
     |      yielding:
     |
     |          - *p = T / Z (N + T)*, if count = 0
     |          - *p = c / (N + T)*, otherwise
     |
     |      The parameters *T* and *N* are taken from the ``freqdist`` parameter
     |      (the ``B()`` and ``N()`` values). The normalizing factor *Z* is
     |      calculated using these values along with the ``bins`` parameter.
     |
     |      :param freqdist: The frequency counts upon which to base the
     |          estimation.
     |      :type freqdist: FreqDist
     |      :param bins: The number of possible event types. This must be at least
     |          as large as the number of bins in the ``freqdist``. If None, then
     |          it's assumed to be equal to that of the ``freqdist``
     |      :type bins: int
     |
     |  __repr__(self)
     |      Return a string representation of this ``ProbDist``.
     |
     |      :rtype: str
     |
     |  discount(self)
     |      Return the ratio by which counts are discounted on average: c*/c
     |
     |      :rtype: float
     |
     |  freqdist(self)
     |
     |  max(self)
     |      Return the sample with the greatest probability.  If two or
     |      more samples have the same probability, return one of them;
     |      which sample is returned is undefined.
     |
     |      :rtype: any
     |
     |  prob(self, sample)
     |      Return the probability for a given sample.  Probabilities
     |      are always real numbers in the range [0, 1].
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  samples(self)
     |      Return a list of all samples that have nonzero probabilities.
     |      Use ``prob`` to find the probability of each sample.
     |
     |      :rtype: list
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ProbDistI:
     |
     |  generate(self)
     |      Return a randomly selected sample from this probability distribution.
     |      The probability of returning each sample ``samp`` is equal to
     |      ``self.prob(samp)``.
     |
     |  logprob(self, sample)
     |      Return the base 2 logarithm of the probability for a given sample.
     |
     |      :param sample: The sample whose probability
     |             should be returned.
     |      :type sample: any
     |      :rtype: float
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from ProbDistI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from ProbDistI:
     |
     |  SUM_TO_ONE = True

FUNCTIONS
    add_logs(logx, logy)
        Given two numbers ``logx`` = *log(x)* and ``logy`` = *log(y)*, return
        *log(x+y)*.  Conceptually, this is the same as returning
        ``log(2**(logx)+2**(logy))``, but the actual implementation
        avoids overflow errors that could result from direct computation.

    entropy(pdist)

    log_likelihood(test_pdist, actual_pdist)

    sum_logs(logs)

DATA
    __all__ = ['ConditionalFreqDist', 'ConditionalProbDist', 'ConditionalP...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\probability.py

nltk.projectivedependencyparser
Python Library Documentation: module nltk.parse.projectivedependencyparser in nltk.parse

NAME
    nltk.parse.projectivedependencyparser

DESCRIPTION
    # Natural Language Toolkit: Dependency Grammars
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Jason Narad <jason.narad@gmail.com>
    #
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT
    #

CLASSES
    builtins.object
        ChartCell
        DependencySpan
        ProbabilisticProjectiveDependencyParser
        ProjectiveDependencyParser

    class ChartCell(builtins.object)
     |  ChartCell(x, y)
     |
     |  A cell from the parse chart formed when performing the CYK algorithm.
     |  Each cell keeps track of its x and y coordinates (though this will probably
     |  be discarded), and a list of spans serving as the cell's entries.
     |
     |  Methods defined here:
     |
     |  __init__(self, x, y)
     |      :param x: This cell's x coordinate.
     |      :type x: int.
     |      :param y: This cell's y coordinate.
     |      :type y: int.
     |
     |  __repr__(self)
     |      :return: A concise string representation of this ``ChartCell``.
     |      :rtype: str.
     |
     |  __str__(self)
     |      :return: A verbose string representation of this ``ChartCell``.
     |      :rtype: str.
     |
     |  add(self, span)
     |      Appends the given span to the list of spans
     |      representing the chart cell's entries.
     |
     |      :param span: The span to add.
     |      :type span: DependencySpan
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DependencySpan(builtins.object)
     |  DependencySpan(start_index, end_index, head_index, arcs, tags)
     |
     |  A contiguous span over some part of the input string representing
     |  dependency (head -> modifier) relationships amongst words.  An atomic
     |  span corresponds to only one word so it isn't a 'span' in the conventional
     |  sense, as its _start_index = _end_index = _head_index for concatenation
     |  purposes.  All other spans are assumed to have arcs between all nodes
     |  within the start and end indexes of the span, and one head index corresponding
     |  to the head word for the entire span.  This is the same as the root node if
     |  the dependency structure were depicted as a graph.
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__(self, other) from functools
     |      Return a >= b.  Computed by @total_ordering from (not a < b).
     |
     |  __gt__(self, other) from functools
     |      Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).
     |
     |  __hash__(self)
     |      :return: The hash value of this ``DependencySpan``.
     |
     |  __init__(self, start_index, end_index, head_index, arcs, tags)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __le__(self, other) from functools
     |      Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __ne__(self, other)
     |      Return self!=value.
     |
     |  __repr__(self)
     |      :return: A concise string representatino of the ``DependencySpan``.
     |      :rtype: str.
     |
     |  __str__(self)
     |      :return: A verbose string representation of the ``DependencySpan``.
     |      :rtype: str
     |
     |  head_index(self)
     |      :return: An value indexing the head of the entire ``DependencySpan``.
     |      :rtype: int
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProbabilisticProjectiveDependencyParser(builtins.object)
     |  A probabilistic, projective dependency parser.
     |
     |  This parser returns the most probable projective parse derived from the
     |  probabilistic dependency grammar derived from the train() method.  The
     |  probabilistic model is an implementation of Eisner's (1996) Model C, which
     |  conditions on head-word, head-tag, child-word, and child-tag.  The decoding
     |  uses a bottom-up chart-based span concatenation algorithm that's identical
     |  to the one utilized by the rule-based projective parser.
     |
     |  Usage example
     |
     |  >>> from nltk.parse.dependencygraph import conll_data2
     |
     |  >>> graphs = [
     |  ... DependencyGraph(entry) for entry in conll_data2.split('\n\n') if entry
     |  ... ]
     |
     |  >>> ppdp = ProbabilisticProjectiveDependencyParser()
     |  >>> ppdp.train(graphs)
     |
     |  >>> sent = ['Cathy', 'zag', 'hen', 'wild', 'zwaaien', '.']
     |  >>> list(ppdp.parse(sent))
     |  [Tree('zag', ['Cathy', 'hen', Tree('zwaaien', ['wild', '.'])])]
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Create a new probabilistic dependency parser.  No additional
     |      operations are necessary.
     |
     |  compute_prob(self, dg)
     |      Computes the probability of a dependency graph based
     |      on the parser's probability model (defined by the parser's
     |      statistical dependency grammar).
     |
     |      :param dg: A dependency graph to score.
     |      :type dg: DependencyGraph
     |      :return: The probability of the dependency graph.
     |      :rtype: int
     |
     |  concatenate(self, span1, span2)
     |      Concatenates the two spans in whichever way possible.  This
     |      includes rightward concatenation (from the leftmost word of the
     |      leftmost span to the rightmost word of the rightmost span) and
     |      leftward concatenation (vice-versa) between adjacent spans.  Unlike
     |      Eisner's presentation of span concatenation, these spans do not
     |      share or pivot on a particular word/word-index.
     |
     |      :return: A list of new spans formed through concatenation.
     |      :rtype: list(DependencySpan)
     |
     |  parse(self, tokens)
     |      Parses the list of tokens subject to the projectivity constraint
     |      and the productions in the parser's grammar.  This uses a method
     |      similar to the span-concatenation algorithm defined in Eisner (1996).
     |      It returns the most probable parse derived from the parser's
     |      probabilistic dependency grammar.
     |
     |  train(self, graphs)
     |      Trains a ProbabilisticDependencyGrammar based on the list of input
     |      DependencyGraphs.  This model is an implementation of Eisner's (1996)
     |      Model C, which derives its statistics from head-word, head-tag,
     |      child-word, and child-tag relationships.
     |
     |      :param graphs: A list of dependency graphs to train from.
     |      :type: list(DependencyGraph)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MAX_TOKENS = 500

    class ProjectiveDependencyParser(builtins.object)
     |  ProjectiveDependencyParser(dependency_grammar)
     |
     |  A projective, rule-based, dependency parser.  A ProjectiveDependencyParser
     |  is created with a DependencyGrammar, a set of productions specifying
     |  word-to-word dependency relations.  The parse() method will then
     |  return the set of all parses, in tree representation, for a given input
     |  sequence of tokens.  Each parse must meet the requirements of the both
     |  the grammar and the projectivity constraint which specifies that the
     |  branches of the dependency tree are not allowed to cross.  Alternatively,
     |  this can be understood as stating that each parent node and its children
     |  in the parse tree form a continuous substring of the input sequence.
     |
     |  Methods defined here:
     |
     |  __init__(self, dependency_grammar)
     |      Create a new ProjectiveDependencyParser, from a word-to-word
     |      dependency grammar ``DependencyGrammar``.
     |
     |      :param dependency_grammar: A word-to-word relation dependencygrammar.
     |      :type dependency_grammar: DependencyGrammar
     |
     |  concatenate(self, span1, span2)
     |      Concatenates the two spans in whichever way possible.  This
     |      includes rightward concatenation (from the leftmost word of the
     |      leftmost span to the rightmost word of the rightmost span) and
     |      leftward concatenation (vice-versa) between adjacent spans.  Unlike
     |      Eisner's presentation of span concatenation, these spans do not
     |      share or pivot on a particular word/word-index.
     |
     |      :return: A list of new spans formed through concatenation.
     |      :rtype: list(DependencySpan)
     |
     |  parse(self, tokens)
     |      Performs a projective dependency parse on the list of tokens using
     |      a chart-based, span-concatenation algorithm similar to Eisner (1996).
     |
     |      :param tokens: The list of input tokens.
     |      :type tokens: list(str)
     |      :return: An iterator over parse trees.
     |      :rtype: iter(Tree)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MAX_TOKENS = 500

FUNCTIONS
    arity_parse_demo()
        A demonstration showing the creation of a ``DependencyGrammar``
        in which a specific number of modifiers is listed for a given
        head.  This can further constrain the number of possible parses
        created by a ``ProjectiveDependencyParser``.

    demo()

    projective_prob_parse_demo()
        A demo showing the training and use of a projective
        dependency parser.

    projective_rule_parse_demo()
        A demonstration showing the creation and use of a
        ``DependencyGrammar`` to perform a projective dependency
        parse.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\projectivedependencyparser.py

nltk.prover9
Python Library Documentation: module nltk.inference.prover9 in nltk.inference

NAME
    nltk.inference.prover9 - A theorem prover that makes use of the external 'Prover9' package.

CLASSES
    builtins.Exception(builtins.BaseException)
        Prover9Exception
            Prover9FatalException
            Prover9LimitExceededException
    builtins.object
        Prover9CommandParent
            Prover9Command(Prover9CommandParent, nltk.inference.api.BaseProverCommand)
        Prover9Parent
            Prover9(Prover9Parent, nltk.inference.api.Prover)

    class Prover9(Prover9Parent, nltk.inference.api.Prover)
     |  Prover9(timeout=60)
     |
     |  Method resolution order:
     |      Prover9
     |      Prover9Parent
     |      nltk.inference.api.Prover
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, timeout=60)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  prover9_input(self, goal, assumptions)
     |      :see: Prover9Parent.prover9_input
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Prover9Parent:
     |
     |  binary_locations(self)
     |      A list of directories that should be searched for the prover9
     |      executables.  This list is used by ``config_prover9`` when searching
     |      for the prover9 executables.
     |
     |  config_prover9(self, binary_location, verbose=False)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Prover9Parent:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.Prover:
     |
     |  prove(self, goal=None, assumptions=None, verbose=False)
     |      :return: Whether the proof was successful or not.
     |      :rtype: bool

    class Prover9Command(Prover9CommandParent, nltk.inference.api.BaseProverCommand)
     |  Prover9Command(goal=None, assumptions=None, timeout=60, prover=None)
     |
     |  A ``ProverCommand`` specific to the ``Prover9`` prover.  It contains
     |  the a print_assumptions() method that is used to print the list
     |  of assumptions in multiple formats.
     |
     |  Method resolution order:
     |      Prover9Command
     |      Prover9CommandParent
     |      nltk.inference.api.BaseProverCommand
     |      nltk.inference.api.BaseTheoremToolCommand
     |      nltk.inference.api.ProverCommand
     |      nltk.inference.api.TheoremToolCommand
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, goal=None, assumptions=None, timeout=60, prover=None)
     |      :param goal: Input expression to prove
     |      :type goal: sem.Expression
     |      :param assumptions: Input expressions to use as assumptions in
     |          the proof.
     |      :type assumptions: list(sem.Expression)
     |      :param timeout: number of seconds before timeout; set to 0 for
     |          no timeout.
     |      :type timeout: int
     |      :param prover: a prover.  If not set, one will be created.
     |      :type prover: Prover9
     |
     |  decorate_proof(self, proof_string, simplify=True)
     |      :see BaseProverCommand.decorate_proof()
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Prover9CommandParent:
     |
     |  print_assumptions(self, output_format='nltk')
     |      Print the list of the current assumptions.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Prover9CommandParent:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.BaseProverCommand:
     |
     |  get_prover(self)
     |      Return the prover object
     |      :return: ``Prover``
     |
     |  proof(self, simplify=True)
     |      Return the proof string
     |      :param simplify: bool simplify the proof?
     |      :return: str
     |
     |  prove(self, verbose=False)
     |      Perform the actual proof.  Store the result to prevent unnecessary
     |      re-proving.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.BaseTheoremToolCommand:
     |
     |  add_assumptions(self, new_assumptions)
     |      Add new assumptions to the assumption list.
     |
     |      :param new_assumptions: new assumptions
     |      :type new_assumptions: list(sem.Expression)
     |
     |  assumptions(self)
     |      List the current assumptions.
     |
     |      :return: list of ``Expression``
     |
     |  goal(self)
     |      Return the goal
     |
     |      :return: ``Expression``
     |
     |  retract_assumptions(self, retracted, debug=False)
     |      Retract assumptions from the assumption list.
     |
     |      :param debug: If True, give warning when ``retracted`` is not present on
     |          assumptions list.
     |      :type debug: bool
     |      :param retracted: assumptions to be retracted
     |      :type retracted: list(sem.Expression)

    class Prover9CommandParent(builtins.object)
     |  A common base class used by both ``Prover9Command`` and ``MaceCommand``,
     |  which is responsible for maintaining a goal and a set of assumptions,
     |  and generating prover9-style input files from them.
     |
     |  Methods defined here:
     |
     |  print_assumptions(self, output_format='nltk')
     |      Print the list of the current assumptions.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Prover9Exception(builtins.Exception)
     |  Prover9Exception(returncode, message)
     |
     |  Method resolution order:
     |      Prover9Exception
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, returncode, message)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class Prover9FatalException(Prover9Exception)
     |  Prover9FatalException(returncode, message)
     |
     |  Method resolution order:
     |      Prover9FatalException
     |      Prover9Exception
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods inherited from Prover9Exception:
     |
     |  __init__(self, returncode, message)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Prover9Exception:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class Prover9LimitExceededException(Prover9Exception)
     |  Prover9LimitExceededException(returncode, message)
     |
     |  Method resolution order:
     |      Prover9LimitExceededException
     |      Prover9Exception
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods inherited from Prover9Exception:
     |
     |  __init__(self, returncode, message)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Prover9Exception:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class Prover9Parent(builtins.object)
     |  A common class extended by both ``Prover9`` and ``Mace <mace.Mace>``.
     |  It contains the functionality required to convert NLTK-style
     |  expressions into Prover9-style expressions.
     |
     |  Methods defined here:
     |
     |  binary_locations(self)
     |      A list of directories that should be searched for the prover9
     |      executables.  This list is used by ``config_prover9`` when searching
     |      for the prover9 executables.
     |
     |  config_prover9(self, binary_location, verbose=False)
     |
     |  prover9_input(self, goal, assumptions)
     |      :return: The input string that should be provided to the
     |          prover9 binary.  This string is formed based on the goal,
     |          assumptions, and timeout value of this object.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    convert_to_prover9(input)
        Convert a ``logic.Expression`` to Prover9 format.

    demo()

    spacer(num=45)

    test_config()

    test_convert_to_prover9(expr)
        Test that parsing works OK.

    test_prove(arguments)
        Try some proofs and exhibit the results.

DATA
    arguments = [('(man(x) <-> (not (not man(x))))', []), ('(not (man(x) &...
    expressions = ['some x y.sees(x,y)', 'some x.(man(x) & walks(x))', r'\...
    p9_return_codes = {0: True, 1: '(FATAL)', 2: False, 3: '(MAX_MEGS)', 4...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\inference\prover9.py

nltk.punkt
Python Library Documentation: module nltk.tokenize.punkt in nltk.tokenize

NAME
    nltk.tokenize.punkt - Punkt Sentence Tokenizer

DESCRIPTION
    This tokenizer divides a text into a list of sentences
    by using an unsupervised algorithm to build a model for abbreviation
    words, collocations, and words that start sentences.  It must be
    trained on a large collection of plaintext in the target language
    before it can be used.

    The NLTK data package includes a pre-trained Punkt tokenizer for
    English.

        >>> from nltk.tokenize import PunktTokenizer
        >>> text = '''
        ... Punkt knows that the periods in Mr. Smith and Johann S. Bach
        ... do not mark sentence boundaries.  And sometimes sentences
        ... can start with non-capitalized words.  i is a good variable
        ... name.
        ... '''
        >>> sent_detector = PunktTokenizer()
        >>> print('\n-----\n'.join(sent_detector.tokenize(text.strip())))
        Punkt knows that the periods in Mr. Smith and Johann S. Bach
        do not mark sentence boundaries.
        -----
        And sometimes sentences
        can start with non-capitalized words.
        -----
        i is a good variable
        name.

    (Note that whitespace from the original text, including newlines, is
    retained in the output.)

    Punctuation following sentences is also included by default
    (from NLTK 3.0 onwards). It can be excluded with the realign_boundaries
    flag.

        >>> text = '''
        ... (How does it deal with this parenthesis?)  "It should be part of the
        ... previous sentence." "(And the same with this one.)" ('And this one!')
        ... "('(And (this)) '?)" [(and this. )]
        ... '''
        >>> print('\n-----\n'.join(
        ...     sent_detector.tokenize(text.strip())))
        (How does it deal with this parenthesis?)
        -----
        "It should be part of the
        previous sentence."
        -----
        "(And the same with this one.)"
        -----
        ('And this one!')
        -----
        "('(And (this)) '?)"
        -----
        [(and this. )]
        >>> print('\n-----\n'.join(
        ...     sent_detector.tokenize(text.strip(), realign_boundaries=False)))
        (How does it deal with this parenthesis?
        -----
        )  "It should be part of the
        previous sentence.
        -----
        " "(And the same with this one.
        -----
        )" ('And this one!
        -----
        ')
        "('(And (this)) '?
        -----
        )" [(and this.
        -----
        )]

    However, Punkt is designed to learn parameters (a list of abbreviations, etc.)
    unsupervised from a corpus similar to the target domain. The pre-packaged models
    may therefore be unsuitable: use ``PunktSentenceTokenizer(text)`` to learn
    parameters from the given text.

    :class:`.PunktTrainer` learns parameters such as a list of abbreviations
    (without supervision) from portions of text. Using a ``PunktTrainer`` directly
    allows for incremental training and modification of the hyper-parameters used
    to decide what is considered an abbreviation, etc.

    The algorithm for this tokenizer is described in::

      Kiss, Tibor and Strunk, Jan (2006): Unsupervised Multilingual Sentence
        Boundary Detection.  Computational Linguistics 32: 485-525.

CLASSES
    builtins.object
        PunktBaseClass
            PunktSentenceTokenizer(PunktBaseClass, nltk.tokenize.api.TokenizerI)
                PunktTokenizer
            PunktTrainer
        PunktLanguageVars
        PunktParameters
        PunktToken

    class PunktBaseClass(builtins.object)
     |  PunktBaseClass(lang_vars=None, token_cls=<class 'nltk.tokenize.punkt.PunktToken'>, params=None)
     |
     |  Includes common components of PunktTrainer and PunktSentenceTokenizer.
     |
     |  Methods defined here:
     |
     |  __init__(self, lang_vars=None, token_cls=<class 'nltk.tokenize.punkt.PunktToken'>, params=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class PunktLanguageVars(builtins.object)
     |  Stores variables, mostly regular expressions, which may be
     |  language-dependent for correct application of the algorithm.
     |  An extension of this class may modify its properties to suit
     |  a language other than English; an instance can then be passed
     |  as an argument to PunktSentenceTokenizer and PunktTrainer
     |  constructors.
     |
     |  Methods defined here:
     |
     |  __getstate__(self)
     |      Helper for pickle.
     |
     |  __setstate__(self, state)
     |
     |  period_context_re(self)
     |      Compiles and returns a regular expression to find contexts
     |      including possible sentence boundaries.
     |
     |  word_tokenize(self, s)
     |      Tokenize a string to split off punctuation other than periods
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  internal_punctuation = ',:;'
     |
     |  re_boundary_realignment = re.compile('["\\\')\\]}]+?(?:\\s+|(?=--)|$)'...
     |
     |  sent_end_chars = ('.', '?', '!')

    class PunktParameters(builtins.object)
     |  Stores data used to perform sentence boundary detection with Punkt.
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  add_ortho_context(self, typ, flag)
     |
     |  clear_abbrevs(self)
     |
     |  clear_collocations(self)
     |
     |  clear_ortho_context(self)
     |
     |  clear_sent_starters(self)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class PunktSentenceTokenizer(PunktBaseClass, nltk.tokenize.api.TokenizerI)
     |  PunktSentenceTokenizer(train_text=None, verbose=False, lang_vars=None, token_cls=<class 'nltk.tokenize.punkt.PunktToken'>)
     |
     |  A sentence tokenizer which uses an unsupervised algorithm to build
     |  a model for abbreviation words, collocations, and words that start
     |  sentences; and then uses that model to find sentence boundaries.
     |  This approach has been shown to work well for many European
     |  languages.
     |
     |  Method resolution order:
     |      PunktSentenceTokenizer
     |      PunktBaseClass
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, train_text=None, verbose=False, lang_vars=None, token_cls=<class 'nltk.tokenize.punkt.PunktToken'>)
     |      train_text can either be the sole training text for this sentence
     |      boundary detector, or can be a PunktParameters object.
     |
     |  debug_decisions(self, text: str) -> collections.abc.Iterator[dict[str, typing.Any]]
     |      Classifies candidate periods as sentence breaks, yielding a dict for
     |      each that may be used to understand why the decision was made.
     |
     |      See format_debug_decision() to help make this output readable.
     |
     |  dump(self, tokens: collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]) -> None
     |      # [XX] TESTING
     |
     |  sentences_from_text(self, text: str, realign_boundaries: bool = True) -> list[str]
     |      Given a text, generates the sentences in that text by only
     |      testing candidate sentence breaks. If realign_boundaries is
     |      True, includes in the sentence closing punctuation that
     |      follows the period.
     |
     |  sentences_from_text_legacy(self, text: str) -> collections.abc.Iterator[str]
     |      Given a text, generates the sentences in that text. Annotates all
     |      tokens, rather than just those with possible sentence breaks. Should
     |      produce the same results as ``sentences_from_text``.
     |
     |  sentences_from_tokens(self, tokens: collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]) -> collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]
     |      Given a sequence of tokens, generates lists of tokens, each list
     |      corresponding to a sentence.
     |
     |  span_tokenize(self, text: str, realign_boundaries: bool = True) -> collections.abc.Iterator[tuple[int, int]]
     |      Given a text, generates (start, end) spans of sentences
     |      in the text.
     |
     |  text_contains_sentbreak(self, text: str) -> bool
     |      Returns True if the given text includes a sentence break.
     |
     |  tokenize(self, text: str, realign_boundaries: bool = True) -> list[str]
     |      Given a text, returns a list of the sentences in that text.
     |
     |  train(self, train_text, verbose=False)
     |      Derives parameters from a given training text, or uses the parameters
     |      given. Repeated calls to this method destroy previous parameters. For
     |      incremental training, instantiate a separate PunktTrainer instance.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  PUNCTUATION = (';', ':', ',', '.', '!', '?')
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from PunktBaseClass:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]

    class PunktToken(builtins.object)
     |  PunktToken(tok, **params)
     |
     |  Stores a token of text with annotations produced during
     |  sentence boundary detection.
     |
     |  Methods defined here:
     |
     |  __init__(self, tok, **params)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      A string representation of the token that can reproduce it
     |      with eval(), which lists all the token's non-default
     |      annotations.
     |
     |  __str__(self)
     |      A string representation akin to that used by Kiss and Strunk.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  first_case
     |
     |  first_lower
     |      True if the token's first character is lowercase.
     |
     |  first_upper
     |      True if the token's first character is uppercase.
     |
     |  is_alpha
     |      True if the token text is all alphabetic.
     |
     |  is_ellipsis
     |      True if the token text is that of an ellipsis.
     |
     |  is_initial
     |      True if the token text is that of an initial.
     |
     |  is_non_punct
     |      True if the token is either a number or is alphabetic.
     |
     |  is_number
     |      True if the token text is that of a number.
     |
     |  type_no_period
     |      The type with its final period removed if it has one.
     |
     |  type_no_sentperiod
     |      The type with its final period removed if it is marked as a
     |      sentence break.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  abbr
     |
     |  ellipsis
     |
     |  linestart
     |
     |  parastart
     |
     |  period_final
     |
     |  sentbreak
     |
     |  tok
     |
     |  type

    class PunktTokenizer(PunktSentenceTokenizer)
     |  PunktTokenizer(lang='english')
     |
     |  Punkt Sentence Tokenizer that loads/saves its parameters from/to data files
     |
     |  Method resolution order:
     |      PunktTokenizer
     |      PunktSentenceTokenizer
     |      PunktBaseClass
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, lang='english')
     |      train_text can either be the sole training text for this sentence
     |      boundary detector, or can be a PunktParameters object.
     |
     |  load_lang(self, lang='english')
     |
     |  save_params(self)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from PunktSentenceTokenizer:
     |
     |  debug_decisions(self, text: str) -> collections.abc.Iterator[dict[str, typing.Any]]
     |      Classifies candidate periods as sentence breaks, yielding a dict for
     |      each that may be used to understand why the decision was made.
     |
     |      See format_debug_decision() to help make this output readable.
     |
     |  dump(self, tokens: collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]) -> None
     |      # [XX] TESTING
     |
     |  sentences_from_text(self, text: str, realign_boundaries: bool = True) -> list[str]
     |      Given a text, generates the sentences in that text by only
     |      testing candidate sentence breaks. If realign_boundaries is
     |      True, includes in the sentence closing punctuation that
     |      follows the period.
     |
     |  sentences_from_text_legacy(self, text: str) -> collections.abc.Iterator[str]
     |      Given a text, generates the sentences in that text. Annotates all
     |      tokens, rather than just those with possible sentence breaks. Should
     |      produce the same results as ``sentences_from_text``.
     |
     |  sentences_from_tokens(self, tokens: collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]) -> collections.abc.Iterator[nltk.tokenize.punkt.PunktToken]
     |      Given a sequence of tokens, generates lists of tokens, each list
     |      corresponding to a sentence.
     |
     |  span_tokenize(self, text: str, realign_boundaries: bool = True) -> collections.abc.Iterator[tuple[int, int]]
     |      Given a text, generates (start, end) spans of sentences
     |      in the text.
     |
     |  text_contains_sentbreak(self, text: str) -> bool
     |      Returns True if the given text includes a sentence break.
     |
     |  tokenize(self, text: str, realign_boundaries: bool = True) -> list[str]
     |      Given a text, returns a list of the sentences in that text.
     |
     |  train(self, train_text, verbose=False)
     |      Derives parameters from a given training text, or uses the parameters
     |      given. Repeated calls to this method destroy previous parameters. For
     |      incremental training, instantiate a separate PunktTrainer instance.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from PunktSentenceTokenizer:
     |
     |  PUNCTUATION = (';', ':', ',', '.', '!', '?')
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from PunktBaseClass:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]

    class PunktTrainer(PunktBaseClass)
     |  PunktTrainer(train_text=None, verbose=False, lang_vars=None, token_cls=<class 'nltk.tokenize.punkt.PunktToken'>)
     |
     |  Learns parameters used in Punkt sentence boundary detection.
     |
     |  Method resolution order:
     |      PunktTrainer
     |      PunktBaseClass
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, train_text=None, verbose=False, lang_vars=None, token_cls=<class 'nltk.tokenize.punkt.PunktToken'>)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  finalize_training(self, verbose=False)
     |      Uses data that has been gathered in training to determine likely
     |      collocations and sentence starters.
     |
     |  find_abbrev_types(self)
     |      Recalculates abbreviations given type frequencies, despite no prior
     |      determination of abbreviations.
     |      This fails to include abbreviations otherwise found as "rare".
     |
     |  freq_threshold(self, ortho_thresh=2, type_thresh=2, colloc_thres=2, sentstart_thresh=2)
     |      Allows memory use to be reduced after much training by removing data
     |      about rare tokens that are unlikely to have a statistical effect with
     |      further training. Entries occurring above the given thresholds will be
     |      retained.
     |
     |  get_params(self)
     |      Calculates and returns parameters for sentence boundary detection as
     |      derived from training.
     |
     |  train(self, text, verbose=False, finalize=True)
     |      Collects training data from a given text. If finalize is True, it
     |      will determine all the parameters for sentence boundary detection. If
     |      not, this will be delayed until get_params() or finalize_training() is
     |      called. If verbose is True, abbreviations found will be listed.
     |
     |  train_tokens(self, tokens, verbose=False, finalize=True)
     |      Collects training data from a given list of tokens.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  ABBREV = 0.3
     |
     |  ABBREV_BACKOFF = 5
     |
     |  COLLOCATION = 7.88
     |
     |  IGNORE_ABBREV_PENALTY = False
     |
     |  INCLUDE_ABBREV_COLLOCS = False
     |
     |  INCLUDE_ALL_COLLOCS = False
     |
     |  MIN_COLLOC_FREQ = 1
     |
     |  SENT_STARTER = 30
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from PunktBaseClass:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo(text, tok_cls=<class 'nltk.tokenize.punkt.PunktSentenceTokenizer'>, train_cls=<class 'nltk.tokenize.punkt.PunktTrainer'>)
        Builds a punkt model and applies it to the same text

    format_debug_decision(d)

    load_punkt_params(lang_dir)

    punkt_pickle_load(file)
        Safely load a legacy Punkt pickle file.

        Old NLTK Punkt models were distributed as pickle files containing
        ``PunktParameters``, ``PunktLanguageVars``, and related classes.
        This helper loads them through :class:`~nltk.picklesec.AllowlistUnpickler`
        restricted to the ``nltk.tokenize.punkt`` and ``nltk.tokenize`` modules,
        so arbitrary code gadgets (``os.system``, ``subprocess``, etc.) are blocked
        while legitimate Punkt objects reconstruct normally.

    save_punkt_params(params, dir='/tmp/punkt_tab')

DATA
    DEBUG_DECISION_FMT = 'Text: {text!r} (at offset {period_index})\nSente...
    Dict = typing.Dict
        A generic version of dict.

    List = typing.List
        A generic version of list.

    Optional = typing.Optional
        Optional[X] is equivalent to Union[X, None].

    REASON_ABBR_WITH_ORTHOGRAPHIC_HEURISTIC = 'abbreviation + orthographic...
    REASON_ABBR_WITH_SENTENCE_STARTER = 'abbreviation + frequent sentence ...
    REASON_DEFAULT_DECISION = 'default decision'
    REASON_INITIAL_WITH_ORTHOGRAPHIC_HEURISTIC = 'initial + orthographic h...
    REASON_INITIAL_WITH_SPECIAL_ORTHOGRAPHIC_HEURISTIC = 'initial + specia...
    REASON_KNOWN_COLLOCATION = 'known collocation (both words)'
    REASON_NUMBER_WITH_ORTHOGRAPHIC_HEURISTIC = 'initial + orthographic he...
    Tuple = typing.Tuple
        Deprecated alias to builtins.tuple.

        Tuple[X, Y] is the cross-product type of X and Y.

        Example: Tuple[T1, T2] is a tuple of two elements corresponding
        to type variables T1 and T2.  Tuple[int, float, str] is a tuple
        of an int, a float and a string.

        To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].

    Union = typing.Union
        Union type; Union[X, Y] means either X or Y.

        On Python 3.10 and higher, the | operator
        can also be used to denote unions;
        X | Y means the same thing to the type checker as Union[X, Y].

        To define a union, use e.g. Union[int, str]. Details:
        - The arguments must be types and there must be at least one.
        - None as an argument is a special case and is replaced by
          type(None).
        - Unions of unions are flattened, e.g.::

            assert Union[Union[int, str], float] == Union[int, str, float]

        - Unions of a single argument vanish, e.g.::

            assert Union[int] == int  # The constructor actually returns int

        - Redundant arguments are skipped, e.g.::

            assert Union[int, str, int] == Union[int, str]

        - When comparing unions, the argument order is ignored, e.g.::

            assert Union[int, str] == Union[str, int]

        - You cannot subclass or instantiate a union.
        - You can use Optional[X] as a shorthand for Union[X, None].

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\punkt.py

nltk.pydoc
Python Library Documentation: module pydoc

NAME
    pydoc - Generate Python documentation in HTML or text for interactive use.

MODULE REFERENCE
    https://docs.python.org/3.12/library/pydoc.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION
    At the Python interactive prompt, calling help(thing) on a Python object
    documents the object, and calling help() starts up an interactive
    help session.

    Or, at the shell command line outside of Python:

    Run "pydoc <name>" to show documentation on something.  <name> may be
    the name of a function, module, package, or a dotted reference to a
    class or function within a module or module in a package.  If the
    argument contains a path segment delimiter (e.g. slash on Unix,
    backslash on Windows) it is treated as the path to a Python source file.

    Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
    of all available modules.

    Run "pydoc -n <hostname>" to start an HTTP server with the given
    hostname (default: localhost) on the local machine.

    Run "pydoc -p <port>" to start an HTTP server on the given port on the
    local machine.  Port number 0 can be used to get an arbitrary unused port.

    Run "pydoc -b" to start an HTTP server on an arbitrary unused port and
    open a web browser to interactively browse documentation.  Combine with
    the -n and -p options to control the hostname and port used.

    Run "pydoc -w <name>" to write out the HTML documentation for a module
    to a file named "<name>.html".

    Module docs for core modules are assumed to be in

        https://docs.python.org/X.Y/library/

    This can be overridden by setting the PYTHONDOCS environment variable
    to a different URL or to a local directory containing the Library
    Reference Manual pages.

DATA
    __all__ = ['help']
    help = <pydoc.Helper instance>

DATE
    26 February 2001

AUTHOR
    Ka-Ping Yee <ping@lfw.org>

CREDITS
    Guido van Rossum, for an excellent programming language.
    Tommy Burnette, the original creator of manpy.
    Paul Prescod, for all his work on onlinehelp.
    Richard Chamberlain, for the first implementation of textdoc.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\pydoc.py

nltk.raise_unorderable_types
Python Library Documentation: function raise_unorderable_types in module nltk.internals

raise_unorderable_types(ordering, a, b)
nltk.ranks_from_scores
Python Library Documentation: function ranks_from_scores in module nltk.metrics.spearman

ranks_from_scores(scores, rank_gap=1e-15)
    Given a sequence of (key, score) tuples, yields each key with an
    increasing rank, tying with previous key's rank if the difference between
    their scores is less than rank_gap. Suitable for use as an argument to
    ``spearman_correlation``.
nltk.ranks_from_sequence
Python Library Documentation: function ranks_from_sequence in module nltk.metrics.spearman

ranks_from_sequence(seq)
    Given a sequence, yields each element with an increasing rank, suitable
    for use as an argument to ``spearman_correlation``.
nltk.re
Python Library Documentation: package re

NAME
    re - Support for regular expressions (RE).

MODULE REFERENCE
    https://docs.python.org/3.12/library/re.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION
    This module provides regular expression matching operations similar to
    those found in Perl.  It supports both 8-bit and Unicode strings; both
    the pattern and the strings being processed can contain null bytes and
    characters outside the US ASCII range.

    Regular expressions can contain both special and ordinary characters.
    Most ordinary characters, like "A", "a", or "0", are the simplest
    regular expressions; they simply match themselves.  You can
    concatenate ordinary characters, so last matches the string 'last'.

    The special characters are:
        "."      Matches any character except a newline.
        "^"      Matches the start of the string.
        "$"      Matches the end of the string or just before the newline at
                 the end of the string.
        "*"      Matches 0 or more (greedy) repetitions of the preceding RE.
                 Greedy means that it will match as many repetitions as possible.
        "+"      Matches 1 or more (greedy) repetitions of the preceding RE.
        "?"      Matches 0 or 1 (greedy) of the preceding RE.
        *?,+?,?? Non-greedy versions of the previous three special characters.
        {m,n}    Matches from m to n repetitions of the preceding RE.
        {m,n}?   Non-greedy version of the above.
        "\\"     Either escapes special characters or signals a special sequence.
        []       Indicates a set of characters.
                 A "^" as the first character indicates a complementing set.
        "|"      A|B, creates an RE that will match either A or B.
        (...)    Matches the RE inside the parentheses.
                 The contents can be retrieved or matched later in the string.
        (?aiLmsux) The letters set the corresponding flags defined below.
        (?:...)  Non-grouping version of regular parentheses.
        (?P<name>...) The substring matched by the group is accessible by name.
        (?P=name)     Matches the text matched earlier by the group named name.
        (?#...)  A comment; ignored.
        (?=...)  Matches if ... matches next, but doesn't consume the string.
        (?!...)  Matches if ... doesn't match next.
        (?<=...) Matches if preceded by ... (must be fixed length).
        (?<!...) Matches if not preceded by ... (must be fixed length).
        (?(id/name)yes|no) Matches yes pattern if the group with id/name matched,
                           the (optional) no pattern otherwise.

    The special sequences consist of "\\" and a character from the list
    below.  If the ordinary character is not on the list, then the
    resulting RE will match the second character.
        \number  Matches the contents of the group of the same number.
        \A       Matches only at the start of the string.
        \Z       Matches only at the end of the string.
        \b       Matches the empty string, but only at the start or end of a word.
        \B       Matches the empty string, but not at the start or end of a word.
        \d       Matches any decimal digit; equivalent to the set [0-9] in
                 bytes patterns or string patterns with the ASCII flag.
                 In string patterns without the ASCII flag, it will match the whole
                 range of Unicode digits.
        \D       Matches any non-digit character; equivalent to [^\d].
        \s       Matches any whitespace character; equivalent to [ \t\n\r\f\v] in
                 bytes patterns or string patterns with the ASCII flag.
                 In string patterns without the ASCII flag, it will match the whole
                 range of Unicode whitespace characters.
        \S       Matches any non-whitespace character; equivalent to [^\s].
        \w       Matches any alphanumeric character; equivalent to [a-zA-Z0-9_]
                 in bytes patterns or string patterns with the ASCII flag.
                 In string patterns without the ASCII flag, it will match the
                 range of Unicode alphanumeric characters (letters plus digits
                 plus underscore).
                 With LOCALE, it will match the set [0-9_] plus characters defined
                 as letters for the current locale.
        \W       Matches the complement of \w.
        \\       Matches a literal backslash.

    This module exports the following functions:
        match     Match a regular expression pattern to the beginning of a string.
        fullmatch Match a regular expression pattern to all of a string.
        search    Search a string for the presence of a pattern.
        sub       Substitute occurrences of a pattern found in a string.
        subn      Same as sub, but also return the number of substitutions made.
        split     Split a string by the occurrences of a pattern.
        findall   Find all occurrences of a pattern in a string.
        finditer  Return an iterator yielding a Match object for each match.
        compile   Compile a pattern into a Pattern object.
        purge     Clear the regular expression cache.
        escape    Backslash all non-alphanumerics in a string.

    Each function other than purge and escape can take an optional 'flags' argument
    consisting of one or more of the following module constants, joined by "|".
    A, L, and U are mutually exclusive.
        A  ASCII       For string patterns, make \w, \W, \b, \B, \d, \D
                       match the corresponding ASCII character categories
                       (rather than the whole Unicode categories, which is the
                       default).
                       For bytes patterns, this flag is the only available
                       behaviour and needn't be specified.
        I  IGNORECASE  Perform case-insensitive matching.
        L  LOCALE      Make \w, \W, \b, \B, dependent on the current locale.
        M  MULTILINE   "^" matches the beginning of lines (after a newline)
                       as well as the string.
                       "$" matches the end of lines (before a newline) as well
                       as the end of the string.
        S  DOTALL      "." matches any character at all, including the newline.
        X  VERBOSE     Ignore whitespace and comments for nicer looking RE's.
        U  UNICODE     For compatibility only. Ignored for string patterns (it
                       is the default), and forbidden for bytes patterns.

    This module also defines an exception 'error'.

PACKAGE CONTENTS
    _casefix
    _compiler
    _constants
    _parser

CLASSES
    builtins.Exception(builtins.BaseException)
        error
    builtins.object
        Match
        Pattern
    enum.IntFlag(builtins.int, enum.ReprEnum, enum.Flag)
        RegexFlag

    class Match(builtins.object)
     |  The result of re.match() and re.search().
     |  Match objects always have a boolean value of True.
     |
     |  Methods defined here:
     |
     |  __copy__(self, /)
     |
     |  __deepcopy__(self, memo, /)
     |
     |  __getitem__(self, key, /)
     |      Return self[key].
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  end(self, group=0, /)
     |      Return index of the end of the substring matched by group.
     |
     |  expand(self, /, template)
     |      Return the string obtained by doing backslash substitution on the string template, as done by the sub() method.
     |
     |  group(...)
     |      group([group1, ...]) -> str or tuple.
     |      Return subgroup(s) of the match by indices or names.
     |      For 0 returns the entire match.
     |
     |  groupdict(self, /, default=None)
     |      Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name.
     |
     |      default
     |        Is used for groups that did not participate in the match.
     |
     |  groups(self, /, default=None)
     |      Return a tuple containing all the subgroups of the match, from 1.
     |
     |      default
     |        Is used for groups that did not participate in the match.
     |
     |  span(self, group=0, /)
     |      For match object m, return the 2-tuple (m.start(group), m.end(group)).
     |
     |  start(self, group=0, /)
     |      Return index of the start of the substring matched by group.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  endpos
     |      The index into the string beyond which the RE engine will not go.
     |
     |  lastgroup
     |      The name of the last matched capturing group.
     |
     |  lastindex
     |      The integer index of the last matched capturing group.
     |
     |  pos
     |      The index into the string at which the RE engine started looking for a match.
     |
     |  re
     |      The regular expression object.
     |
     |  regs
     |
     |  string
     |      The string passed to match() or search().

    class Pattern(builtins.object)
     |  Compiled regular expression object.
     |
     |  Methods defined here:
     |
     |  __copy__(self, /)
     |
     |  __deepcopy__(self, memo, /)
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  findall(self, /, string, pos=0, endpos=9223372036854775807)
     |      Return a list of all non-overlapping matches of pattern in string.
     |
     |  finditer(self, /, string, pos=0, endpos=9223372036854775807)
     |      Return an iterator over all non-overlapping matches for the RE pattern in string.
     |
     |      For each match, the iterator returns a match object.
     |
     |  fullmatch(self, /, string, pos=0, endpos=9223372036854775807)
     |      Matches against all of the string.
     |
     |  match(self, /, string, pos=0, endpos=9223372036854775807)
     |      Matches zero or more characters at the beginning of the string.
     |
     |  scanner(self, /, string, pos=0, endpos=9223372036854775807)
     |
     |  search(self, /, string, pos=0, endpos=9223372036854775807)
     |      Scan through string looking for a match, and return a corresponding match object instance.
     |
     |      Return None if no position in the string matches.
     |
     |  split(self, /, string, maxsplit=0)
     |      Split string by the occurrences of pattern.
     |
     |  sub(self, /, repl, string, count=0)
     |      Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.
     |
     |  subn(self, /, repl, string, count=0)
     |      Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  flags
     |      The regex matching flags.
     |
     |  groupindex
     |      A dictionary mapping group names to group numbers.
     |
     |  groups
     |      The number of capturing groups in the pattern.
     |
     |  pattern
     |      The pattern string from which the RE object was compiled.

    class RegexFlag(enum.IntFlag)
     |  RegexFlag(*values)
     |
     |  An enumeration.
     |
     |  Method resolution order:
     |      RegexFlag
     |      enum.IntFlag
     |      builtins.int
     |      enum.ReprEnum
     |      enum.Flag
     |      enum.Enum
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __and__(self, other) from enum.Flag
     |
     |  __format__(self, format_spec, /) from builtins.int
     |      Convert to a string according to format_spec.
     |
     |  __invert__(self) from enum.Flag
     |
     |  __new__(cls, value) from enum.Enum
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  __or__(self, other) from enum.Flag
     |      Return self|value.
     |
     |  __rand__ = __and__(self, other)
     |
     |  __repr__ = global_flag_repr(self) from enum
     |      use module.flag_name instead of class.flag_name
     |
     |      the module is the last module in case of a multi-module name
     |
     |  __ror__ = __or__(self, other)
     |
     |  __rxor__ = __xor__(self, other)
     |
     |  __str__(self, /) from builtins.object
     |      Return str(self).
     |
     |  __xor__(self, other) from enum.Flag
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  ASCII = re.ASCII
     |
     |  DEBUG = re.DEBUG
     |
     |  DOTALL = re.DOTALL
     |
     |  IGNORECASE = re.IGNORECASE
     |
     |  LOCALE = re.LOCALE
     |
     |  MULTILINE = re.MULTILINE
     |
     |  TEMPLATE = re.TEMPLATE
     |
     |  UNICODE = re.UNICODE
     |
     |  VERBOSE = re.VERBOSE
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.int:
     |
     |  __abs__(self, /)
     |      abs(self)
     |
     |  __add__(self, value, /)
     |      Return self+value.
     |
     |  __bool__(self, /)
     |      True if self else False
     |
     |  __ceil__(...)
     |      Ceiling of an Integral returns itself.
     |
     |  __divmod__(self, value, /)
     |      Return divmod(self, value).
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __float__(self, /)
     |      float(self)
     |
     |  __floor__(...)
     |      Flooring an Integral returns itself.
     |
     |  __floordiv__(self, value, /)
     |      Return self//value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getnewargs__(self, /)
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __hash__(self, /)
     |      Return hash(self).
     |
     |  __index__(self, /)
     |      Return self converted to an integer, if self is suitable for use as an index into a list.
     |
     |  __int__(self, /)
     |      int(self)
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __lshift__(self, value, /)
     |      Return self<<value.
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mod__(self, value, /)
     |      Return self%value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __neg__(self, /)
     |      -self
     |
     |  __pos__(self, /)
     |      +self
     |
     |  __pow__(self, value, mod=None, /)
     |      Return pow(self, value, mod).
     |
     |  __radd__(self, value, /)
     |      Return value+self.
     |
     |  __rdivmod__(self, value, /)
     |      Return divmod(value, self).
     |
     |  __rfloordiv__(self, value, /)
     |      Return value//self.
     |
     |  __rlshift__(self, value, /)
     |      Return value<<self.
     |
     |  __rmod__(self, value, /)
     |      Return value%self.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __round__(...)
     |      Rounding an Integral returns itself.
     |
     |      Rounding with an ndigits argument also returns an integer.
     |
     |  __rpow__(self, value, mod=None, /)
     |      Return pow(value, self, mod).
     |
     |  __rrshift__(self, value, /)
     |      Return value>>self.
     |
     |  __rshift__(self, value, /)
     |      Return self>>value.
     |
     |  __rsub__(self, value, /)
     |      Return value-self.
     |
     |  __rtruediv__(self, value, /)
     |      Return value/self.
     |
     |  __sizeof__(self, /)
     |      Returns size in memory, in bytes.
     |
     |  __sub__(self, value, /)
     |      Return self-value.
     |
     |  __truediv__(self, value, /)
     |      Return self/value.
     |
     |  __trunc__(...)
     |      Truncating an Integral returns itself.
     |
     |  as_integer_ratio(self, /)
     |      Return a pair of integers, whose ratio is equal to the original int.
     |
     |      The ratio is in lowest terms and has a positive denominator.
     |
     |      >>> (10).as_integer_ratio()
     |      (10, 1)
     |      >>> (-10).as_integer_ratio()
     |      (-10, 1)
     |      >>> (0).as_integer_ratio()
     |      (0, 1)
     |
     |  bit_count(self, /)
     |      Number of ones in the binary representation of the absolute value of self.
     |
     |      Also known as the population count.
     |
     |      >>> bin(13)
     |      '0b1101'
     |      >>> (13).bit_count()
     |      3
     |
     |  bit_length(self, /)
     |      Number of bits necessary to represent self in binary.
     |
     |      >>> bin(37)
     |      '0b100101'
     |      >>> (37).bit_length()
     |      6
     |
     |  conjugate(...)
     |      Returns self, the complex conjugate of any int.
     |
     |  is_integer(self, /)
     |      Returns True. Exists for duck type compatibility with float.is_integer.
     |
     |  to_bytes(self, /, length=1, byteorder='big', *, signed=False)
     |      Return an array of bytes representing an integer.
     |
     |      length
     |        Length of bytes object to use.  An OverflowError is raised if the
     |        integer is not representable with the given number of bytes.  Default
     |        is length 1.
     |      byteorder
     |        The byte order used to represent the integer.  If byteorder is 'big',
     |        the most significant byte is at the beginning of the byte array.  If
     |        byteorder is 'little', the most significant byte is at the end of the
     |        byte array.  To request the native byte order of the host system, use
     |        `sys.byteorder' as the byte order value.  Default is to use 'big'.
     |      signed
     |        Determines whether two's complement is used to represent the integer.
     |        If signed is False and a negative integer is given, an OverflowError
     |        is raised.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.int:
     |
     |  from_bytes(bytes, byteorder='big', *, signed=False)
     |      Return the integer represented by the given array of bytes.
     |
     |      bytes
     |        Holds the array of bytes to convert.  The argument must either
     |        support the buffer protocol or be an iterable object producing bytes.
     |        Bytes and bytearray are examples of built-in objects that support the
     |        buffer protocol.
     |      byteorder
     |        The byte order used to represent the integer.  If byteorder is 'big',
     |        the most significant byte is at the beginning of the byte array.  If
     |        byteorder is 'little', the most significant byte is at the end of the
     |        byte array.  To request the native byte order of the host system, use
     |        `sys.byteorder' as the byte order value.  Default is to use 'big'.
     |      signed
     |        Indicates whether two's complement is used to represent the integer.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.int:
     |
     |  denominator
     |      the denominator of a rational number in lowest terms
     |
     |  imag
     |      the imaginary part of a complex number
     |
     |  numerator
     |      the numerator of a rational number in lowest terms
     |
     |  real
     |      the real part of a complex number
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from enum.Flag:
     |
     |  __contains__(self, other)
     |      Returns True if self has at least the same flags set as other.
     |
     |  __iter__(self)
     |      Returns flags in definition order.
     |
     |  __len__(self)
     |      Return the number of members (no aliases)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from enum.Enum:
     |
     |  __dir__(self)
     |      Returns public methods and other interesting attributes.
     |
     |  __init__(self, *args, **kwds)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __reduce_ex__(self, proto)
     |      Helper for pickle.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from enum.Enum:
     |
     |  name
     |      The name of the Enum member.
     |
     |  value
     |      The value of the Enum member.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from enum.EnumType:
     |
     |  __getitem__(name)
     |      Return the member matching `name`.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from enum.EnumType:
     |
     |  __members__
     |      Returns a mapping of member name->value.
     |
     |      This mapping lists all enum members, including aliases. Note that this
     |      is a read-only view of the internal mapping.

    class error(builtins.Exception)
     |  error(msg, pattern=None, pos=None)
     |
     |  Exception raised for invalid regular expressions.
     |
     |  Attributes:
     |
     |      msg: The unformatted error message
     |      pattern: The regular expression pattern
     |      pos: The index in the pattern where compilation failed (may be None)
     |      lineno: The line corresponding to pos (may be None)
     |      colno: The column corresponding to pos (may be None)
     |
     |  Method resolution order:
     |      error
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, msg, pattern=None, pos=None) from re._constants.error
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

FUNCTIONS
    compile(pattern, flags=0)
        Compile a regular expression pattern, returning a Pattern object.

    escape(pattern)
        Escape special characters in a string.

    findall(pattern, string, flags=0)
        Return a list of all non-overlapping matches in the string.

        If one or more capturing groups are present in the pattern, return
        a list of groups; this will be a list of tuples if the pattern
        has more than one group.

        Empty matches are included in the result.

    finditer(pattern, string, flags=0)
        Return an iterator over all non-overlapping matches in the
        string.  For each match, the iterator returns a Match object.

        Empty matches are included in the result.

    fullmatch(pattern, string, flags=0)
        Try to apply the pattern to all of the string, returning
        a Match object, or None if no match was found.

    match(pattern, string, flags=0)
        Try to apply the pattern at the start of the string, returning
        a Match object, or None if no match was found.

    purge()
        Clear the regular expression caches

    search(pattern, string, flags=0)
        Scan through string looking for a match to the pattern, returning
        a Match object, or None if no match was found.

    split(pattern, string, maxsplit=0, flags=0)
        Split the source string by the occurrences of the pattern,
        returning a list containing the resulting substrings.  If
        capturing parentheses are used in pattern, then the text of all
        groups in the pattern are also returned as part of the resulting
        list.  If maxsplit is nonzero, at most maxsplit splits occur,
        and the remainder of the string is returned as the final element
        of the list.

    sub(pattern, repl, string, count=0, flags=0)
        Return the string obtained by replacing the leftmost
        non-overlapping occurrences of the pattern in string by the
        replacement repl.  repl can be either a string or a callable;
        if a string, backslash escapes in it are processed.  If it is
        a callable, it's passed the Match object and must return
        a replacement string to be used.

    subn(pattern, repl, string, count=0, flags=0)
        Return a 2-tuple containing (new_string, number).
        new_string is the string obtained by replacing the leftmost
        non-overlapping occurrences of the pattern in the source
        string by the replacement repl.  number is the number of
        substitutions that were made. repl can be either a string or a
        callable; if a string, backslash escapes in it are processed.
        If it is a callable, it's passed the Match object and must
        return a replacement string to be used.

    template(pattern, flags=0)
        Compile a template pattern, returning a Pattern object, deprecated

DATA
    A = re.ASCII
    ASCII = re.ASCII
    DOTALL = re.DOTALL
    I = re.IGNORECASE
    IGNORECASE = re.IGNORECASE
    L = re.LOCALE
    LOCALE = re.LOCALE
    M = re.MULTILINE
    MULTILINE = re.MULTILINE
    NOFLAG = re.NOFLAG
    S = re.DOTALL
    U = re.UNICODE
    UNICODE = re.UNICODE
    VERBOSE = re.VERBOSE
    X = re.VERBOSE
    __all__ = ['match', 'fullmatch', 'search', 'sub', 'subn', 'split', 'fi...

VERSION
    2.2.1

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\re\__init__.py

nltk.re_show
Python Library Documentation: function re_show in module nltk.util

re_show(regexp, string, left='{', right='}')
    Return a string with markers surrounding the matched substrings.
    Search str for substrings matching ``regexp`` and wrap the matches
    with braces.  This is convenient for learning about regular expressions.

    :param regexp: The regular expression.
    :type regexp: str
    :param string: The string being matched.
    :type string: str
    :param left: The left delimiter (printed before the matched substring)
    :type left: str
    :param right: The right delimiter (printed after the matched substring)
    :type right: str
    :rtype: str
nltk.read_grammar
Python Library Documentation: function read_grammar in module nltk.grammar

read_grammar(input, nonterm_parser, probabilistic=False, encoding=None)
    Return a pair consisting of a starting category and a list of
    ``Productions``.

    :param input: a grammar, either in the form of a string or else
        as a list of strings.
    :param nonterm_parser: a function for parsing nonterminals.
        It should take a ``(string, position)`` as argument and
        return a ``(nonterminal, position)`` as result.
    :param probabilistic: are the grammar rules probabilistic?
    :type probabilistic: bool
    :param encoding: the encoding of the grammar, if it is a binary string
    :type encoding: str
nltk.read_logic
Python Library Documentation: function read_logic in module nltk.sem.logic

read_logic(s, logic_parser=None, encoding=None)
    Convert a file of First Order Formulas into a list of {Expression}s.

    :param s: the contents of the file
    :type s: str
    :param logic_parser: The parser to be used to parse the logical expression
    :type logic_parser: LogicParser
    :param encoding: the encoding of the input string, if it is binary
    :type encoding: str
    :return: a list of parsed formulas.
    :rtype: list(Expression)
nltk.read_valuation
Python Library Documentation: function read_valuation in module nltk.sem.evaluate

read_valuation(s, encoding=None)
    Convert a valuation string into a valuation.

    :param s: a valuation string
    :type s: str
    :param encoding: the encoding of the input string, if it is binary
    :type encoding: str
    :return: a ``nltk.sem`` valuation
    :rtype: Valuation
nltk.recall
Python Library Documentation: function recall in module nltk.metrics.scores

recall(reference, test)
    Given a set of reference values and a set of test values, return
    the fraction of reference values that appear in the test set.
    In particular, return card(``reference`` intersection ``test``)/card(``reference``).
    If ``reference`` is empty, then return None.

    :type reference: set
    :param reference: A set of reference values.
    :type test: set
    :param test: A set of values to compare against the reference set.
    :rtype: float or None
nltk.recursivedescent
Python Library Documentation: module nltk.parse.recursivedescent in nltk.parse

NAME
    nltk.parse.recursivedescent

DESCRIPTION
    # Natural Language Toolkit: Recursive Descent Parser
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Edward Loper <edloper@gmail.com>
    #         Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.parse.api.ParserI(builtins.object)
        RecursiveDescentParser
            SteppingRecursiveDescentParser

    class RecursiveDescentParser(nltk.parse.api.ParserI)
     |  RecursiveDescentParser(grammar, trace=0)
     |
     |  A simple top-down CFG parser that parses texts by recursively
     |  expanding the fringe of a Tree, and matching it against a
     |  text.
     |
     |  ``RecursiveDescentParser`` uses a list of tree locations called a
     |  "frontier" to remember which subtrees have not yet been expanded
     |  and which leaves have not yet been matched against the text.  Each
     |  tree location consists of a list of child indices specifying the
     |  path from the root of the tree to a subtree or a leaf; see the
     |  reference documentation for Tree for more information
     |  about tree locations.
     |
     |  When the parser begins parsing a text, it constructs a tree
     |  containing only the start symbol, and a frontier containing the
     |  location of the tree's root node.  It then extends the tree to
     |  cover the text, using the following recursive procedure:
     |
     |    - If the frontier is empty, and the text is covered by the tree,
     |      then return the tree as a possible parse.
     |    - If the frontier is empty, and the text is not covered by the
     |      tree, then return no parses.
     |    - If the first element of the frontier is a subtree, then
     |      use CFG productions to "expand" it.  For each applicable
     |      production, add the expanded subtree's children to the
     |      frontier, and recursively find all parses that can be
     |      generated by the new tree and frontier.
     |    - If the first element of the frontier is a token, then "match"
     |      it against the next token from the text.  Remove the token
     |      from the frontier, and recursively find all parses that can be
     |      generated by the new tree and frontier.
     |
     |  :see: ``nltk.grammar``
     |
     |  Method resolution order:
     |      RecursiveDescentParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, trace=0)
     |      Create a new ``RecursiveDescentParser``, that uses ``grammar``
     |      to parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SteppingRecursiveDescentParser(RecursiveDescentParser)
     |  SteppingRecursiveDescentParser(grammar, trace=0)
     |
     |  A ``RecursiveDescentParser`` that allows you to step through the
     |  parsing process, performing a single operation at a time.
     |
     |  The ``initialize`` method is used to start parsing a text.
     |  ``expand`` expands the first element on the frontier using a single
     |  CFG production, and ``match`` matches the first element on the
     |  frontier against the next text token. ``backtrack`` undoes the most
     |  recent expand or match operation.  ``step`` performs a single
     |  expand, match, or backtrack operation.  ``parses`` returns the set
     |  of parses that have been found by the parser.
     |
     |  :ivar _history: A list of ``(rtext, tree, frontier)`` tripples,
     |      containing the previous states of the parser.  This history is
     |      used to implement the ``backtrack`` operation.
     |  :ivar _tried_e: A record of all productions that have been tried
     |      for a given tree.  This record is used by ``expand`` to perform
     |      the next untried production.
     |  :ivar _tried_m: A record of what tokens have been matched for a
     |      given tree.  This record is used by ``step`` to decide whether
     |      or not to match a token.
     |  :see: ``nltk.grammar``
     |
     |  Method resolution order:
     |      SteppingRecursiveDescentParser
     |      RecursiveDescentParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, trace=0)
     |      Create a new ``RecursiveDescentParser``, that uses ``grammar``
     |      to parse texts.
     |
     |      :type grammar: CFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  backtrack(self)
     |      Return the parser to its state before the most recent
     |      match or expand operation.  Calling ``undo`` repeatedly return
     |      the parser to successively earlier states.  If no match or
     |      expand operations have been performed, ``undo`` will make no
     |      changes.
     |
     |      :return: true if an operation was successfully undone.
     |      :rtype: bool
     |
     |  currently_complete(self)
     |      :return: Whether the parser's current state represents a
     |          complete parse.
     |      :rtype: bool
     |
     |  expand(self, production=None)
     |      Expand the first element of the frontier.  In particular, if
     |      the first element of the frontier is a subtree whose node type
     |      is equal to ``production``'s left hand side, then add a child
     |      to that subtree for each element of ``production``'s right hand
     |      side.  If ``production`` is not specified, then use the first
     |      untried expandable production.  If all expandable productions
     |      have been tried, do nothing.
     |
     |      :return: The production used to expand the frontier, if an
     |         expansion was performed.  If no expansion was performed,
     |         return None.
     |      :rtype: Production or None
     |
     |  expandable_productions(self)
     |      :return: A list of all the productions for which expansions
     |          are available for the current parser state.
     |      :rtype: list(Production)
     |
     |  frontier(self)
     |      :return: A list of the tree locations of all subtrees that
     |          have not yet been expanded, and all leaves that have not
     |          yet been matched.
     |      :rtype: list(tuple(int))
     |
     |  initialize(self, tokens)
     |      Start parsing a given text.  This sets the parser's tree to
     |      the start symbol, its frontier to the root node, and its
     |      remaining text to ``token['SUBTOKENS']``.
     |
     |  match(self)
     |      Match the first element of the frontier.  In particular, if
     |      the first element of the frontier has the same type as the
     |      next text token, then substitute the text token into the tree.
     |
     |      :return: The token matched, if a match operation was
     |          performed.  If no match was performed, return None
     |      :rtype: str or None
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  parses(self)
     |      :return: An iterator of the parses that have been found by this
     |          parser so far.
     |      :rtype: list of Tree
     |
     |  remaining_text(self)
     |      :return: The portion of the text that is not yet covered by the
     |          tree.
     |      :rtype: list(str)
     |
     |  set_grammar(self, grammar)
     |      Change the grammar used to parse texts.
     |
     |      :param grammar: The new grammar.
     |      :type grammar: CFG
     |
     |  step(self)
     |      Perform a single parsing operation.  If an untried match is
     |      possible, then perform the match, and return the matched
     |      token.  If an untried expansion is possible, then perform the
     |      expansion, and return the production that it is based on.  If
     |      backtracking is possible, then backtrack, and return True.
     |      Otherwise, return None.
     |
     |      :return: None if no operation was performed; a token if a match
     |          was performed; a production if an expansion was performed;
     |          and True if a backtrack operation was performed.
     |      :rtype: Production or String or bool
     |
     |  tree(self)
     |      :return: A partial structure for the text that is
     |          currently being parsed.  The elements specified by the
     |          frontier have not yet been expanded or matched.
     |      :rtype: Tree
     |
     |  untried_expandable_productions(self)
     |      :return: A list of all the untried productions for which
     |          expansions are available for the current parser state.
     |      :rtype: list(Production)
     |
     |  untried_match(self)
     |      :return: Whether the first element of the frontier is a token
     |          that has not yet been matched.
     |      :rtype: bool
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from RecursiveDescentParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()
        A demonstration of the recursive descent parser.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\recursivedescent.py

nltk.regexp
Python Library Documentation: module nltk.stem.regexp in nltk.stem

NAME
    nltk.stem.regexp

DESCRIPTION
    # Natural Language Toolkit: Stemmers
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Trevor Cohn <tacohn@cs.mu.oz.au>
    #         Edward Loper <edloper@gmail.com>
    #         Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.stem.api.StemmerI(builtins.object)
        RegexpStemmer

    class RegexpStemmer(nltk.stem.api.StemmerI)
     |  RegexpStemmer(regexp, min=0)
     |
     |  A stemmer that uses regular expressions to identify morphological
     |  affixes.  Any substrings that match the regular expressions will
     |  be removed.
     |
     |      >>> from nltk.stem import RegexpStemmer
     |      >>> st = RegexpStemmer('ing$|s$|e$|able$', min=4)
     |      >>> st.stem('cars')
     |      'car'
     |      >>> st.stem('mass')
     |      'mas'
     |      >>> st.stem('was')
     |      'was'
     |      >>> st.stem('bee')
     |      'bee'
     |      >>> st.stem('compute')
     |      'comput'
     |      >>> st.stem('advisable')
     |      'advis'
     |
     |  :type regexp: str or regexp
     |  :param regexp: The regular expression that should be used to
     |      identify morphological affixes.
     |  :type min: int
     |  :param min: The minimum length of string to stem
     |
     |  Method resolution order:
     |      RegexpStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, regexp, min=0)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  stem(self, word)
     |      Strip affixes from the token and return the stem.
     |
     |      :param token: The token that should be stemmed.
     |      :type token: str
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\regexp.py

nltk.regexp_span_tokenize
Python Library Documentation: function regexp_span_tokenize in module nltk.tokenize.util

regexp_span_tokenize(s, regexp)
    Return the offsets of the tokens in *s*, as a sequence of ``(start, end)``
    tuples, by splitting the string at each successive match of *regexp*.

        >>> from nltk.tokenize.util import regexp_span_tokenize
        >>> s = '''Good muffins cost $3.88\nin New York.  Please buy me
        ... two of them.\n\nThanks.'''
        >>> list(regexp_span_tokenize(s, r'\s')) # doctest: +NORMALIZE_WHITESPACE
        [(0, 4), (5, 12), (13, 17), (18, 23), (24, 26), (27, 30), (31, 36),
        (38, 44), (45, 48), (49, 51), (52, 55), (56, 58), (59, 64), (66, 73)]

    :param s: the string to be tokenized
    :type s: str
    :param regexp: regular expression that matches token separators (must not be empty)
    :type regexp: str
    :rtype: iter(tuple(int, int))
nltk.regexp_tokenize
Python Library Documentation: function regexp_tokenize in module nltk.tokenize.regexp

regexp_tokenize(text, pattern, gaps=False, discard_empty=True, flags=re.UNICODE|re.MULTILINE|re.DOTALL)
    Return a tokenized copy of *text*.  See :class:`.RegexpTokenizer`
    for descriptions of the arguments.
nltk.register_tag
Python Library Documentation: function register_tag in module nltk.jsontags

register_tag(cls)
    Decorates a class to register it's json tag.
nltk.relextract
Python Library Documentation: module nltk.sem.relextract in nltk.sem

NAME
    nltk.sem.relextract - Code for extracting relational triples from the ieer and conll2002 corpora.

DESCRIPTION
    Relations are stored internally as dictionaries ('reldicts').

    The two serialization outputs are "rtuple" and "clause".

    - An rtuple is a tuple of the form ``(subj, filler, obj)``,
      where ``subj`` and ``obj`` are pairs of Named Entity mentions, and ``filler`` is the string of words
      occurring between ``sub`` and ``obj`` (with no intervening NEs). Strings are printed via ``repr()`` to
      circumvent locale variations in rendering utf-8 encoded strings.
    - A clause is an atom of the form ``relsym(subjsym, objsym)``,
      where the relation, subject and object have been canonicalized to single strings.

FUNCTIONS
    class_abbrev(type)
        Abbreviate an NE class name.
        :type type: str
        :rtype: str

    clause(reldict, relsym)
        Print the relation in clausal form.
        :param reldict: a relation dictionary
        :type reldict: defaultdict
        :param relsym: a label for the relation
        :type relsym: str

    conllesp()

    conllned(trace=1)
        Find the copula+'van' relation ('of') in the Dutch tagged training corpus
        from CoNLL 2002.

    descape_entity(m, defs={'AElig': 'Æ', 'Aacute': 'Á', 'Acirc': 'Â', 'Agrave': 'À', 'Alpha': 'Α', 'Aring': 'Å', 'Atilde': 'Ã', 'Auml': 'Ä', 'Beta': 'Β', 'Ccedil': 'Ç', 'Chi': 'Χ', 'Dagger': '‡', 'Delta': 'Δ', 'ETH': 'Ð', 'Eacute': 'É', 'Ecirc': 'Ê', 'Egrave': 'È', 'Epsilon': 'Ε', 'Eta': 'Η', 'Euml': 'Ë', 'Gamma': 'Γ', 'Iacute': 'Í', 'Icirc': 'Î', 'Igrave': 'Ì', 'Iota': 'Ι', 'Iuml': 'Ï', 'Kappa': 'Κ', 'Lambda': 'Λ', 'Mu': 'Μ', 'Ntilde': 'Ñ', 'Nu': 'Ν', 'OElig': 'Œ', 'Oacute': 'Ó', 'Ocirc': 'Ô', 'Ograve': 'Ò', 'Omega': 'Ω', 'Omicron': 'Ο', 'Oslash': 'Ø', 'Otilde': 'Õ', 'Ouml': 'Ö', 'Phi': 'Φ', 'Pi': 'Π', 'Prime': '″', 'Psi': 'Ψ', 'Rho': 'Ρ', 'Scaron': 'Š', 'Sigma': 'Σ', 'THORN': 'Þ', 'Tau': 'Τ', 'Theta': 'Θ', 'Uacute': 'Ú', 'Ucirc': 'Û', 'Ugrave': 'Ù', 'Upsilon': 'Υ', 'Uuml': 'Ü', 'Xi': 'Ξ', 'Yacute': 'Ý', 'Yuml': 'Ÿ', 'Zeta': 'Ζ', 'aacute': 'á', 'acirc': 'â', 'acute': '´', 'aelig': 'æ', 'agrave': 'à', 'alefsym': 'ℵ', 'alpha': 'α', 'amp': '&', 'and': '∧', 'ang': '∠', 'aring': 'å', 'asymp': '≈', 'atilde': 'ã', 'auml': 'ä', 'bdquo': '„', 'beta': 'β', 'brvbar': '¦', 'bull': '•', 'cap': '∩', 'ccedil': 'ç', 'cedil': '¸', 'cent': '¢', 'chi': 'χ', 'circ': 'ˆ', 'clubs': '♣', 'cong': '≅', 'copy': '©', 'crarr': '↵', 'cup': '∪', 'curren': '¤', 'dArr': '⇓', 'dagger': '†', 'darr': '↓', 'deg': '°', 'delta': 'δ', 'diams': '♦', 'divide': '÷', 'eacute': 'é', 'ecirc': 'ê', 'egrave': 'è', 'empty': '∅', 'emsp': '\u2003', 'ensp': '\u2002', 'epsilon': 'ε', 'equiv': '≡', 'eta': 'η', 'eth': 'ð', 'euml': 'ë', 'euro': '€', 'exist': '∃', 'fnof': 'ƒ', 'forall': '∀', 'frac12': '½', 'frac14': '¼', 'frac34': '¾', 'frasl': '⁄', 'gamma': 'γ', 'ge': '≥', 'gt': '>', 'hArr': '⇔', 'harr': '↔', 'hearts': '♥', 'hellip': '…', 'iacute': 'í', 'icirc': 'î', 'iexcl': '¡', 'igrave': 'ì', 'image': 'ℑ', 'infin': '∞', 'int': '∫', 'iota': 'ι', 'iquest': '¿', 'isin': '∈', 'iuml': 'ï', 'kappa': 'κ', 'lArr': '⇐', 'lambda': 'λ', 'lang': '〈', 'laquo': '«', 'larr': '←', 'lceil': '⌈', 'ldquo': '“', 'le': '≤', 'lfloor': '⌊', 'lowast': '∗', 'loz': '◊', 'lrm': '\u200e', 'lsaquo': '‹', 'lsquo': '‘', 'lt': '<', 'macr': '¯', 'mdash': '—', 'micro': 'µ', 'middot': '·', 'minus': '−', 'mu': 'μ', 'nabla': '∇', 'nbsp': '\xa0', 'ndash': '–', 'ne': '≠', 'ni': '∋', 'not': '¬', 'notin': '∉', 'nsub': '⊄', 'ntilde': 'ñ', 'nu': 'ν', 'oacute': 'ó', 'ocirc': 'ô', 'oelig': 'œ', 'ograve': 'ò', 'oline': '‾', 'omega': 'ω', 'omicron': 'ο', 'oplus': '⊕', 'or': '∨', 'ordf': 'ª', 'ordm': 'º', 'oslash': 'ø', 'otilde': 'õ', 'otimes': '⊗', 'ouml': 'ö', 'para': '¶', 'part': '∂', 'permil': '‰', 'perp': '⊥', 'phi': 'φ', 'pi': 'π', 'piv': 'ϖ', 'plusmn': '±', 'pound': '£', 'prime': '′', 'prod': '∏', 'prop': '∝', 'psi': 'ψ', 'quot': '"', 'rArr': '⇒', 'radic': '√', 'rang': '〉', 'raquo': '»', 'rarr': '→', 'rceil': '⌉', 'rdquo': '”', 'real': 'ℜ', 'reg': '®', 'rfloor': '⌋', 'rho': 'ρ', 'rlm': '\u200f', 'rsaquo': '›', 'rsquo': '’', 'sbquo': '‚', 'scaron': 'š', 'sdot': '⋅', 'sect': '§', 'shy': '\xad', 'sigma': 'σ', 'sigmaf': 'ς', 'sim': '∼', 'spades': '♠', 'sub': '⊂', 'sube': '⊆', 'sum': '∑', 'sup': '⊃', 'sup1': '¹', 'sup2': '²', 'sup3': '³', 'supe': '⊇', 'szlig': 'ß', 'tau': 'τ', 'there4': '∴', 'theta': 'θ', 'thetasym': 'ϑ', 'thinsp': '\u2009', 'thorn': 'þ', 'tilde': '˜', 'times': '×', 'trade': '™', 'uArr': '⇑', 'uacute': 'ú', 'uarr': '↑', 'ucirc': 'û', 'ugrave': 'ù', 'uml': '¨', 'upsih': 'ϒ', 'upsilon': 'υ', 'uuml': 'ü', 'weierp': '℘', 'xi': 'ξ', 'yacute': 'ý', 'yen': '¥', 'yuml': 'ÿ', 'zeta': 'ζ', 'zwj': '\u200d', 'zwnj': '\u200c'})
        Translate one entity to its ISO Latin value.
        Inspired by example from effbot.org

    extract_rels(subjclass, objclass, doc, corpus='ace', pattern=None, window=10)
        Filter the output of ``semi_rel2reldict`` according to specified NE classes and a filler pattern.

        The parameters ``subjclass`` and ``objclass`` can be used to restrict the
        Named Entities to particular types (any of 'LOCATION', 'ORGANIZATION',
        'PERSON', 'DURATION', 'DATE', 'CARDINAL', 'PERCENT', 'MONEY', 'MEASURE').

        :param subjclass: the class of the subject Named Entity.
        :type subjclass: str
        :param objclass: the class of the object Named Entity.
        :type objclass: str
        :param doc: input document
        :type doc: ieer document or a list of chunk trees
        :param corpus: name of the corpus to take as input; possible values are
            'ieer' and 'conll2002'
        :type corpus: str
        :param pattern: a regular expression for filtering the fillers of
            retrieved triples.
        :type pattern: SRE_Pattern
        :param window: filters out fillers which exceed this threshold
        :type window: int
        :return: see ``mk_reldicts``
        :rtype: list(defaultdict)

    ieer_headlines()

    in_demo(trace=0, sql=True)
        Select pairs of organizations and locations whose mentions occur with an
        intervening occurrence of the preposition "in".

        If the sql parameter is set to True, then the entity pairs are loaded into
        an in-memory database, and subsequently pulled out using an SQL "SELECT"
        query.

    list2sym(lst)
        Convert a list of strings into a canonical symbol.
        :type lst: list
        :return: a Unicode string without whitespace
        :rtype: unicode

    ne_chunked()

    roles_demo(trace=0)

    rtuple(reldict, lcon=False, rcon=False)
        Pretty print the reldict as an rtuple.
        :param reldict: a relation dictionary
        :type reldict: defaultdict

    semi_rel2reldict(pairs, window=5, trace=False)
        Converts the pairs generated by ``tree2semi_rel`` into a 'reldict': a dictionary which
        stores information about the subject and object NEs plus the filler between them.
        Additionally, a left and right context of length =< window are captured (within
        a given input sentence).

        :param pairs: a pair of list(str) and ``Tree``, as generated by
        :param window: a threshold for the number of items to include in the left and right context
        :type window: int
        :return: 'relation' dictionaries whose keys are 'lcon', 'subjclass', 'subjtext', 'subjsym', 'filler', objclass', objtext', 'objsym' and 'rcon'
        :rtype: list(defaultdict)

    tree2semi_rel(tree)
        Group a chunk structure into a list of 'semi-relations' of the form (list(str), ``Tree``).

        In order to facilitate the construction of (``Tree``, string, ``Tree``) triples, this
        identifies pairs whose first member is a list (possibly empty) of terminal
        strings, and whose second member is a ``Tree`` of the form (NE_label, terminals).

        :param tree: a chunk tree
        :return: a list of pairs (list(str), ``Tree``)
        :rtype: list of tuple

DATA
    NE_CLASSES = {'ace': ['LOCATION', 'ORGANIZATION', 'PERSON', 'DURATION'...
    long2short = {'LOCATION': 'LOC', 'ORGANIZATION': 'ORG', 'PERSON': 'PER...
    short2long = {'LOC': 'LOCATION', 'ORG': 'ORGANIZATION', 'PER': 'PERSON...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\sem\relextract.py

nltk.repp
Python Library Documentation: module nltk.tokenize.repp in nltk.tokenize

NAME
    nltk.tokenize.repp

DESCRIPTION
    # Natural Language Toolkit: Interface to the Repp Tokenizer
    #
    # Copyright (C) 2001-2015 NLTK Project
    # Authors: Rebecca Dridan and Stephan Oepen
    # Contributors: Liling Tan
    #
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.tokenize.api.TokenizerI(abc.ABC)
        ReppTokenizer

    class ReppTokenizer(nltk.tokenize.api.TokenizerI)
     |  ReppTokenizer(repp_dir, encoding='utf8')
     |
     |  A class for word tokenization using the REPP parser described in
     |  Rebecca Dridan and Stephan Oepen (2012) Tokenization: Returning to a
     |  Long Solved Problem - A Survey, Contrastive  Experiment, Recommendations,
     |  and Toolkit. In ACL. http://anthology.aclweb.org/P/P12/P12-2.pdf#page=406
     |
     |  >>> sents = ['Tokenization is widely regarded as a solved problem due to the high accuracy that rulebased tokenizers achieve.' ,
     |  ... 'But rule-based tokenizers are hard to maintain and their rules language specific.' ,
     |  ... 'We evaluated our method on three languages and obtained error rates of 0.27% (English), 0.35% (Dutch) and 0.76% (Italian) for our best models.'
     |  ... ]
     |  >>> tokenizer = ReppTokenizer('/home/alvas/repp/') # doctest: +SKIP
     |  >>> for sent in sents:                             # doctest: +SKIP
     |  ...     tokenizer.tokenize(sent)                   # doctest: +SKIP
     |  ...
     |  (u'Tokenization', u'is', u'widely', u'regarded', u'as', u'a', u'solved', u'problem', u'due', u'to', u'the', u'high', u'accuracy', u'that', u'rulebased', u'tokenizers', u'achieve', u'.')
     |  (u'But', u'rule-based', u'tokenizers', u'are', u'hard', u'to', u'maintain', u'and', u'their', u'rules', u'language', u'specific', u'.')
     |  (u'We', u'evaluated', u'our', u'method', u'on', u'three', u'languages', u'and', u'obtained', u'error', u'rates', u'of', u'0.27', u'%', u'(', u'English', u')', u',', u'0.35', u'%', u'(', u'Dutch', u')', u'and', u'0.76', u'%', u'(', u'Italian', u')', u'for', u'our', u'best', u'models', u'.')
     |
     |  >>> for sent in tokenizer.tokenize_sents(sents): # doctest: +SKIP
     |  ...     print(sent)                              # doctest: +SKIP
     |  ...
     |  (u'Tokenization', u'is', u'widely', u'regarded', u'as', u'a', u'solved', u'problem', u'due', u'to', u'the', u'high', u'accuracy', u'that', u'rulebased', u'tokenizers', u'achieve', u'.')
     |  (u'But', u'rule-based', u'tokenizers', u'are', u'hard', u'to', u'maintain', u'and', u'their', u'rules', u'language', u'specific', u'.')
     |  (u'We', u'evaluated', u'our', u'method', u'on', u'three', u'languages', u'and', u'obtained', u'error', u'rates', u'of', u'0.27', u'%', u'(', u'English', u')', u',', u'0.35', u'%', u'(', u'Dutch', u')', u'and', u'0.76', u'%', u'(', u'Italian', u')', u'for', u'our', u'best', u'models', u'.')
     |  >>> for sent in tokenizer.tokenize_sents(sents, keep_token_positions=True): # doctest: +SKIP
     |  ...     print(sent)                                                         # doctest: +SKIP
     |  ...
     |  [(u'Tokenization', 0, 12), (u'is', 13, 15), (u'widely', 16, 22), (u'regarded', 23, 31), (u'as', 32, 34), (u'a', 35, 36), (u'solved', 37, 43), (u'problem', 44, 51), (u'due', 52, 55), (u'to', 56, 58), (u'the', 59, 62), (u'high', 63, 67), (u'accuracy', 68, 76), (u'that', 77, 81), (u'rulebased', 82, 91), (u'tokenizers', 92, 102), (u'achieve', 103, 110), (u'.', 110, 111)]
     |  [(u'But', 0, 3), (u'rule-based', 4, 14), (u'tokenizers', 15, 25), (u'are', 26, 29), (u'hard', 30, 34), (u'to', 35, 37), (u'maintain', 38, 46), (u'and', 47, 50), (u'their', 51, 56), (u'rules', 57, 62), (u'language', 63, 71), (u'specific', 72, 80), (u'.', 80, 81)]
     |  [(u'We', 0, 2), (u'evaluated', 3, 12), (u'our', 13, 16), (u'method', 17, 23), (u'on', 24, 26), (u'three', 27, 32), (u'languages', 33, 42), (u'and', 43, 46), (u'obtained', 47, 55), (u'error', 56, 61), (u'rates', 62, 67), (u'of', 68, 70), (u'0.27', 71, 75), (u'%', 75, 76), (u'(', 77, 78), (u'English', 78, 85), (u')', 85, 86), (u',', 86, 87), (u'0.35', 88, 92), (u'%', 92, 93), (u'(', 94, 95), (u'Dutch', 95, 100), (u')', 100, 101), (u'and', 102, 105), (u'0.76', 106, 110), (u'%', 110, 111), (u'(', 112, 113), (u'Italian', 113, 120), (u')', 120, 121), (u'for', 122, 125), (u'our', 126, 129), (u'best', 130, 134), (u'models', 135, 141), (u'.', 141, 142)]
     |
     |  Method resolution order:
     |      ReppTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, repp_dir, encoding='utf8')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  find_repptokenizer(self, repp_dirname)
     |      A module to find REPP tokenizer binary and its *repp.set* config file.
     |
     |  generate_repp_command(self, inputfilename)
     |      This module generates the REPP command to be used at the terminal.
     |
     |      :param inputfilename: path to the input file
     |      :type inputfilename: str
     |
     |  tokenize(self, sentence)
     |      Use Repp to tokenize a single sentence.
     |
     |      :param sentence: A single sentence string.
     |      :type sentence: str
     |      :return: A tuple of tokens.
     |      :rtype: tuple(str)
     |
     |  tokenize_sents(self, sentences, keep_token_positions=False)
     |      Tokenize multiple sentences using Repp.
     |
     |      :param sentences: A list of sentence strings.
     |      :type sentences: list(str)
     |      :return: A list of tuples of tokens
     |      :rtype: iter(tuple(str))
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  parse_repp_outputs(repp_output)
     |      This module parses the tri-tuple format that REPP outputs using the
     |      "--format triple" option and returns an generator with tuple of string
     |      tokens.
     |
     |      :param repp_output:
     |      :type repp_output: type
     |      :return: an iterable of the tokenized sentences as tuples of strings
     |      :rtype: iter(tuple)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\repp.py

nltk.resolution
Python Library Documentation: module nltk.inference.resolution in nltk.inference

NAME
    nltk.inference.resolution - Module for a resolution-based First Order theorem prover.

CLASSES
    builtins.Exception(builtins.BaseException)
        BindingException
        ProverParseError
        UnificationException
    builtins.list(builtins.object)
        Clause
    builtins.object
        BindingDict
        DebugObject
    nltk.inference.api.BaseProverCommand(nltk.inference.api.BaseTheoremToolCommand, nltk.inference.api.ProverCommand)
        ResolutionProverCommand
    nltk.inference.api.Prover(builtins.object)
        ResolutionProver

    class BindingDict(builtins.object)
     |  BindingDict(binding_list=None)
     |
     |  Methods defined here:
     |
     |  __add__(self, other)
     |      :param other: ``BindingDict`` The dict with which to combine self
     |      :return: ``BindingDict`` A new dict containing all the elements of both parameters
     |      :raise BindingException: If the parameter dictionaries are not consistent with each other
     |
     |  __contains__(self, item)
     |
     |  __getitem__(self, variable)
     |      Return the expression to which 'variable' is bound
     |
     |  __init__(self, binding_list=None)
     |      :param binding_list: list of (``AbstractVariableExpression``, ``AtomicExpression``) to initialize the dictionary
     |
     |  __len__(self)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __setitem__(self, variable, binding)
     |      A binding is consistent with the dict if its variable is not already bound, OR if its
     |      variable is already bound to its argument.
     |
     |      :param variable: ``Variable`` The variable to bind
     |      :param binding: ``Expression`` The atomic to which 'variable' should be bound
     |      :raise BindingException: If the variable cannot be bound in this dictionary
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BindingException(builtins.Exception)
     |  BindingException(arg)
     |
     |  Method resolution order:
     |      BindingException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, arg)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class Clause(builtins.list)
     |  Clause(data)
     |
     |  Method resolution order:
     |      Clause
     |      builtins.list
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __add__(self, other)
     |      Return self+value.
     |
     |  __getslice__(self, start, end)
     |
     |  __init__(self, data)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  __sub__(self, other)
     |
     |  free(self)
     |
     |  isSubsetOf(self, other)
     |      Return True iff every term in 'self' is a term in 'other'.
     |
     |      :param other: ``Clause``
     |      :return: bool
     |
     |  is_tautology(self)
     |      Self is a tautology if it contains ground terms P and -P.  The ground
     |      term, P, must be an exact match, ie, not using unification.
     |
     |  replace(self, variable, expression)
     |      Replace every instance of variable with expression across every atom
     |      in the clause
     |
     |      :param variable: ``Variable``
     |      :param expression: ``Expression``
     |
     |  substitute_bindings(self, bindings)
     |      Replace every binding
     |
     |      :param bindings: A list of tuples mapping Variable Expressions to the
     |          Expressions to which they are bound.
     |      :return: ``Clause``
     |
     |  subsumes(self, other)
     |      Return True iff 'self' subsumes 'other', this is, if there is a
     |      substitution such that every term in 'self' can be unified with a term
     |      in 'other'.
     |
     |      :param other: ``Clause``
     |      :return: bool
     |
     |  unify(self, other, bindings=None, used=None, skipped=None, debug=False)
     |      Attempt to unify this Clause with the other, returning a list of
     |      resulting, unified, Clauses.
     |
     |      :param other: ``Clause`` with which to unify
     |      :param bindings: ``BindingDict`` containing bindings that should be used
     |          during the unification
     |      :param used: tuple of two lists of atoms.  The first lists the
     |          atoms from 'self' that were successfully unified with atoms from
     |          'other'.  The second lists the atoms from 'other' that were successfully
     |          unified with atoms from 'self'.
     |      :param skipped: tuple of two ``Clause`` objects.  The first is a list of all
     |          the atoms from the 'self' Clause that have not been unified with
     |          anything on the path.  The second is same thing for the 'other' Clause.
     |      :param debug: bool indicating whether debug statements should print
     |      :return: list containing all the resulting ``Clause`` objects that could be
     |          obtained by unification
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __delitem__(self, key, /)
     |      Delete self[key].
     |
     |  __eq__(self, value, /)
     |      Return self==value.
     |
     |  __ge__(self, value, /)
     |      Return self>=value.
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __getitem__(self, index, /)
     |      Return self[index].
     |
     |  __gt__(self, value, /)
     |      Return self>value.
     |
     |  __iadd__(self, value, /)
     |      Implement self+=value.
     |
     |  __imul__(self, value, /)
     |      Implement self*=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __le__(self, value, /)
     |      Return self<=value.
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __lt__(self, value, /)
     |      Return self<value.
     |
     |  __mul__(self, value, /)
     |      Return self*value.
     |
     |  __ne__(self, value, /)
     |      Return self!=value.
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __rmul__(self, value, /)
     |      Return value*self.
     |
     |  __setitem__(self, key, value, /)
     |      Set self[key] to value.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  append(self, object, /)
     |      Append object to the end of the list.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  copy(self, /)
     |      Return a shallow copy of the list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  extend(self, iterable, /)
     |      Extend list by appending elements from the iterable.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  insert(self, index, object, /)
     |      Insert object before index.
     |
     |  pop(self, index=-1, /)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, value, /)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self, /)
     |      Reverse *IN PLACE*.
     |
     |  sort(self, /, *, key=None, reverse=False)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from builtins.list:
     |
     |  __hash__ = None

    class DebugObject(builtins.object)
     |  DebugObject(enabled=True, indent=0)
     |
     |  Methods defined here:
     |
     |  __add__(self, i)
     |
     |  __init__(self, enabled=True, indent=0)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  line(self, line)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProverParseError(builtins.Exception)
     |  Method resolution order:
     |      ProverParseError
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class ResolutionProver(nltk.inference.api.Prover)
     |  Method resolution order:
     |      ResolutionProver
     |      nltk.inference.api.Prover
     |      builtins.object
     |
     |  Data and other attributes defined here:
     |
     |  ANSWER_KEY = 'ANSWER'
     |
     |  TIMEOUT = 60
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.Prover:
     |
     |  prove(self, goal=None, assumptions=None, verbose=False)
     |      :return: Whether the proof was successful or not.
     |      :rtype: bool
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.inference.api.Prover:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ResolutionProverCommand(nltk.inference.api.BaseProverCommand)
     |  ResolutionProverCommand(goal=None, assumptions=None, prover=None)
     |
     |  Method resolution order:
     |      ResolutionProverCommand
     |      nltk.inference.api.BaseProverCommand
     |      nltk.inference.api.BaseTheoremToolCommand
     |      nltk.inference.api.ProverCommand
     |      nltk.inference.api.TheoremToolCommand
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, goal=None, assumptions=None, prover=None)
     |      :param goal: Input expression to prove
     |      :type goal: sem.Expression
     |      :param assumptions: Input expressions to use as assumptions in
     |          the proof.
     |      :type assumptions: list(sem.Expression)
     |
     |  find_answers(self, verbose=False)
     |
     |  prove(self, verbose=False)
     |      Perform the actual proof.  Store the result to prevent unnecessary
     |      re-proving.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.BaseProverCommand:
     |
     |  decorate_proof(self, proof_string, simplify=True)
     |      Modify and return the proof string
     |      :param proof_string: str the proof to decorate
     |      :param simplify: bool simplify the proof?
     |      :return: str
     |
     |  get_prover(self)
     |      Return the prover object
     |      :return: ``Prover``
     |
     |  proof(self, simplify=True)
     |      Return the proof string
     |      :param simplify: bool simplify the proof?
     |      :return: str
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.BaseTheoremToolCommand:
     |
     |  add_assumptions(self, new_assumptions)
     |      Add new assumptions to the assumption list.
     |
     |      :param new_assumptions: new assumptions
     |      :type new_assumptions: list(sem.Expression)
     |
     |  assumptions(self)
     |      List the current assumptions.
     |
     |      :return: list of ``Expression``
     |
     |  goal(self)
     |      Return the goal
     |
     |      :return: ``Expression``
     |
     |  print_assumptions(self)
     |      Print the list of the current assumptions.
     |
     |  retract_assumptions(self, retracted, debug=False)
     |      Retract assumptions from the assumption list.
     |
     |      :param debug: If True, give warning when ``retracted`` is not present on
     |          assumptions list.
     |      :type debug: bool
     |      :param retracted: assumptions to be retracted
     |      :type retracted: list(sem.Expression)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.inference.api.TheoremToolCommand:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class UnificationException(builtins.Exception)
     |  UnificationException(a, b)
     |
     |  Method resolution order:
     |      UnificationException
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, a, b)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

FUNCTIONS
    clausify(expression)
        Skolemize, clausify, and standardize the variables apart.

    demo()

    most_general_unification(a, b, bindings=None)
        Find the most general unification of the two given expressions

        :param a: ``Expression``
        :param b: ``Expression``
        :param bindings: ``BindingDict`` a starting set of bindings with which the
                         unification must be consistent
        :return: a list of bindings
        :raise BindingException: if the Expressions cannot be unified

    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

    resolution_test(e)

    testResolutionProver()

    test_clausify()

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\inference\resolution.py

nltk.ribes
Python Library Documentation: function sentence_ribes in module nltk.translate.ribes_score

sentence_ribes(references, hypothesis, alpha=0.25, beta=0.1)
    The RIBES (Rank-based Intuitive Bilingual Evaluation Score) from
    Hideki Isozaki, Tsutomu Hirao, Kevin Duh, Katsuhito Sudoh and
    Hajime Tsukada. 2010. "Automatic Evaluation of Translation Quality for
    Distant Language Pairs". In Proceedings of EMNLP.
    https://www.aclweb.org/anthology/D/D10/D10-1092.pdf

    The generic RIBES scores used in shared task, e.g. Workshop for
    Asian Translation (WAT) uses the following RIBES calculations:

        RIBES = kendall_tau * (alpha**p1) * (beta**bp)

    Please note that this re-implementation differs from the official
    RIBES implementation and though it emulates the results as describe
    in the original paper, there are further optimization implemented
    in the official RIBES script.

    Users are encouraged to use the official RIBES script instead of this
    implementation when evaluating your machine translation system. Refer
    to https://www.kecl.ntt.co.jp/icl/lirg/ribes/ for the official script.

    :param references: a list of reference sentences
    :type references: list(list(str))
    :param hypothesis: a hypothesis sentence
    :type hypothesis: list(str)
    :param alpha: hyperparameter used as a prior for the unigram precision.
    :type alpha: float
    :param beta: hyperparameter used as a prior for the brevity penalty.
    :type beta: float
    :return: The best ribes score from one of the references.
    :rtype: float
nltk.ribes_score
Python Library Documentation: module nltk.translate.ribes_score in nltk.translate

NAME
    nltk.translate.ribes_score - RIBES score implementation

FUNCTIONS
    corpus_ribes(list_of_references, hypotheses, alpha=0.25, beta=0.1)
        This function "calculates RIBES for a system output (hypothesis) with
        multiple references, and returns "best" score among multi-references and
        individual scores. The scores are corpus-wise, i.e., averaged by the number
        of sentences." (c.f. RIBES version 1.03.1 code).

        Different from BLEU's micro-average precision, RIBES calculates the
        macro-average precision by averaging the best RIBES score for each pair of
        hypothesis and its corresponding references

        >>> hyp1 = ['It', 'is', 'a', 'guide', 'to', 'action', 'which',
        ...         'ensures', 'that', 'the', 'military', 'always',
        ...         'obeys', 'the', 'commands', 'of', 'the', 'party']
        >>> ref1a = ['It', 'is', 'a', 'guide', 'to', 'action', 'that',
        ...          'ensures', 'that', 'the', 'military', 'will', 'forever',
        ...          'heed', 'Party', 'commands']
        >>> ref1b = ['It', 'is', 'the', 'guiding', 'principle', 'which',
        ...          'guarantees', 'the', 'military', 'forces', 'always',
        ...          'being', 'under', 'the', 'command', 'of', 'the', 'Party']
        >>> ref1c = ['It', 'is', 'the', 'practical', 'guide', 'for', 'the',
        ...          'army', 'always', 'to', 'heed', 'the', 'directions',
        ...          'of', 'the', 'party']

        >>> hyp2 = ['he', 'read', 'the', 'book', 'because', 'he', 'was',
        ...         'interested', 'in', 'world', 'history']
        >>> ref2a = ['he', 'was', 'interested', 'in', 'world', 'history',
        ...          'because', 'he', 'read', 'the', 'book']

        >>> list_of_references = [[ref1a, ref1b, ref1c], [ref2a]]
        >>> hypotheses = [hyp1, hyp2]
        >>> round(corpus_ribes(list_of_references, hypotheses),4)
        0.3597

        :param references: a corpus of lists of reference sentences, w.r.t. hypotheses
        :type references: list(list(list(str)))
        :param hypotheses: a list of hypothesis sentences
        :type hypotheses: list(list(str))
        :param alpha: hyperparameter used as a prior for the unigram precision.
        :type alpha: float
        :param beta: hyperparameter used as a prior for the brevity penalty.
        :type beta: float
        :return: The best ribes score from one of the references.
        :rtype: float

    find_increasing_sequences(worder)
        Given the *worder* list, this function groups monotonic +1 sequences.

            >>> worder = [7, 8, 9, 10, 6, 0, 1, 2, 3, 4, 5]
            >>> list(find_increasing_sequences(worder))
            [(7, 8, 9, 10), (0, 1, 2, 3, 4, 5)]

        :param worder: The worder list output from word_rank_alignment
        :param type: list(int)

    kendall_tau(worder, normalize=True)
        Calculates the Kendall's Tau correlation coefficient given the *worder*
        list of word alignments from word_rank_alignment(), using the formula:

            tau = 2 * num_increasing_pairs / num_possible_pairs -1

        Note that the no. of increasing pairs can be discontinuous in the *worder*
        list and each each increasing sequence can be tabulated as choose(len(seq), 2)
        no. of increasing pairs, e.g.

            >>> worder = [7, 8, 9, 10, 6, 0, 1, 2, 3, 4, 5]
            >>> number_possible_pairs = choose(len(worder), 2)
            >>> round(kendall_tau(worder, normalize=False),3)
            -0.236
            >>> round(kendall_tau(worder),3)
            0.382

        :param worder: The worder list output from word_rank_alignment
        :type worder: list(int)
        :param normalize: Flag to indicate normalization to between 0.0 and 1.0.
        :type normalize: boolean
        :return: The Kendall's Tau correlation coefficient.
        :rtype: float

    position_of_ngram(ngram, sentence)
        This function returns the position of the first instance of the ngram
        appearing in a sentence.

        Note that one could also use string as follows but the code is a little
        convoluted with type casting back and forth:

            char_pos = ' '.join(sent)[:' '.join(sent).index(' '.join(ngram))]
            word_pos = char_pos.count(' ')

        Another way to conceive this is:

            return next(i for i, ng in enumerate(ngrams(sentence, len(ngram)))
                        if ng == ngram)

        :param ngram: The ngram that needs to be searched
        :type ngram: tuple
        :param sentence: The list of tokens to search from.
        :type sentence: list(str)

    sentence_ribes(references, hypothesis, alpha=0.25, beta=0.1)
        The RIBES (Rank-based Intuitive Bilingual Evaluation Score) from
        Hideki Isozaki, Tsutomu Hirao, Kevin Duh, Katsuhito Sudoh and
        Hajime Tsukada. 2010. "Automatic Evaluation of Translation Quality for
        Distant Language Pairs". In Proceedings of EMNLP.
        https://www.aclweb.org/anthology/D/D10/D10-1092.pdf

        The generic RIBES scores used in shared task, e.g. Workshop for
        Asian Translation (WAT) uses the following RIBES calculations:

            RIBES = kendall_tau * (alpha**p1) * (beta**bp)

        Please note that this re-implementation differs from the official
        RIBES implementation and though it emulates the results as describe
        in the original paper, there are further optimization implemented
        in the official RIBES script.

        Users are encouraged to use the official RIBES script instead of this
        implementation when evaluating your machine translation system. Refer
        to https://www.kecl.ntt.co.jp/icl/lirg/ribes/ for the official script.

        :param references: a list of reference sentences
        :type references: list(list(str))
        :param hypothesis: a hypothesis sentence
        :type hypothesis: list(str)
        :param alpha: hyperparameter used as a prior for the unigram precision.
        :type alpha: float
        :param beta: hyperparameter used as a prior for the brevity penalty.
        :type beta: float
        :return: The best ribes score from one of the references.
        :rtype: float

    spearman_rho(worder, normalize=True)
        Calculates the Spearman's Rho correlation coefficient given the *worder*
        list of word alignment from word_rank_alignment(), using the formula:

            rho = 1 - sum(d**2) / choose(len(worder)+1, 3)

        Given that d is the sum of difference between the *worder* list of indices
        and the original word indices from the reference sentence.

        Using the (H0,R0) and (H5, R5) example from the paper

            >>> worder =  [7, 8, 9, 10, 6, 0, 1, 2, 3, 4, 5]
            >>> round(spearman_rho(worder, normalize=False), 3)
            -0.591
            >>> round(spearman_rho(worder), 3)
            0.205

        :param worder: The worder list output from word_rank_alignment
        :param type: list(int)

    word_rank_alignment(reference, hypothesis, character_based=False)
        This is the word rank alignment algorithm described in the paper to produce
        the *worder* list, i.e. a list of word indices of the hypothesis word orders
        w.r.t. the list of reference words.

        Below is (H0, R0) example from the Isozaki et al. 2010 paper,
        note the examples are indexed from 1 but the results here are indexed from 0:

            >>> ref = str('he was interested in world history because he '
            ... 'read the book').split()
            >>> hyp = str('he read the book because he was interested in world '
            ... 'history').split()
            >>> word_rank_alignment(ref, hyp)
            [7, 8, 9, 10, 6, 0, 1, 2, 3, 4, 5]

        The (H1, R1) example from the paper, note the 0th index:

            >>> ref = 'John hit Bob yesterday'.split()
            >>> hyp = 'Bob hit John yesterday'.split()
            >>> word_rank_alignment(ref, hyp)
            [2, 1, 0, 3]

        Here is the (H2, R2) example from the paper, note the 0th index here too:

            >>> ref = 'the boy read the book'.split()
            >>> hyp = 'the book was read by the boy'.split()
            >>> word_rank_alignment(ref, hyp)
            [3, 4, 2, 0, 1]

        :param reference: a reference sentence
        :type reference: list(str)
        :param hypothesis: a hypothesis sentence
        :type hypothesis: list(str)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\ribes_score.py

nltk.root_semrep
Python Library Documentation: function root_semrep in module nltk.sem.util

root_semrep(syntree, semkey='SEM')
    Find the semantic representation at the root of a tree.

    :param syntree: a parse ``Tree``
    :param semkey: the feature label to use for the root semantics in the tree
    :return: the semantic representation at the root of a ``Tree``
    :rtype: sem.Expression
nltk.rslp
Python Library Documentation: module nltk.stem.rslp in nltk.stem

NAME
    nltk.stem.rslp

DESCRIPTION
    # Natural Language Toolkit: RSLP Stemmer
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Tiago Tresoldi <tresoldi@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.stem.api.StemmerI(builtins.object)
        RSLPStemmer

    class RSLPStemmer(nltk.stem.api.StemmerI)
     |  A stemmer for Portuguese.
     |
     |      >>> from nltk.stem import RSLPStemmer
     |      >>> st = RSLPStemmer()
     |      >>> # opening lines of Erico Verissimo's "Música ao Longe"
     |      >>> text = '''
     |      ... Clarissa risca com giz no quadro-negro a paisagem que os alunos
     |      ... devem copiar . Uma casinha de porta e janela , em cima duma
     |      ... coxilha .'''
     |      >>> for token in text.split(): # doctest: +NORMALIZE_WHITESPACE
     |      ...     print(st.stem(token))
     |      clariss risc com giz no quadro-negr a pais que os alun dev copi .
     |      uma cas de port e janel , em cim dum coxilh .
     |
     |  Method resolution order:
     |      RSLPStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  apply_rule(self, word, rule_index)
     |
     |  read_rule(self, filename)
     |
     |  stem(self, word)
     |      Strip affixes from the token and return the stem.
     |
     |      :param token: The token that should be stemmed.
     |      :type token: str
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\rslp.py

nltk.rte_classifier
Python Library Documentation: function rte_classifier in module nltk.classify.rte_classify

rte_classifier(algorithm, sample_N=None)
nltk.rte_classify
Python Library Documentation: module nltk.classify.rte_classify in nltk.classify

NAME
    nltk.classify.rte_classify - Simple classifier for RTE corpus.

DESCRIPTION
    It calculates the overlap in words and named entities between text and
    hypothesis, and also whether there are words / named entities in the
    hypothesis which fail to occur in the text, since this is an indicator that
    the hypothesis is more informative than (i.e not entailed by) the text.

    TO DO: better Named Entity classification
    TO DO: add lemmatization

CLASSES
    builtins.object
        RTEFeatureExtractor

    class RTEFeatureExtractor(builtins.object)
     |  RTEFeatureExtractor(rtepair, stop=True, use_lemmatize=False)
     |
     |  This builds a bag of words for both the text and the hypothesis after
     |  throwing away some stopwords, then calculates overlap and difference.
     |
     |  Methods defined here:
     |
     |  __init__(self, rtepair, stop=True, use_lemmatize=False)
     |      :param rtepair: a ``RTEPair`` from which features should be extracted
     |      :param stop: if ``True``, stopwords are thrown away.
     |      :type stop: bool
     |
     |  hyp_extra(self, toktype, debug=True)
     |      Compute the extraneous material in the hypothesis.
     |
     |      :param toktype: distinguish Named Entities from ordinary words
     |      :type toktype: 'ne' or 'word'
     |
     |  overlap(self, toktype, debug=False)
     |      Compute the overlap between text and hypothesis.
     |
     |      :param toktype: distinguish Named Entities from ordinary words
     |      :type toktype: 'ne' or 'word'
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    rte_classifier(algorithm, sample_N=None)

    rte_features(rtepair)

    rte_featurize(rte_pairs)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\rte_classify.py

nltk.rte_features
Python Library Documentation: function rte_features in module nltk.classify.rte_classify

rte_features(rtepair)
nltk.rtuple
Python Library Documentation: function rtuple in module nltk.sem.relextract

rtuple(reldict, lcon=False, rcon=False)
    Pretty print the reldict as an rtuple.
    :param reldict: a relation dictionary
    :type reldict: defaultdict
nltk.scikitlearn
Python Library Documentation: module nltk.classify.scikitlearn in nltk.classify

NAME
    nltk.classify.scikitlearn

DESCRIPTION
    scikit-learn (https://scikit-learn.org) is a machine learning library for
    Python. It supports many classification algorithms, including SVMs,
    Naive Bayes, logistic regression (MaxEnt) and decision trees.

    This package implements a wrapper around scikit-learn classifiers. To use this
    wrapper, construct a scikit-learn estimator object, then use that to construct
    a SklearnClassifier. E.g., to wrap a linear SVM with default settings:

    >>> from sklearn.svm import LinearSVC
    >>> from nltk.classify.scikitlearn import SklearnClassifier
    >>> classif = SklearnClassifier(LinearSVC())

    A scikit-learn classifier may include preprocessing steps when it's wrapped
    in a Pipeline object. The following constructs and wraps a Naive Bayes text
    classifier with tf-idf weighting and chi-square feature selection to get the
    best 1000 features:

    >>> from sklearn.feature_extraction.text import TfidfTransformer
    >>> from sklearn.feature_selection import SelectKBest, chi2
    >>> from sklearn.naive_bayes import MultinomialNB
    >>> from sklearn.pipeline import Pipeline
    >>> pipeline = Pipeline([('tfidf', TfidfTransformer()),
    ...                      ('chi2', SelectKBest(chi2, k=1000)),
    ...                      ('nb', MultinomialNB())])
    >>> classif = SklearnClassifier(pipeline)

CLASSES
    nltk.classify.api.ClassifierI(builtins.object)
        SklearnClassifier

    class SklearnClassifier(nltk.classify.api.ClassifierI)
     |  SklearnClassifier(estimator, dtype=<class 'float'>, sparse=True)
     |
     |  Wrapper for scikit-learn classifiers.
     |
     |  Method resolution order:
     |      SklearnClassifier
     |      nltk.classify.api.ClassifierI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, estimator, dtype=<class 'float'>, sparse=True)
     |      :param estimator: scikit-learn classifier object.
     |
     |      :param dtype: data type used when building feature array.
     |          scikit-learn estimators work exclusively on numeric data. The
     |          default value should be fine for almost all situations.
     |
     |      :param sparse: Whether to use sparse matrices internally.
     |          The estimator must support these; not all scikit-learn classifiers
     |          do (see their respective documentation and look for "sparse
     |          matrix"). The default value is True, since most NLP problems
     |          involve sparse feature sets. Setting this to False may take a
     |          great amount of memory.
     |      :type sparse: boolean.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  classify_many(self, featuresets)
     |      Classify a batch of samples.
     |
     |      :param featuresets: An iterable over featuresets, each a dict mapping
     |          strings to either numbers, booleans or strings.
     |      :return: The predicted class label for each input sample.
     |      :rtype: list
     |
     |  labels(self)
     |      The class labels used by this classifier.
     |
     |      :rtype: list
     |
     |  prob_classify_many(self, featuresets)
     |      Compute per-class probabilities for a batch of samples.
     |
     |      :param featuresets: An iterable over featuresets, each a dict mapping
     |          strings to either numbers, booleans or strings.
     |      :rtype: list of ``ProbDistI``
     |
     |  train(self, labeled_featuresets)
     |      Train (fit) the scikit-learn estimator.
     |
     |      :param labeled_featuresets: A list of ``(featureset, label)``
     |          where each ``featureset`` is a dict mapping strings to either
     |          numbers, booleans or strings.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.api.ClassifierI:
     |
     |  classify(self, featureset)
     |      :return: the most appropriate label for the given featureset.
     |      :rtype: label
     |
     |  prob_classify(self, featureset)
     |      :return: a probability distribution over labels for the given
     |          featureset.
     |      :rtype: ProbDistI
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.classify.api.ClassifierI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    __all__ = ['SklearnClassifier']

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\scikitlearn.py

nltk.scores
Python Library Documentation: module nltk.metrics.scores in nltk.metrics

NAME
    nltk.metrics.scores

DESCRIPTION
    # Natural Language Toolkit: Evaluation
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Edward Loper <edloper@gmail.com>
    #         Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

FUNCTIONS
    accuracy(reference, test)
        Given a list of reference values and a corresponding list of test
        values, return the fraction of corresponding values that are
        equal.  In particular, return the fraction of indices
        ``0<i<=len(test)`` such that ``test[i] == reference[i]``.

        :type reference: list
        :param reference: An ordered list of reference values.
        :type test: list
        :param test: A list of values to compare against the corresponding
            reference values.
        :raise ValueError: If ``reference`` and ``length`` do not have the
            same length.

    approxrand(a, b, **kwargs)
        Returns an approximate significance level between two lists of
        independently generated test values.

        Approximate randomization calculates significance by randomly drawing
        from a sample of the possible permutations. At the limit of the number
        of possible permutations, the significance level is exact. The
        approximate significance level is the sample mean number of times the
        statistic of the permutated lists varies from the actual statistic of
        the unpermuted argument lists.

        :return: a tuple containing an approximate significance level, the count
                 of the number of times the pseudo-statistic varied from the
                 actual statistic, and the number of shuffles
        :rtype: tuple
        :param a: a list of test values
        :type a: list
        :param b: another list of independently generated test values
        :type b: list

    demo()

    f_measure(reference, test, alpha=0.5)
        Given a set of reference values and a set of test values, return
        the f-measure of the test values, when compared against the
        reference values.  The f-measure is the harmonic mean of the
        ``precision`` and ``recall``, weighted by ``alpha``.  In particular,
        given the precision *p* and recall *r* defined by:

        - *p* = card(``reference`` intersection ``test``)/card(``test``)
        - *r* = card(``reference`` intersection ``test``)/card(``reference``)

        The f-measure is:

        - *1/(alpha/p + (1-alpha)/r)*

        If either ``reference`` or ``test`` is empty, then ``f_measure``
        returns None.

        :type reference: set
        :param reference: A set of reference values.
        :type test: set
        :param test: A set of values to compare against the reference set.
        :rtype: float or None

    fabs(x, /)
        Return the absolute value of the float x.

    log_likelihood(reference, test)
        Given a list of reference values and a corresponding list of test
        probability distributions, return the average log likelihood of
        the reference values, given the probability distributions.

        :param reference: A list of reference values
        :type reference: list
        :param test: A list of probability distributions over values to
            compare against the corresponding reference values.
        :type test: list(ProbDistI)

    precision(reference, test)
        Given a set of reference values and a set of test values, return
        the fraction of test values that appear in the reference set.
        In particular, return card(``reference`` intersection ``test``)/card(``test``).
        If ``test`` is empty, then return None.

        :type reference: set
        :param reference: A set of reference values.
        :type test: set
        :param test: A set of values to compare against the reference set.
        :rtype: float or None

    recall(reference, test)
        Given a set of reference values and a set of test values, return
        the fraction of reference values that appear in the test set.
        In particular, return card(``reference`` intersection ``test``)/card(``reference``).
        If ``reference`` is empty, then return None.

        :type reference: set
        :param reference: A set of reference values.
        :type test: set
        :param test: A set of values to compare against the reference set.
        :rtype: float or None

    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

DATA
    betai = None

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\metrics\scores.py

nltk.segmentation
Python Library Documentation: module nltk.metrics.segmentation in nltk.metrics

NAME
    nltk.metrics.segmentation - Text Segmentation Metrics

DESCRIPTION
    1. Windowdiff

    Pevzner, L., and Hearst, M., A Critique and Improvement of
      an Evaluation Metric for Text Segmentation,
      Computational Linguistics 28, 19-36


    2. Generalized Hamming Distance

    Bookstein A., Kulyukin V.A., Raita T.
    Generalized Hamming Distance
    Information Retrieval 5, 2002, pp 353-375

    Baseline implementation in C++
    http://digital.cs.usu.edu/~vkulyukin/vkweb/software/ghd/ghd.html

    Study describing benefits of Generalized Hamming Distance Versus
    WindowDiff for evaluating text segmentation tasks
    Begsten, Y.  Quel indice pour mesurer l'efficacite en segmentation de textes ?
    TALN 2009


    3. Pk text segmentation metric

    Beeferman D., Berger A., Lafferty J. (1999)
    Statistical Models for Text Segmentation
    Machine Learning, 34, 177-210

FUNCTIONS
    ghd(ref, hyp, ins_cost=2.0, del_cost=2.0, shift_cost_coeff=1.0, boundary='1')
        Compute the Generalized Hamming Distance for a reference and a hypothetical
        segmentation, corresponding to the cost related to the transformation
        of the hypothetical segmentation into the reference segmentation
        through boundary insertion, deletion and shift operations.

        A segmentation is any sequence over a vocabulary of two items
        (e.g. "0", "1"), where the specified boundary value is used to
        mark the edge of a segmentation.

        Recommended parameter values are a shift_cost_coeff of 2.
        Associated with a ins_cost, and del_cost equal to the mean segment
        length in the reference segmentation.

            >>> # Same examples as Kulyukin C++ implementation
            >>> ghd('1100100000', '1100010000', 1.0, 1.0, 0.5)
            0.5
            >>> ghd('1100100000', '1100000001', 1.0, 1.0, 0.5)
            2.0
            >>> ghd('011', '110', 1.0, 1.0, 0.5)
            1.0
            >>> ghd('1', '0', 1.0, 1.0, 0.5)
            1.0
            >>> ghd('111', '000', 1.0, 1.0, 0.5)
            3.0
            >>> ghd('000', '111', 1.0, 2.0, 0.5)
            6.0

        :param ref: the reference segmentation
        :type ref: str or list
        :param hyp: the hypothetical segmentation
        :type hyp: str or list
        :param ins_cost: insertion cost
        :type ins_cost: float
        :param del_cost: deletion cost
        :type del_cost: float
        :param shift_cost_coeff: constant used to compute the cost of a shift.
            ``shift cost = shift_cost_coeff * |i - j|`` where ``i`` and ``j``
            are the positions indicating the shift
        :type shift_cost_coeff: float
        :param boundary: boundary value
        :type boundary: str or int or bool
        :rtype: float

    pk(ref, hyp, k=None, boundary='1')
        Compute the Pk metric for a pair of segmentations A segmentation
        is any sequence over a vocabulary of two items (e.g. "0", "1"),
        where the specified boundary value is used to mark the edge of a
        segmentation.

        >>> '%.2f' % pk('0100'*100, '1'*400, 2)
        '0.50'
        >>> '%.2f' % pk('0100'*100, '0'*400, 2)
        '0.50'
        >>> '%.2f' % pk('0100'*100, '0100'*100, 2)
        '0.00'

        :param ref: the reference segmentation
        :type ref: str or list
        :param hyp: the segmentation to evaluate
        :type hyp: str or list
        :param k: window size, if None, set to half of the average reference segment length
        :type boundary: str or int or bool
        :param boundary: boundary value
        :type boundary: str or int or bool
        :rtype: float

    windowdiff(seg1, seg2, k, boundary='1', weighted=False)
        Compute the windowdiff score for a pair of segmentations.  A
        segmentation is any sequence over a vocabulary of two items
        (e.g. "0", "1"), where the specified boundary value is used to
        mark the edge of a segmentation.

        From Pevzner & Hearst (2002), the WindowDiff metric is defined as::

            WindowDiff(ref, hyp, k) =
                1 / (N - k) * sum_{i=1}^{N-k} (
                    |b(ref, i, i+k) - b(hyp, i, i+k)| > 0
                )

        where ``b(seg, i, j)`` counts the number of boundaries in ``seg``
        between positions ``i`` and ``j``, and ``N = len(seg)``.

        The weighted variant sums the absolute differences instead
        of thresholding at 1.

            >>> s1 = "000100000010"
            >>> s2 = "000010000100"
            >>> s3 = "100000010000"
            >>> '%.2f' % windowdiff(s1, s1, 3)
            '0.00'
            >>> '%.2f' % windowdiff(s1, s2, 3)
            '0.30'
            >>> '%.2f' % windowdiff(s2, s3, 3)
            '0.80'

        :param seg1: a segmentation
        :type seg1: str or list
        :param seg2: a segmentation
        :type seg2: str or list
        :param k: window width
        :type k: int
        :param boundary: boundary value
        :type boundary: str or int or bool
        :param weighted: use the weighted variant of windowdiff
        :type weighted: boolean
        :rtype: float

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\metrics\segmentation.py

nltk.sem
Python Library Documentation: package nltk.sem in nltk

NAME
    nltk.sem - NLTK Semantic Interpretation Package

DESCRIPTION
    This package contains classes for representing semantic structure in
    formulas of first-order logic and for evaluating such formulas in
    set-theoretic models.

        >>> from nltk.sem import logic
        >>> logic._counter._value = 0

    The package has two main components:

     - ``logic`` provides support for analyzing expressions of First
       Order Logic (FOL).
     - ``evaluate`` allows users to recursively determine truth in a
       model for formulas of FOL.

    A model consists of a domain of discourse and a valuation function,
    which assigns values to non-logical constants. We assume that entities
    in the domain are represented as strings such as ``'b1'``, ``'g1'``,
    etc. A ``Valuation`` is initialized with a list of (symbol, value)
    pairs, where values are entities, sets of entities or sets of tuples
    of entities.
    The domain of discourse can be inferred from the valuation, and model
    is then created with domain and valuation as parameters.

        >>> from nltk.sem import Valuation, Model
        >>> v = [('adam', 'b1'), ('betty', 'g1'), ('fido', 'd1'),
        ... ('girl', set(['g1', 'g2'])), ('boy', set(['b1', 'b2'])),
        ... ('dog', set(['d1'])),
        ... ('love', set([('b1', 'g1'), ('b2', 'g2'), ('g1', 'b1'), ('g2', 'b1')]))]
        >>> val = Valuation(v)
        >>> dom = val.domain
        >>> m = Model(dom, val)

PACKAGE CONTENTS
    boxer
    chat80
    cooper_storage
    drt
    drt_glue_demo
    evaluate
    glue
    hole
    lfg
    linearlogic
    logic
    relextract
    skolemize
    util

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\sem\__init__.py

nltk.senna
Python Library Documentation: module nltk.tag.senna in nltk.tag

NAME
    nltk.tag.senna - Senna POS tagger, NER Tagger, Chunk Tagger

DESCRIPTION
    The input is:

    - path to the directory that contains SENNA executables. If the path is incorrect,
      SennaTagger will automatically search for executable file specified in SENNA environment variable
    - (optionally) the encoding of the input data (default:utf-8)

    Note: Unit tests for this module can be found in test/unit/test_senna.py

    >>> from nltk.tag import SennaTagger
    >>> tagger = SennaTagger('/usr/share/senna-v3.0')  # doctest: +SKIP
    >>> tagger.tag('What is the airspeed of an unladen swallow ?'.split()) # doctest: +SKIP
    [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'), ('airspeed', 'NN'),
    ('of', 'IN'), ('an', 'DT'), ('unladen', 'NN'), ('swallow', 'NN'), ('?', '.')]

    >>> from nltk.tag import SennaChunkTagger
    >>> chktagger = SennaChunkTagger('/usr/share/senna-v3.0')  # doctest: +SKIP
    >>> chktagger.tag('What is the airspeed of an unladen swallow ?'.split()) # doctest: +SKIP
    [('What', 'B-NP'), ('is', 'B-VP'), ('the', 'B-NP'), ('airspeed', 'I-NP'),
    ('of', 'B-PP'), ('an', 'B-NP'), ('unladen', 'I-NP'), ('swallow', 'I-NP'),
    ('?', 'O')]

    >>> from nltk.tag import SennaNERTagger
    >>> nertagger = SennaNERTagger('/usr/share/senna-v3.0')  # doctest: +SKIP
    >>> nertagger.tag('Shakespeare theatre was in London .'.split()) # doctest: +SKIP
    [('Shakespeare', 'B-PER'), ('theatre', 'O'), ('was', 'O'), ('in', 'O'),
    ('London', 'B-LOC'), ('.', 'O')]
    >>> nertagger.tag('UN headquarters are in NY , USA .'.split()) # doctest: +SKIP
    [('UN', 'B-ORG'), ('headquarters', 'O'), ('are', 'O'), ('in', 'O'),
    ('NY', 'B-LOC'), (',', 'O'), ('USA', 'B-LOC'), ('.', 'O')]

CLASSES
    nltk.classify.senna.Senna(nltk.tag.api.TaggerI)
        SennaChunkTagger
        SennaNERTagger
        SennaTagger

    class SennaChunkTagger(nltk.classify.senna.Senna)
     |  SennaChunkTagger(path, encoding='utf-8')
     |
     |  Method resolution order:
     |      SennaChunkTagger
     |      nltk.classify.senna.Senna
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, path, encoding='utf-8')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  bio_to_chunks(self, tagged_sent, chunk_type)
     |      Extracts the chunks in a BIO chunk-tagged sentence.
     |
     |      >>> from nltk.tag import SennaChunkTagger
     |      >>> chktagger = SennaChunkTagger('/usr/share/senna-v3.0')  # doctest: +SKIP
     |      >>> sent = 'What is the airspeed of an unladen swallow ?'.split()
     |      >>> tagged_sent = chktagger.tag(sent)  # doctest: +SKIP
     |      >>> tagged_sent  # doctest: +SKIP
     |      [('What', 'B-NP'), ('is', 'B-VP'), ('the', 'B-NP'), ('airspeed', 'I-NP'),
     |      ('of', 'B-PP'), ('an', 'B-NP'), ('unladen', 'I-NP'), ('swallow', 'I-NP'),
     |      ('?', 'O')]
     |      >>> list(chktagger.bio_to_chunks(tagged_sent, chunk_type='NP'))  # doctest: +SKIP
     |      [('What', '0'), ('the airspeed', '2-3'), ('an unladen swallow', '5-6-7')]
     |
     |      :param tagged_sent: A list of tuples of word and BIO chunk tag.
     |      :type tagged_sent: list(tuple)
     |      :param tagged_sent: The chunk tag that users want to extract, e.g. 'NP' or 'VP'
     |      :type tagged_sent: str
     |
     |      :return: An iterable of tuples of chunks that users want to extract
     |        and their corresponding indices.
     |      :rtype: iter(tuple(str))
     |
     |  tag_sents(self, sentences)
     |      Applies the tag method over a list of sentences. This method will return
     |      for each sentence a list of tuples of (word, tag).
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.senna.Senna:
     |
     |  executable(self, base_path)
     |      The function that determines the system specific binary that should be
     |      used in the pipeline. In case, the system is not known the default senna binary will
     |      be used.
     |
     |  tag(self, tokens)
     |      Applies the specified operation(s) on a list of tokens.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.classify.senna.Senna:
     |
     |  SUPPORTED_OPERATIONS = ['pos', 'chk', 'ner']
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SennaNERTagger(nltk.classify.senna.Senna)
     |  SennaNERTagger(path, encoding='utf-8')
     |
     |  Method resolution order:
     |      SennaNERTagger
     |      nltk.classify.senna.Senna
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, path, encoding='utf-8')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  tag_sents(self, sentences)
     |      Applies the tag method over a list of sentences. This method will return
     |      for each sentence a list of tuples of (word, tag).
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.senna.Senna:
     |
     |  executable(self, base_path)
     |      The function that determines the system specific binary that should be
     |      used in the pipeline. In case, the system is not known the default senna binary will
     |      be used.
     |
     |  tag(self, tokens)
     |      Applies the specified operation(s) on a list of tokens.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.classify.senna.Senna:
     |
     |  SUPPORTED_OPERATIONS = ['pos', 'chk', 'ner']
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SennaTagger(nltk.classify.senna.Senna)
     |  SennaTagger(path, encoding='utf-8')
     |
     |  Method resolution order:
     |      SennaTagger
     |      nltk.classify.senna.Senna
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, path, encoding='utf-8')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  tag_sents(self, sentences)
     |      Applies the tag method over a list of sentences. This method will return
     |      for each sentence a list of tuples of (word, tag).
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.senna.Senna:
     |
     |  executable(self, base_path)
     |      The function that determines the system specific binary that should be
     |      used in the pipeline. In case, the system is not known the default senna binary will
     |      be used.
     |
     |  tag(self, tokens)
     |      Applies the specified operation(s) on a list of tokens.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.classify.senna.Senna:
     |
     |  SUPPORTED_OPERATIONS = ['pos', 'chk', 'ner']
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\senna.py

nltk.sent_tokenize
Python Library Documentation: function sent_tokenize in module nltk.tokenize

sent_tokenize(text, language='english')
    Return a sentence-tokenized copy of *text*,
    using NLTK's recommended sentence tokenizer
    (currently :class:`.PunktSentenceTokenizer`
    for the specified language).

    :param text: text to split into sentences
    :param language: the model name in the Punkt corpus
nltk.sequential
Python Library Documentation: module nltk.tag.sequential in nltk.tag

NAME
    nltk.tag.sequential

DESCRIPTION
    Classes for tagging sentences sequentially, left to right.  The
    abstract base class SequentialBackoffTagger serves as the base
    class for all the taggers in this module.  Tagging of individual words
    is performed by the method ``choose_tag()``, which is defined by
    subclasses of SequentialBackoffTagger.  If a tagger is unable to
    determine a tag for the specified token, then its backoff tagger is
    consulted instead.  Any SequentialBackoffTagger may serve as a
    backoff tagger for any other SequentialBackoffTagger.

CLASSES
    nltk.tag.api.TaggerI(builtins.object)
        SequentialBackoffTagger
            ClassifierBasedTagger(SequentialBackoffTagger, nltk.tag.api.FeaturesetTaggerI)
                ClassifierBasedPOSTagger
            ContextTagger
                AffixTagger
                NgramTagger
                    BigramTagger
                    TrigramTagger
                    UnigramTagger
            DefaultTagger
            RegexpTagger

    class AffixTagger(ContextTagger)
     |  AffixTagger(train=None, model=None, affix_length=-3, min_stem_length=2, backoff=None, cutoff=0, verbose=False)
     |
     |  A tagger that chooses a token's tag based on a leading or trailing
     |  substring of its word string.  (It is important to note that these
     |  substrings are not necessarily "true" morphological affixes).  In
     |  particular, a fixed-length substring of the word is looked up in a
     |  table, and the corresponding tag is returned.  Affix taggers are
     |  typically constructed by training them on a tagged corpus.
     |
     |  Construct a new affix tagger.
     |
     |  :param affix_length: The length of the affixes that should be
     |      considered during training and tagging.  Use negative
     |      numbers for suffixes.
     |  :param min_stem_length: Any words whose length is less than
     |      min_stem_length+abs(affix_length) will be assigned a
     |      tag of None by this tagger.
     |
     |  Method resolution order:
     |      AffixTagger
     |      ContextTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, train=None, model=None, affix_length=-3, min_stem_length=2, backoff=None, cutoff=0, verbose=False)
     |      :param context_to_tag: A dictionary mapping contexts to tags.
     |      :param backoff: The backoff tagger that should be used for this tagger.
     |
     |  context(self, tokens, index, history)
     |      :return: the context that should be used to look up the tag
     |          for the specified token; or None if the specified token
     |          should not be handled by this tagger.
     |      :rtype: (hashable)
     |
     |  encode_json_obj(self)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.sequential.AffixTagger'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ContextTagger:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  size(self)
     |      :return: The number of entries in the table used by this
     |          tagger to map from contexts to tags.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class BigramTagger(NgramTagger)
     |  BigramTagger(train=None, model=None, backoff=None, cutoff=0, verbose=False)
     |
     |  A tagger that chooses a token's tag based its word string and on
     |  the preceding words' tag.  In particular, a tuple consisting
     |  of the previous tag and the word is looked up in a table, and
     |  the corresponding tag is returned.
     |
     |  :param train: The corpus of training data, a list of tagged sentences
     |  :type train: list(list(tuple(str, str)))
     |  :param model: The tagger model
     |  :type model: dict
     |  :param backoff: Another tagger which this tagger will consult when it is
     |      unable to tag a word
     |  :type backoff: TaggerI
     |  :param cutoff: The number of instances of training data the tagger must see
     |      in order not to use the backoff tagger
     |  :type cutoff: int
     |
     |  Method resolution order:
     |      BigramTagger
     |      NgramTagger
     |      ContextTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, train=None, model=None, backoff=None, cutoff=0, verbose=False)
     |      :param context_to_tag: A dictionary mapping contexts to tags.
     |      :param backoff: The backoff tagger that should be used for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.sequential.BigramTagger'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from NgramTagger:
     |
     |  context(self, tokens, index, history)
     |      :return: the context that should be used to look up the tag
     |          for the specified token; or None if the specified token
     |          should not be handled by this tagger.
     |      :rtype: (hashable)
     |
     |  encode_json_obj(self)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from NgramTagger:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ContextTagger:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  size(self)
     |      :return: The number of entries in the table used by this
     |          tagger to map from contexts to tags.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ClassifierBasedPOSTagger(ClassifierBasedTagger)
     |  ClassifierBasedPOSTagger(feature_detector=None, train=None, classifier_builder=<bound method NaiveBayesClassifier.train of <class 'nltk.classify.naivebayes.NaiveBayesClassifier'>>, classifier=None, backoff=None, cutoff_prob=None, verbose=False)
     |
     |  A classifier based part of speech tagger.
     |
     |  Method resolution order:
     |      ClassifierBasedPOSTagger
     |      ClassifierBasedTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.FeaturesetTaggerI
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  feature_detector(self, tokens, index, history)
     |      Return the feature detector that this tagger uses to generate
     |      featuresets for its classifier.  The feature detector is a
     |      function with the signature::
     |
     |        feature_detector(tokens, index, history) -> featureset
     |
     |      See ``classifier()``
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ClassifierBasedTagger:
     |
     |  __init__(self, feature_detector=None, train=None, classifier_builder=<bound method NaiveBayesClassifier.train of <class 'nltk.classify.naivebayes.NaiveBayesClassifier'>>, classifier=None, backoff=None, cutoff_prob=None, verbose=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  classifier(self)
     |      Return the classifier that this tagger uses to choose a tag
     |      for each word in a sentence.  The input for this classifier is
     |      generated using this tagger's feature detector.
     |      See ``feature_detector()``
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ClassifierBasedTagger(SequentialBackoffTagger, nltk.tag.api.FeaturesetTaggerI)
     |  ClassifierBasedTagger(feature_detector=None, train=None, classifier_builder=<bound method NaiveBayesClassifier.train of <class 'nltk.classify.naivebayes.NaiveBayesClassifier'>>, classifier=None, backoff=None, cutoff_prob=None, verbose=False)
     |
     |  A sequential tagger that uses a classifier to choose the tag for
     |  each token in a sentence.  The featureset input for the classifier
     |  is generated by a feature detector function::
     |
     |      feature_detector(tokens, index, history) -> featureset
     |
     |  Where tokens is the list of unlabeled tokens in the sentence;
     |  index is the index of the token for which feature detection
     |  should be performed; and history is list of the tags for all
     |  tokens before index.
     |
     |  Construct a new classifier-based sequential tagger.
     |
     |  :param feature_detector: A function used to generate the
     |      featureset input for the classifier::
     |      feature_detector(tokens, index, history) -> featureset
     |
     |  :param train: A tagged corpus consisting of a list of tagged
     |      sentences, where each sentence is a list of (word, tag) tuples.
     |
     |  :param backoff: A backoff tagger, to be used by the new tagger
     |      if it encounters an unknown context.
     |
     |  :param classifier_builder: A function used to train a new
     |      classifier based on the data in *train*.  It should take
     |      one argument, a list of labeled featuresets (i.e.,
     |      (featureset, label) tuples).
     |
     |  :param classifier: The classifier that should be used by the
     |      tagger.  This is only useful if you want to manually
     |      construct the classifier; normally, you would use *train*
     |      instead.
     |
     |  :param backoff: A backoff tagger, used if this tagger is
     |      unable to determine a tag for a given token.
     |
     |  :param cutoff_prob: If specified, then this tagger will fall
     |      back on its backoff tagger if the probability of the most
     |      likely tag is less than *cutoff_prob*.
     |
     |  Method resolution order:
     |      ClassifierBasedTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.FeaturesetTaggerI
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, feature_detector=None, train=None, classifier_builder=<bound method NaiveBayesClassifier.train of <class 'nltk.classify.naivebayes.NaiveBayesClassifier'>>, classifier=None, backoff=None, cutoff_prob=None, verbose=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  classifier(self)
     |      Return the classifier that this tagger uses to choose a tag
     |      for each word in a sentence.  The input for this classifier is
     |      generated using this tagger's feature detector.
     |      See ``feature_detector()``
     |
     |  feature_detector(self, tokens, index, history)
     |      Return the feature detector that this tagger uses to generate
     |      featuresets for its classifier.  The feature detector is a
     |      function with the signature::
     |
     |        feature_detector(tokens, index, history) -> featureset
     |
     |      See ``classifier()``
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ContextTagger(SequentialBackoffTagger)
     |  ContextTagger(context_to_tag, backoff=None)
     |
     |  An abstract base class for sequential backoff taggers that choose
     |  a tag for a token based on the value of its "context".  Different
     |  subclasses are used to define different contexts.
     |
     |  A ContextTagger chooses the tag for a token by calculating the
     |  token's context, and looking up the corresponding tag in a table.
     |  This table can be constructed manually; or it can be automatically
     |  constructed based on a training corpus, using the ``_train()``
     |  factory method.
     |
     |  :ivar _context_to_tag: Dictionary mapping contexts to tags.
     |
     |  Method resolution order:
     |      ContextTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, context_to_tag, backoff=None)
     |      :param context_to_tag: A dictionary mapping contexts to tags.
     |      :param backoff: The backoff tagger that should be used for this tagger.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  context(self, tokens, index, history)
     |      :return: the context that should be used to look up the tag
     |          for the specified token; or None if the specified token
     |          should not be handled by this tagger.
     |      :rtype: (hashable)
     |
     |  size(self)
     |      :return: The number of entries in the table used by this
     |          tagger to map from contexts to tags.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset({'context'})
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DefaultTagger(SequentialBackoffTagger)
     |  DefaultTagger(tag)
     |
     |  A tagger that assigns the same tag to every token.
     |
     |      >>> from nltk.tag import DefaultTagger
     |      >>> default_tagger = DefaultTagger('NN')
     |      >>> list(default_tagger.tag('This is a test'.split()))
     |      [('This', 'NN'), ('is', 'NN'), ('a', 'NN'), ('test', 'NN')]
     |
     |  This tagger is recommended as a backoff tagger, in cases where
     |  a more powerful tagger is unable to assign a tag to the word
     |  (e.g. because the word was not seen during training).
     |
     |  :param tag: The tag to assign to each token
     |  :type tag: str
     |
     |  Method resolution order:
     |      DefaultTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, tag)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  encode_json_obj(self)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.sequential.DefaultTagger'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class NgramTagger(ContextTagger)
     |  NgramTagger(n, train=None, model=None, backoff=None, cutoff=0, verbose=False)
     |
     |  A tagger that chooses a token's tag based on its word string and
     |  on the preceding n word's tags.  In particular, a tuple
     |  (tags[i-n:i-1], words[i]) is looked up in a table, and the
     |  corresponding tag is returned.  N-gram taggers are typically
     |  trained on a tagged corpus.
     |
     |  Train a new NgramTagger using the given training data or
     |  the supplied model.  In particular, construct a new tagger
     |  whose table maps from each context (tag[i-n:i-1], word[i])
     |  to the most frequent tag for that context.  But exclude any
     |  contexts that are already tagged perfectly by the backoff
     |  tagger.
     |
     |  :param train: A tagged corpus consisting of a list of tagged
     |      sentences, where each sentence is a list of (word, tag) tuples.
     |  :param backoff: A backoff tagger, to be used by the new
     |      tagger if it encounters an unknown context.
     |  :param cutoff: If the most likely tag for a context occurs
     |      fewer than *cutoff* times, then exclude it from the
     |      context-to-tag table for the new tagger.
     |
     |  Method resolution order:
     |      NgramTagger
     |      ContextTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, n, train=None, model=None, backoff=None, cutoff=0, verbose=False)
     |      :param context_to_tag: A dictionary mapping contexts to tags.
     |      :param backoff: The backoff tagger that should be used for this tagger.
     |
     |  context(self, tokens, index, history)
     |      :return: the context that should be used to look up the tag
     |          for the specified token; or None if the specified token
     |          should not be handled by this tagger.
     |      :rtype: (hashable)
     |
     |  encode_json_obj(self)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.sequential.NgramTagger'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ContextTagger:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  size(self)
     |      :return: The number of entries in the table used by this
     |          tagger to map from contexts to tags.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class RegexpTagger(SequentialBackoffTagger)
     |  RegexpTagger(regexps: list[tuple[str, str]], backoff: nltk.tag.api.TaggerI | None = None)
     |
     |  Regular Expression Tagger
     |
     |  The RegexpTagger assigns tags to tokens by comparing their
     |  word strings to a series of regular expressions.  The following tagger
     |  uses word suffixes to make guesses about the correct Brown Corpus part
     |  of speech tag:
     |
     |      >>> from nltk.corpus import brown
     |      >>> from nltk.tag import RegexpTagger
     |      >>> test_sent = brown.sents(categories='news')[0]
     |      >>> regexp_tagger = RegexpTagger(
     |      ...     [(r'^-?[0-9]+(\.[0-9]+)?$', 'CD'),  # cardinal numbers
     |      ...      (r'(The|the|A|a|An|an)$', 'AT'),   # articles
     |      ...      (r'.*able$', 'JJ'),                # adjectives
     |      ...      (r'.*ness$', 'NN'),                # nouns formed from adjectives
     |      ...      (r'.*ly$', 'RB'),                  # adverbs
     |      ...      (r'.*s$', 'NNS'),                  # plural nouns
     |      ...      (r'.*ing$', 'VBG'),                # gerunds
     |      ...      (r'.*ed$', 'VBD'),                 # past tense verbs
     |      ...      (r'.*', 'NN')                      # nouns (default)
     |      ... ])
     |      >>> regexp_tagger
     |      <Regexp Tagger: size=9>
     |      >>> regexp_tagger.tag(test_sent) # doctest: +NORMALIZE_WHITESPACE
     |      [('The', 'AT'), ('Fulton', 'NN'), ('County', 'NN'), ('Grand', 'NN'), ('Jury', 'NN'),
     |      ('said', 'NN'), ('Friday', 'NN'), ('an', 'AT'), ('investigation', 'NN'), ('of', 'NN'),
     |      ("Atlanta's", 'NNS'), ('recent', 'NN'), ('primary', 'NN'), ('election', 'NN'),
     |      ('produced', 'VBD'), ('``', 'NN'), ('no', 'NN'), ('evidence', 'NN'), ("''", 'NN'),
     |      ('that', 'NN'), ('any', 'NN'), ('irregularities', 'NNS'), ('took', 'NN'),
     |      ('place', 'NN'), ('.', 'NN')]
     |
     |  :type regexps: list(tuple(str, str))
     |  :param regexps: A list of ``(regexp, tag)`` pairs, each of
     |      which indicates that a word matching ``regexp`` should
     |      be tagged with ``tag``.  The pairs will be evaluated in
     |      order.  If none of the regexps match a word, then the
     |      optional backoff tagger is invoked, else it is
     |      assigned the tag None.
     |
     |  Method resolution order:
     |      RegexpTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, regexps: list[tuple[str, str]], backoff: nltk.tag.api.TaggerI | None = None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  encode_json_obj(self)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.sequential.RegexpTagger'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SequentialBackoffTagger(nltk.tag.api.TaggerI)
     |  SequentialBackoffTagger(backoff=None)
     |
     |  An abstract base class for taggers that tags words sequentially,
     |  left to right.  Tagging of individual words is performed by the
     |  ``choose_tag()`` method, which should be defined by subclasses.  If
     |  a tagger is unable to determine a tag for the specified token,
     |  then its backoff tagger is consulted.
     |
     |  :ivar _taggers: A list of all the taggers that should be tried to
     |      tag a token (i.e., self and its backoff taggers).
     |
     |  Method resolution order:
     |      SequentialBackoffTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, backoff=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties defined here:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset({'choose_tag'})
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TrigramTagger(NgramTagger)
     |  TrigramTagger(train=None, model=None, backoff=None, cutoff=0, verbose=False)
     |
     |  A tagger that chooses a token's tag based its word string and on
     |  the preceding two words' tags.  In particular, a tuple consisting
     |  of the previous two tags and the word is looked up in a table, and
     |  the corresponding tag is returned.
     |
     |  :param train: The corpus of training data, a list of tagged sentences
     |  :type train: list(list(tuple(str, str)))
     |  :param model: The tagger model
     |  :type model: dict
     |  :param backoff: Another tagger which this tagger will consult when it is
     |      unable to tag a word
     |  :type backoff: TaggerI
     |  :param cutoff: The number of instances of training data the tagger must see
     |      in order not to use the backoff tagger
     |  :type cutoff: int
     |
     |  Method resolution order:
     |      TrigramTagger
     |      NgramTagger
     |      ContextTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, train=None, model=None, backoff=None, cutoff=0, verbose=False)
     |      :param context_to_tag: A dictionary mapping contexts to tags.
     |      :param backoff: The backoff tagger that should be used for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.sequential.TrigramTagger'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from NgramTagger:
     |
     |  context(self, tokens, index, history)
     |      :return: the context that should be used to look up the tag
     |          for the specified token; or None if the specified token
     |          should not be handled by this tagger.
     |      :rtype: (hashable)
     |
     |  encode_json_obj(self)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from NgramTagger:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ContextTagger:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  size(self)
     |      :return: The number of entries in the table used by this
     |          tagger to map from contexts to tags.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class UnigramTagger(NgramTagger)
     |  UnigramTagger(train=None, model=None, backoff=None, cutoff=0, verbose=False)
     |
     |  Unigram Tagger
     |
     |  The UnigramTagger finds the most likely tag for each word in a training
     |  corpus, and then uses that information to assign tags to new tokens.
     |
     |      >>> from nltk.corpus import brown
     |      >>> from nltk.tag import UnigramTagger
     |      >>> test_sent = brown.sents(categories='news')[0]
     |      >>> unigram_tagger = UnigramTagger(brown.tagged_sents(categories='news')[:500])
     |      >>> for tok, tag in unigram_tagger.tag(test_sent):
     |      ...     print("({}, {}), ".format(tok, tag)) # doctest: +NORMALIZE_WHITESPACE
     |      (The, AT), (Fulton, NP-TL), (County, NN-TL), (Grand, JJ-TL),
     |      (Jury, NN-TL), (said, VBD), (Friday, NR), (an, AT),
     |      (investigation, NN), (of, IN), (Atlanta's, NP$), (recent, JJ),
     |      (primary, NN), (election, NN), (produced, VBD), (``, ``),
     |      (no, AT), (evidence, NN), ('', ''), (that, CS), (any, DTI),
     |      (irregularities, NNS), (took, VBD), (place, NN), (., .),
     |
     |  :param train: The corpus of training data, a list of tagged sentences
     |  :type train: list(list(tuple(str, str)))
     |  :param model: The tagger model
     |  :type model: dict
     |  :param backoff: Another tagger which this tagger will consult when it is
     |      unable to tag a word
     |  :type backoff: TaggerI
     |  :param cutoff: The number of instances of training data the tagger must see
     |      in order not to use the backoff tagger
     |  :type cutoff: int
     |
     |  Method resolution order:
     |      UnigramTagger
     |      NgramTagger
     |      ContextTagger
     |      SequentialBackoffTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, train=None, model=None, backoff=None, cutoff=0, verbose=False)
     |      :param context_to_tag: A dictionary mapping contexts to tags.
     |      :param backoff: The backoff tagger that should be used for this tagger.
     |
     |  context(self, tokens, index, history)
     |      :return: the context that should be used to look up the tag
     |          for the specified token; or None if the specified token
     |          should not be handled by this tagger.
     |      :rtype: (hashable)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  json_tag = 'nltk.tag.sequential.UnigramTagger'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from NgramTagger:
     |
     |  encode_json_obj(self)
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from NgramTagger:
     |
     |  decode_json_obj(obj)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ContextTagger:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  choose_tag(self, tokens, index, history)
     |      Decide which tag should be used for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, return None -- do not consult
     |      the backoff tagger.  This method should be overridden by
     |      subclasses of SequentialBackoffTagger.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  size(self)
     |      :return: The number of entries in the table used by this
     |          tagger to map from contexts to tags.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from SequentialBackoffTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_one(self, tokens, index, history)
     |      Determine an appropriate tag for the specified token, and
     |      return that tag.  If this tagger is unable to determine a tag
     |      for the specified token, then its backoff tagger is consulted.
     |
     |      :rtype: str
     |      :type tokens: list
     |      :param tokens: The list of words that are being tagged.
     |      :type index: int
     |      :param index: The index of the word whose tag should be
     |          returned.
     |      :type history: list(str)
     |      :param history: A list of the tags for all words before *index*.
     |
     |  ----------------------------------------------------------------------
     |  Readonly properties inherited from SequentialBackoffTagger:
     |
     |  backoff
     |      The backoff tagger for this tagger.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    List = typing.List
        A generic version of list.

    Optional = typing.Optional
        Optional[X] is equivalent to Union[X, None].

    Tuple = typing.Tuple
        Deprecated alias to builtins.tuple.

        Tuple[X, Y] is the cross-product type of X and Y.

        Example: Tuple[T1, T2] is a tuple of two elements corresponding
        to type variables T1 and T2.  Tuple[int, float, str] is a tuple
        of an int, a float and a string.

        To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\sequential.py

nltk.set2rel
Python Library Documentation: function set2rel in module nltk.sem.evaluate

set2rel(s)
    Convert a set containing individuals (strings or numbers) into a set of
    unary tuples. Any tuples of strings already in the set are passed through
    unchanged.

    For example:
      - set(['a', 'b']) => set([('a',), ('b',)])
      - set([3, 27]) => set([('3',), ('27',)])

    :type s: set
    :rtype: set of tuple of str
nltk.set_proxy
Python Library Documentation: function set_proxy in module nltk.util

set_proxy(proxy, user=None, password='')
    Set the HTTP proxy for Python to download through.

    If ``proxy`` is None then tries to set proxy from environment or system
    settings.

    :param proxy: The HTTP proxy server to use. For example:
        'http://proxy.example.com:3128/'
    :param user: The username to authenticate with. Use None to disable
        authentication.
    :param password: The password to authenticate with.
nltk.sexpr
Python Library Documentation: module nltk.tokenize.sexpr in nltk.tokenize

NAME
    nltk.tokenize.sexpr - S-Expression Tokenizer

DESCRIPTION
    ``SExprTokenizer`` is used to find parenthesized expressions in a
    string.  In particular, it divides a string into a sequence of
    substrings that are either parenthesized expressions (including any
    nested parenthesized expressions), or other whitespace-separated
    tokens.

        >>> from nltk.tokenize import SExprTokenizer
        >>> SExprTokenizer().tokenize('(a b (c d)) e f (g)')
        ['(a b (c d))', 'e', 'f', '(g)']

    By default, `SExprTokenizer` will raise a ``ValueError`` exception if
    used to tokenize an expression with non-matching parentheses:

        >>> SExprTokenizer().tokenize('c) d) e (f (g')
        Traceback (most recent call last):
          ...
        ValueError: Un-matched close paren at char 1

    The ``strict`` argument can be set to False to allow for
    non-matching parentheses.  Any unmatched close parentheses will be
    listed as their own s-expression; and the last partial sexpr with
    unmatched open parentheses will be listed as its own sexpr:

        >>> SExprTokenizer(strict=False).tokenize('c) d) e (f (g')
        ['c', ')', 'd', ')', 'e', '(f (g']

    The characters used for open and close parentheses may be customized
    using the ``parens`` argument to the `SExprTokenizer` constructor:

        >>> SExprTokenizer(parens='{}').tokenize('{a b {c d}} e f {g}')
        ['{a b {c d}}', 'e', 'f', '{g}']

    The s-expression tokenizer is also available as a function:

        >>> from nltk.tokenize import sexpr_tokenize
        >>> sexpr_tokenize('(a b (c d)) e f (g)')
        ['(a b (c d))', 'e', 'f', '(g)']

CLASSES
    nltk.tokenize.api.TokenizerI(abc.ABC)
        SExprTokenizer

    class SExprTokenizer(nltk.tokenize.api.TokenizerI)
     |  SExprTokenizer(parens='()', strict=True)
     |
     |  A tokenizer that divides strings into s-expressions.
     |  An s-expresion can be either:
     |
     |    - a parenthesized expression, including any nested parenthesized
     |      expressions, or
     |    - a sequence of non-whitespace non-parenthesis characters.
     |
     |  For example, the string ``(a (b c)) d e (f)`` consists of four
     |  s-expressions: ``(a (b c))``, ``d``, ``e``, and ``(f)``.
     |
     |  By default, the characters ``(`` and ``)`` are treated as open and
     |  close parentheses, but alternative strings may be specified.
     |
     |  :param parens: A two-element sequence specifying the open and close parentheses
     |      that should be used to find sexprs.  This will typically be either a
     |      two-character string, or a list of two strings.
     |  :type parens: str or list
     |  :param strict: If true, then raise an exception when tokenizing an ill-formed sexpr.
     |
     |  Method resolution order:
     |      SExprTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, parens='()', strict=True)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  tokenize(self, text)
     |      Return a list of s-expressions extracted from *text*.
     |      For example:
     |
     |          >>> SExprTokenizer().tokenize('(a b (c d)) e f (g)')
     |          ['(a b (c d))', 'e', 'f', '(g)']
     |
     |      All parentheses are assumed to mark s-expressions.
     |      (No special processing is done to exclude parentheses that occur
     |      inside strings, or following backslash characters.)
     |
     |      If the given expression contains non-matching parentheses,
     |      then the behavior of the tokenizer depends on the ``strict``
     |      parameter to the constructor.  If ``strict`` is ``True``, then
     |      raise a ``ValueError``.  If ``strict`` is ``False``, then any
     |      unmatched close parentheses will be listed as their own
     |      s-expression; and the last partial s-expression with unmatched open
     |      parentheses will be listed as its own s-expression:
     |
     |          >>> SExprTokenizer(strict=False).tokenize('c) d) e (f (g')
     |          ['c', ')', 'd', ')', 'e', '(f (g']
     |
     |      :param text: the string to be tokenized
     |      :type text: str or iter(str)
     |      :rtype: iter(str)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    sexpr_tokenize = tokenize(text) method of SExprTokenizer instance
        Return a list of s-expressions extracted from *text*.
        For example:

            >>> SExprTokenizer().tokenize('(a b (c d)) e f (g)')
            ['(a b (c d))', 'e', 'f', '(g)']

        All parentheses are assumed to mark s-expressions.
        (No special processing is done to exclude parentheses that occur
        inside strings, or following backslash characters.)

        If the given expression contains non-matching parentheses,
        then the behavior of the tokenizer depends on the ``strict``
        parameter to the constructor.  If ``strict`` is ``True``, then
        raise a ``ValueError``.  If ``strict`` is ``False``, then any
        unmatched close parentheses will be listed as their own
        s-expression; and the last partial s-expression with unmatched open
        parentheses will be listed as its own s-expression:

            >>> SExprTokenizer(strict=False).tokenize('c) d) e (f (g')
            ['c', ')', 'd', ')', 'e', '(f (g']

        :param text: the string to be tokenized
        :type text: str or iter(str)
        :rtype: iter(str)

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\sexpr.py

nltk.sexpr_tokenize
Python Library Documentation: method tokenize in module nltk.tokenize.sexpr

tokenize(text) method of nltk.tokenize.sexpr.SExprTokenizer instance
    Return a list of s-expressions extracted from *text*.
    For example:

        >>> SExprTokenizer().tokenize('(a b (c d)) e f (g)')
        ['(a b (c d))', 'e', 'f', '(g)']

    All parentheses are assumed to mark s-expressions.
    (No special processing is done to exclude parentheses that occur
    inside strings, or following backslash characters.)

    If the given expression contains non-matching parentheses,
    then the behavior of the tokenizer depends on the ``strict``
    parameter to the constructor.  If ``strict`` is ``True``, then
    raise a ``ValueError``.  If ``strict`` is ``False``, then any
    unmatched close parentheses will be listed as their own
    s-expression; and the last partial s-expression with unmatched open
    parentheses will be listed as its own s-expression:

        >>> SExprTokenizer(strict=False).tokenize('c) d) e (f (g')
        ['c', ')', 'd', ')', 'e', '(f (g']

    :param text: the string to be tokenized
    :type text: str or iter(str)
    :rtype: iter(str)
nltk.shiftreduce
Python Library Documentation: module nltk.parse.shiftreduce in nltk.parse

NAME
    nltk.parse.shiftreduce

DESCRIPTION
    # Natural Language Toolkit: Shift-Reduce Parser
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Edward Loper <edloper@gmail.com>
    #         Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.parse.api.ParserI(builtins.object)
        ShiftReduceParser
            SteppingShiftReduceParser

    class ShiftReduceParser(nltk.parse.api.ParserI)
     |  ShiftReduceParser(grammar, trace=0)
     |
     |  A simple bottom-up CFG parser that uses two operations, "shift"
     |  and "reduce", to find a single parse for a text.
     |
     |  ``ShiftReduceParser`` maintains a stack, which records the
     |  structure of a portion of the text.  This stack is a list of
     |  strings and Trees that collectively cover a portion of
     |  the text.  For example, while parsing the sentence "the dog saw
     |  the man" with a typical grammar, ``ShiftReduceParser`` will produce
     |  the following stack, which covers "the dog saw"::
     |
     |     [(NP: (Det: 'the') (N: 'dog')), (V: 'saw')]
     |
     |  ``ShiftReduceParser`` attempts to extend the stack to cover the
     |  entire text, and to combine the stack elements into a single tree,
     |  producing a complete parse for the sentence.
     |
     |  Initially, the stack is empty.  It is extended to cover the text,
     |  from left to right, by repeatedly applying two operations:
     |
     |    - "shift" moves a token from the beginning of the text to the
     |      end of the stack.
     |    - "reduce" uses a CFG production to combine the rightmost stack
     |      elements into a single Tree.
     |
     |  Often, more than one operation can be performed on a given stack.
     |  In this case, ``ShiftReduceParser`` uses the following heuristics
     |  to decide which operation to perform:
     |
     |    - Only shift if no reductions are available.
     |    - If multiple reductions are available, then apply the reduction
     |      whose CFG production is listed earliest in the grammar.
     |
     |  Note that these heuristics are not guaranteed to choose an
     |  operation that leads to a parse of the text.  Also, if multiple
     |  parses exists, ``ShiftReduceParser`` will return at most one of
     |  them.
     |
     |  :see: ``nltk.grammar``
     |
     |  Method resolution order:
     |      ShiftReduceParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, trace=0)
     |      Create a new ``ShiftReduceParser``, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: Grammar
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SteppingShiftReduceParser(ShiftReduceParser)
     |  SteppingShiftReduceParser(grammar, trace=0)
     |
     |  A ``ShiftReduceParser`` that allows you to setp through the parsing
     |  process, performing a single operation at a time.  It also allows
     |  you to change the parser's grammar midway through parsing a text.
     |
     |  The ``initialize`` method is used to start parsing a text.
     |  ``shift`` performs a single shift operation, and ``reduce`` performs
     |  a single reduce operation.  ``step`` will perform a single reduce
     |  operation if possible; otherwise, it will perform a single shift
     |  operation.  ``parses`` returns the set of parses that have been
     |  found by the parser.
     |
     |  :ivar _history: A list of ``(stack, remaining_text)`` pairs,
     |      containing all of the previous states of the parser.  This
     |      history is used to implement the ``undo`` operation.
     |  :see: ``nltk.grammar``
     |
     |  Method resolution order:
     |      SteppingShiftReduceParser
     |      ShiftReduceParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, trace=0)
     |      Create a new ``ShiftReduceParser``, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: Grammar
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  initialize(self, tokens)
     |      Start parsing a given text.  This sets the parser's stack to
     |      ``[]`` and sets its remaining text to ``tokens``.
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  parses(self)
     |      :return: An iterator of the parses that have been found by this
     |          parser so far.
     |      :rtype: iter(Tree)
     |
     |  reduce(self, production=None)
     |      Use ``production`` to combine the rightmost stack elements into
     |      a single Tree.  If ``production`` does not match the
     |      rightmost stack elements, then do nothing.
     |
     |      :return: The production used to reduce the stack, if a
     |          reduction was performed.  If no reduction was performed,
     |          return None.
     |
     |      :rtype: Production or None
     |
     |  reducible_productions(self)
     |      :return: A list of the productions for which reductions are
     |          available for the current parser state.
     |      :rtype: list(Production)
     |
     |  remaining_text(self)
     |      :return: The portion of the text that is not yet covered by the
     |          stack.
     |      :rtype: list(str)
     |
     |  set_grammar(self, grammar)
     |      Change the grammar used to parse texts.
     |
     |      :param grammar: The new grammar.
     |      :type grammar: CFG
     |
     |  shift(self)
     |      Move a token from the beginning of the remaining text to the
     |      end of the stack.  If there are no more tokens in the
     |      remaining text, then do nothing.
     |
     |      :return: True if the shift operation was successful.
     |      :rtype: bool
     |
     |  stack(self)
     |      :return: The parser's stack.
     |      :rtype: list(str and Tree)
     |
     |  step(self)
     |      Perform a single parsing operation.  If a reduction is
     |      possible, then perform that reduction, and return the
     |      production that it is based on.  Otherwise, if a shift is
     |      possible, then perform it, and return True.  Otherwise,
     |      return False.
     |
     |      :return: False if no operation was performed; True if a shift was
     |          performed; and the CFG production used to reduce if a
     |          reduction was performed.
     |      :rtype: Production or bool
     |
     |  undo(self)
     |      Return the parser to its state before the most recent
     |      shift or reduce operation.  Calling ``undo`` repeatedly return
     |      the parser to successively earlier states.  If no shift or
     |      reduce operations have been performed, ``undo`` will make no
     |      changes.
     |
     |      :return: true if an operation was successfully undone.
     |      :rtype: bool
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ShiftReduceParser:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()
        A demonstration of the shift-reduce parser.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\shiftreduce.py

nltk.simple
Python Library Documentation: module nltk.tokenize.simple in nltk.tokenize

NAME
    nltk.tokenize.simple - Simple Tokenizers

DESCRIPTION
    These tokenizers divide strings into substrings using the string
    ``split()`` method.
    When tokenizing using a particular delimiter string, use
    the string ``split()`` method directly, as this is more efficient.

    The simple tokenizers are *not* available as separate functions;
    instead, you should just use the string ``split()`` method directly:

        >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
        >>> s.split() # doctest: +NORMALIZE_WHITESPACE
        ['Good', 'muffins', 'cost', '$3.88', 'in', 'New', 'York.',
        'Please', 'buy', 'me', 'two', 'of', 'them.', 'Thanks.']
        >>> s.split(' ') # doctest: +NORMALIZE_WHITESPACE
        ['Good', 'muffins', 'cost', '$3.88\nin', 'New', 'York.', '',
        'Please', 'buy', 'me\ntwo', 'of', 'them.\n\nThanks.']
        >>> s.split('\n') # doctest: +NORMALIZE_WHITESPACE
        ['Good muffins cost $3.88', 'in New York.  Please buy me',
        'two of them.', '', 'Thanks.']

    The simple tokenizers are mainly useful because they follow the
    standard ``TokenizerI`` interface, and so can be used with any code
    that expects a tokenizer.  For example, these tokenizers can be used
    to specify the tokenization conventions when building a `CorpusReader`.

CLASSES
    nltk.tokenize.api.StringTokenizer(nltk.tokenize.api.TokenizerI)
        CharTokenizer
        SpaceTokenizer
        TabTokenizer
    nltk.tokenize.api.TokenizerI(abc.ABC)
        LineTokenizer

    class CharTokenizer(nltk.tokenize.api.StringTokenizer)
     |  Tokenize a string into individual characters.  If this functionality
     |  is ever required directly, use ``for char in string``.
     |
     |  Method resolution order:
     |      CharTokenizer
     |      nltk.tokenize.api.StringTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  span_tokenize(self, s)
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  tokenize(self, s)
     |      Return a tokenized copy of *s*.
     |
     |      :rtype: List[str]
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class LineTokenizer(nltk.tokenize.api.TokenizerI)
     |  LineTokenizer(blanklines='discard')
     |
     |  Tokenize a string into its lines, optionally discarding blank lines.
     |  This is similar to ``s.split('\n')``.
     |
     |      >>> from nltk.tokenize import LineTokenizer
     |      >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
     |      >>> LineTokenizer(blanklines='keep').tokenize(s) # doctest: +NORMALIZE_WHITESPACE
     |      ['Good muffins cost $3.88', 'in New York.  Please buy me',
     |      'two of them.', '', 'Thanks.']
     |      >>> # same as [l for l in s.split('\n') if l.strip()]:
     |      >>> LineTokenizer(blanklines='discard').tokenize(s) # doctest: +NORMALIZE_WHITESPACE
     |      ['Good muffins cost $3.88', 'in New York.  Please buy me',
     |      'two of them.', 'Thanks.']
     |
     |  :param blanklines: Indicates how blank lines should be handled.  Valid values are:
     |
     |      - ``discard``: strip blank lines out of the token list before returning it.
     |         A line is considered blank if it contains only whitespace characters.
     |      - ``keep``: leave all blank lines in the token list.
     |      - ``discard-eof``: if the string ends with a newline, then do not generate
     |         a corresponding token ``''`` after that newline.
     |
     |  Method resolution order:
     |      LineTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, blanklines='discard')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  span_tokenize(self, s)
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  tokenize(self, s)
     |      Return a tokenized copy of *s*.
     |
     |      :rtype: List[str]
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SpaceTokenizer(nltk.tokenize.api.StringTokenizer)
     |  Tokenize a string using the space character as a delimiter,
     |  which is the same as ``s.split(' ')``.
     |
     |      >>> from nltk.tokenize import SpaceTokenizer
     |      >>> s = "Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\n\nThanks."
     |      >>> SpaceTokenizer().tokenize(s) # doctest: +NORMALIZE_WHITESPACE
     |      ['Good', 'muffins', 'cost', '$3.88\nin', 'New', 'York.', '',
     |      'Please', 'buy', 'me\ntwo', 'of', 'them.\n\nThanks.']
     |
     |  Method resolution order:
     |      SpaceTokenizer
     |      nltk.tokenize.api.StringTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.StringTokenizer:
     |
     |  span_tokenize(self, s)
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  tokenize(self, s)
     |      Return a tokenized copy of *s*.
     |
     |      :rtype: List[str]
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TabTokenizer(nltk.tokenize.api.StringTokenizer)
     |  Tokenize a string use the tab character as a delimiter,
     |  the same as ``s.split('\t')``.
     |
     |      >>> from nltk.tokenize import TabTokenizer
     |      >>> TabTokenizer().tokenize('a\tb c\n\t d')
     |      ['a', 'b c\n', ' d']
     |
     |  Method resolution order:
     |      TabTokenizer
     |      nltk.tokenize.api.StringTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.StringTokenizer:
     |
     |  span_tokenize(self, s)
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  tokenize(self, s)
     |      Return a tokenized copy of *s*.
     |
     |      :rtype: List[str]
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    line_tokenize(text, blanklines='discard')

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\simple.py

nltk.sinica_parse
Python Library Documentation: function sinica_parse in module nltk.tree.parsing

sinica_parse(s)
    Parse a Sinica Treebank string and return a tree.  Trees are represented as nested brackettings,
    as shown in the following example (X represents a Chinese character):
    S(goal:NP(Head:Nep:XX)|theme:NP(Head:Nhaa:X)|quantity:Dab:X|Head:VL2:X)#0(PERIODCATEGORY)

    :return: A tree corresponding to the string representation.
    :rtype: Tree
    :param s: The string to be converted
    :type s: str
nltk.skipgrams
Python Library Documentation: function skipgrams in module nltk.util

skipgrams(sequence, n, k, **kwargs)
    Returns all possible skipgrams generated from a sequence of items, as an iterator.
    Skipgrams are ngrams that allows tokens to be skipped.
    Refer to http://homepages.inf.ed.ac.uk/ballison/pdf/lrec_skipgrams.pdf

        >>> sent = "Insurgents killed in ongoing fighting".split()
        >>> list(skipgrams(sent, 2, 2))
        [('Insurgents', 'killed'), ('Insurgents', 'in'), ('Insurgents', 'ongoing'), ('killed', 'in'), ('killed', 'ongoing'), ('killed', 'fighting'), ('in', 'ongoing'), ('in', 'fighting'), ('ongoing', 'fighting')]
        >>> list(skipgrams(sent, 3, 2))
        [('Insurgents', 'killed', 'in'), ('Insurgents', 'killed', 'ongoing'), ('Insurgents', 'killed', 'fighting'), ('Insurgents', 'in', 'ongoing'), ('Insurgents', 'in', 'fighting'), ('Insurgents', 'ongoing', 'fighting'), ('killed', 'in', 'ongoing'), ('killed', 'in', 'fighting'), ('killed', 'ongoing', 'fighting'), ('in', 'ongoing', 'fighting')]

    :param sequence: the source data to be converted into trigrams
    :type sequence: sequence or iter
    :param n: the degree of the ngrams
    :type n: int
    :param k: the skip distance
    :type  k: int
    :rtype: iter(tuple)
nltk.skolemize
Python Library Documentation: function skolemize in module nltk.sem.skolemize

skolemize(expression, univ_scope=None, used_variables=None)
    Skolemize the expression and convert to conjunctive normal form (CNF)
nltk.slice_bounds
Python Library Documentation: function slice_bounds in module nltk.internals

slice_bounds(sequence, slice_obj, allow_step=False)
    Given a slice, return the corresponding (start, stop) bounds,
    taking into account None indices and negative indices.  The
    following guarantees are made for the returned start and stop values:

      - 0 <= start <= len(sequence)
      - 0 <= stop <= len(sequence)
      - start <= stop

    :raise ValueError: If ``slice_obj.step`` is not None.
    :param allow_step: If true, then the slice object may have a
        non-None step.  If it does, then return a tuple
        (start, stop, step).
nltk.snowball
Python Library Documentation: module nltk.stem.snowball in nltk.stem

NAME
    nltk.stem.snowball - Snowball stemmers

DESCRIPTION
    This module provides a port of the Snowball stemmers
    developed by Martin Porter.

    There is also a demo function: `snowball.demo()`.

CLASSES
    nltk.stem.api.StemmerI(builtins.object)
        SnowballStemmer
    nltk.stem.porter.PorterStemmer(nltk.stem.api.StemmerI)
        PorterStemmer(_LanguageSpecificStemmer, nltk.stem.porter.PorterStemmer)
    _LanguageSpecificStemmer(nltk.stem.api.StemmerI)
        HungarianStemmer
        PorterStemmer(_LanguageSpecificStemmer, nltk.stem.porter.PorterStemmer)
        RussianStemmer
    _ScandinavianStemmer(_LanguageSpecificStemmer)
        DanishStemmer
        NorwegianStemmer
        SwedishStemmer
    _StandardStemmer(_LanguageSpecificStemmer)
        ArabicStemmer
        DutchStemmer
        EnglishStemmer
        FinnishStemmer
        FrenchStemmer
        GermanStemmer
        ItalianStemmer
        PortugueseStemmer
        RomanianStemmer
        SpanishStemmer

    class ArabicStemmer(_StandardStemmer)
     |  ArabicStemmer(ignore_stopwords=False)
     |
     |  https://github.com/snowballstem/snowball/blob/master/algorithms/arabic/stem_Unicode.sbl (Original Algorithm)
     |  The Snowball Arabic light Stemmer
     |  Algorithm:
     |
     |  - Assem Chelli
     |  - Abdelkrim Aries
     |  - Lakhdar Benzahia
     |
     |  NLTK Version Author:
     |
     |  - Lakhdar Benzahia
     |
     |  Method resolution order:
     |      ArabicStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem an Arabic word and return the stemmed form.
     |
     |      :param word: string
     |      :return: string
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  is_defined = False
     |
     |  is_noun = True
     |
     |  is_verb = True
     |
     |  prefix_step2a_success = False
     |
     |  prefix_step3a_noun_success = False
     |
     |  prefix_step3b_noun_success = False
     |
     |  suffix_noun_step1a_success = False
     |
     |  suffix_noun_step2a_success = False
     |
     |  suffix_noun_step2b_success = False
     |
     |  suffix_noun_step2c2_success = False
     |
     |  suffix_verb_step2a_success = False
     |
     |  suffix_verb_step2b_success = False
     |
     |  suffixe_noun_step1b_success = False
     |
     |  suffixes_verb_step1_success = False
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DanishStemmer(_ScandinavianStemmer)
     |  DanishStemmer(ignore_stopwords=False)
     |
     |  The Danish Snowball stemmer.
     |
     |  :cvar __vowels: The Danish vowels.
     |  :type __vowels: unicode
     |  :cvar __consonants: The Danish consonants.
     |  :type __consonants: unicode
     |  :cvar __double_consonants: The Danish double consonants.
     |  :type __double_consonants: tuple
     |  :cvar __s_ending: Letters that may directly appear before a word final 's'.
     |  :type __s_ending: unicode
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :cvar __step3_suffixes: Suffixes to be deleted in step 3 of the algorithm.
     |  :type __step3_suffixes: tuple
     |  :note: A detailed description of the Danish
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/danish/stemmer.html
     |
     |  Method resolution order:
     |      DanishStemmer
     |      _ScandinavianStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a Danish word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class DutchStemmer(_StandardStemmer)
     |  DutchStemmer(ignore_stopwords=False)
     |
     |  The Dutch Snowball stemmer.
     |
     |  :cvar __vowels: The Dutch vowels.
     |  :type __vowels: unicode
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step3b_suffixes: Suffixes to be deleted in step 3b of the algorithm.
     |  :type __step3b_suffixes: tuple
     |  :note: A detailed description of the Dutch
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/dutch/stemmer.html
     |
     |  Method resolution order:
     |      DutchStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a Dutch word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class EnglishStemmer(_StandardStemmer)
     |  EnglishStemmer(ignore_stopwords=False)
     |
     |  The English Snowball stemmer.
     |
     |  :cvar __vowels: The English vowels.
     |  :type __vowels: unicode
     |  :cvar __double_consonants: The English double consonants.
     |  :type __double_consonants: tuple
     |  :cvar __li_ending: Letters that may directly appear before a word final 'li'.
     |  :type __li_ending: unicode
     |  :cvar __step0_suffixes: Suffixes to be deleted in step 0 of the algorithm.
     |  :type __step0_suffixes: tuple
     |  :cvar __step1a_suffixes: Suffixes to be deleted in step 1a of the algorithm.
     |  :type __step1a_suffixes: tuple
     |  :cvar __step1b_suffixes: Suffixes to be deleted in step 1b of the algorithm.
     |  :type __step1b_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :cvar __step3_suffixes: Suffixes to be deleted in step 3 of the algorithm.
     |  :type __step3_suffixes: tuple
     |  :cvar __step4_suffixes: Suffixes to be deleted in step 4 of the algorithm.
     |  :type __step4_suffixes: tuple
     |  :cvar __step5_suffixes: Suffixes to be deleted in step 5 of the algorithm.
     |  :type __step5_suffixes: tuple
     |  :cvar __special_words: A dictionary containing words
     |                         which have to be stemmed specially.
     |  :type __special_words: dict
     |  :note: A detailed description of the English
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/english/stemmer.html
     |
     |  Method resolution order:
     |      EnglishStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem an English word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FinnishStemmer(_StandardStemmer)
     |  FinnishStemmer(ignore_stopwords=False)
     |
     |  The Finnish Snowball stemmer.
     |
     |  :cvar __vowels: The Finnish vowels.
     |  :type __vowels: unicode
     |  :cvar __restricted_vowels: A subset of the Finnish vowels.
     |  :type __restricted_vowels: unicode
     |  :cvar __long_vowels: The Finnish vowels in their long forms.
     |  :type __long_vowels: tuple
     |  :cvar __consonants: The Finnish consonants.
     |  :type __consonants: unicode
     |  :cvar __double_consonants: The Finnish double consonants.
     |  :type __double_consonants: tuple
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :cvar __step3_suffixes: Suffixes to be deleted in step 3 of the algorithm.
     |  :type __step3_suffixes: tuple
     |  :cvar __step4_suffixes: Suffixes to be deleted in step 4 of the algorithm.
     |  :type __step4_suffixes: tuple
     |  :note: A detailed description of the Finnish
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/finnish/stemmer.html
     |
     |  Method resolution order:
     |      FinnishStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a Finnish word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class FrenchStemmer(_StandardStemmer)
     |  FrenchStemmer(ignore_stopwords=False)
     |
     |  The French Snowball stemmer.
     |
     |  :cvar __vowels: The French vowels.
     |  :type __vowels: unicode
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2a_suffixes: Suffixes to be deleted in step 2a of the algorithm.
     |  :type __step2a_suffixes: tuple
     |  :cvar __step2b_suffixes: Suffixes to be deleted in step 2b of the algorithm.
     |  :type __step2b_suffixes: tuple
     |  :cvar __step4_suffixes: Suffixes to be deleted in step 4 of the algorithm.
     |  :type __step4_suffixes: tuple
     |  :note: A detailed description of the French
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/french/stemmer.html
     |
     |  Method resolution order:
     |      FrenchStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a French word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class GermanStemmer(_StandardStemmer)
     |  GermanStemmer(ignore_stopwords=False)
     |
     |  The German Snowball stemmer.
     |
     |  :cvar __vowels: The German vowels.
     |  :type __vowels: unicode
     |  :cvar __s_ending: Letters that may directly appear before a word final 's'.
     |  :type __s_ending: unicode
     |  :cvar __st_ending: Letter that may directly appear before a word final 'st'.
     |  :type __st_ending: unicode
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :cvar __step3_suffixes: Suffixes to be deleted in step 3 of the algorithm.
     |  :type __step3_suffixes: tuple
     |  :note: A detailed description of the German
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/german/stemmer.html
     |
     |  Method resolution order:
     |      GermanStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a German word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class HungarianStemmer(_LanguageSpecificStemmer)
     |  HungarianStemmer(ignore_stopwords=False)
     |
     |  The Hungarian Snowball stemmer.
     |
     |  :cvar __vowels: The Hungarian vowels.
     |  :type __vowels: unicode
     |  :cvar __digraphs: The Hungarian digraphs.
     |  :type __digraphs: tuple
     |  :cvar __double_consonants: The Hungarian double consonants.
     |  :type __double_consonants: tuple
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :cvar __step3_suffixes: Suffixes to be deleted in step 3 of the algorithm.
     |  :type __step3_suffixes: tuple
     |  :cvar __step4_suffixes: Suffixes to be deleted in step 4 of the algorithm.
     |  :type __step4_suffixes: tuple
     |  :cvar __step5_suffixes: Suffixes to be deleted in step 5 of the algorithm.
     |  :type __step5_suffixes: tuple
     |  :cvar __step6_suffixes: Suffixes to be deleted in step 6 of the algorithm.
     |  :type __step6_suffixes: tuple
     |  :cvar __step7_suffixes: Suffixes to be deleted in step 7 of the algorithm.
     |  :type __step7_suffixes: tuple
     |  :cvar __step8_suffixes: Suffixes to be deleted in step 8 of the algorithm.
     |  :type __step8_suffixes: tuple
     |  :cvar __step9_suffixes: Suffixes to be deleted in step 9 of the algorithm.
     |  :type __step9_suffixes: tuple
     |  :note: A detailed description of the Hungarian
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/hungarian/stemmer.html
     |
     |  Method resolution order:
     |      HungarianStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem an Hungarian word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ItalianStemmer(_StandardStemmer)
     |  ItalianStemmer(ignore_stopwords=False)
     |
     |  The Italian Snowball stemmer.
     |
     |  :cvar __vowels: The Italian vowels.
     |  :type __vowels: unicode
     |  :cvar __step0_suffixes: Suffixes to be deleted in step 0 of the algorithm.
     |  :type __step0_suffixes: tuple
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :note: A detailed description of the Italian
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/italian/stemmer.html
     |
     |  Method resolution order:
     |      ItalianStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem an Italian word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class NorwegianStemmer(_ScandinavianStemmer)
     |  NorwegianStemmer(ignore_stopwords=False)
     |
     |  The Norwegian Snowball stemmer.
     |
     |  :cvar __vowels: The Norwegian vowels.
     |  :type __vowels: unicode
     |  :cvar __s_ending: Letters that may directly appear before a word final 's'.
     |  :type __s_ending: unicode
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :cvar __step3_suffixes: Suffixes to be deleted in step 3 of the algorithm.
     |  :type __step3_suffixes: tuple
     |  :note: A detailed description of the Norwegian
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/norwegian/stemmer.html
     |
     |  Method resolution order:
     |      NorwegianStemmer
     |      _ScandinavianStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a Norwegian word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class PorterStemmer(_LanguageSpecificStemmer, nltk.stem.porter.PorterStemmer)
     |  PorterStemmer(ignore_stopwords=False)
     |
     |  A word stemmer based on the original Porter stemming algorithm.
     |
     |      Porter, M. "An algorithm for suffix stripping."
     |      Program 14.3 (1980): 130-137.
     |
     |  A few minor modifications have been made to Porter's basic
     |  algorithm.  See the source code of the module
     |  nltk.stem.porter for more information.
     |
     |  Method resolution order:
     |      PorterStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.porter.PorterStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.stem.porter.PorterStemmer:
     |
     |  stem(self, word, to_lowercase=True)
     |      :param to_lowercase: if `to_lowercase=True` the word always lowercase
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.stem.porter.PorterStemmer:
     |
     |  MARTIN_EXTENSIONS = 'MARTIN_EXTENSIONS'
     |
     |  NLTK_EXTENSIONS = 'NLTK_EXTENSIONS'
     |
     |  ORIGINAL_ALGORITHM = 'ORIGINAL_ALGORITHM'
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class PortugueseStemmer(_StandardStemmer)
     |  PortugueseStemmer(ignore_stopwords=False)
     |
     |  The Portuguese Snowball stemmer.
     |
     |  :cvar __vowels: The Portuguese vowels.
     |  :type __vowels: unicode
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :cvar __step4_suffixes: Suffixes to be deleted in step 4 of the algorithm.
     |  :type __step4_suffixes: tuple
     |  :note: A detailed description of the Portuguese
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/portuguese/stemmer.html
     |
     |  Method resolution order:
     |      PortugueseStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a Portuguese word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class RomanianStemmer(_StandardStemmer)
     |  RomanianStemmer(ignore_stopwords=False)
     |
     |  The Romanian Snowball stemmer.
     |
     |  :cvar __vowels: The Romanian vowels.
     |  :type __vowels: unicode
     |  :cvar __step0_suffixes: Suffixes to be deleted in step 0 of the algorithm.
     |  :type __step0_suffixes: tuple
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :cvar __step3_suffixes: Suffixes to be deleted in step 3 of the algorithm.
     |  :type __step3_suffixes: tuple
     |  :note: A detailed description of the Romanian
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/romanian/stemmer.html
     |
     |  Method resolution order:
     |      RomanianStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a Romanian word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class RussianStemmer(_LanguageSpecificStemmer)
     |  RussianStemmer(ignore_stopwords=False)
     |
     |  The Russian Snowball stemmer.
     |
     |  :cvar __perfective_gerund_suffixes: Suffixes to be deleted.
     |  :type __perfective_gerund_suffixes: tuple
     |  :cvar __adjectival_suffixes: Suffixes to be deleted.
     |  :type __adjectival_suffixes: tuple
     |  :cvar __reflexive_suffixes: Suffixes to be deleted.
     |  :type __reflexive_suffixes: tuple
     |  :cvar __verb_suffixes: Suffixes to be deleted.
     |  :type __verb_suffixes: tuple
     |  :cvar __noun_suffixes: Suffixes to be deleted.
     |  :type __noun_suffixes: tuple
     |  :cvar __superlative_suffixes: Suffixes to be deleted.
     |  :type __superlative_suffixes: tuple
     |  :cvar __derivational_suffixes: Suffixes to be deleted.
     |  :type __derivational_suffixes: tuple
     |  :note: A detailed description of the Russian
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/russian/stemmer.html
     |
     |  Method resolution order:
     |      RussianStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a Russian word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SnowballStemmer(nltk.stem.api.StemmerI)
     |  SnowballStemmer(language, ignore_stopwords=False)
     |
     |  Snowball Stemmer
     |
     |  The following languages are supported:
     |  Arabic, Danish, Dutch, English, Finnish, French, German,
     |  Hungarian, Italian, Norwegian, Portuguese, Romanian, Russian,
     |  Spanish and Swedish.
     |
     |  The algorithm for English is documented here:
     |
     |      Porter, M. "An algorithm for suffix stripping."
     |      Program 14.3 (1980): 130-137.
     |
     |  The algorithms have been developed by Martin Porter.
     |  These stemmers are called Snowball, because Porter created
     |  a programming language with this name for creating
     |  new stemming algorithms. There is more information available
     |  at http://snowball.tartarus.org/
     |
     |  The stemmer is invoked as shown below:
     |
     |  >>> from nltk.stem import SnowballStemmer # See which languages are supported
     |  >>> print(" ".join(SnowballStemmer.languages)) # doctest: +NORMALIZE_WHITESPACE
     |  arabic danish dutch english finnish french german hungarian
     |  italian norwegian porter portuguese romanian russian
     |  spanish swedish
     |  >>> stemmer = SnowballStemmer("german") # Choose a language
     |  >>> stemmer.stem("Autobahnen") # Stem a word
     |  'autobahn'
     |
     |  Invoking the stemmers that way is useful if you do not know the
     |  language to be stemmed at runtime. Alternatively, if you already know
     |  the language, then you can invoke the language specific stemmer directly:
     |
     |  >>> from nltk.stem.snowball import GermanStemmer
     |  >>> stemmer = GermanStemmer()
     |  >>> stemmer.stem("Autobahnen")
     |  'autobahn'
     |
     |  :param language: The language whose subclass is instantiated.
     |  :type language: str or unicode
     |  :param ignore_stopwords: If set to True, stopwords are
     |                           not stemmed and returned unchanged.
     |                           Set to False by default.
     |  :type ignore_stopwords: bool
     |  :raise ValueError: If there is no stemmer for the specified
     |                         language, a ValueError is raised.
     |
     |  Method resolution order:
     |      SnowballStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, language, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  stem(self, token)
     |      Strip affixes from the token and return the stem.
     |
     |      :param token: The token that should be stemmed.
     |      :type token: str
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  languages = ('arabic', 'danish', 'dutch', 'english', 'finnish', 'frenc...
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SpanishStemmer(_StandardStemmer)
     |  SpanishStemmer(ignore_stopwords=False)
     |
     |  The Spanish Snowball stemmer.
     |
     |  :cvar __vowels: The Spanish vowels.
     |  :type __vowels: unicode
     |  :cvar __step0_suffixes: Suffixes to be deleted in step 0 of the algorithm.
     |  :type __step0_suffixes: tuple
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2a_suffixes: Suffixes to be deleted in step 2a of the algorithm.
     |  :type __step2a_suffixes: tuple
     |  :cvar __step2b_suffixes: Suffixes to be deleted in step 2b of the algorithm.
     |  :type __step2b_suffixes: tuple
     |  :cvar __step3_suffixes: Suffixes to be deleted in step 3 of the algorithm.
     |  :type __step3_suffixes: tuple
     |  :note: A detailed description of the Spanish
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/spanish/stemmer.html
     |
     |  Method resolution order:
     |      SpanishStemmer
     |      _StandardStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a Spanish word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SwedishStemmer(_ScandinavianStemmer)
     |  SwedishStemmer(ignore_stopwords=False)
     |
     |  The Swedish Snowball stemmer.
     |
     |  :cvar __vowels: The Swedish vowels.
     |  :type __vowels: unicode
     |  :cvar __s_ending: Letters that may directly appear before a word final 's'.
     |  :type __s_ending: unicode
     |  :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm.
     |  :type __step1_suffixes: tuple
     |  :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm.
     |  :type __step2_suffixes: tuple
     |  :cvar __step3_suffixes: Suffixes to be deleted in step 3 of the algorithm.
     |  :type __step3_suffixes: tuple
     |  :note: A detailed description of the Swedish
     |         stemming algorithm can be found under
     |         http://snowball.tartarus.org/algorithms/swedish/stemmer.html
     |
     |  Method resolution order:
     |      SwedishStemmer
     |      _ScandinavianStemmer
     |      _LanguageSpecificStemmer
     |      nltk.stem.api.StemmerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  stem(self, word)
     |      Stem a Swedish word and return the stemmed form.
     |
     |      :param word: The word that is stemmed.
     |      :type word: str or unicode
     |      :return: The stemmed form.
     |      :rtype: unicode
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from _LanguageSpecificStemmer:
     |
     |  __init__(self, ignore_stopwords=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Print out the string representation of the respective class.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.stem.api.StemmerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()
        This function provides a demonstration of the Snowball stemmers.

        After invoking this function and specifying a language,
        it stems an excerpt of the Universal Declaration of Human Rights
        (which is a part of the NLTK corpus collection) and then prints
        out the original and the stemmed text.

DATA
    stopwords = <WordListCorpusReader in '.../corpora/stopwords' (not load...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\snowball.py

nltk.sonority_sequencing
Python Library Documentation: module nltk.tokenize.sonority_sequencing in nltk.tokenize

NAME
    nltk.tokenize.sonority_sequencing

DESCRIPTION
    The Sonority Sequencing Principle (SSP) is a language agnostic algorithm proposed
    by Otto Jesperson in 1904. The sonorous quality of a phoneme is judged by the
    openness of the lips. Syllable breaks occur before troughs in sonority. For more
    on the SSP see Selkirk (1984).

    The default implementation uses the English alphabet, but the `sonority_hiearchy`
    can be modified to IPA or any other alphabet for the use-case. The SSP is a
    universal syllabification algorithm, but that does not mean it performs equally
    across languages. Bartlett et al. (2009) is a good benchmark for English accuracy
    if utilizing IPA (pg. 311).

    Importantly, if a custom hierarchy is supplied and vowels span across more than
    one level, they should be given separately to the `vowels` class attribute.

    References:

    - Otto Jespersen. 1904. Lehrbuch der Phonetik.
      Leipzig, Teubner. Chapter 13, Silbe, pp. 185-203.
    - Elisabeth Selkirk. 1984. On the major class features and syllable theory.
      In Aronoff & Oehrle (eds.) Language Sound Structure: Studies in Phonology.
      Cambridge, MIT Press. pp. 107-136.
    - Susan Bartlett, et al. 2009. On the Syllabification of Phonemes.
      In HLT-NAACL. pp. 308-316.

CLASSES
    nltk.tokenize.api.TokenizerI(abc.ABC)
        SyllableTokenizer

    class SyllableTokenizer(nltk.tokenize.api.TokenizerI)
     |  SyllableTokenizer(lang='en', sonority_hierarchy=False)
     |
     |  Syllabifies words based on the Sonority Sequencing Principle (SSP).
     |
     |      >>> from nltk.tokenize import SyllableTokenizer
     |      >>> from nltk import word_tokenize
     |      >>> SSP = SyllableTokenizer()
     |      >>> SSP.tokenize('justification')
     |      ['jus', 'ti', 'fi', 'ca', 'tion']
     |      >>> text = "This is a foobar-like sentence."
     |      >>> [SSP.tokenize(token) for token in word_tokenize(text)]
     |      [['This'], ['is'], ['a'], ['foo', 'bar', '-', 'li', 'ke'], ['sen', 'ten', 'ce'], ['.']]
     |
     |  Method resolution order:
     |      SyllableTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, lang='en', sonority_hierarchy=False)
     |      :param lang: Language parameter, default is English, 'en'
     |      :type lang: str
     |      :param sonority_hierarchy: Sonority hierarchy according to the
     |                                 Sonority Sequencing Principle.
     |      :type sonority_hierarchy: list(str)
     |
     |  assign_values(self, token)
     |      Assigns each phoneme its value from the sonority hierarchy.
     |      Note: Sentence/text has to be tokenized first.
     |
     |      :param token: Single word or token
     |      :type token: str
     |      :return: List of tuples, first element is character/phoneme and
     |               second is the soronity value.
     |      :rtype: list(tuple(str, int))
     |
     |  tokenize(self, token)
     |      Apply the SSP to return a list of syllables.
     |      Note: Sentence/text has to be tokenized first.
     |
     |      :param token: Single word or token
     |      :type token: str
     |      :return syllable_list: Single word or token broken up into syllables.
     |      :rtype: list(str)
     |
     |  validate_syllables(self, syllable_list)
     |      Ensures each syllable has at least one vowel.
     |      If the following syllable doesn't have vowel, add it to the current one.
     |
     |      :param syllable_list: Single word or token broken up into syllables.
     |      :type syllable_list: list(str)
     |      :return: Single word or token broken up into syllables
     |               (with added syllables if necessary)
     |      :rtype: list(str)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\sonority_sequencing.py

nltk.spearman
Python Library Documentation: module nltk.metrics.spearman in nltk.metrics

NAME
    nltk.metrics.spearman - Tools for comparing ranked lists.

FUNCTIONS
    ranks_from_scores(scores, rank_gap=1e-15)
        Given a sequence of (key, score) tuples, yields each key with an
        increasing rank, tying with previous key's rank if the difference between
        their scores is less than rank_gap. Suitable for use as an argument to
        ``spearman_correlation``.

    ranks_from_sequence(seq)
        Given a sequence, yields each element with an increasing rank, suitable
        for use as an argument to ``spearman_correlation``.

    spearman_correlation(ranks1, ranks2)
        Returns the Spearman correlation coefficient for two rankings, which
        should be dicts or sequences of (key, rank). The coefficient ranges from
        -1.0 (ranks are opposite) to 1.0 (ranks are identical), and is only
        calculated for keys in both rankings (for meaningful results, remove keys
        present in only one list before ranking).

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\metrics\spearman.py

nltk.spearman_correlation
Python Library Documentation: function spearman_correlation in module nltk.metrics.spearman

spearman_correlation(ranks1, ranks2)
    Returns the Spearman correlation coefficient for two rankings, which
    should be dicts or sequences of (key, rank). The coefficient ranges from
    -1.0 (ranks are opposite) to 1.0 (ranks are identical), and is only
    calculated for keys in both rankings (for meaningful results, remove keys
    present in only one list before ranking).
nltk.stack_decoder
Python Library Documentation: module nltk.translate.stack_decoder in nltk.translate

NAME
    nltk.translate.stack_decoder - A decoder that uses stacks to implement phrase-based translation.

DESCRIPTION
    In phrase-based translation, the source sentence is segmented into
    phrases of one or more words, and translations for those phrases are
    used to build the target sentence.

    Hypothesis data structures are used to keep track of the source words
    translated so far and the partial output. A hypothesis can be expanded
    by selecting an untranslated phrase, looking up its translation in a
    phrase table, and appending that translation to the partial output.
    Translation is complete when a hypothesis covers all source words.

    The search space is huge because the source sentence can be segmented
    in different ways, the source phrases can be selected in any order,
    and there could be multiple translations for the same source phrase in
    the phrase table. To make decoding tractable, stacks are used to limit
    the number of candidate hypotheses by doing histogram and/or threshold
    pruning.

    Hypotheses with the same number of words translated are placed in the
    same stack. In histogram pruning, each stack has a size limit, and
    the hypothesis with the lowest score is removed when the stack is full.
    In threshold pruning, hypotheses that score below a certain threshold
    of the best hypothesis in that stack are removed.

    Hypothesis scoring can include various factors such as phrase
    translation probability, language model probability, length of
    translation, cost of remaining words to be translated, and so on.


    References:
    Philipp Koehn. 2010. Statistical Machine Translation.
    Cambridge University Press, New York.

CLASSES
    builtins.object
        StackDecoder

    class StackDecoder(builtins.object)
     |  StackDecoder(phrase_table, language_model)
     |
     |  Phrase-based stack decoder for machine translation
     |
     |  >>> from nltk.translate import PhraseTable
     |  >>> phrase_table = PhraseTable()
     |  >>> phrase_table.add(('niemand',), ('nobody',), log(0.8))
     |  >>> phrase_table.add(('niemand',), ('no', 'one'), log(0.2))
     |  >>> phrase_table.add(('erwartet',), ('expects',), log(0.8))
     |  >>> phrase_table.add(('erwartet',), ('expecting',), log(0.2))
     |  >>> phrase_table.add(('niemand', 'erwartet'), ('one', 'does', 'not', 'expect'), log(0.1))
     |  >>> phrase_table.add(('die', 'spanische', 'inquisition'), ('the', 'spanish', 'inquisition'), log(0.8))
     |  >>> phrase_table.add(('!',), ('!',), log(0.8))
     |
     |  >>> #  nltk.model should be used here once it is implemented
     |  >>> from collections import defaultdict
     |  >>> language_prob = defaultdict(lambda: -999.0)
     |  >>> language_prob[('nobody',)] = log(0.5)
     |  >>> language_prob[('expects',)] = log(0.4)
     |  >>> language_prob[('the', 'spanish', 'inquisition')] = log(0.2)
     |  >>> language_prob[('!',)] = log(0.1)
     |  >>> language_model = type('',(object,),{'probability_change': lambda self, context, phrase: language_prob[phrase], 'probability': lambda self, phrase: language_prob[phrase]})()
     |
     |  >>> stack_decoder = StackDecoder(phrase_table, language_model)
     |
     |  >>> stack_decoder.translate(['niemand', 'erwartet', 'die', 'spanische', 'inquisition', '!'])
     |  ['nobody', 'expects', 'the', 'spanish', 'inquisition', '!']
     |
     |  Methods defined here:
     |
     |  __init__(self, phrase_table, language_model)
     |      :param phrase_table: Table of translations for source language
     |          phrases and the log probabilities for those translations.
     |      :type phrase_table: PhraseTable
     |
     |      :param language_model: Target language model. Must define a
     |          ``probability_change`` method that calculates the change in
     |          log probability of a sentence, if a given string is appended
     |          to it.
     |          This interface is experimental and will likely be replaced
     |          with nltk.model once it is implemented.
     |      :type language_model: object
     |
     |  compute_future_scores(self, src_sentence)
     |      Determines the approximate scores for translating every
     |      subsequence in ``src_sentence``
     |
     |      Future scores can be used a look-ahead to determine the
     |      difficulty of translating the remaining parts of a src_sentence.
     |
     |      :type src_sentence: tuple(str)
     |
     |      :return: Scores of subsequences referenced by their start and
     |          end positions. For example, result[2][5] is the score of the
     |          subsequence covering positions 2, 3, and 4.
     |      :rtype: dict(int: (dict(int): float))
     |
     |  distortion_score(self, hypothesis, next_src_phrase_span)
     |
     |  expansion_score(self, hypothesis, translation_option, src_phrase_span)
     |      Calculate the score of expanding ``hypothesis`` with
     |      ``translation_option``
     |
     |      :param hypothesis: Hypothesis being expanded
     |      :type hypothesis: _Hypothesis
     |
     |      :param translation_option: Information about the proposed expansion
     |      :type translation_option: PhraseTableEntry
     |
     |      :param src_phrase_span: Word position span of the source phrase
     |      :type src_phrase_span: tuple(int, int)
     |
     |  find_all_src_phrases(self, src_sentence)
     |      Finds all subsequences in src_sentence that have a phrase
     |      translation in the translation table
     |
     |      :type src_sentence: tuple(str)
     |
     |      :return: Subsequences that have a phrase translation,
     |          represented as a table of lists of end positions.
     |          For example, if result[2] is [5, 6, 9], then there are
     |          three phrases starting from position 2 in ``src_sentence``,
     |          ending at positions 5, 6, and 9 exclusive. The list of
     |          ending positions are in ascending order.
     |      :rtype: list(list(int))
     |
     |  future_score(self, hypothesis, future_score_table, sentence_length)
     |      Determines the approximate score for translating the
     |      untranslated words in ``hypothesis``
     |
     |  translate(self, src_sentence)
     |      :param src_sentence: Sentence to be translated
     |      :type src_sentence: list(str)
     |
     |      :return: Translated sentence
     |      :rtype: list(str)
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  valid_phrases(all_phrases_from, hypothesis)
     |      Extract phrases from ``all_phrases_from`` that contains words
     |      that have not been translated by ``hypothesis``
     |
     |      :param all_phrases_from: Phrases represented by their spans, in
     |          the same format as the return value of
     |          ``find_all_src_phrases``
     |      :type all_phrases_from: list(list(int))
     |
     |      :type hypothesis: _Hypothesis
     |
     |      :return: A list of phrases, represented by their spans, that
     |          cover untranslated positions.
     |      :rtype: list(tuple(int, int))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  distortion_factor
     |      float: Amount of reordering of source phrases.
     |          Lower values favour monotone translation, suitable when
     |          word order is similar for both source and target languages.
     |          Value between 0.0 and 1.0. Default 0.5.

FUNCTIONS
    log(...)
        log(x, [base=math.e])
        Return the logarithm of x to the given base.

        If the base is not specified, returns the natural logarithm (base e) of x.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\stack_decoder.py

nltk.stanford
Python Library Documentation: module nltk.tag.stanford in nltk.tag

NAME
    nltk.tag.stanford - A module for interfacing with the Stanford taggers.

DESCRIPTION
    Tagger models need to be downloaded from https://nlp.stanford.edu/software
    and the STANFORD_MODELS environment variable set (a colon-separated
    list of paths).

    For more details see the documentation for StanfordPOSTagger and StanfordNERTagger.

CLASSES
    nltk.tag.api.TaggerI(builtins.object)
        StanfordTagger
            StanfordNERTagger
            StanfordPOSTagger

    class StanfordNERTagger(StanfordTagger)
     |  StanfordNERTagger(*args, **kwargs)
     |
     |  A class for Named-Entity Tagging with Stanford Tagger. The input is the paths to:
     |
     |  - a model trained on training data
     |  - (optionally) the path to the stanford tagger jar file. If not specified here,
     |    then this jar file must be specified in the CLASSPATH environment variable.
     |  - (optionally) the encoding of the training data (default: UTF-8)
     |
     |  Example:
     |
     |      >>> from nltk.tag import StanfordNERTagger
     |      >>> st = StanfordNERTagger('english.all.3class.distsim.crf.ser.gz') # doctest: +SKIP
     |      >>> st.tag('Rami Eid is studying at Stony Brook University in NY'.split()) # doctest: +SKIP
     |      [('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'),
     |       ('at', 'O'), ('Stony', 'ORGANIZATION'), ('Brook', 'ORGANIZATION'),
     |       ('University', 'ORGANIZATION'), ('in', 'O'), ('NY', 'LOCATION')]
     |
     |  Method resolution order:
     |      StanfordNERTagger
     |      StanfordTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  parse_output(self, text, sentences)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from StanfordTagger:
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StanfordPOSTagger(StanfordTagger)
     |  StanfordPOSTagger(*args, **kwargs)
     |
     |  A class for pos tagging with Stanford Tagger. The input is the paths to:
     |   - a model trained on training data
     |   - (optionally) the path to the stanford tagger jar file. If not specified here,
     |     then this jar file must be specified in the CLASSPATH environment variable.
     |   - (optionally) the encoding of the training data (default: UTF-8)
     |
     |  Example:
     |
     |      >>> from nltk.tag import StanfordPOSTagger
     |      >>> st = StanfordPOSTagger('english-bidirectional-distsim.tagger') # doctest: +SKIP
     |      >>> st.tag('What is the airspeed of an unladen swallow ?'.split()) # doctest: +SKIP
     |      [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'), ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'), ('unladen', 'JJ'), ('swallow', 'VB'), ('?', '.')]
     |
     |  Method resolution order:
     |      StanfordPOSTagger
     |      StanfordTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from StanfordTagger:
     |
     |  parse_output(self, text, sentences=None)
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class StanfordTagger(nltk.tag.api.TaggerI)
     |  StanfordTagger(model_filename, path_to_jar=None, encoding='utf8', verbose=False, java_options='-mx1000m')
     |
     |  An interface to Stanford taggers. Subclasses must define:
     |
     |  - ``_cmd`` property: A property that returns the command that will be
     |    executed.
     |  - ``_SEPARATOR``: Class constant that represents that character that
     |    is used to separate the tokens from their tags.
     |  - ``_JAR`` file: Class constant that represents the jar file name.
     |
     |  Method resolution order:
     |      StanfordTagger
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, model_filename, path_to_jar=None, encoding='utf8', verbose=False, java_options='-mx1000m')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  parse_output(self, text, sentences=None)
     |
     |  tag(self, tokens)
     |      Determine the most appropriate tag sequence for the given
     |      token sequence, and return a corresponding list of tagged
     |      tokens.  A tagged token is encoded as a tuple ``(token, tag)``.
     |
     |      :rtype: list(tuple(str, str))
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset({'_cmd'})
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    PIPE = -1

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\stanford.py

nltk.stanford_segmenter
Python Library Documentation: module nltk.tokenize.stanford_segmenter in nltk.tokenize

NAME
    nltk.tokenize.stanford_segmenter

DESCRIPTION
    # Natural Language Toolkit: Interface to the Stanford Segmenter
    # for Chinese and Arabic
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: 52nlp <52nlpcn@gmail.com>
    #         Casper Lehmann-Strøm <casperlehmann@gmail.com>
    #         Alex Constantin <alex@keyworder.ch>
    #
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.tokenize.api.TokenizerI(abc.ABC)
        StanfordSegmenter

    class StanfordSegmenter(nltk.tokenize.api.TokenizerI)
     |  StanfordSegmenter(path_to_jar=None, path_to_slf4j=None, java_class=None, path_to_model=None, path_to_dict=None, path_to_sihan_corpora_dict=None, sihan_post_processing='false', keep_whitespaces='false', encoding='UTF-8', options=None, verbose=False, java_options='-mx2g')
     |
     |  Interface to the Stanford Segmenter
     |
     |  If stanford-segmenter version is older than 2016-10-31, then path_to_slf4j
     |  should be provieded, for example::
     |
     |      seg = StanfordSegmenter(path_to_slf4j='/YOUR_PATH/slf4j-api.jar')
     |
     |  >>> from nltk.tokenize.stanford_segmenter import StanfordSegmenter
     |  >>> seg = StanfordSegmenter() # doctest: +SKIP
     |  >>> seg.default_config('zh') # doctest: +SKIP
     |  >>> sent = u'这是斯坦福中文分词器测试'
     |  >>> print(seg.segment(sent)) # doctest: +SKIP
     |  这 是 斯坦福 中文 分词器 测试
     |  <BLANKLINE>
     |  >>> seg.default_config('ar') # doctest: +SKIP
     |  >>> sent = u'هذا هو تصنيف ستانفورد العربي للكلمات'
     |  >>> print(seg.segment(sent.split())) # doctest: +SKIP
     |  هذا هو تصنيف ستانفورد العربي ل الكلمات
     |  <BLANKLINE>
     |
     |  Method resolution order:
     |      StanfordSegmenter
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, path_to_jar=None, path_to_slf4j=None, java_class=None, path_to_model=None, path_to_dict=None, path_to_sihan_corpora_dict=None, sihan_post_processing='false', keep_whitespaces='false', encoding='UTF-8', options=None, verbose=False, java_options='-mx2g')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  default_config(self, lang)
     |      Attempt to initialize Stanford Word Segmenter for the specified language
     |      using the STANFORD_SEGMENTER and STANFORD_MODELS environment variables
     |
     |  segment(self, tokens)
     |
     |  segment_file(self, input_file_path)
     |
     |  segment_sents(self, sentences)
     |
     |  tokenize(self, s)
     |      Return a tokenized copy of *s*.
     |
     |      :rtype: List[str]
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    PIPE = -1

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\stanford_segmenter.py

nltk.stem
Python Library Documentation: package nltk.stem in nltk

NAME
    nltk.stem - NLTK Stemmers

DESCRIPTION
    Interfaces used to remove morphological affixes from words, leaving
    only the word stem.  Stemming algorithms aim to remove those affixes
    required for eg. grammatical role, tense, derivational morphology
    leaving only the stem of the word.  This is a difficult problem due to
    irregular words (eg. common verbs in English), complicated
    morphological rules, and part-of-speech and sense ambiguities
    (eg. ``ceil-`` is not the stem of ``ceiling``).

    StemmerI defines a standard interface for stemmers.

PACKAGE CONTENTS
    api
    arlstem
    arlstem2
    cistem
    isri
    lancaster
    porter
    regexp
    rslp
    snowball
    util
    wordnet

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\__init__.py

nltk.str2tuple
Python Library Documentation: function str2tuple in module nltk.tag.util

str2tuple(s, sep='/')
    Given the string representation of a tagged token, return the
    corresponding tuple representation.  The rightmost occurrence of
    *sep* in *s* will be used to divide *s* into a word string and
    a tag string.  If *sep* does not occur in *s*, return (s, None).

        >>> from nltk.tag.util import str2tuple
        >>> str2tuple('fly/NN')
        ('fly', 'NN')

    :type s: str
    :param s: The string representation of a tagged token.
    :type sep: str
    :param sep: The separator string used to separate word strings
        from tags.
nltk.string_span_tokenize
Python Library Documentation: function string_span_tokenize in module nltk.tokenize.util

string_span_tokenize(s, sep)
    Return the offsets of the tokens in *s*, as a sequence of ``(start, end)``
    tuples, by splitting the string at each occurrence of *sep*.

        >>> from nltk.tokenize.util import string_span_tokenize
        >>> s = '''Good muffins cost $3.88\nin New York.  Please buy me
        ... two of them.\n\nThanks.'''
        >>> list(string_span_tokenize(s, " ")) # doctest: +NORMALIZE_WHITESPACE
        [(0, 4), (5, 12), (13, 17), (18, 26), (27, 30), (31, 36), (37, 37),
        (38, 44), (45, 48), (49, 55), (56, 58), (59, 73)]

    :param s: the string to be tokenized
    :type s: str
    :param sep: the token separator
    :type sep: str
    :rtype: iter(tuple(int, int))
nltk.subprocess
Python Library Documentation: module subprocess

NAME
    subprocess - Subprocesses with accessible I/O streams

MODULE REFERENCE
    https://docs.python.org/3.12/library/subprocess.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

DESCRIPTION
    This module allows you to spawn processes, connect to their
    input/output/error pipes, and obtain their return codes.

    For a complete description of this module see the Python documentation.

    Main API
    ========
    run(...): Runs a command, waits for it to complete, then returns a
              CompletedProcess instance.
    Popen(...): A class for flexibly executing a command in a new process

    Constants
    ---------
    DEVNULL: Special value that indicates that os.devnull should be used
    PIPE:    Special value that indicates a pipe should be created
    STDOUT:  Special value that indicates that stderr should go to stdout


    Older API
    =========
    call(...): Runs a command, waits for it to complete, then returns
        the return code.
    check_call(...): Same as call() but raises CalledProcessError()
        if return code is not 0
    check_output(...): Same as check_call() but returns the contents of
        stdout instead of a return code
    getoutput(...): Runs a command in the shell, waits for it to complete,
        then returns the output
    getstatusoutput(...): Runs a command in the shell, waits for it to complete,
        then returns a (exitcode, output) tuple

CLASSES
    builtins.Exception(builtins.BaseException)
        SubprocessError
            CalledProcessError
            TimeoutExpired
    builtins.object
        CompletedProcess
        Popen
        STARTUPINFO

    class CalledProcessError(SubprocessError)
     |  CalledProcessError(returncode, cmd, output=None, stderr=None)
     |
     |  Raised when run() is called with check=True and the process
     |  returns a non-zero exit status.
     |
     |  Attributes:
     |    cmd, returncode, stdout, stderr, output
     |
     |  Method resolution order:
     |      CalledProcessError
     |      SubprocessError
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, returncode, cmd, output=None, stderr=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  stdout
     |      Alias for output attribute, to match stderr
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubprocessError:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class CompletedProcess(builtins.object)
     |  CompletedProcess(args, returncode, stdout=None, stderr=None)
     |
     |  A process that has finished running.
     |
     |  This is returned by run().
     |
     |  Attributes:
     |    args: The list or str args passed to run().
     |    returncode: The exit code of the process, negative for signals.
     |    stdout: The standard output (None if not captured).
     |    stderr: The standard error (None if not captured).
     |
     |  Methods defined here:
     |
     |  __init__(self, args, returncode, stdout=None, stderr=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  check_returncode(self)
     |      Raise CalledProcessError if the exit code is non-zero.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__ = GenericAlias(...)
     |      Represent a PEP 585 generic type
     |
     |      E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Popen(builtins.object)
     |  Popen(args, bufsize=-1, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=True, shell=False, cwd=None, env=None, universal_newlines=None, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=(), *, user=None, group=None, extra_groups=None, encoding=None, errors=None, text=None, umask=-1, pipesize=-1, process_group=None)
     |
     |  Execute a child program in a new process.
     |
     |  For a complete description of the arguments see the Python documentation.
     |
     |  Arguments:
     |    args: A string, or a sequence of program arguments.
     |
     |    bufsize: supplied as the buffering argument to the open() function when
     |        creating the stdin/stdout/stderr pipe file objects
     |
     |    executable: A replacement program to execute.
     |
     |    stdin, stdout and stderr: These specify the executed programs' standard
     |        input, standard output and standard error file handles, respectively.
     |
     |    preexec_fn: (POSIX only) An object to be called in the child process
     |        just before the child is executed.
     |
     |    close_fds: Controls closing or inheriting of file descriptors.
     |
     |    shell: If true, the command will be executed through the shell.
     |
     |    cwd: Sets the current directory before the child is executed.
     |
     |    env: Defines the environment variables for the new process.
     |
     |    text: If true, decode stdin, stdout and stderr using the given encoding
     |        (if set) or the system default otherwise.
     |
     |    universal_newlines: Alias of text, provided for backwards compatibility.
     |
     |    startupinfo and creationflags (Windows only)
     |
     |    restore_signals (POSIX only)
     |
     |    start_new_session (POSIX only)
     |
     |    process_group (POSIX only)
     |
     |    group (POSIX only)
     |
     |    extra_groups (POSIX only)
     |
     |    user (POSIX only)
     |
     |    umask (POSIX only)
     |
     |    pass_fds (POSIX only)
     |
     |    encoding and errors: Text mode encoding and error handling to use for
     |        file objects stdin, stdout and stderr.
     |
     |  Attributes:
     |      stdin, stdout, stderr, pid, returncode
     |
     |  Methods defined here:
     |
     |  __del__(self, _maxsize=9223372036854775807, _warn=<built-in function warn>)
     |
     |  __enter__(self)
     |
     |  __exit__(self, exc_type, value, traceback)
     |
     |  __init__(self, args, bufsize=-1, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=True, shell=False, cwd=None, env=None, universal_newlines=None, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=(), *, user=None, group=None, extra_groups=None, encoding=None, errors=None, text=None, umask=-1, pipesize=-1, process_group=None)
     |      Create new Popen instance.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  communicate(self, input=None, timeout=None)
     |      Interact with process: Send data to stdin and close it.
     |      Read data from stdout and stderr, until end-of-file is
     |      reached.  Wait for process to terminate.
     |
     |      The optional "input" argument should be data to be sent to the
     |      child process, or None, if no data should be sent to the child.
     |      communicate() returns a tuple (stdout, stderr).
     |
     |      By default, all communication is in bytes, and therefore any
     |      "input" should be bytes, and the (stdout, stderr) will be bytes.
     |      If in text mode (indicated by self.text_mode), any "input" should
     |      be a string, and (stdout, stderr) will be strings decoded
     |      according to locale encoding, or by "encoding" if set. Text mode
     |      is triggered by setting any of text, encoding, errors or
     |      universal_newlines.
     |
     |  kill = terminate(self)
     |
     |  poll(self)
     |      Check if child process has terminated. Set and return returncode
     |      attribute.
     |
     |  send_signal(self, sig)
     |      Send a signal to the process.
     |
     |  terminate(self)
     |      Terminates the process.
     |
     |  wait(self, timeout=None)
     |      Wait for child process to terminate; returns self.returncode.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__ = GenericAlias(...)
     |      Represent a PEP 585 generic type
     |
     |      E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  universal_newlines

    class STARTUPINFO(builtins.object)
     |  STARTUPINFO(*, dwFlags=0, hStdInput=None, hStdOutput=None, hStdError=None, wShowWindow=0, lpAttributeList=None)
     |
     |  Methods defined here:
     |
     |  __init__(self, *, dwFlags=0, hStdInput=None, hStdOutput=None, hStdError=None, wShowWindow=0, lpAttributeList=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  copy(self)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class SubprocessError(builtins.Exception)
     |  # Exception classes used by this module.
     |
     |  Method resolution order:
     |      SubprocessError
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class TimeoutExpired(SubprocessError)
     |  TimeoutExpired(cmd, timeout, output=None, stderr=None)
     |
     |  This exception is raised when the timeout expires while waiting for a
     |  child process.
     |
     |  Attributes:
     |      cmd, output, stdout, stderr, timeout
     |
     |  Method resolution order:
     |      TimeoutExpired
     |      SubprocessError
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, cmd, timeout, output=None, stderr=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  stdout
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from SubprocessError:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

FUNCTIONS
    call(*popenargs, timeout=None, **kwargs)
        Run command with arguments.  Wait for command to complete or
        timeout, then return the returncode attribute.

        The arguments are the same as for the Popen constructor.  Example:

        retcode = call(["ls", "-l"])

    check_call(*popenargs, **kwargs)
        Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.

        The arguments are the same as for the call function.  Example:

        check_call(["ls", "-l"])

    check_output(*popenargs, timeout=None, **kwargs)
        Run command with arguments and return its output.

        If the exit code was non-zero it raises a CalledProcessError.  The
        CalledProcessError object will have the return code in the returncode
        attribute and output in the output attribute.

        The arguments are the same as for the Popen constructor.  Example:

        >>> check_output(["ls", "-l", "/dev/null"])
        b'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

        The stdout argument is not allowed as it is used internally.
        To capture standard error in the result, use stderr=STDOUT.

        >>> check_output(["/bin/sh", "-c",
        ...               "ls -l non_existent_file ; exit 0"],
        ...              stderr=STDOUT)
        b'ls: non_existent_file: No such file or directory\n'

        There is an additional optional argument, "input", allowing you to
        pass a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it too will be used internally.  Example:

        >>> check_output(["sed", "-e", "s/foo/bar/"],
        ...              input=b"when in the course of fooman events\n")
        b'when in the course of barman events\n'

        By default, all communication is in bytes, and therefore any "input"
        should be bytes, and the return value will be bytes.  If in text mode,
        any "input" should be a string, and the return value will be a string
        decoded according to locale encoding, or by "encoding" if set. Text mode
        is triggered by setting any of text, encoding, errors or universal_newlines.

    getoutput(cmd, *, encoding=None, errors=None)
        Return output (stdout or stderr) of executing cmd in a shell.

        Like getstatusoutput(), except the exit status is ignored and the return
        value is a string containing the command's output.  Example:

        >>> import subprocess
        >>> subprocess.getoutput('ls /bin/ls')
        '/bin/ls'

    getstatusoutput(cmd, *, encoding=None, errors=None)
        Return (exitcode, output) of executing cmd in a shell.

        Execute the string 'cmd' in a shell with 'check_output' and
        return a 2-tuple (status, output). The locale encoding is used
        to decode the output and process newlines.

        A trailing newline is stripped from the output.
        The exit status for the command can be interpreted
        according to the rules for the function 'wait'. Example:

        >>> import subprocess
        >>> subprocess.getstatusoutput('ls /bin/ls')
        (0, '/bin/ls')
        >>> subprocess.getstatusoutput('cat /bin/junk')
        (1, 'cat: /bin/junk: No such file or directory')
        >>> subprocess.getstatusoutput('/bin/junk')
        (127, 'sh: /bin/junk: not found')
        >>> subprocess.getstatusoutput('/bin/kill $$')
        (-15, '')

    run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs)
        Run command with arguments and return a CompletedProcess instance.

        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.

        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.

        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.

        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.

        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.

        The other arguments are the same as for the Popen constructor.

DATA
    ABOVE_NORMAL_PRIORITY_CLASS = 32768
    BELOW_NORMAL_PRIORITY_CLASS = 16384
    CREATE_BREAKAWAY_FROM_JOB = 16777216
    CREATE_DEFAULT_ERROR_MODE = 67108864
    CREATE_NEW_CONSOLE = 16
    CREATE_NEW_PROCESS_GROUP = 512
    CREATE_NO_WINDOW = 134217728
    DETACHED_PROCESS = 8
    DEVNULL = -3
    HIGH_PRIORITY_CLASS = 128
    IDLE_PRIORITY_CLASS = 64
    NORMAL_PRIORITY_CLASS = 32
    PIPE = -1
    REALTIME_PRIORITY_CLASS = 256
    STARTF_USESHOWWINDOW = 1
    STARTF_USESTDHANDLES = 256
    STDOUT = -2
    STD_ERROR_HANDLE = 4294967284
    STD_INPUT_HANDLE = 4294967286
    STD_OUTPUT_HANDLE = 4294967285
    SW_HIDE = 0
    __all__ = ['Popen', 'PIPE', 'STDOUT', 'call', 'check_call', 'getstatus...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\subprocess.py

nltk.subsumes
Python Library Documentation: function subsumes in module nltk.featstruct

subsumes(fstruct1, fstruct2)
    Return True if ``fstruct1`` subsumes ``fstruct2``.  I.e., return
    true if unifying ``fstruct1`` with ``fstruct2`` would result in a
    feature structure equal to ``fstruct2.``

    :rtype: bool
nltk.sum_logs
Python Library Documentation: function sum_logs in module nltk.probability

sum_logs(logs)
nltk.tableau
Python Library Documentation: module nltk.inference.tableau in nltk.inference

NAME
    nltk.inference.tableau - Module for a tableau-based First Order theorem prover.

CLASSES
    builtins.Exception(builtins.BaseException)
        ProverParseError
    builtins.object
        Agenda
        Categories
        Debug
    nltk.inference.api.BaseProverCommand(nltk.inference.api.BaseTheoremToolCommand, nltk.inference.api.ProverCommand)
        TableauProverCommand
    nltk.inference.api.Prover(builtins.object)
        TableauProver

    class Agenda(builtins.object)
     |  Methods defined here:
     |
     |  __getitem__(self, index)
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  clone(self)
     |
     |  mark_alls_fresh(self)
     |
     |  mark_neqs_fresh(self)
     |
     |  pop_first(self)
     |      Pop the first expression that appears in the agenda
     |
     |  put(self, expression, context=None)
     |
     |  put_all(self, expressions)
     |
     |  put_atoms(self, atoms)
     |
     |  replace_all(self, old, new)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Categories(builtins.object)
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  ALL = 20
     |
     |  AND = 10
     |
     |  APP = 4
     |
     |  ATOM = 0
     |
     |  D_NEG = 7
     |
     |  EQ = 18
     |
     |  EXISTS = 19
     |
     |  IFF = 16
     |
     |  IMP = 14
     |
     |  N_ALL = 8
     |
     |  N_AND = 15
     |
     |  N_APP = 5
     |
     |  N_ATOM = 2
     |
     |  N_EQ = 6
     |
     |  N_EXISTS = 9
     |
     |  N_IFF = 17
     |
     |  N_IMP = 12
     |
     |  N_OR = 11
     |
     |  N_PROP = 3
     |
     |  OR = 13
     |
     |  PROP = 1

    class Debug(builtins.object)
     |  Debug(verbose, indent=0, lines=None)
     |
     |  Methods defined here:
     |
     |  __add__(self, increment)
     |
     |  __init__(self, verbose, indent=0, lines=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  line(self, data, indent=0)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ProverParseError(builtins.Exception)
     |  Method resolution order:
     |      ProverParseError
     |      builtins.Exception
     |      builtins.BaseException
     |      builtins.object
     |
     |  Data descriptors defined here:
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.Exception:
     |
     |  __init__(self, /, *args, **kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.Exception:
     |
     |  __new__(*args, **kwargs) class method of builtins.Exception
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.BaseException:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __reduce__(...)
     |      Helper for pickle.
     |
     |  __repr__(self, /)
     |      Return repr(self).
     |
     |  __setstate__(...)
     |
     |  __str__(self, /)
     |      Return str(self).
     |
     |  add_note(...)
     |      Exception.add_note(note) --
     |      add a note to the exception
     |
     |  with_traceback(...)
     |      Exception.with_traceback(tb) --
     |      set self.__traceback__ to tb and return self.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from builtins.BaseException:
     |
     |  __cause__
     |      exception cause
     |
     |  __context__
     |      exception context
     |
     |  __dict__
     |
     |  __suppress_context__
     |
     |  __traceback__
     |
     |  args

    class TableauProver(nltk.inference.api.Prover)
     |  Method resolution order:
     |      TableauProver
     |      nltk.inference.api.Prover
     |      builtins.object
     |
     |  Static methods defined here:
     |
     |  is_atom(e)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  MAX_TABLEAU_DEPTH = 200
     |
     |  TIMEOUT = 60
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.Prover:
     |
     |  prove(self, goal=None, assumptions=None, verbose=False)
     |      :return: Whether the proof was successful or not.
     |      :rtype: bool
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.inference.api.Prover:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TableauProverCommand(nltk.inference.api.BaseProverCommand)
     |  TableauProverCommand(goal=None, assumptions=None, prover=None)
     |
     |  Method resolution order:
     |      TableauProverCommand
     |      nltk.inference.api.BaseProverCommand
     |      nltk.inference.api.BaseTheoremToolCommand
     |      nltk.inference.api.ProverCommand
     |      nltk.inference.api.TheoremToolCommand
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, goal=None, assumptions=None, prover=None)
     |      :param goal: Input expression to prove
     |      :type goal: sem.Expression
     |      :param assumptions: Input expressions to use as assumptions in
     |          the proof.
     |      :type assumptions: list(sem.Expression)
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.BaseProverCommand:
     |
     |  decorate_proof(self, proof_string, simplify=True)
     |      Modify and return the proof string
     |      :param proof_string: str the proof to decorate
     |      :param simplify: bool simplify the proof?
     |      :return: str
     |
     |  get_prover(self)
     |      Return the prover object
     |      :return: ``Prover``
     |
     |  proof(self, simplify=True)
     |      Return the proof string
     |      :param simplify: bool simplify the proof?
     |      :return: str
     |
     |  prove(self, verbose=False)
     |      Perform the actual proof.  Store the result to prevent unnecessary
     |      re-proving.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.inference.api.BaseTheoremToolCommand:
     |
     |  add_assumptions(self, new_assumptions)
     |      Add new assumptions to the assumption list.
     |
     |      :param new_assumptions: new assumptions
     |      :type new_assumptions: list(sem.Expression)
     |
     |  assumptions(self)
     |      List the current assumptions.
     |
     |      :return: list of ``Expression``
     |
     |  goal(self)
     |      Return the goal
     |
     |      :return: ``Expression``
     |
     |  print_assumptions(self)
     |      Print the list of the current assumptions.
     |
     |  retract_assumptions(self, retracted, debug=False)
     |      Retract assumptions from the assumption list.
     |
     |      :param debug: If True, give warning when ``retracted`` is not present on
     |          assumptions list.
     |      :type debug: bool
     |      :param retracted: assumptions to be retracted
     |      :type retracted: list(sem.Expression)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.inference.api.TheoremToolCommand:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()

    tableau_test(c, ps=None, verbose=False)

    testHigherOrderTableauProver()

    testTableauProver()

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\inference\tableau.py

nltk.tadm
Python Library Documentation: module nltk.classify.tadm in nltk.classify

NAME
    nltk.classify.tadm

DESCRIPTION
    # Natural Language Toolkit: Interface to TADM Classifier
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Joseph Frazee <jfrazee@mail.utexas.edu>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

FUNCTIONS
    call_tadm(args)
        Call the ``tadm`` binary with the given arguments.

    config_tadm(bin=None)

    encoding_demo()

    names_demo()

    parse_tadm_weights(paramfile)
        Given the stdout output generated by ``tadm`` when training a
        model, return a ``numpy`` array containing the corresponding weight
        vector.

    write_tadm_file(train_toks, encoding, stream)
        Generate an input file for ``tadm`` based on the given corpus of
        classified tokens.

        :type train_toks: list(tuple(dict, str))
        :param train_toks: Training data, represented as a list of
            pairs, the first member of which is a feature dictionary,
            and the second of which is a classification label.
        :type encoding: TadmEventMaxentFeatureEncoding
        :param encoding: A feature encoding, used to convert featuresets
            into feature vectors.
        :type stream: stream
        :param stream: The stream to which the ``tadm`` input file should be
            written.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\tadm.py

nltk.tag
Python Library Documentation: package nltk.tag in nltk

NAME
    nltk.tag - NLTK Taggers

DESCRIPTION
    This package contains classes and interfaces for part-of-speech
    tagging, or simply "tagging".

    A "tag" is a case-sensitive string that specifies some property of a token,
    such as its part of speech.  Tagged tokens are encoded as tuples
    ``(tag, token)``.  For example, the following tagged token combines
    the word ``'fly'`` with a noun part of speech tag (``'NN'``):

        >>> tagged_tok = ('fly', 'NN')

    An off-the-shelf tagger is available for English. It uses the Penn Treebank tagset:

        >>> from nltk import pos_tag, word_tokenize
        >>> pos_tag(word_tokenize("John's big idea isn't all that bad.")) # doctest: +NORMALIZE_WHITESPACE
        [('John', 'NNP'), ("'s", 'POS'), ('big', 'JJ'), ('idea', 'NN'), ('is', 'VBZ'),
        ("n't", 'RB'), ('all', 'PDT'), ('that', 'DT'), ('bad', 'JJ'), ('.', '.')]

    A Russian tagger is also available if you specify lang="rus". It uses
    the Russian National Corpus tagset:

        >>> pos_tag(word_tokenize("Илья оторопел и дважды перечитал бумажку."), lang='rus')    # doctest: +SKIP
        [('Илья', 'S'), ('оторопел', 'V'), ('и', 'CONJ'), ('дважды', 'ADV'), ('перечитал', 'V'),
        ('бумажку', 'S'), ('.', 'NONLEX')]

    This package defines several taggers, which take a list of tokens,
    assign a tag to each one, and return the resulting list of tagged tokens.
    Most of the taggers are built automatically based on a training corpus.
    For example, the unigram tagger tags each word *w* by checking what
    the most frequent tag for *w* was in a training corpus:

        >>> from nltk.corpus import brown
        >>> from nltk.tag import UnigramTagger
        >>> tagger = UnigramTagger(brown.tagged_sents(categories='news')[:500])
        >>> sent = ['Mitchell', 'decried', 'the', 'high', 'rate', 'of', 'unemployment']
        >>> for word, tag in tagger.tag(sent):
        ...     print(word, '->', tag)
        Mitchell -> NP
        decried -> None
        the -> AT
        high -> JJ
        rate -> NN
        of -> IN
        unemployment -> None

    Note that words that the tagger has not seen during training receive a tag
    of ``None``.

    We evaluate a tagger on data that was not seen during training:

        >>> round(tagger.accuracy(brown.tagged_sents(categories='news')[500:600]), 3)
        0.735

    For more information, please consult chapter 5 of the NLTK Book.

    isort:skip_file

PACKAGE CONTENTS
    api
    brill
    brill_trainer
    crf
    hmm
    hunpos
    mapping
    perceptron
    senna
    sequential
    stanford
    tnt
    util

FUNCTIONS
    pos_tag(tokens, tagset=None, lang='eng')
        Use NLTK's currently recommended part of speech tagger to
        tag the given list of tokens.

            >>> from nltk.tag import pos_tag
            >>> from nltk.tokenize import word_tokenize
            >>> pos_tag(word_tokenize("John's big idea isn't all that bad.")) # doctest: +NORMALIZE_WHITESPACE
            [('John', 'NNP'), ("'s", 'POS'), ('big', 'JJ'), ('idea', 'NN'), ('is', 'VBZ'),
            ("n't", 'RB'), ('all', 'PDT'), ('that', 'DT'), ('bad', 'JJ'), ('.', '.')]
            >>> pos_tag(word_tokenize("John's big idea isn't all that bad."), tagset='universal') # doctest: +NORMALIZE_WHITESPACE
            [('John', 'NOUN'), ("'s", 'PRT'), ('big', 'ADJ'), ('idea', 'NOUN'), ('is', 'VERB'),
            ("n't", 'ADV'), ('all', 'DET'), ('that', 'DET'), ('bad', 'ADJ'), ('.', '.')]

        NB. Use `pos_tag_sents()` for efficient tagging of more than one sentence.

        :param tokens: Sequence of tokens to be tagged
        :type tokens: list(str)
        :param tagset: the tagset to be used, e.g. universal, wsj, brown
        :type tagset: str
        :param lang: the ISO 639 code of the language, e.g. 'eng' for English, 'rus' for Russian
        :type lang: str
        :return: The tagged tokens
        :rtype: list(tuple(str, str))

    pos_tag_sents(sentences, tagset=None, lang='eng')
        Use NLTK's currently recommended part of speech tagger to tag the
        given list of sentences, each consisting of a list of tokens.

        :param sentences: List of sentences to be tagged
        :type sentences: list(list(str))
        :param tagset: the tagset to be used, e.g. universal, wsj, brown
        :type tagset: str
        :param lang: the ISO 639 code of the language, e.g. 'eng' for English, 'rus' for Russian
        :type lang: str
        :return: The list of tagged sentences
        :rtype: list(list(tuple(str, str)))

DATA
    PRETRAINED_TAGGERS = {'eng': 'taggers/averaged_perceptron_tagger_eng/'...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\__init__.py

nltk.tagset_mapping
Python Library Documentation: function tagset_mapping in module nltk.tag.mapping

tagset_mapping(source, target)
    Retrieve the mapping dictionary between tagsets.

    >>> tagset_mapping('ru-rnc', 'universal') == {'!': '.', 'A': 'ADJ', 'C': 'CONJ', 'AD': 'ADV',            'NN': 'NOUN', 'VG': 'VERB', 'COMP': 'CONJ', 'NC': 'NUM', 'VP': 'VERB', 'P': 'ADP',            'IJ': 'X', 'V': 'VERB', 'Z': 'X', 'VI': 'VERB', 'YES_NO_SENT': 'X', 'PTCL': 'PRT'}
    True
nltk.tagstr2tree
Python Library Documentation: function tagstr2tree in module nltk.chunk.util

tagstr2tree(s, chunk_label='NP', root_label='S', sep='/', source_tagset=None, target_tagset=None)
    Divide a string of bracketted tagged text into
    chunks and unchunked tokens, and produce a Tree.
    Chunks are marked by square brackets (``[...]``).  Words are
    delimited by whitespace, and each word should have the form
    ``text/tag``.  Words that do not contain a slash are
    assigned a ``tag`` of None.

    :param s: The string to be converted
    :type s: str
    :param chunk_label: The label to use for chunk nodes
    :type chunk_label: str
    :param root_label: The label to use for the root of the tree
    :type root_label: str
    :rtype: Tree
nltk.tbl
Python Library Documentation: package nltk.tbl in nltk

NAME
    nltk.tbl - Transformation Based Learning

DESCRIPTION
    A general purpose package for Transformation Based Learning,
    currently used by nltk.tag.BrillTagger.

    isort:skip_file

PACKAGE CONTENTS
    api
    demo
    erroranalysis
    feature
    rule
    template

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tbl\__init__.py

nltk.tee
Python Library Documentation: built-in function tee in module itertools

tee(iterable, n=2, /)
    Returns a tuple of n independent iterators.
nltk.text
Python Library Documentation: module nltk.text in nltk

NAME
    nltk.text

DESCRIPTION
    This module brings together a variety of NLTK functionality for
    text analysis, and provides simple, interactive interfaces.
    Functionality includes: concordancing, collocation discovery,
    regular expression search over tokenized strings, and
    distributional similarity.

CLASSES
    builtins.object
        ConcordanceIndex
        ContextIndex
        Text
            TextCollection
        TokenSearcher

    class ConcordanceIndex(builtins.object)
     |  ConcordanceIndex(tokens, key=<function ConcordanceIndex.<lambda> at 0x0000028F96303E20>)
     |
     |  An index that can be used to look up the offset locations at which
     |  a given word occurs in a document.
     |
     |  Methods defined here:
     |
     |  __init__(self, tokens, key=<function ConcordanceIndex.<lambda> at 0x0000028F96303E20>)
     |      Construct a new concordance index.
     |
     |      :param tokens: The document (list of tokens) that this
     |          concordance index was created from.  This list can be used
     |          to access the context of a given word occurrence.
     |      :param key: A function that maps each token to a normalized
     |          version that will be used as a key in the index.  E.g., if
     |          you use ``key=lambda s:s.lower()``, then the index will be
     |          case-insensitive.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  find_concordance(self, word, width=80)
     |      Find all concordance lines given the query word.
     |
     |      Provided with a list of words, these will be found as a phrase.
     |
     |  offsets(self, word)
     |      :rtype: list(int)
     |      :return: A list of the offset positions at which the given
     |          word occurs.  If a key function was specified for the
     |          index, then given word's key will be looked up.
     |
     |  print_concordance(self, word, width=80, lines=25)
     |      Print concordance lines given the query word.
     |      :param word: The target word or phrase (a list of strings)
     |      :type word: str or list
     |      :param lines: The number of lines to display (default=25)
     |      :type lines: int
     |      :param width: The width of each line, in characters (default=80)
     |      :type width: int
     |      :param save: The option to save the concordance.
     |      :type save: bool
     |
     |  tokens(self)
     |      :rtype: list(str)
     |      :return: The document that this concordance index was
     |          created from.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class ContextIndex(builtins.object)
     |  ContextIndex(tokens, context_func=None, filter=None, key=<function ContextIndex.<lambda> at 0x0000028F96303A60>)
     |
     |  A bidirectional index between words and their 'contexts' in a text.
     |  The context of a word is usually defined to be the words that occur
     |  in a fixed window around the word; but other definitions may also
     |  be used by providing a custom context function.
     |
     |  Methods defined here:
     |
     |  __init__(self, tokens, context_func=None, filter=None, key=<function ContextIndex.<lambda> at 0x0000028F96303A60>)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  common_contexts(self, words, fail_on_unknown=False)
     |      Find contexts where the specified words can all appear; and
     |      return a frequency distribution mapping each context to the
     |      number of times that context was used.
     |
     |      :param words: The words used to seed the similarity search
     |      :type words: str
     |      :param fail_on_unknown: If true, then raise a value error if
     |          any of the given words do not occur at all in the index.
     |
     |  similar_words(self, word, n=20)
     |
     |  tokens(self)
     |      :rtype: list(str)
     |      :return: The document that this context index was
     |          created from.
     |
     |  word_similarity_dict(self, word)
     |      Return a dictionary mapping from words to 'similarity scores,'
     |      indicating how often these two words occur in the same
     |      context.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Text(builtins.object)
     |  Text(tokens, name=None)
     |
     |  A wrapper around a sequence of simple (string) tokens, which is
     |  intended to support initial exploration of texts (via the
     |  interactive console).  Its methods perform a variety of analyses
     |  on the text's contexts (e.g., counting, concordancing, collocation
     |  discovery), and display the results.  If you wish to write a
     |  program which makes use of these analyses, then you should bypass
     |  the ``Text`` class, and use the appropriate analysis function or
     |  class directly instead.
     |
     |  A ``Text`` is typically initialized from a given document or
     |  corpus.  E.g.:
     |
     |  >>> import nltk.corpus
     |  >>> from nltk.text import Text
     |  >>> moby = Text(nltk.corpus.gutenberg.words('melville-moby_dick.txt'))
     |
     |  Methods defined here:
     |
     |  __getitem__(self, i)
     |
     |  __init__(self, tokens, name=None)
     |      Create a Text object.
     |
     |      :param tokens: The source text.
     |      :type tokens: sequence of str
     |
     |  __len__(self)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  collocation_list(self, num=20, window_size=2)
     |      Return collocations derived from the text, ignoring stopwords.
     |
     |          >>> from nltk.book import text4
     |          >>> text4.collocation_list()[:2]
     |          [('United', 'States'), ('fellow', 'citizens')]
     |
     |      :param num: The maximum number of collocations to return.
     |      :type num: int
     |      :param window_size: The number of tokens spanned by a collocation (default=2)
     |      :type window_size: int
     |      :rtype: list(tuple(str, str))
     |
     |  collocations(self, num=20, window_size=2)
     |      Print collocations derived from the text, ignoring stopwords.
     |
     |          >>> from nltk.book import text4
     |          >>> text4.collocations() # doctest: +NORMALIZE_WHITESPACE
     |          United States; fellow citizens; years ago; four years; Federal
     |          Government; General Government; Vice President; American people; God
     |          bless; Chief Justice; one another; fellow Americans; Old World;
     |          Almighty God; Fellow citizens; Chief Magistrate; every citizen; Indian
     |          tribes; public debt; foreign nations
     |
     |
     |      :param num: The maximum number of collocations to print.
     |      :type num: int
     |      :param window_size: The number of tokens spanned by a collocation (default=2)
     |      :type window_size: int
     |
     |  common_contexts(self, words, num=20)
     |      Find contexts where the specified words appear; list
     |      most frequent common contexts first.
     |
     |      :param words: The words used to seed the similarity search
     |      :type words: str
     |      :param num: The number of words to generate (default=20)
     |      :type num: int
     |      :seealso: ContextIndex.common_contexts()
     |
     |  concordance(self, word, width=79, lines=25)
     |      Prints a concordance for ``word`` with the specified context window.
     |      Word matching is not case-sensitive.
     |
     |      :param word: The target word or phrase (a list of strings)
     |      :type word: str or list
     |      :param width: The width of each line, in characters (default=80)
     |      :type width: int
     |      :param lines: The number of lines to display (default=25)
     |      :type lines: int
     |
     |      :seealso: ``ConcordanceIndex``
     |
     |  concordance_list(self, word, width=79, lines=25)
     |      Generate a concordance for ``word`` with the specified context window.
     |      Word matching is not case-sensitive.
     |
     |      :param word: The target word or phrase (a list of strings)
     |      :type word: str or list
     |      :param width: The width of each line, in characters (default=80)
     |      :type width: int
     |      :param lines: The number of lines to display (default=25)
     |      :type lines: int
     |
     |      :seealso: ``ConcordanceIndex``
     |
     |  count(self, word)
     |      Count the number of times this word appears in the text.
     |
     |  dispersion_plot(self, words)
     |      Produce a plot showing the distribution of the words through the text.
     |      Requires pylab to be installed.
     |
     |      :param words: The words to be plotted
     |      :type words: list(str)
     |      :seealso: nltk.draw.dispersion_plot()
     |
     |  findall(self, regexp, timeout=<object object at 0x0000028F95A7E840>)
     |      Find instances of the regular expression in the text.
     |      The text is a list of tokens, and a regexp pattern to match
     |      a single token must be surrounded by angle brackets.  E.g.
     |
     |      >>> from nltk.book import text1, text5, text9
     |      >>> text5.findall("<.*><.*><bro>")
     |      you rule bro; telling you bro; u twizted bro
     |      >>> text1.findall("<a>(<.*>)<man>")
     |      monied; nervous; dangerous; white; white; white; pious; queer; good;
     |      mature; white; Cape; great; wise; wise; butterless; white; fiendish;
     |      pale; furious; better; certain; complete; dismasted; younger; brave;
     |      brave; brave; brave
     |      >>> text9.findall("<th.*>{3,}")
     |      thread through those; the thought that; that the thing; the thing
     |      that; that that thing; through these than through; them that the;
     |      through the thick; them that they; thought that the
     |
     |      :param regexp: A regular expression
     |      :type regexp: str
     |      :param timeout: wall-clock limit, in seconds, for the search; ``None``
     |          disables it. Defaults to ``TOKENSEARCH_TIMEOUT``.
     |      :type timeout: float or None
     |
     |  generate(self, length=100, text_seed=None, random_seed=42)
     |      Print random text, generated using a trigram language model.
     |      See also `help(nltk.lm)`.
     |
     |      :param length: The length of text to generate (default=100)
     |      :type length: int
     |
     |      :param text_seed: Generation can be conditioned on preceding context.
     |      :type text_seed: list(str)
     |
     |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
     |          makes the random sampling part of generation reproducible. (default=42)
     |      :type random_seed: int
     |
     |  index(self, word)
     |      Find the index of the first occurrence of the word in the text.
     |
     |  plot(self, *args)
     |      See documentation for FreqDist.plot()
     |      :seealso: nltk.prob.FreqDist.plot()
     |
     |  readability(self, method)
     |
     |  similar(self, word, num=20)
     |      Distributional similarity: find other words which appear in the
     |      same contexts as the specified word; list most similar words first.
     |
     |      :param word: The word used to seed the similarity search
     |      :type word: str
     |      :param num: The number of words to generate (default=20)
     |      :type num: int
     |      :seealso: ContextIndex.similar_words()
     |
     |  vocab(self)
     |      :seealso: nltk.prob.FreqDist
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TextCollection(Text)
     |  TextCollection(source)
     |
     |  A collection of texts, which can be loaded with list of texts, or
     |  with a corpus consisting of one or more texts, and which supports
     |  counting, concordancing, collocation discovery, etc.  Initialize a
     |  TextCollection as follows:
     |
     |  >>> import nltk.corpus
     |  >>> from nltk.text import TextCollection
     |  >>> from nltk.book import text1, text2, text3
     |  >>> gutenberg = TextCollection(nltk.corpus.gutenberg)
     |  >>> mytexts = TextCollection([text1, text2, text3])
     |
     |  Iterating over a TextCollection produces all the tokens of all the
     |  texts in order.
     |
     |  Method resolution order:
     |      TextCollection
     |      Text
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, source)
     |      Create a Text object.
     |
     |      :param tokens: The source text.
     |      :type tokens: sequence of str
     |
     |  idf(self, term)
     |      The number of texts in the corpus divided by the
     |      number of texts that the term appears in.
     |      If a term does not appear in the corpus, 0.0 is returned.
     |
     |  tf(self, term, text)
     |      The frequency of the term in text.
     |
     |  tf_idf(self, term, text)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from Text:
     |
     |  __getitem__(self, i)
     |
     |  __len__(self)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  collocation_list(self, num=20, window_size=2)
     |      Return collocations derived from the text, ignoring stopwords.
     |
     |          >>> from nltk.book import text4
     |          >>> text4.collocation_list()[:2]
     |          [('United', 'States'), ('fellow', 'citizens')]
     |
     |      :param num: The maximum number of collocations to return.
     |      :type num: int
     |      :param window_size: The number of tokens spanned by a collocation (default=2)
     |      :type window_size: int
     |      :rtype: list(tuple(str, str))
     |
     |  collocations(self, num=20, window_size=2)
     |      Print collocations derived from the text, ignoring stopwords.
     |
     |          >>> from nltk.book import text4
     |          >>> text4.collocations() # doctest: +NORMALIZE_WHITESPACE
     |          United States; fellow citizens; years ago; four years; Federal
     |          Government; General Government; Vice President; American people; God
     |          bless; Chief Justice; one another; fellow Americans; Old World;
     |          Almighty God; Fellow citizens; Chief Magistrate; every citizen; Indian
     |          tribes; public debt; foreign nations
     |
     |
     |      :param num: The maximum number of collocations to print.
     |      :type num: int
     |      :param window_size: The number of tokens spanned by a collocation (default=2)
     |      :type window_size: int
     |
     |  common_contexts(self, words, num=20)
     |      Find contexts where the specified words appear; list
     |      most frequent common contexts first.
     |
     |      :param words: The words used to seed the similarity search
     |      :type words: str
     |      :param num: The number of words to generate (default=20)
     |      :type num: int
     |      :seealso: ContextIndex.common_contexts()
     |
     |  concordance(self, word, width=79, lines=25)
     |      Prints a concordance for ``word`` with the specified context window.
     |      Word matching is not case-sensitive.
     |
     |      :param word: The target word or phrase (a list of strings)
     |      :type word: str or list
     |      :param width: The width of each line, in characters (default=80)
     |      :type width: int
     |      :param lines: The number of lines to display (default=25)
     |      :type lines: int
     |
     |      :seealso: ``ConcordanceIndex``
     |
     |  concordance_list(self, word, width=79, lines=25)
     |      Generate a concordance for ``word`` with the specified context window.
     |      Word matching is not case-sensitive.
     |
     |      :param word: The target word or phrase (a list of strings)
     |      :type word: str or list
     |      :param width: The width of each line, in characters (default=80)
     |      :type width: int
     |      :param lines: The number of lines to display (default=25)
     |      :type lines: int
     |
     |      :seealso: ``ConcordanceIndex``
     |
     |  count(self, word)
     |      Count the number of times this word appears in the text.
     |
     |  dispersion_plot(self, words)
     |      Produce a plot showing the distribution of the words through the text.
     |      Requires pylab to be installed.
     |
     |      :param words: The words to be plotted
     |      :type words: list(str)
     |      :seealso: nltk.draw.dispersion_plot()
     |
     |  findall(self, regexp, timeout=<object object at 0x0000028F95A7E840>)
     |      Find instances of the regular expression in the text.
     |      The text is a list of tokens, and a regexp pattern to match
     |      a single token must be surrounded by angle brackets.  E.g.
     |
     |      >>> from nltk.book import text1, text5, text9
     |      >>> text5.findall("<.*><.*><bro>")
     |      you rule bro; telling you bro; u twizted bro
     |      >>> text1.findall("<a>(<.*>)<man>")
     |      monied; nervous; dangerous; white; white; white; pious; queer; good;
     |      mature; white; Cape; great; wise; wise; butterless; white; fiendish;
     |      pale; furious; better; certain; complete; dismasted; younger; brave;
     |      brave; brave; brave
     |      >>> text9.findall("<th.*>{3,}")
     |      thread through those; the thought that; that the thing; the thing
     |      that; that that thing; through these than through; them that the;
     |      through the thick; them that they; thought that the
     |
     |      :param regexp: A regular expression
     |      :type regexp: str
     |      :param timeout: wall-clock limit, in seconds, for the search; ``None``
     |          disables it. Defaults to ``TOKENSEARCH_TIMEOUT``.
     |      :type timeout: float or None
     |
     |  generate(self, length=100, text_seed=None, random_seed=42)
     |      Print random text, generated using a trigram language model.
     |      See also `help(nltk.lm)`.
     |
     |      :param length: The length of text to generate (default=100)
     |      :type length: int
     |
     |      :param text_seed: Generation can be conditioned on preceding context.
     |      :type text_seed: list(str)
     |
     |      :param random_seed: A random seed or an instance of `random.Random`. If provided,
     |          makes the random sampling part of generation reproducible. (default=42)
     |      :type random_seed: int
     |
     |  index(self, word)
     |      Find the index of the first occurrence of the word in the text.
     |
     |  plot(self, *args)
     |      See documentation for FreqDist.plot()
     |      :seealso: nltk.prob.FreqDist.plot()
     |
     |  readability(self, method)
     |
     |  similar(self, word, num=20)
     |      Distributional similarity: find other words which appear in the
     |      same contexts as the specified word; list most similar words first.
     |
     |      :param word: The word used to seed the similarity search
     |      :type word: str
     |      :param num: The number of words to generate (default=20)
     |      :type num: int
     |      :seealso: ContextIndex.similar_words()
     |
     |  vocab(self)
     |      :seealso: nltk.prob.FreqDist
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from Text:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TokenSearcher(builtins.object)
     |  TokenSearcher(tokens)
     |
     |  A class that makes it easier to use regular expressions to search
     |  over tokenized strings.  The tokenized string is converted to a
     |  string where tokens are marked with angle brackets -- e.g.,
     |  ``'<the><window><is><still><open>'``.  The regular expression
     |  passed to the ``findall()`` method is modified to treat angle
     |  brackets as non-capturing parentheses, in addition to matching the
     |  token boundaries; and to have ``'.'`` not match the angle brackets.
     |
     |  Methods defined here:
     |
     |  __init__(self, tokens)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  findall(self, regexp, timeout=<object object at 0x0000028F95A7E840>)
     |      Find instances of the regular expression in the text.
     |      The text is a list of tokens, and a regexp pattern to match
     |      a single token must be surrounded by angle brackets.  E.g.
     |
     |      >>> from nltk.text import TokenSearcher
     |      >>> from nltk.book import text1, text5, text9
     |      >>> text5.findall("<.*><.*><bro>")
     |      you rule bro; telling you bro; u twizted bro
     |      >>> text1.findall("<a>(<.*>)<man>")
     |      monied; nervous; dangerous; white; white; white; pious; queer; good;
     |      mature; white; Cape; great; wise; wise; butterless; white; fiendish;
     |      pale; furious; better; certain; complete; dismasted; younger; brave;
     |      brave; brave; brave
     |      >>> text9.findall("<th.*>{3,}")
     |      thread through those; the thought that; that the thing; the thing
     |      that; that that thing; through these than through; them that the;
     |      through the thick; them that they; thought that the
     |
     |      :param regexp: A regular expression
     |      :type regexp: str
     |      :param timeout: wall-clock limit, in seconds, for the search; ``None``
     |          disables it. Defaults to ``TOKENSEARCH_TIMEOUT``.
     |      :type timeout: float or None
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    __all__ = ['ContextIndex', 'ConcordanceIndex', 'TokenSearcher', 'Text'...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\text.py

nltk.textcat
Python Library Documentation: module nltk.classify.textcat in nltk.classify

NAME
    nltk.classify.textcat

DESCRIPTION
    A module for language identification using the TextCat algorithm.
    An implementation of the text categorization algorithm
    presented in Cavnar, W. B. and J. M. Trenkle,
    "N-Gram-Based Text Categorization".

    The algorithm takes advantage of Zipf's law and uses
    n-gram frequencies to profile languages and text-yet to
    be identified-then compares using a distance measure.

    Language n-grams are provided by the "An Crubadan"
    project. A corpus reader was created separately to read
    those files.

    For details regarding the algorithm, see:
    https://www.let.rug.nl/~vannoord/TextCat/textcat.pdf

    For details about An Crubadan, see:
    https://borel.slu.edu/crubadan/index.html

CLASSES
    builtins.object
        TextCat

    class TextCat(builtins.object)
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  calc_dist(self, lang, trigram, text_profile)
     |      Calculate the "out-of-place" measure between the
     |      text and language profile for a single trigram
     |
     |  guess_language(self, text, return_all=False)
     |      Determines the most likely language(s) for the given text.
     |
     |      Parameters
     |      ----------
     |      text : str
     |          The text whose language is to be identified.
     |      return_all : bool, optional
     |          If False (default), returns a single ISO 639-3 language code as a str,
     |          or None if the language is ambiguous or cannot be determined.
     |          If True, returns a list of all language codes sharing the minimal distance.
     |          The list will have one element if there is a unique best match,
     |          multiple elements for ties, or be empty if no language is found.
     |
     |      Returns
     |      -------
     |      str or None, or list of str
     |          If return_all is False:
     |              - str: language code if unique minimum found
     |              - None: if ambiguous or not classifiable
     |          If return_all is True:
     |              - list: possible language code(s), or empty list if not classifiable
     |
     |      Examples
     |      --------
     |      >>> from nltk.classify.textcat import TextCat
     |      >>> cat = TextCat()
     |      >>> print(cat.guess_language('The quick brown fox jumps over the lazy dog.'))
     |      eng
     |
     |      A case with no information, returns None or an empty list:
     |
     |      >>> print(cat.guess_language('', return_all=True))
     |      []
     |      >>> print(cat.guess_language(''))
     |      None
     |
     |      A case where a single short input ties between Catalan and French:
     |
     |      >>> print(sorted(cat.guess_language('ent', return_all=True)))
     |      ['cat', 'fra']
     |
     |      By default (`return_all=False`), in a tie, guess_language returns None:
     |
     |      >>> print(cat.guess_language('ent'))
     |      None
     |
     |      Note: For short or generic inputs, or for closely related languages,
     |      the classifier may return an unexpected language. For example,
     |      the following is a perfectly grammatical English sentence, but may
     |      be classified as Scots ('sco') due to profile similarity:
     |
     |      >>> print(cat.guess_language('This is a short English sentence.'))
     |      sco
     |
     |      This behavior is not a bug, but an artifact of the underlying n-gram profiles.
     |      The classifier should be used with sufficiently distinctive and longer text fragments
     |      for best accuracy.
     |
     |  lang_dists(self, text)
     |      Calculate the "out-of-place" measure between
     |      the text and all languages
     |
     |  profile(self, text)
     |      Create FreqDist of trigrams within text
     |
     |  remove_punctuation(self, text)
     |      Get rid of punctuation except apostrophes
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  fingerprints = {}
     |
     |  last_distances = {}

FUNCTIONS
    demo()

DATA
    maxsize = 9223372036854775807

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\textcat.py

nltk.texttiling
Python Library Documentation: module nltk.tokenize.texttiling in nltk.tokenize

NAME
    nltk.tokenize.texttiling

DESCRIPTION
    # Natural Language Toolkit: TextTiling
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: George Boutsioukis
    #
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.object
        TokenSequence
        TokenTableField
    nltk.tokenize.api.TokenizerI(abc.ABC)
        TextTilingTokenizer

    class TextTilingTokenizer(nltk.tokenize.api.TokenizerI)
     |  TextTilingTokenizer(w=20, k=10, similarity_method='block_comparison', stopwords=None, smoothing_method=[0], smoothing_width=2, smoothing_rounds=1, cutoff_policy=1, demo_mode=False)
     |
     |  Tokenize a document into topical sections using the TextTiling algorithm.
     |  This algorithm detects subtopic shifts based on the analysis of lexical
     |  co-occurrence patterns.
     |
     |  The process starts by tokenizing the text into pseudosentences of
     |  a fixed size w. Then, depending on the method used, similarity
     |  scores are assigned at sentence gaps. The algorithm proceeds by
     |  detecting the peak differences between these scores and marking
     |  them as boundaries. The boundaries are normalized to the closest
     |  paragraph break and the segmented text is returned.
     |
     |  :param w: Pseudosentence size
     |  :type w: int
     |  :param k: Size (in sentences) of the block used in the block comparison method
     |  :type k: int
     |  :param similarity_method: The method used for determining similarity scores:
     |     `BLOCK_COMPARISON` (default) or `VOCABULARY_INTRODUCTION`.
     |  :type similarity_method: constant
     |  :param stopwords: A list of stopwords that are filtered out (defaults to NLTK's stopwords corpus)
     |  :type stopwords: list(str)
     |  :param smoothing_method: The method used for smoothing the score plot:
     |    `DEFAULT_SMOOTHING` (default)
     |  :type smoothing_method: constant
     |  :param smoothing_width: The width of the window used by the smoothing method
     |  :type smoothing_width: int
     |  :param smoothing_rounds: The number of smoothing passes
     |  :type smoothing_rounds: int
     |  :param cutoff_policy: The policy used to determine the number of boundaries:
     |    `HC` (default) or `LC`
     |  :type cutoff_policy: constant
     |
     |  >>> from nltk.corpus import brown
     |  >>> tt = TextTilingTokenizer(demo_mode=True)
     |  >>> text = brown.raw()[:4000]
     |  >>> s, ss, d, b = tt.tokenize(text)
     |  >>> b
     |  [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0]
     |
     |  Method resolution order:
     |      TextTilingTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, w=20, k=10, similarity_method='block_comparison', stopwords=None, smoothing_method=[0], smoothing_width=2, smoothing_rounds=1, cutoff_policy=1, demo_mode=False)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  tokenize(self, text)
     |      Return a tokenized copy of *text*, where each "token" represents
     |      a separate topic.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TokenSequence(builtins.object)
     |  TokenSequence(index, wrdindex_list, original_length=None)
     |
     |  A token list with its original length and its index
     |
     |  Methods defined here:
     |
     |  __init__(self, index, wrdindex_list, original_length=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TokenTableField(builtins.object)
     |  TokenTableField(first_pos, ts_occurences, total_count=1, par_count=1, last_par=0, last_tok_seq=None)
     |
     |  A field in the token table holding parameters for each token,
     |  used later in the process
     |
     |  Methods defined here:
     |
     |  __init__(self, first_pos, ts_occurences, total_count=1, par_count=1, last_par=0, last_tok_seq=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo(text=None, similarity_method='block_comparison')

    smooth(x, window_len=11, window='flat')
        smooth the data using a window with requested size.

        This method is based on the convolution of a scaled window with the signal.
        The signal is prepared by introducing reflected copies of the signal
        (with the window size) in both ends so that transient parts are minimized
        in the beginning and end part of the output signal.

        :param x: the input signal
        :param window_len: the dimension of the smoothing window; should be an odd integer
        :param window: the type of window from 'flat', 'hanning', 'hamming', 'bartlett', 'blackman'
            flat window will produce a moving average smoothing.

        :return: the smoothed signal

        example::

            t=linspace(-2,2,0.1)
            x=sin(t)+randn(len(t))*0.1
            y=smooth(x)

        :see also: numpy.hanning, numpy.hamming, numpy.bartlett, numpy.blackman, numpy.convolve,
            scipy.signal.lfilter

        TODO: the window parameter could be the window itself if an array instead of a string

DATA
    BLOCK_COMPARISON = 'block_comparison'
    DEFAULT_SMOOTHING = [0]
    HC = 1
    LC = 0
    VOCABULARY_INTRODUCTION = 'vocabulary_introduction'

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\texttiling.py

nltk.textwrap
Python Library Documentation: module textwrap

NAME
    textwrap - Text wrapping and filling.

MODULE REFERENCE
    https://docs.python.org/3.12/library/textwrap.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

CLASSES
    builtins.object
        TextWrapper

    class TextWrapper(builtins.object)
     |  TextWrapper(width=70, initial_indent='', subsequent_indent='', expand_tabs=True, replace_whitespace=True, fix_sentence_endings=False, break_long_words=True, drop_whitespace=True, break_on_hyphens=True, tabsize=8, *, max_lines=None, placeholder=' [...]')
     |
     |  Object for wrapping/filling text.  The public interface consists of
     |  the wrap() and fill() methods; the other methods are just there for
     |  subclasses to override in order to tweak the default behaviour.
     |  If you want to completely replace the main wrapping algorithm,
     |  you'll probably have to override _wrap_chunks().
     |
     |  Several instance attributes control various aspects of wrapping:
     |    width (default: 70)
     |      the maximum width of wrapped lines (unless break_long_words
     |      is false)
     |    initial_indent (default: "")
     |      string that will be prepended to the first line of wrapped
     |      output.  Counts towards the line's width.
     |    subsequent_indent (default: "")
     |      string that will be prepended to all lines save the first
     |      of wrapped output; also counts towards each line's width.
     |    expand_tabs (default: true)
     |      Expand tabs in input text to spaces before further processing.
     |      Each tab will become 0 .. 'tabsize' spaces, depending on its position
     |      in its line.  If false, each tab is treated as a single character.
     |    tabsize (default: 8)
     |      Expand tabs in input text to 0 .. 'tabsize' spaces, unless
     |      'expand_tabs' is false.
     |    replace_whitespace (default: true)
     |      Replace all whitespace characters in the input text by spaces
     |      after tab expansion.  Note that if expand_tabs is false and
     |      replace_whitespace is true, every tab will be converted to a
     |      single space!
     |    fix_sentence_endings (default: false)
     |      Ensure that sentence-ending punctuation is always followed
     |      by two spaces.  Off by default because the algorithm is
     |      (unavoidably) imperfect.
     |    break_long_words (default: true)
     |      Break words longer than 'width'.  If false, those words will not
     |      be broken, and some lines might be longer than 'width'.
     |    break_on_hyphens (default: true)
     |      Allow breaking hyphenated words. If true, wrapping will occur
     |      preferably on whitespaces and right after hyphens part of
     |      compound words.
     |    drop_whitespace (default: true)
     |      Drop leading and trailing whitespace from lines.
     |    max_lines (default: None)
     |      Truncate wrapped lines.
     |    placeholder (default: ' [...]')
     |      Append to the last line of truncated text.
     |
     |  Methods defined here:
     |
     |  __init__(self, width=70, initial_indent='', subsequent_indent='', expand_tabs=True, replace_whitespace=True, fix_sentence_endings=False, break_long_words=True, drop_whitespace=True, break_on_hyphens=True, tabsize=8, *, max_lines=None, placeholder=' [...]')
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  fill(self, text)
     |      fill(text : string) -> string
     |
     |      Reformat the single paragraph in 'text' to fit in lines of no
     |      more than 'self.width' columns, and return a new string
     |      containing the entire wrapped paragraph.
     |
     |  wrap(self, text)
     |      wrap(text : string) -> [string]
     |
     |      Reformat the single paragraph in 'text' so it fits in lines of
     |      no more than 'self.width' columns, and return a list of wrapped
     |      lines.  Tabs in 'text' are expanded with string.expandtabs(),
     |      and all other whitespace characters (including newline) are
     |      converted to space.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  sentence_end_re = re.compile('[a-z][\\.\\!\\?][\\"\\\']?\\Z')
     |
     |  unicode_whitespace_trans = {9: 32, 10: 32, 11: 32, 12: 32, 13: 32, 32:...
     |
     |  wordsep_re = re.compile('\n        ( # any whitespace\n      ...# word...
     |
     |  wordsep_simple_re = re.compile('([\\\t\\\n\\\x0b\\\x0c\\\r\\ ]+)')

FUNCTIONS
    dedent(text)
        Remove any common leading whitespace from every line in `text`.

        This can be used to make triple-quoted strings line up with the left
        edge of the display, while still presenting them in the source code
        in indented form.

        Note that tabs and spaces are both treated as whitespace, but they
        are not equal: the lines "  hello" and "\thello" are
        considered to have no common leading whitespace.

        Entirely blank lines are normalized to a newline character.

    fill(text, width=70, **kwargs)
        Fill a single paragraph of text, returning a new string.

        Reformat the single paragraph in 'text' to fit in lines of no more
        than 'width' columns, and return a new string containing the entire
        wrapped paragraph.  As with wrap(), tabs are expanded and other
        whitespace characters converted to space.  See TextWrapper class for
        available keyword args to customize wrapping behaviour.

    indent(text, prefix, predicate=None)
        Adds 'prefix' to the beginning of selected lines in 'text'.

        If 'predicate' is provided, 'prefix' will only be added to the lines
        where 'predicate(line)' is True. If 'predicate' is not provided,
        it will default to adding 'prefix' to all non-empty lines that do not
        consist solely of whitespace characters.

    shorten(text, width, **kwargs)
        Collapse and truncate the given text to fit in the given width.

        The text first has its whitespace collapsed.  If it then fits in
        the *width*, it is returned as is.  Otherwise, as many words
        as possible are joined and then the placeholder is appended::

            >>> textwrap.shorten("Hello  world!", width=12)
            'Hello world!'
            >>> textwrap.shorten("Hello  world!", width=11)
            'Hello [...]'

    wrap(text, width=70, **kwargs)
        Wrap a single paragraph of text, returning a list of wrapped lines.

        Reformat the single paragraph in 'text' so it fits in lines of no
        more than 'width' columns, and return a list of wrapped lines.  By
        default, tabs in 'text' are expanded with string.expandtabs(), and
        all other whitespace characters (including newline) are converted to
        space.  See TextWrapper class for available keyword args to customize
        wrapping behaviour.

DATA
    __all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\textwrap.py

nltk.tnt
Python Library Documentation: module nltk.tag.tnt in nltk.tag

NAME
    nltk.tag.tnt

DESCRIPTION
    Implementation of 'TnT - A Statistical Part of Speech Tagger'
    by Thorsten Brants

    https://aclanthology.org/A00-1031.pdf

    Where Brants (2000) is silent, the implementation makes principled
    choices flagged with ``Underspecified by Brants:`` in inline comments
    so future readers can tell paper-derived behavior from local policy:

    * ``_compute_lambda`` - even-split tie-breaking when multiple ``c_i``
      reach the max, and zeroed weights on degenerate training input.
    * ``train`` - empty sentences contribute no EOS counts.
    * ``_expand_states`` - strict ``>`` beam tie-break, so the
      first-encountered hypothesis wins. No clearly better policy is
      known; future work on deterministic hypothesis recombination
      could improve this.

CLASSES
    nltk.tag.api.TaggerI(builtins.object)
        TnT

    class TnT(nltk.tag.api.TaggerI)
     |  TnT(unk=None, Trained=False, N=1000, C=False)
     |
     |  TnT statistical part of speech tagger.
     |
     |  This class implements the Trigrams'n'Tags tagger described by
     |  Brants (2000). TnT is a second order hidden Markov model. Its
     |  hidden states are part of speech tags, its observations are word
     |  tokens, and each transition is conditioned on the two previous tag
     |  states.
     |
     |  Input
     |
     |  TnT estimates and scores sentence boundary transitions, so training
     |  and tagging data should normally be sentence delimited.
     |
     |  Training data should be a list of tagged sentences. Each sentence
     |  should be a list of ``(word, tag)`` tuples.
     |
     |  ``tag()`` expects one tokenized sentence.
     |  ``tagdata()`` expects a list of tokenized sentences.
     |
     |  For simple punctuation based segmentation of token streams, use
     |  ``basic_sent_chop()`` or pass ``segment=True`` to ``tag()``. The
     |  punctuation tokens are ``.``, ``!``, ``?``, and ``;``, following
     |  Brants's sentence boundary heuristic.
     |
     |  Model
     |
     |  For a sentence of length ``T``, the decoder chooses the tag sequence
     |  that maximizes
     |
     |      prod_i P(t_i | t_{i-1}, t_{i-2}) * P(w_i | t_i)
     |
     |  and then scores an explicit end of sentence transition. EOS is
     |  recorded as an ordinary next state in the trained n-gram stream,
     |  so its factor uses the same deleted interpolation as the body
     |  transitions (unigram, bigram, and trigram tiers). This generalizes
     |  Brants's printed factor ``P(t_{T+1} | t_T)``, which is bigram only.
     |
     |  Decoding runs in log space over a Viterbi trellis whose state is
     |  the pair ``(t_{i-1}, t_i)``.
     |
     |  Transition smoothing
     |
     |  Transition probabilities use context independent deleted
     |  interpolation of unigram, bigram, and trigram tag models.
     |
     |      P(t_i | t_{i-1}, t_{i-2})
     |          = l1 * P(t_i)
     |          + l2 * P(t_i | t_{i-1})
     |          + l3 * P(t_i | t_{i-1}, t_{i-2})
     |
     |  The interpolation weights ``l1``, ``l2``, and ``l3`` are estimated
     |  from the training counts by the deleted interpolation procedure in
     |  Brants (2000), section 2.2.
     |
     |  Emissions
     |
     |  Known words use a tag dictionary. For a known word, candidate tags
     |  are restricted to the tags assigned to that word in the training
     |  data. The emission probability is the relative frequency of the
     |  word and tag pair in the training lexicon.
     |
     |  Unknown words use Brants's suffix model by default. The model builds
     |  capitalization specific suffix tries from infrequent training words,
     |  using the threshold of at most 10 occurrences from Brants (2000),
     |  section 2.3. At decode time it uses the longest suffix observed in
     |  training, capped at 10 characters, smooths the suffix tag
     |  distribution by successive abstraction, and applies Bayesian
     |  inversion to obtain emission like scores.
     |
     |  A user supplied tagger may be passed with ``unk``. When supplied,
     |  it overrides the built in suffix model for unknown words.
     |
     |  Beam search
     |
     |  The decoder uses beam pruning to limit memory and runtime. After
     |  each Viterbi step, states whose log probability is worse than the
     |  current best state by more than ``log2(N)`` are discarded. The
     |  default threshold ``N=1000`` follows Brants (2000), section 2.5.
     |
     |  Capitalization
     |
     |  When ``C=True``, capitalization is included in the tag state. This
     |  is equivalent to splitting each tag into capitalized and
     |  uncapitalized variants, as described by Brants (2000), section 2.4.
     |
     |  Reproducibility
     |
     |  Training-time iteration is sorted in ``_compute_lambda``,
     |  ``_build_suffix_model``, and ``_tagword``'s candidate construction,
     |  so the trained model and decoded output are bit-identical across
     |  reorderings of equivalent training data.
     |
     |  Method resolution order:
     |      TnT
     |      nltk.tag.api.TaggerI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, unk=None, Trained=False, N=1000, C=False)
     |      Construct a TnT statistical tagger. The tagger must be trained
     |      before it can be used to tag input.
     |
     |      :param unk: instance of a POS tagger, conforms to TaggerI.
     |                  When supplied, overrides the built-in suffix model
     |                  on the unknown-word path.
     |      :type unk: TaggerI
     |      :param Trained: Indication that the POS tagger is trained or not.
     |                      Set True to skip training the optional ``unk``
     |                      tagger on the next train() call.
     |      :type Trained: bool
     |      :param N: Beam search pruning threshold. After each Viterbi
     |              step any state whose log-probability is worse than
     |              the best by more than a factor of N is discarded.
     |              Must be a positive integer; 1000 is a good default.
     |      :type N: int
     |      :param C: Capitalization flag. When True, tags are differentiated
     |              by whether the source word is capitalized. This rarely
     |              improves accuracy in practice.
     |      :type C: bool
     |
     |  tag(self, tokens, segment=False)
     |      Tag a single sentence. Delegates the actual decode to
     |      `_tagword`, then pairs each chosen tag with its input token.
     |
     |      When `segment` is True, the input may contain mid-sequence
     |      sentence punctuation [.!?;]. The decoder splits on those
     |      tokens and re-seeds the BOS state for each segment.
     |      The default is False because most NLTK callers pre-segment,
     |      and auto-splitting on `.` would mis-handle abbreviations
     |      like "Mr." in unsegmented input.
     |
     |      :param tokens: words to tag
     |      :type tokens: list[str]
     |      :param segment: split on [.!?;] and decode each segment with a
     |                      fresh BOS state
     |      :type segment: bool
     |      :return: list of `(word, tag)` tuples
     |
     |  tagdata(self, data, segment=False)
     |      Tags a list of sentences. Each input sentence is a list of words;
     |      each output sentence is a list of (word, tag) tuples.
     |
     |      :param data: list of list of words
     |      :type data: list[list[str]]
     |      :param segment: forwarded to ``tag``. Pass True to auto-split
     |                      each input on internal [.!?;] punctuation.
     |      :type segment: bool
     |      :return: list of list of (word, tag) tuples
     |
     |  train(self, data)
     |      Trains the tagger on a list of tagged sentences. Each call
     |      rebuilds the model from scratch on the supplied data. The
     |      n-gram counts, word-tag lexicon, suffix model, and
     |      deleted-interpolation weights are all replaced, and the decode
     |      cache is cleared.
     |
     |      The optional external unknown-word tagger (``unk``) is trained
     |      on the supplied data only the first time ``train()`` is called.
     |      Subsequent calls leave it alone, since retraining it on each
     |      new training set is rarely what callers want.
     |
     |      :param data: list of lists of (word, tag) tuples
     |      :type data: list[list[tuple[str, str]]]
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tag.api.TaggerI:
     |
     |  accuracy(self, gold)
     |      Score the accuracy of the tagger against the gold standard.
     |      Strip the tags from the gold standard text, retag it using
     |      the tagger, then compute the accuracy score.
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: float
     |
     |  confusion(self, gold)
     |      Return a ConfusionMatrix with the tags from ``gold`` as the reference
     |      values, with the predictions from ``tag_sents`` as the predicted values.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.confusion(gold_data))
     |             |        -                                                                                     |
     |             |        N                                                                                     |
     |             |        O                                               P                                     |
     |             |        N                       J  J        N  N  P  P  R     R           V  V  V  V  V  W    |
     |             |  '     E     C  C  D  E  I  J  J  J  M  N  N  N  O  R  P  R  B  R  T  V  B  B  B  B  B  D  ` |
     |             |  '  ,  -  .  C  D  T  X  N  J  R  S  D  N  P  S  S  P  $  B  R  P  O  B  D  G  N  P  Z  T  ` |
     |      -------+----------------------------------------------------------------------------------------------+
     |          '' | <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |           , |  .<15> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |      -NONE- |  .  . <.> .  .  2  .  .  .  2  .  .  .  5  1  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  . |
     |           . |  .  .  .<10> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CC |  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          CD |  .  .  .  .  . <5> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          DT |  .  .  .  .  .  .<20> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          EX |  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          IN |  .  .  .  .  .  .  .  .<22> .  .  .  .  .  .  .  .  .  .  3  .  .  .  .  .  .  .  .  .  .  . |
     |          JJ |  .  .  .  .  .  .  .  .  .<16> .  .  .  .  1  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . |
     |         JJR |  .  .  .  .  .  .  .  .  .  . <.> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         JJS |  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          MD |  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |          NN |  .  .  .  .  .  .  .  .  .  .  .  .  .<28> 1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .<25> .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         NNS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .<19> .  .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         POS |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  .  .  .  .  . |
     |         PRP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  .  .  . |
     |        PRP$ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <2> .  .  .  .  .  .  .  .  .  .  .  . |
     |          RB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  .  .  .  .  .  .  . |
     |         RBR |  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  .  . |
     |          RP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1> .  .  .  .  .  .  .  .  . |
     |          TO |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <5> .  .  .  .  .  .  .  . |
     |          VB |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  .  .  .  .  . |
     |         VBD |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  . <6> .  .  .  .  .  . |
     |         VBG |  .  .  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .  .  . <4> .  .  .  .  . |
     |         VBN |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  1  . <4> .  .  .  . |
     |         VBP |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <3> .  .  . |
     |         VBZ |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <7> .  . |
     |         WDT |  .  .  .  .  .  .  .  .  2  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <.> . |
     |          `` |  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . <1>|
     |      -------+----------------------------------------------------------------------------------------------+
     |      (row = reference; col = test)
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to run the tagger with,
     |          also used as the reference values in the generated confusion matrix.
     |      :type gold: list(list(tuple(str, str)))
     |      :rtype: ConfusionMatrix
     |
     |  evaluate(*args, **kwargs) from nltk.internals.deprecated.<locals>.decorator.<locals>
     |      @deprecated: Use accuracy(gold) instead.
     |
     |  evaluate_per_tag(self, gold, alpha=0.5, truncate=None, sort_by_count=False)
     |      Tabulate the **recall**, **precision** and **f-measure**
     |      for each tag from ``gold`` or from running ``tag`` on the tokenized
     |      sentences from ``gold``.
     |
     |      >>> from nltk.tag import PerceptronTagger
     |      >>> from nltk.corpus import treebank
     |      >>> tagger = PerceptronTagger()
     |      >>> gold_data = treebank.tagged_sents()[:10]
     |      >>> print(tagger.evaluate_per_tag(gold_data))
     |         Tag | Prec.  | Recall | F-measure
     |      -------+--------+--------+-----------
     |          '' | 1.0000 | 1.0000 | 1.0000
     |           , | 1.0000 | 1.0000 | 1.0000
     |      -NONE- | 0.0000 | 0.0000 | 0.0000
     |           . | 1.0000 | 1.0000 | 1.0000
     |          CC | 1.0000 | 1.0000 | 1.0000
     |          CD | 0.7143 | 1.0000 | 0.8333
     |          DT | 1.0000 | 1.0000 | 1.0000
     |          EX | 1.0000 | 1.0000 | 1.0000
     |          IN | 0.9167 | 0.8800 | 0.8980
     |          JJ | 0.8889 | 0.8889 | 0.8889
     |         JJR | 0.0000 | 0.0000 | 0.0000
     |         JJS | 1.0000 | 1.0000 | 1.0000
     |          MD | 1.0000 | 1.0000 | 1.0000
     |          NN | 0.8000 | 0.9333 | 0.8615
     |         NNP | 0.8929 | 1.0000 | 0.9434
     |         NNS | 0.9500 | 1.0000 | 0.9744
     |         POS | 1.0000 | 1.0000 | 1.0000
     |         PRP | 1.0000 | 1.0000 | 1.0000
     |        PRP$ | 1.0000 | 1.0000 | 1.0000
     |          RB | 0.4000 | 1.0000 | 0.5714
     |         RBR | 1.0000 | 0.5000 | 0.6667
     |          RP | 1.0000 | 1.0000 | 1.0000
     |          TO | 1.0000 | 1.0000 | 1.0000
     |          VB | 1.0000 | 1.0000 | 1.0000
     |         VBD | 0.8571 | 0.8571 | 0.8571
     |         VBG | 1.0000 | 0.8000 | 0.8889
     |         VBN | 1.0000 | 0.8000 | 0.8889
     |         VBP | 1.0000 | 1.0000 | 1.0000
     |         VBZ | 1.0000 | 1.0000 | 1.0000
     |         WDT | 0.0000 | 0.0000 | 0.0000
     |          `` | 1.0000 | 1.0000 | 1.0000
     |      <BLANKLINE>
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives, as used in the f-measure computation. Defaults to 0.5,
     |          where the costs are equal.
     |      :type alpha: float
     |      :param truncate: If specified, then only show the specified
     |          number of values.  Any sorting (e.g., sort_by_count)
     |          will be performed before truncation. Defaults to None
     |      :type truncate: int, optional
     |      :param sort_by_count: Whether to sort the outputs on number of
     |          occurrences of that tag in the ``gold`` data, defaults to False
     |      :type sort_by_count: bool, optional
     |      :return: A tabulated recall, precision and f-measure string
     |      :rtype: str
     |
     |  f_measure(self, gold, alpha=0.5)
     |      Compute the f-measure for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to f-measure. The f-measure is the harmonic mean
     |      of the ``precision`` and ``recall``, weighted by ``alpha``.
     |      In particular, given the precision *p* and recall *r* defined by:
     |
     |      - *p* = true positive / (true positive + false negative)
     |      - *r* = true positive / (true positive + false positive)
     |
     |      The f-measure is:
     |
     |      - *1/(alpha/p + (1-alpha)/r)*
     |
     |      With ``alpha = 0.5``, this reduces to:
     |
     |      - *2pr / (p + r)*
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :param alpha: Ratio of the cost of false negative compared to false
     |          positives. Defaults to 0.5, where the costs are equal.
     |      :type alpha: float
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  precision(self, gold)
     |      Compute the precision for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to precision. The precision is defined as:
     |
     |      - *p* = true positive / (true positive + false negative)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to precision
     |      :rtype: Dict[str, float]
     |
     |  recall(self, gold) -> dict[str, float]
     |      Compute the recall for each tag from ``gold`` or from running ``tag``
     |      on the tokenized sentences from ``gold``. Then, return the dictionary
     |      with mappings from tag to recall. The recall is defined as:
     |
     |      - *r* = true positive / (true positive + false positive)
     |
     |      :param gold: The list of tagged sentences to score the tagger on.
     |      :type gold: list(list(tuple(str, str)))
     |      :return: A mapping from tags to recall
     |      :rtype: Dict[str, float]
     |
     |  tag_sents(self, sentences)
     |      Apply ``self.tag()`` to each element of *sentences*.  I.e.::
     |
     |          return [self.tag(sent) for sent in sentences]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tag.api.TaggerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    basic_sent_chop(data, raw=True, sent_marks=('.', '!', '?', ';'))
        Split a flat token sequence into sentence-like segments.

        Splits after tokens whose surface form appears in ``sent_marks``.
        Works for raw tokens and tagged ``(word, tag)`` tokens.

        :param data: flat sequence of tokens or ``(word, tag)`` tuples
        :param raw: whether ``data`` contains raw tokens
        :param sent_marks: token strings that end a sentence segment
        :return: list of sentence segments with the same token shape as input

    demo(test_size=1000)
        Evaluate TnT on a held-out Treebank slice.

    demo_errors(limit=25, test_size=1000)
        Print the first ``limit`` errors from a held-out Treebank slice.

    log2(x, /)
        Return the base 2 logarithm of x.

DATA
    __annotations__ = {'_EMPTY_DICT': <class 'dict'>}

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tag\tnt.py

nltk.tokenize
Python Library Documentation: package nltk.tokenize in nltk

NAME
    nltk.tokenize - NLTK Tokenizer Package

DESCRIPTION
    Tokenizers divide strings into lists of substrings.  For example,
    tokenizers can be used to find the words and punctuation in a string:

        >>> from nltk.tokenize import word_tokenize
        >>> s = '''Good muffins cost $3.88\nin New York.  Please buy me
        ... two of them.\n\nThanks.'''
        >>> word_tokenize(s) # doctest: +NORMALIZE_WHITESPACE
        ['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York', '.',
        'Please', 'buy', 'me', 'two', 'of', 'them', '.', 'Thanks', '.']

    This particular tokenizer requires the Punkt sentence tokenization
    models to be installed. NLTK also provides a simpler,
    regular-expression based tokenizer, which splits text on whitespace
    and punctuation:

        >>> from nltk.tokenize import wordpunct_tokenize
        >>> wordpunct_tokenize(s) # doctest: +NORMALIZE_WHITESPACE
        ['Good', 'muffins', 'cost', '$', '3', '.', '88', 'in', 'New', 'York', '.',
        'Please', 'buy', 'me', 'two', 'of', 'them', '.', 'Thanks', '.']

    We can also operate at the level of sentences, using the sentence
    tokenizer directly as follows:

        >>> from nltk.tokenize import sent_tokenize, word_tokenize
        >>> sent_tokenize(s)
        ['Good muffins cost $3.88\nin New York.', 'Please buy me\ntwo of them.', 'Thanks.']
        >>> [word_tokenize(t) for t in sent_tokenize(s)] # doctest: +NORMALIZE_WHITESPACE
        [['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York', '.'],
        ['Please', 'buy', 'me', 'two', 'of', 'them', '.'], ['Thanks', '.']]

    Caution: when tokenizing a Unicode string, make sure you are not
    using an encoded version of the string (it may be necessary to
    decode it first, e.g. with ``s.decode("utf8")``.

    NLTK tokenizers can produce token-spans, represented as tuples of integers
    having the same semantics as string slices, to support efficient comparison
    of tokenizers.  (These methods are implemented as generators.)

        >>> from nltk.tokenize import WhitespaceTokenizer
        >>> list(WhitespaceTokenizer().span_tokenize(s)) # doctest: +NORMALIZE_WHITESPACE
        [(0, 4), (5, 12), (13, 17), (18, 23), (24, 26), (27, 30), (31, 36), (38, 44),
        (45, 48), (49, 51), (52, 55), (56, 58), (59, 64), (66, 73)]

    There are numerous ways to tokenize text.  If you need more control over
    tokenization, see the other methods provided in this package.

    For further information, please see Chapter 3 of the NLTK book.

PACKAGE CONTENTS
    api
    casual
    destructive
    legality_principle
    mwe
    nist
    punkt
    regexp
    repp
    sexpr
    simple
    sonority_sequencing
    stanford
    stanford_segmenter
    texttiling
    toktok
    treebank
    util

FUNCTIONS
    sent_tokenize(text, language='english')
        Return a sentence-tokenized copy of *text*,
        using NLTK's recommended sentence tokenizer
        (currently :class:`.PunktSentenceTokenizer`
        for the specified language).

        :param text: text to split into sentences
        :param language: the model name in the Punkt corpus

    word_tokenize(text, language='english', preserve_line=False)
        Return a tokenized copy of *text*,
        using NLTK's recommended word tokenizer
        (currently an improved :class:`.TreebankWordTokenizer`
        along with :class:`.PunktSentenceTokenizer`
        for the specified language).

        :param text: text to split into words
        :type text: str
        :param language: the model name in the Punkt corpus
        :type language: str
        :param preserve_line: A flag to decide whether to sentence tokenize the text or not.
        :type preserve_line: bool

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\__init__.py

nltk.tokenwrap
Python Library Documentation: function tokenwrap in module nltk.util

tokenwrap(tokens, separator=' ', width=70)
    Pretty print a list of text tokens, breaking lines on whitespace

    :param tokens: the tokens to print
    :type tokens: list
    :param separator: the string to use to separate tokens
    :type separator: str
    :param width: the display width (default=70)
    :type width: int
nltk.toktok
Python Library Documentation: module nltk.tokenize.toktok in nltk.tokenize

NAME
    nltk.tokenize.toktok

DESCRIPTION
    The tok-tok tokenizer is a simple, general tokenizer, where the input has one
    sentence per line; thus only final period is tokenized.

    Tok-tok has been tested on, and gives reasonably good results for English,
    Persian, Russian, Czech, French, German, Vietnamese, Tajik, and a few others.
    The input should be in UTF-8 encoding.

    Reference:
    Jon Dehdari. 2014. A Neurophysiologically-Inspired Statistical Language
    Model (Doctoral dissertation). Columbus, OH, USA: The Ohio State University.

CLASSES
    nltk.tokenize.api.TokenizerI(abc.ABC)
        ToktokTokenizer

    class ToktokTokenizer(nltk.tokenize.api.TokenizerI)
     |  This is a Python port of the tok-tok.pl from
     |  https://github.com/jonsafari/tok-tok/blob/master/tok-tok.pl
     |
     |  >>> toktok = ToktokTokenizer()
     |  >>> text = u'Is 9.5 or 525,600 my favorite number?'
     |  >>> print(toktok.tokenize(text, return_str=True))
     |  Is 9.5 or 525,600 my favorite number ?
     |  >>> text = u'The https://github.com/jonsafari/tok-tok/blob/master/tok-tok.pl is a website with/and/or slashes and sort of weird : things'
     |  >>> print(toktok.tokenize(text, return_str=True))
     |  The https://github.com/jonsafari/tok-tok/blob/master/tok-tok.pl is a website with/and/or slashes and sort of weird : things
     |  >>> text = u'¡This, is a sentence with weird» symbols… appearing everywhere¿'
     |  >>> expected = u'¡ This , is a sentence with weird » symbols … appearing everywhere ¿'
     |  >>> assert toktok.tokenize(text, return_str=True) == expected
     |  >>> toktok.tokenize(text) == [u'¡', u'This', u',', u'is', u'a', u'sentence', u'with', u'weird', u'»', u'symbols', u'…', u'appearing', u'everywhere', u'¿']
     |  True
     |
     |  Method resolution order:
     |      ToktokTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  tokenize(self, text, return_str=False)
     |      Return a tokenized copy of *s*.
     |
     |      :rtype: List[str]
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  AMPERCENT = (re.compile('& '), '&amp; ')
     |
     |  CLOSE_PUNCT = ')]}༻༽᚜⁆⁾₎〉❩❫❭❯❱❳❵⟆⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘⧙⧛⧽⸣⸥⸧⸩〉》」』】〕〗〙〛〞〟﴿︘︶...
     |
     |  CLOSE_PUNCT_RE = (re.compile('([)]}༻༽᚜⁆⁾₎〉❩❫❭❯❱❳❵⟆⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘⧙⧛⧽⸣...
     |
     |  COMMA_IN_NUM = (re.compile('(?<!,)([,،])(?![,\\d])'), r' \1 ')
     |
     |  CURRENCY_SYM = '$¢£¤¥֏؋৲৳৻૱௹฿៛₠₡₢₣₤₥₦₧₨₩₪₫€₭₮₯₰₱₲₳₴₵₶₷₸₹₺꠸﷼﹩$¢£¥₩'
     |
     |  CURRENCY_SYM_RE = (re.compile('([$¢£¤¥֏؋৲৳৻૱௹฿៛₠₡₢₣₤₥₦₧₨₩₪₫€₭₮₯₰₱₲₳₴₵₶...
     |
     |  EN_EM_DASHES = (re.compile('([–—])'), r' \1 ')
     |
     |  FINAL_PERIOD_1 = (re.compile('(?<!\\.)\\.$'), ' .')
     |
     |  FINAL_PERIOD_2 = (re.compile('(?<!\\.)\\.\\s*(["\'’»›”]) *$'), r' . \1...
     |
     |  FUNKY_PUNCT_1 = (re.compile('([،;؛¿!"\\])}»›”؟¡%٪°±©®।॥…])'), r' \1 ')
     |
     |  FUNKY_PUNCT_2 = (re.compile('([({\\[“‘„‚«‹「『])'), r' \1 ')
     |
     |  LSTRIP = (re.compile('^ +'), '')
     |
     |  MULTI_COMMAS = (re.compile('(,{2,})'), r' \1 ')
     |
     |  MULTI_DASHES = (re.compile('(-{2,})'), r' \1 ')
     |
     |  MULTI_DOTS = (re.compile('(\\.{2,})'), r' \1 ')
     |
     |  NON_BREAKING = (re.compile('\xa0'), ' ')
     |
     |  ONE_SPACE = (re.compile(' {2,}'), ' ')
     |
     |  OPEN_PUNCT = '([{༺༼᚛‚„⁅⁽₍〈❨❪❬❮❰❲❴⟅⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗⧘⧚⧼⸢⸤⸦⸨〈《「『【〔〖〘〚〝﴾︗︵...
     |
     |  OPEN_PUNCT_RE = (re.compile('([([{༺༼᚛‚„⁅⁽₍〈❨❪❬❮❰❲❴⟅⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗⧘⧚⧼...
     |
     |  PIPE = (re.compile('\\|'), ' &#124; ')
     |
     |  PROB_SINGLE_QUOTES = (re.compile("(['’`])"), r' \1 ')
     |
     |  RSTRIP = (re.compile('\\s+$'), '\n')
     |
     |  STUPID_QUOTES_1 = (re.compile(' ` ` '), ' `` ')
     |
     |  STUPID_QUOTES_2 = (re.compile(" ' ' "), " '' ")
     |
     |  TAB = (re.compile('\t'), ' &#9; ')
     |
     |  TOKTOK_REGEXES = [(re.compile('\xa0'), ' '), (re.compile('([،;؛¿!"\\])...
     |
     |  URL_FOE_1 = (re.compile(':(?!//)'), ' : ')
     |
     |  URL_FOE_2 = (re.compile('\\?(?!\\S)'), ' ? ')
     |
     |  URL_FOE_3 = (re.compile('(:\\/\\/)[\\S+\\.\\S+\\/\\S+][\\/]'), ' / ')
     |
     |  URL_FOE_4 = (re.compile(' /'), ' / ')
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\toktok.py

nltk.toolbox
Python Library Documentation: LazyModule in nltk object

nltk.toolbox = class LazyModule(builtins.object)
 |  nltk.toolbox(name, locals, globals=None)
 |
 |  Lazy module class.
 |
 |  Lazy modules are imported into the given namespaces whenever a
 |  non-special attribute (there are some attributes like __doc__
 |  that class instances handle without calling __getattr__) is
 |  requested. The module is then registered under the given name
 |  in locals usually replacing the import wrapper instance. The
 |  import itself is done using globals as global namespace.
 |
 |  Example of creating a lazy load module:
 |
 |  ISO = LazyModule('ISO',locals(),globals())
 |
 |  Later, requesting an attribute from ISO will load the module
 |  automatically into the locals() namespace, overriding the
 |  LazyModule instance:
 |
 |  t = ISO.Week(1998,1,1)
 |
 |  Methods defined here:
 |
 |  __getattr__(self, name)
 |      Import the module on demand and get the attribute.
 |
 |  __init__(self, name, locals, globals=None)
 |      Create a LazyModule instance wrapping module name.
 |
 |      The module will later on be registered in locals under the
 |      given module name.
 |
 |      globals is optional and defaults to locals.
 |
 |  __repr__(self)
 |      Return repr(self).
 |
 |  __setattr__(self, name, value)
 |      Import the module on demand and set the attribute.
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
nltk.total_ordering
Python Library Documentation: function total_ordering in module functools

total_ordering(cls)
    Class decorator that fills in missing ordering methods
nltk.trace
Python Library Documentation: function trace in module nltk.translate.gale_church

trace(backlinks, source_sents_lens, target_sents_lens)
    Traverse the alignment cost from the tracebacks and retrieves
    appropriate sentence pairs.

    :param backlinks: A dictionary where the key is the alignment points and value is the cost (referencing the LanguageIndependent.PRIORS)
    :type backlinks: dict
    :param source_sents_lens: A list of target sentences' lengths
    :type source_sents_lens: list(int)
    :param target_sents_lens: A list of target sentences' lengths
    :type target_sents_lens: list(int)
nltk.transitionparser
Python Library Documentation: module nltk.parse.transitionparser in nltk.parse

NAME
    nltk.parse.transitionparser

DESCRIPTION
    # Natural Language Toolkit: Arc-Standard and Arc-eager Transition Based Parsers
    #
    # Author: Long Duong <longdt219@gmail.com>
    #
    # Copyright (C) 2001-2026 NLTK Project
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.object
        Configuration
        Transition
    nltk.parse.api.ParserI(builtins.object)
        TransitionParser

    class Configuration(builtins.object)
     |  Configuration(dep_graph)
     |
     |  Class for holding configuration which is the partial analysis of the input sentence.
     |  The transition based parser aims at finding set of operators that transfer the initial
     |  configuration to the terminal configuration.
     |
     |  The configuration includes:
     |      - Stack: for storing partially proceeded words
     |      - Buffer: for storing remaining input words
     |      - Set of arcs: for storing partially built dependency tree
     |
     |  This class also provides a method to represent a configuration as list of features.
     |
     |  Methods defined here:
     |
     |  __init__(self, dep_graph)
     |      :param dep_graph: the representation of an input in the form of dependency graph.
     |      :type dep_graph: DependencyGraph where the dependencies are not specified.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  extract_features(self)
     |      Extract the set of features for the current configuration. Implement standard features as describe in
     |      Table 3.2 (page 31) in Dependency Parsing book by Sandra Kubler, Ryan McDonal, Joakim Nivre.
     |      Please note that these features are very basic.
     |      :return: list(str)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class Transition(builtins.object)
     |  Transition(alg_option)
     |
     |  This class defines a set of transition which is applied to a configuration to get another configuration
     |  Note that for different parsing algorithm, the transition is different.
     |
     |  Methods defined here:
     |
     |  __init__(self, alg_option)
     |      :param alg_option: the algorithm option of this parser. Currently support `arc-standard` and `arc-eager` algorithm
     |      :type alg_option: str
     |
     |  left_arc(self, conf, relation)
     |      Note that the algorithm for left-arc is quite similar except for precondition for both arc-standard and arc-eager
     |
     |      :param configuration: is the current configuration
     |      :return: A new configuration or -1 if the pre-condition is not satisfied
     |
     |  reduce(self, conf)
     |      Note that the algorithm for reduce is only available for arc-eager
     |
     |      :param configuration: is the current configuration
     |      :return: A new configuration or -1 if the pre-condition is not satisfied
     |
     |  right_arc(self, conf, relation)
     |      Note that the algorithm for right-arc is DIFFERENT for arc-standard and arc-eager
     |
     |      :param configuration: is the current configuration
     |      :return: A new configuration or -1 if the pre-condition is not satisfied
     |
     |  shift(self, conf)
     |      Note that the algorithm for shift is the SAME for arc-standard and arc-eager
     |
     |      :param configuration: is the current configuration
     |      :return: A new configuration or -1 if the pre-condition is not satisfied
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  LEFT_ARC = 'LEFTARC'
     |
     |  REDUCE = 'REDUCE'
     |
     |  RIGHT_ARC = 'RIGHTARC'
     |
     |  SHIFT = 'SHIFT'

    class TransitionParser(nltk.parse.api.ParserI)
     |  TransitionParser(algorithm)
     |
     |  Class for transition based parser. Implement 2 algorithms which are "arc-standard" and "arc-eager"
     |
     |  Method resolution order:
     |      TransitionParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, algorithm)
     |      :param algorithm: the algorithm option of this parser. Currently support `arc-standard` and `arc-eager` algorithm
     |      :type algorithm: str
     |
     |  parse(self, depgraphs, modelFile)
     |      :param depgraphs: the list of test sentence, each sentence is represented as a dependency graph where the 'head' information is dummy
     |      :type depgraphs: list(DependencyGraph)
     |      :param modelfile: the model file
     |      :type modelfile: str
     |      :return: list (DependencyGraph) with the 'head' and 'rel' information
     |
     |  train(self, depgraphs, modelfile, verbose=True)
     |      :param depgraphs : list of DependencyGraph as the training data
     |      :type depgraphs : DependencyGraph
     |      :param modelfile : file name to save the trained model
     |      :type modelfile : str
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  ARC_EAGER = 'arc-eager'
     |
     |  ARC_STANDARD = 'arc-standard'
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    array(...)
        array(object, dtype=None, *, copy=True, order='K', subok=False, ndmin=0,
              like=None)

        Create an array.

        Parameters
        ----------
        object : array_like
            An array, any object exposing the array interface, an object whose
            ``__array__`` method returns an array, or any (nested) sequence.
            If object is a scalar, a 0-dimensional array containing object is
            returned.
        dtype : data-type, optional
            The desired data-type for the array. If not given, NumPy will try to use
            a default ``dtype`` that can represent the values (by applying promotion
            rules when necessary.)
        copy : bool, optional
            If ``True`` (default), then the array data is copied. If ``None``,
            a copy will only be made if ``__array__`` returns a copy, if obj is
            a nested sequence, or if a copy is needed to satisfy any of the other
            requirements (``dtype``, ``order``, etc.). Note that any copy of
            the data is shallow, i.e., for arrays with object dtype, the new
            array will point to the same objects. See Examples for `ndarray.copy`.
            For ``False`` it raises a ``ValueError`` if a copy cannot be avoided.
            Default: ``True``.
        order : {'K', 'A', 'C', 'F'}, optional
            Specify the memory layout of the array. If object is not an array, the
            newly created array will be in C order (row major) unless 'F' is
            specified, in which case it will be in Fortran order (column major).
            If object is an array the following holds.

            ===== ========= ===================================================
            order  no copy                     copy=True
            ===== ========= ===================================================
            'K'   unchanged F & C order preserved, otherwise most similar order
            'A'   unchanged F order if input is F and not C, otherwise C order
            'C'   C order   C order
            'F'   F order   F order
            ===== ========= ===================================================

            When ``copy=None`` and a copy is made for other reasons, the result is
            the same as if ``copy=True``, with some exceptions for 'A', see the
            Notes section. The default order is 'K'.
        subok : bool, optional
            If True, then sub-classes will be passed-through, otherwise
            the returned array will be forced to be a base-class array (default).
        ndmin : int, optional
            Specifies the minimum number of dimensions that the resulting
            array should have.  Ones will be prepended to the shape as
            needed to meet this requirement.
        like : array_like, optional
            Reference object to allow the creation of arrays which are not
            NumPy arrays. If an array-like passed in as ``like`` supports
            the ``__array_function__`` protocol, the result will be defined
            by it. In this case, it ensures the creation of an array object
            compatible with that passed in via this argument.

            .. versionadded:: 1.20.0

        Returns
        -------
        out : ndarray
            An array object satisfying the specified requirements.

        See Also
        --------
        empty_like : Return an empty array with shape and type of input.
        ones_like : Return an array of ones with shape and type of input.
        zeros_like : Return an array of zeros with shape and type of input.
        full_like : Return a new array with shape of input filled with value.
        empty : Return a new uninitialized array.
        ones : Return a new array setting values to one.
        zeros : Return a new array setting values to zero.
        full : Return a new array of given shape filled with value.
        copy: Return an array copy of the given object.


        Notes
        -----
        When order is 'A' and ``object`` is an array in neither 'C' nor 'F' order,
        and a copy is forced by a change in dtype, then the order of the result is
        not necessarily 'C' as expected. This is likely a bug.

        Examples
        --------
        >>> import numpy as np
        >>> np.array([1, 2, 3])
        array([1, 2, 3])

        Upcasting:

        >>> np.array([1, 2, 3.0])
        array([ 1.,  2.,  3.])

        More than one dimension:

        >>> np.array([[1, 2], [3, 4]])
        array([[1, 2],
               [3, 4]])

        Minimum dimensions 2:

        >>> np.array([1, 2, 3], ndmin=2)
        array([[1, 2, 3]])

        Type provided:

        >>> np.array([1, 2, 3], dtype=complex)
        array([ 1.+0.j,  2.+0.j,  3.+0.j])

        Data-type consisting of more than one element:

        >>> x = np.array([(1,2),(3,4)],dtype=[('a','<i4'),('b','<i4')])
        >>> x['a']
        array([1, 3])

        Creating an array from sub-classes:

        >>> np.array(np.asmatrix('1 2; 3 4'))
        array([[1, 2],
               [3, 4]])

        >>> np.array(np.asmatrix('1 2; 3 4'), subok=True)
        matrix([[1, 2],
                [3, 4]])

    demo()
        >>> from nltk.parse import DependencyGraph, DependencyEvaluator
        >>> from nltk.parse.transitionparser import TransitionParser, Configuration, Transition
        >>> gold_sent = DependencyGraph("""
        ... Economic  JJ     2      ATT
        ... news  NN     3       SBJ
        ... has       VBD       0       ROOT
        ... little      JJ      5       ATT
        ... effect   NN     3       OBJ
        ... on     IN      5       ATT
        ... financial       JJ       8       ATT
        ... markets    NNS      6       PC
        ... .    .      3       PU
        ... """)

        >>> conf = Configuration(gold_sent)

        ###################### Check the Initial Feature ########################

        >>> print(', '.join(conf.extract_features()))
        STK_0_POS_TOP, BUF_0_FORM_Economic, BUF_0_LEMMA_Economic, BUF_0_POS_JJ, BUF_1_FORM_news, BUF_1_POS_NN, BUF_2_POS_VBD, BUF_3_POS_JJ

        ###################### Check The Transition #######################
        Check the Initialized Configuration
        >>> print(conf)
        Stack : [0]  Buffer : [1, 2, 3, 4, 5, 6, 7, 8, 9]   Arcs : []

        A. Do some transition checks for ARC-STANDARD

        >>> operation = Transition('arc-standard')
        >>> operation.shift(conf)
        >>> operation.left_arc(conf, "ATT")
        >>> operation.shift(conf)
        >>> operation.left_arc(conf,"SBJ")
        >>> operation.shift(conf)
        >>> operation.shift(conf)
        >>> operation.left_arc(conf, "ATT")
        >>> operation.shift(conf)
        >>> operation.shift(conf)
        >>> operation.shift(conf)
        >>> operation.left_arc(conf, "ATT")

        Middle Configuration and Features Check
        >>> print(conf)
        Stack : [0, 3, 5, 6]  Buffer : [8, 9]   Arcs : [(2, 'ATT', 1), (3, 'SBJ', 2), (5, 'ATT', 4), (8, 'ATT', 7)]

        >>> print(', '.join(conf.extract_features()))
        STK_0_FORM_on, STK_0_LEMMA_on, STK_0_POS_IN, STK_1_POS_NN, BUF_0_FORM_markets, BUF_0_LEMMA_markets, BUF_0_POS_NNS, BUF_1_FORM_., BUF_1_POS_., BUF_0_LDEP_ATT

        >>> operation.right_arc(conf, "PC")
        >>> operation.right_arc(conf, "ATT")
        >>> operation.right_arc(conf, "OBJ")
        >>> operation.shift(conf)
        >>> operation.right_arc(conf, "PU")
        >>> operation.right_arc(conf, "ROOT")
        >>> operation.shift(conf)

        Terminated Configuration Check
        >>> print(conf)
        Stack : [0]  Buffer : []   Arcs : [(2, 'ATT', 1), (3, 'SBJ', 2), (5, 'ATT', 4), (8, 'ATT', 7), (6, 'PC', 8), (5, 'ATT', 6), (3, 'OBJ', 5), (3, 'PU', 9), (0, 'ROOT', 3)]


        B. Do some transition checks for ARC-EAGER

        >>> conf = Configuration(gold_sent)
        >>> operation = Transition('arc-eager')
        >>> operation.shift(conf)
        >>> operation.left_arc(conf,'ATT')
        >>> operation.shift(conf)
        >>> operation.left_arc(conf,'SBJ')
        >>> operation.right_arc(conf,'ROOT')
        >>> operation.shift(conf)
        >>> operation.left_arc(conf,'ATT')
        >>> operation.right_arc(conf,'OBJ')
        >>> operation.right_arc(conf,'ATT')
        >>> operation.shift(conf)
        >>> operation.left_arc(conf,'ATT')
        >>> operation.right_arc(conf,'PC')
        >>> operation.reduce(conf)
        >>> operation.reduce(conf)
        >>> operation.reduce(conf)
        >>> operation.right_arc(conf,'PU')
        >>> print(conf)
        Stack : [0, 3, 9]  Buffer : []   Arcs : [(2, 'ATT', 1), (3, 'SBJ', 2), (0, 'ROOT', 3), (5, 'ATT', 4), (3, 'OBJ', 5), (5, 'ATT', 6), (8, 'ATT', 7), (6, 'PC', 8), (3, 'PU', 9)]

        ###################### Check The Training Function #######################

        A. Check the ARC-STANDARD training
        >>> import tempfile
        >>> import os
        >>> input_file = tempfile.NamedTemporaryFile(prefix='transition_parse.train', dir=tempfile.gettempdir(), delete=False)

        >>> parser_std = TransitionParser('arc-standard')
        >>> print(', '.join(parser_std._create_training_examples_arc_std([gold_sent], input_file)))
         Number of training examples : 1
         Number of valid (projective) examples : 1
        SHIFT, LEFTARC:ATT, SHIFT, LEFTARC:SBJ, SHIFT, SHIFT, LEFTARC:ATT, SHIFT, SHIFT, SHIFT, LEFTARC:ATT, RIGHTARC:PC, RIGHTARC:ATT, RIGHTARC:OBJ, SHIFT, RIGHTARC:PU, RIGHTARC:ROOT, SHIFT

        >>> parser_std.train([gold_sent],'temp.arcstd.model', verbose=False)
         Number of training examples : 1
         Number of valid (projective) examples : 1
        >>> input_file.close()
        >>> remove(input_file.name)

        B. Check the ARC-EAGER training

        >>> input_file = tempfile.NamedTemporaryFile(prefix='transition_parse.train', dir=tempfile.gettempdir(),delete=False)
        >>> parser_eager = TransitionParser('arc-eager')
        >>> print(', '.join(parser_eager._create_training_examples_arc_eager([gold_sent], input_file)))
         Number of training examples : 1
         Number of valid (projective) examples : 1
        SHIFT, LEFTARC:ATT, SHIFT, LEFTARC:SBJ, RIGHTARC:ROOT, SHIFT, LEFTARC:ATT, RIGHTARC:OBJ, RIGHTARC:ATT, SHIFT, LEFTARC:ATT, RIGHTARC:PC, REDUCE, REDUCE, REDUCE, RIGHTARC:PU

        >>> parser_eager.train([gold_sent],'temp.arceager.model', verbose=False)
         Number of training examples : 1
         Number of valid (projective) examples : 1

        >>> input_file.close()
        >>> remove(input_file.name)

        ###################### Check The Parsing Function ########################

        A. Check the ARC-STANDARD parser

        >>> result = parser_std.parse([gold_sent], 'temp.arcstd.model')
        >>> de = DependencyEvaluator(result, [gold_sent])
        >>> de.eval() >= (0, 0)
        True

        B. Check the ARC-EAGER parser
        >>> result = parser_eager.parse([gold_sent], 'temp.arceager.model')
        >>> de = DependencyEvaluator(result, [gold_sent])
        >>> de.eval() >= (0, 0)
        True

        Remove test temporary files
        >>> remove('temp.arceager.model')
        >>> remove('temp.arcstd.model')

        Note that result is very poor because of only one training example.

    remove(path, *, dir_fd=None)
        Remove a file (same as unlink()).

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and path should be relative; path will then be relative to that directory.
        dir_fd may not be implemented on your platform.
          If it is unavailable, using it will raise a NotImplementedError.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\transitionparser.py

nltk.transitive_closure
Python Library Documentation: function transitive_closure in module nltk.util

transitive_closure(graph, reflexive=False)
    Calculate the transitive closure of a directed graph,
    optionally the reflexive transitive closure.

    The algorithm is a slight modification of the "Marking Algorithm" of
    Ioannidis & Ramakrishnan (1998) "Efficient Transitive Closure Algorithms".

    :param graph: the initial graph, represented as a dictionary of sets
    :type graph: dict(set)
    :param reflexive: if set, also make the closure reflexive
    :type reflexive: bool
    :rtype: dict(set)
nltk.translate
Python Library Documentation: package nltk.translate in nltk

NAME
    nltk.translate

DESCRIPTION
    Experimental features for machine translation.
    These interfaces are prone to change.

    isort:skip_file

PACKAGE CONTENTS
    api
    bleu_score
    chrf_score
    gale_church
    gdfa
    gleu_score
    ibm1
    ibm2
    ibm3
    ibm4
    ibm5
    ibm_model
    lepor
    meteor_score
    metrics
    nist_score
    phrase_based
    ribes_score
    stack_decoder

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\translate\__init__.py

nltk.tree
Python Library Documentation: package nltk.tree in nltk

NAME
    nltk.tree - NLTK Tree Package

DESCRIPTION
    This package may be used for representing hierarchical language
    structures, such as syntax trees and morphological trees.

PACKAGE CONTENTS
    immutable
    parented
    parsing
    prettyprinter
    probabilistic
    transforms
    tree

CLASSES
    builtins.list(builtins.object)
        nltk.tree.tree.Tree
            nltk.tree.immutable.ImmutableTree
                nltk.tree.immutable.ImmutableMultiParentedTree(nltk.tree.immutable.ImmutableTree, nltk.tree.parented.MultiParentedTree)
                nltk.tree.immutable.ImmutableParentedTree(nltk.tree.immutable.ImmutableTree, nltk.tree.parented.ParentedTree)
                nltk.tree.immutable.ImmutableProbabilisticTree(nltk.tree.immutable.ImmutableTree, nltk.probability.ProbabilisticMixIn)
            nltk.tree.probabilistic.ProbabilisticTree(nltk.tree.tree.Tree, nltk.probability.ProbabilisticMixIn)
    builtins.object
        nltk.tree.prettyprinter.TreePrettyPrinter
    nltk.tree.parented.AbstractParentedTree(nltk.tree.tree.Tree)
        nltk.tree.parented.MultiParentedTree
        nltk.tree.parented.ParentedTree

    class ImmutableMultiParentedTree(ImmutableTree, nltk.tree.parented.MultiParentedTree)
     |  ImmutableMultiParentedTree(node, children=None)
     |
     |  Method resolution order:
     |      ImmutableMultiParentedTree
     |      ImmutableTree
     |      nltk.tree.parented.MultiParentedTree
     |      nltk.tree.parented.AbstractParentedTree
     |      nltk.tree.tree.Tree
     |      builtins.list
     |      builtins.object
     |
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ImmutableTree:
     |
     |  __delitem__(self, index)
     |      Delete self[key].
     |
     |  __delslice__(self, i, j)
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __iadd__(self, other)
     |      Implement self+=value.
     |
     |  __imul__(self, other)
     |      Implement self*=value.
     |
     |  __init__(self, node, children=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __setitem__(self, index, value)
     |      Set self[key] to value.
     |
     |  __setslice__(self, i, j, value)
     |
     |  append(self, v)
     |      Append object to the end of the list.
     |
     |  extend(self, v)
     |      Extend list by appending elements from the iterable.
     |
     |  pop(self, v=None)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, v)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self)
     |      Reverse *IN PLACE*.
     |
     |  set_label(self, value)
     |      Set the node label.  This will only succeed the first time the
     |      node label is set, which should occur in ImmutableTree.__init__().
     |
     |  sort(self)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.parented.MultiParentedTree:
     |
     |  left_siblings(self)
     |      A list of all left siblings of this tree, in any of its parent
     |      trees.  A tree may be its own left sibling if it is used as
     |      multiple contiguous children of the same parent.  A tree may
     |      appear multiple times in this list if it is the left sibling
     |      of this tree with respect to multiple parents.
     |
     |      :type: list(MultiParentedTree)
     |
     |  parent_indices(self, parent)
     |      Return a list of the indices where this tree occurs as a child
     |      of ``parent``.  If this child does not occur as a child of
     |      ``parent``, then the empty list is returned.  The following is
     |      always true::
     |
     |        for parent_index in ptree.parent_indices(parent):
     |            parent[parent_index] is ptree
     |
     |  parents(self)
     |      The set of parents of this tree.  If this tree has no parents,
     |      then ``parents`` is the empty set.  To check if a tree is used
     |      as multiple children of the same parent, use the
     |      ``parent_indices()`` method.
     |
     |      :type: list(MultiParentedTree)
     |
     |  right_siblings(self)
     |      A list of all right siblings of this tree, in any of its parent
     |      trees.  A tree may be its own right sibling if it is used as
     |      multiple contiguous children of the same parent.  A tree may
     |      appear multiple times in this list if it is the right sibling
     |      of this tree with respect to multiple parents.
     |
     |      :type: list(MultiParentedTree)
     |
     |  roots(self)
     |      The set of all roots of this tree.  This set is formed by
     |      tracing all possible parent paths until trees with no parents
     |      are found.
     |
     |      :type: list(MultiParentedTree)
     |
     |  treepositions(self, root)
     |      Return a list of all tree positions that can be used to reach
     |      this multi-parented tree starting from ``root``.  I.e., the
     |      following is always true::
     |
     |        for treepos in ptree.treepositions(root):
     |            root[treepos] is ptree
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.parented.AbstractParentedTree:
     |
     |  __getnewargs__(self)
     |      Method used by the pickle module when un-pickling.
     |      This method provides the arguments passed to ``__new__``
     |      upon un-pickling. Without this method, ParentedTree instances
     |      cannot be pickled and unpickled in Python 3.7+ onwards.
     |
     |      :return: Tuple of arguments for ``__new__``, i.e. the label
     |          and the children of this node.
     |      :rtype: Tuple[Any, List[AbstractParentedTree]]
     |
     |  insert(self, index, child)
     |      Insert object before index.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.tree.Tree:
     |
     |  __add__(self, v)
     |      Return self+value.
     |
     |  __copy__(self)
     |
     |  __deepcopy__(self, memo)
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__ lambda self, other
     |
     |  __getitem__(self, index)
     |      Return self[index].
     |
     |  __gt__ lambda self, other
     |
     |  __le__ lambda self, other
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, v)
     |      Return self*value.
     |
     |  __ne__ lambda self, other
     |      # @total_ordering doesn't work here, since the class inherits from a builtin class
     |
     |  __radd__(self, v)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __rmul__(self, v)
     |      Return value*self.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
     |      This method can modify a tree in three ways:
     |
     |        1. Convert a tree into its Chomsky Normal Form (CNF)
     |           equivalent -- Every subtree has either two non-terminals
     |           or one terminal as its children.  This process requires
     |           the creation of more"artificial" non-terminal nodes.
     |        2. Markov (vertical) smoothing of children in new artificial
     |           nodes
     |        3. Horizontal (parent) annotation of nodes
     |
     |      :param factor: Right or left factoring method (default = "right")
     |      :type  factor: str = [left|right]
     |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
     |      :type  horzMarkov: int | None
     |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
     |      :type  vertMarkov: int | None
     |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
     |                        original subtree from the child nodes that have yet to be expanded (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string used to separate the node representation from its vertical annotation
     |      :type  parentChar: str
     |
     |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
     |      Collapse subtrees with a single child (ie. unary productions)
     |      into a new non-terminal (Tree node) joined by 'joinChar'.
     |      This is useful when working with algorithms that do not allow
     |      unary productions, and completely removing the unary productions
     |      would require loss of useful information.  The Tree is modified
     |      directly (since it is passed by reference) and no value is returned.
     |
     |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
     |                          Part-of-Speech tags) since they are always unary productions
     |      :type  collapsePOS: bool
     |      :param collapseRoot: 'False' (default) will not modify the root production
     |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
     |                           to the TOP -> productions.
     |      :type collapseRoot: bool
     |      :param joinChar: A string used to connect collapsed node values (default = "+")
     |      :type  joinChar: str
     |
     |  copy(self, deep=False)
     |      Return a shallow copy of the list.
     |
     |  draw(self)
     |      Open a new window containing a graphical diagram of this tree.
     |
     |  flatten(self)
     |      Return a flat version of the tree, with all non-root non-terminals removed.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> print(t.flatten())
     |          (S the dog chased the cat)
     |
     |      :return: a tree consisting of this tree's root connected directly to
     |          its leaves, omitting all intervening non-terminal nodes.
     |      :rtype: Tree
     |
     |  freeze(self, leaf_freezer=None)
     |
     |  height(self)
     |      Return the height of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.height()
     |          5
     |          >>> print(t[0,0])
     |          (D the)
     |          >>> t[0,0].height()
     |          2
     |
     |      :return: The height of this tree.  The height of a tree
     |          containing no children is 1; the height of a tree
     |          containing only leaves is 2; and the height of any other
     |          tree is one plus the maximum of its children's
     |          heights.
     |      :rtype: int
     |
     |  label(self)
     |      Return the node label of the tree.
     |
     |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
     |          >>> t.label()
     |          'S'
     |
     |      :return: the node label (typically a string)
     |      :rtype: any
     |
     |  leaf_treeposition(self, index)
     |      :return: The tree position of the ``index``-th leaf in this
     |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
     |          ``self[tp]==self.leaves()[i]``.
     |
     |      :raise IndexError: If this tree contains fewer than ``index+1``
     |          leaves, or if ``index<0``.
     |
     |  leaves(self)
     |      Return the leaves of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.leaves()
     |          ['the', 'dog', 'chased', 'the', 'cat']
     |
     |      :return: a list containing this tree's leaves.
     |          The order reflects the order of the
     |          leaves in the tree's hierarchical structure.
     |      :rtype: list
     |
     |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
     |      :return: A pretty-printed string representation of this tree.
     |      :rtype: str
     |      :param margin: The right margin at which to do line-wrapping.
     |      :type margin: int
     |      :param indent: The indentation level at which printing
     |          begins.  This number is used to decide how far to indent
     |          subsequent lines.
     |      :type indent: int
     |      :param nodesep: A string that is used to separate the node
     |          from the children.  E.g., the default value ``':'`` gives
     |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
     |
     |  pformat_latex_qtree(self)
     |      Returns a representation of the tree compatible with the
     |      LaTeX qtree package. This consists of the string ``\Tree``
     |      followed by the tree represented in bracketed notation.
     |
     |      For example, the following result was generated from a parse tree of
     |      the sentence ``The announcement astounded us``::
     |
     |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
     |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
     |
     |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
     |      style file for the qtree package.
     |
     |      :return: A latex qtree representation of this tree.
     |      :rtype: str
     |
     |  pos(self)
     |      Return a sequence of pos-tagged words extracted from the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.pos()
     |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
     |
     |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
     |          The order reflects the order of the leaves in the tree's hierarchical structure.
     |      :rtype: list(tuple)
     |
     |  pprint(self, **kwargs)
     |      Print a string representation of this Tree to 'stream'
     |
     |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
     |      Pretty-print this tree as ASCII or Unicode art.
     |      For explanation of the arguments, see the documentation for
     |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
     |
     |  productions(self)
     |      Generate the productions that correspond to the non-terminal nodes of the tree.
     |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
     |      form P -> C1 C2 ... Cn.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
     |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
     |          NP -> D N, D -> 'the', N -> 'cat']
     |
     |      :rtype: list(Production)
     |
     |  subtrees(self, filter=None)
     |      Generate all the subtrees of this tree, optionally restricted
     |      to trees matching the filter function.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> for s in t.subtrees(lambda t: t.height() == 2):
     |          ...     print(s)
     |          (D the)
     |          (N dog)
     |          (V chased)
     |          (D the)
     |          (N cat)
     |
     |      :type filter: function
     |      :param filter: the function to filter all local trees
     |
     |  treeposition_spanning_leaves(self, start, end)
     |      :return: The tree position of the lowest descendant of this
     |          tree that dominates ``self.leaves()[start:end]``.
     |      :raise ValueError: if ``end <= start``
     |
     |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
     |      This method modifies the tree in three ways:
     |
     |        1. Transforms a tree in Chomsky Normal Form back to its
     |           original structure (branching greater than two)
     |        2. Removes any parent annotation (if it exists)
     |        3. (optional) expands unary subtrees (if previously
     |           collapsed with collapseUnary(...) )
     |
     |      :param expandUnary: Flag to expand unary or not (default = True)
     |      :type  expandUnary: bool
     |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
     |      :type  parentChar: str
     |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
     |      :type  unaryChar: str
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from nltk.tree.tree.Tree:
     |
     |  convert(tree)
     |      Convert a tree between different subtypes of Tree.  ``cls`` determines
     |      which class will be used to encode the new tree.
     |
     |      :type tree: Tree
     |      :param tree: The tree that should be converted.
     |      :return: The new Tree.
     |
     |  fromlist(l)
     |      :type l: list
     |      :param l: a tree represented as nested lists
     |
     |      :return: A tree corresponding to the list representation ``l``.
     |      :rtype: Tree
     |
     |      Convert nested lists to a NLTK Tree
     |
     |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
     |      Read a bracketed tree string and return the resulting tree.
     |      Trees are represented as nested brackettings, such as::
     |
     |        (S (NP (NNP John)) (VP (V runs)))
     |
     |      :type s: str
     |      :param s: The string to read
     |
     |      :type brackets: str (length=2)
     |      :param brackets: The bracket characters used to mark the
     |          beginning and end of trees and subtrees.
     |
     |      :type read_node: function
     |      :type read_leaf: function
     |      :param read_node, read_leaf: If specified, these functions
     |          are applied to the substrings of ``s`` corresponding to
     |          nodes and leaves (respectively) to obtain the values for
     |          those nodes and leaves.  They should have the following
     |          signature:
     |
     |             read_node(str) -> value
     |
     |          For example, these functions could be used to process nodes
     |          and leaves whose values should be some type other than
     |          string (such as ``FeatStruct``).
     |          Note that by default, node strings and leaf strings are
     |          delimited by whitespace and brackets; to override this
     |          default, use the ``node_pattern`` and ``leaf_pattern``
     |          arguments.
     |
     |      :type node_pattern: str
     |      :type leaf_pattern: str
     |      :param node_pattern, leaf_pattern: Regular expression patterns
     |          used to find node and leaf substrings in ``s``.  By
     |          default, both nodes patterns are defined to match any
     |          sequence of non-whitespace non-bracket characters.
     |
     |      :type remove_empty_top_bracketing: bool
     |      :param remove_empty_top_bracketing: If the resulting tree has
     |          an empty node label, and is length one, then return its
     |          single child instead.  This is useful for treebank trees,
     |          which sometimes contain an extra level of bracketing.
     |
     |      :return: A tree corresponding to the string representation ``s``.
     |          If this class method is called using a subclass of Tree,
     |          then it will return a tree of that type.
     |      :rtype: Tree
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tree.tree.Tree:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  node
     |      Outdated method to access the node value; use the label() method instead.
     |
     |      @deprecated: Use label() instead
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.

    class ImmutableParentedTree(ImmutableTree, nltk.tree.parented.ParentedTree)
     |  ImmutableParentedTree(node, children=None)
     |
     |  Method resolution order:
     |      ImmutableParentedTree
     |      ImmutableTree
     |      nltk.tree.parented.ParentedTree
     |      nltk.tree.parented.AbstractParentedTree
     |      nltk.tree.tree.Tree
     |      builtins.list
     |      builtins.object
     |
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ImmutableTree:
     |
     |  __delitem__(self, index)
     |      Delete self[key].
     |
     |  __delslice__(self, i, j)
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __iadd__(self, other)
     |      Implement self+=value.
     |
     |  __imul__(self, other)
     |      Implement self*=value.
     |
     |  __init__(self, node, children=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __setitem__(self, index, value)
     |      Set self[key] to value.
     |
     |  __setslice__(self, i, j, value)
     |
     |  append(self, v)
     |      Append object to the end of the list.
     |
     |  extend(self, v)
     |      Extend list by appending elements from the iterable.
     |
     |  pop(self, v=None)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, v)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self)
     |      Reverse *IN PLACE*.
     |
     |  set_label(self, value)
     |      Set the node label.  This will only succeed the first time the
     |      node label is set, which should occur in ImmutableTree.__init__().
     |
     |  sort(self)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.parented.ParentedTree:
     |
     |  copy(self, deep=False)
     |      Return a shallow copy of the list.
     |
     |  left_sibling(self)
     |      The left sibling of this tree, or None if it has none.
     |
     |  parent(self)
     |      The parent of this tree, or None if it has no parent.
     |
     |  parent_index(self)
     |      The index of this tree in its parent.  I.e.,
     |      ``ptree.parent()[ptree.parent_index()] is ptree``.  Note that
     |      ``ptree.parent_index()`` is not necessarily equal to
     |      ``ptree.parent.index(ptree)``, since the ``index()`` method
     |      returns the first child that is equal to its argument.
     |
     |  right_sibling(self)
     |      The right sibling of this tree, or None if it has none.
     |
     |  root(self)
     |      The root of this tree.  I.e., the unique ancestor of this tree
     |      whose parent is None.  If ``ptree.parent()`` is None, then
     |      ``ptree`` is its own root.
     |
     |  treeposition(self)
     |      The tree position of this tree, relative to the root of the
     |      tree.  I.e., ``ptree.root[ptree.treeposition] is ptree``.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.parented.AbstractParentedTree:
     |
     |  __getnewargs__(self)
     |      Method used by the pickle module when un-pickling.
     |      This method provides the arguments passed to ``__new__``
     |      upon un-pickling. Without this method, ParentedTree instances
     |      cannot be pickled and unpickled in Python 3.7+ onwards.
     |
     |      :return: Tuple of arguments for ``__new__``, i.e. the label
     |          and the children of this node.
     |      :rtype: Tuple[Any, List[AbstractParentedTree]]
     |
     |  insert(self, index, child)
     |      Insert object before index.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.tree.Tree:
     |
     |  __add__(self, v)
     |      Return self+value.
     |
     |  __copy__(self)
     |
     |  __deepcopy__(self, memo)
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__ lambda self, other
     |
     |  __getitem__(self, index)
     |      Return self[index].
     |
     |  __gt__ lambda self, other
     |
     |  __le__ lambda self, other
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, v)
     |      Return self*value.
     |
     |  __ne__ lambda self, other
     |      # @total_ordering doesn't work here, since the class inherits from a builtin class
     |
     |  __radd__(self, v)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __rmul__(self, v)
     |      Return value*self.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
     |      This method can modify a tree in three ways:
     |
     |        1. Convert a tree into its Chomsky Normal Form (CNF)
     |           equivalent -- Every subtree has either two non-terminals
     |           or one terminal as its children.  This process requires
     |           the creation of more"artificial" non-terminal nodes.
     |        2. Markov (vertical) smoothing of children in new artificial
     |           nodes
     |        3. Horizontal (parent) annotation of nodes
     |
     |      :param factor: Right or left factoring method (default = "right")
     |      :type  factor: str = [left|right]
     |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
     |      :type  horzMarkov: int | None
     |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
     |      :type  vertMarkov: int | None
     |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
     |                        original subtree from the child nodes that have yet to be expanded (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string used to separate the node representation from its vertical annotation
     |      :type  parentChar: str
     |
     |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
     |      Collapse subtrees with a single child (ie. unary productions)
     |      into a new non-terminal (Tree node) joined by 'joinChar'.
     |      This is useful when working with algorithms that do not allow
     |      unary productions, and completely removing the unary productions
     |      would require loss of useful information.  The Tree is modified
     |      directly (since it is passed by reference) and no value is returned.
     |
     |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
     |                          Part-of-Speech tags) since they are always unary productions
     |      :type  collapsePOS: bool
     |      :param collapseRoot: 'False' (default) will not modify the root production
     |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
     |                           to the TOP -> productions.
     |      :type collapseRoot: bool
     |      :param joinChar: A string used to connect collapsed node values (default = "+")
     |      :type  joinChar: str
     |
     |  draw(self)
     |      Open a new window containing a graphical diagram of this tree.
     |
     |  flatten(self)
     |      Return a flat version of the tree, with all non-root non-terminals removed.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> print(t.flatten())
     |          (S the dog chased the cat)
     |
     |      :return: a tree consisting of this tree's root connected directly to
     |          its leaves, omitting all intervening non-terminal nodes.
     |      :rtype: Tree
     |
     |  freeze(self, leaf_freezer=None)
     |
     |  height(self)
     |      Return the height of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.height()
     |          5
     |          >>> print(t[0,0])
     |          (D the)
     |          >>> t[0,0].height()
     |          2
     |
     |      :return: The height of this tree.  The height of a tree
     |          containing no children is 1; the height of a tree
     |          containing only leaves is 2; and the height of any other
     |          tree is one plus the maximum of its children's
     |          heights.
     |      :rtype: int
     |
     |  label(self)
     |      Return the node label of the tree.
     |
     |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
     |          >>> t.label()
     |          'S'
     |
     |      :return: the node label (typically a string)
     |      :rtype: any
     |
     |  leaf_treeposition(self, index)
     |      :return: The tree position of the ``index``-th leaf in this
     |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
     |          ``self[tp]==self.leaves()[i]``.
     |
     |      :raise IndexError: If this tree contains fewer than ``index+1``
     |          leaves, or if ``index<0``.
     |
     |  leaves(self)
     |      Return the leaves of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.leaves()
     |          ['the', 'dog', 'chased', 'the', 'cat']
     |
     |      :return: a list containing this tree's leaves.
     |          The order reflects the order of the
     |          leaves in the tree's hierarchical structure.
     |      :rtype: list
     |
     |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
     |      :return: A pretty-printed string representation of this tree.
     |      :rtype: str
     |      :param margin: The right margin at which to do line-wrapping.
     |      :type margin: int
     |      :param indent: The indentation level at which printing
     |          begins.  This number is used to decide how far to indent
     |          subsequent lines.
     |      :type indent: int
     |      :param nodesep: A string that is used to separate the node
     |          from the children.  E.g., the default value ``':'`` gives
     |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
     |
     |  pformat_latex_qtree(self)
     |      Returns a representation of the tree compatible with the
     |      LaTeX qtree package. This consists of the string ``\Tree``
     |      followed by the tree represented in bracketed notation.
     |
     |      For example, the following result was generated from a parse tree of
     |      the sentence ``The announcement astounded us``::
     |
     |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
     |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
     |
     |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
     |      style file for the qtree package.
     |
     |      :return: A latex qtree representation of this tree.
     |      :rtype: str
     |
     |  pos(self)
     |      Return a sequence of pos-tagged words extracted from the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.pos()
     |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
     |
     |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
     |          The order reflects the order of the leaves in the tree's hierarchical structure.
     |      :rtype: list(tuple)
     |
     |  pprint(self, **kwargs)
     |      Print a string representation of this Tree to 'stream'
     |
     |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
     |      Pretty-print this tree as ASCII or Unicode art.
     |      For explanation of the arguments, see the documentation for
     |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
     |
     |  productions(self)
     |      Generate the productions that correspond to the non-terminal nodes of the tree.
     |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
     |      form P -> C1 C2 ... Cn.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
     |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
     |          NP -> D N, D -> 'the', N -> 'cat']
     |
     |      :rtype: list(Production)
     |
     |  subtrees(self, filter=None)
     |      Generate all the subtrees of this tree, optionally restricted
     |      to trees matching the filter function.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> for s in t.subtrees(lambda t: t.height() == 2):
     |          ...     print(s)
     |          (D the)
     |          (N dog)
     |          (V chased)
     |          (D the)
     |          (N cat)
     |
     |      :type filter: function
     |      :param filter: the function to filter all local trees
     |
     |  treeposition_spanning_leaves(self, start, end)
     |      :return: The tree position of the lowest descendant of this
     |          tree that dominates ``self.leaves()[start:end]``.
     |      :raise ValueError: if ``end <= start``
     |
     |  treepositions(self, order='preorder')
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.treepositions() # doctest: +ELLIPSIS
     |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
     |          >>> for pos in t.treepositions('leaves'):
     |          ...     t[pos] = t[pos][::-1].upper()
     |          >>> print(t)
     |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
     |
     |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
     |          ``leaves``.
     |
     |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
     |      This method modifies the tree in three ways:
     |
     |        1. Transforms a tree in Chomsky Normal Form back to its
     |           original structure (branching greater than two)
     |        2. Removes any parent annotation (if it exists)
     |        3. (optional) expands unary subtrees (if previously
     |           collapsed with collapseUnary(...) )
     |
     |      :param expandUnary: Flag to expand unary or not (default = True)
     |      :type  expandUnary: bool
     |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
     |      :type  parentChar: str
     |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
     |      :type  unaryChar: str
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from nltk.tree.tree.Tree:
     |
     |  convert(tree)
     |      Convert a tree between different subtypes of Tree.  ``cls`` determines
     |      which class will be used to encode the new tree.
     |
     |      :type tree: Tree
     |      :param tree: The tree that should be converted.
     |      :return: The new Tree.
     |
     |  fromlist(l)
     |      :type l: list
     |      :param l: a tree represented as nested lists
     |
     |      :return: A tree corresponding to the list representation ``l``.
     |      :rtype: Tree
     |
     |      Convert nested lists to a NLTK Tree
     |
     |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
     |      Read a bracketed tree string and return the resulting tree.
     |      Trees are represented as nested brackettings, such as::
     |
     |        (S (NP (NNP John)) (VP (V runs)))
     |
     |      :type s: str
     |      :param s: The string to read
     |
     |      :type brackets: str (length=2)
     |      :param brackets: The bracket characters used to mark the
     |          beginning and end of trees and subtrees.
     |
     |      :type read_node: function
     |      :type read_leaf: function
     |      :param read_node, read_leaf: If specified, these functions
     |          are applied to the substrings of ``s`` corresponding to
     |          nodes and leaves (respectively) to obtain the values for
     |          those nodes and leaves.  They should have the following
     |          signature:
     |
     |             read_node(str) -> value
     |
     |          For example, these functions could be used to process nodes
     |          and leaves whose values should be some type other than
     |          string (such as ``FeatStruct``).
     |          Note that by default, node strings and leaf strings are
     |          delimited by whitespace and brackets; to override this
     |          default, use the ``node_pattern`` and ``leaf_pattern``
     |          arguments.
     |
     |      :type node_pattern: str
     |      :type leaf_pattern: str
     |      :param node_pattern, leaf_pattern: Regular expression patterns
     |          used to find node and leaf substrings in ``s``.  By
     |          default, both nodes patterns are defined to match any
     |          sequence of non-whitespace non-bracket characters.
     |
     |      :type remove_empty_top_bracketing: bool
     |      :param remove_empty_top_bracketing: If the resulting tree has
     |          an empty node label, and is length one, then return its
     |          single child instead.  This is useful for treebank trees,
     |          which sometimes contain an extra level of bracketing.
     |
     |      :return: A tree corresponding to the string representation ``s``.
     |          If this class method is called using a subclass of Tree,
     |          then it will return a tree of that type.
     |      :rtype: Tree
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tree.tree.Tree:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  node
     |      Outdated method to access the node value; use the label() method instead.
     |
     |      @deprecated: Use label() instead
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.

    class ImmutableProbabilisticTree(ImmutableTree, nltk.probability.ProbabilisticMixIn)
     |  ImmutableProbabilisticTree(node, children=None, **prob_kwargs)
     |
     |  Method resolution order:
     |      ImmutableProbabilisticTree
     |      ImmutableTree
     |      nltk.tree.tree.Tree
     |      builtins.list
     |      nltk.probability.ProbabilisticMixIn
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, node, children=None, **prob_kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  copy(self, deep=False)
     |      Return a shallow copy of the list.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  convert(val)
     |      Convert a tree between different subtypes of Tree.  ``cls`` determines
     |      which class will be used to encode the new tree.
     |
     |      :type tree: Tree
     |      :param tree: The tree that should be converted.
     |      :return: The new Tree.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from ImmutableTree:
     |
     |  __delitem__(self, index)
     |      Delete self[key].
     |
     |  __delslice__(self, i, j)
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __iadd__(self, other)
     |      Implement self+=value.
     |
     |  __imul__(self, other)
     |      Implement self*=value.
     |
     |  __setitem__(self, index, value)
     |      Set self[key] to value.
     |
     |  __setslice__(self, i, j, value)
     |
     |  append(self, v)
     |      Append object to the end of the list.
     |
     |  extend(self, v)
     |      Extend list by appending elements from the iterable.
     |
     |  pop(self, v=None)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, v)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self)
     |      Reverse *IN PLACE*.
     |
     |  set_label(self, value)
     |      Set the node label.  This will only succeed the first time the
     |      node label is set, which should occur in ImmutableTree.__init__().
     |
     |  sort(self)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.tree.Tree:
     |
     |  __add__(self, v)
     |      Return self+value.
     |
     |  __copy__(self)
     |
     |  __deepcopy__(self, memo)
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__ lambda self, other
     |
     |  __getitem__(self, index)
     |      Return self[index].
     |
     |  __gt__ lambda self, other
     |
     |  __le__ lambda self, other
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, v)
     |      Return self*value.
     |
     |  __ne__ lambda self, other
     |      # @total_ordering doesn't work here, since the class inherits from a builtin class
     |
     |  __radd__(self, v)
     |
     |  __rmul__(self, v)
     |      Return value*self.
     |
     |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
     |      This method can modify a tree in three ways:
     |
     |        1. Convert a tree into its Chomsky Normal Form (CNF)
     |           equivalent -- Every subtree has either two non-terminals
     |           or one terminal as its children.  This process requires
     |           the creation of more"artificial" non-terminal nodes.
     |        2. Markov (vertical) smoothing of children in new artificial
     |           nodes
     |        3. Horizontal (parent) annotation of nodes
     |
     |      :param factor: Right or left factoring method (default = "right")
     |      :type  factor: str = [left|right]
     |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
     |      :type  horzMarkov: int | None
     |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
     |      :type  vertMarkov: int | None
     |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
     |                        original subtree from the child nodes that have yet to be expanded (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string used to separate the node representation from its vertical annotation
     |      :type  parentChar: str
     |
     |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
     |      Collapse subtrees with a single child (ie. unary productions)
     |      into a new non-terminal (Tree node) joined by 'joinChar'.
     |      This is useful when working with algorithms that do not allow
     |      unary productions, and completely removing the unary productions
     |      would require loss of useful information.  The Tree is modified
     |      directly (since it is passed by reference) and no value is returned.
     |
     |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
     |                          Part-of-Speech tags) since they are always unary productions
     |      :type  collapsePOS: bool
     |      :param collapseRoot: 'False' (default) will not modify the root production
     |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
     |                           to the TOP -> productions.
     |      :type collapseRoot: bool
     |      :param joinChar: A string used to connect collapsed node values (default = "+")
     |      :type  joinChar: str
     |
     |  draw(self)
     |      Open a new window containing a graphical diagram of this tree.
     |
     |  flatten(self)
     |      Return a flat version of the tree, with all non-root non-terminals removed.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> print(t.flatten())
     |          (S the dog chased the cat)
     |
     |      :return: a tree consisting of this tree's root connected directly to
     |          its leaves, omitting all intervening non-terminal nodes.
     |      :rtype: Tree
     |
     |  freeze(self, leaf_freezer=None)
     |
     |  height(self)
     |      Return the height of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.height()
     |          5
     |          >>> print(t[0,0])
     |          (D the)
     |          >>> t[0,0].height()
     |          2
     |
     |      :return: The height of this tree.  The height of a tree
     |          containing no children is 1; the height of a tree
     |          containing only leaves is 2; and the height of any other
     |          tree is one plus the maximum of its children's
     |          heights.
     |      :rtype: int
     |
     |  label(self)
     |      Return the node label of the tree.
     |
     |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
     |          >>> t.label()
     |          'S'
     |
     |      :return: the node label (typically a string)
     |      :rtype: any
     |
     |  leaf_treeposition(self, index)
     |      :return: The tree position of the ``index``-th leaf in this
     |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
     |          ``self[tp]==self.leaves()[i]``.
     |
     |      :raise IndexError: If this tree contains fewer than ``index+1``
     |          leaves, or if ``index<0``.
     |
     |  leaves(self)
     |      Return the leaves of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.leaves()
     |          ['the', 'dog', 'chased', 'the', 'cat']
     |
     |      :return: a list containing this tree's leaves.
     |          The order reflects the order of the
     |          leaves in the tree's hierarchical structure.
     |      :rtype: list
     |
     |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
     |      :return: A pretty-printed string representation of this tree.
     |      :rtype: str
     |      :param margin: The right margin at which to do line-wrapping.
     |      :type margin: int
     |      :param indent: The indentation level at which printing
     |          begins.  This number is used to decide how far to indent
     |          subsequent lines.
     |      :type indent: int
     |      :param nodesep: A string that is used to separate the node
     |          from the children.  E.g., the default value ``':'`` gives
     |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
     |
     |  pformat_latex_qtree(self)
     |      Returns a representation of the tree compatible with the
     |      LaTeX qtree package. This consists of the string ``\Tree``
     |      followed by the tree represented in bracketed notation.
     |
     |      For example, the following result was generated from a parse tree of
     |      the sentence ``The announcement astounded us``::
     |
     |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
     |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
     |
     |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
     |      style file for the qtree package.
     |
     |      :return: A latex qtree representation of this tree.
     |      :rtype: str
     |
     |  pos(self)
     |      Return a sequence of pos-tagged words extracted from the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.pos()
     |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
     |
     |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
     |          The order reflects the order of the leaves in the tree's hierarchical structure.
     |      :rtype: list(tuple)
     |
     |  pprint(self, **kwargs)
     |      Print a string representation of this Tree to 'stream'
     |
     |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
     |      Pretty-print this tree as ASCII or Unicode art.
     |      For explanation of the arguments, see the documentation for
     |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
     |
     |  productions(self)
     |      Generate the productions that correspond to the non-terminal nodes of the tree.
     |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
     |      form P -> C1 C2 ... Cn.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
     |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
     |          NP -> D N, D -> 'the', N -> 'cat']
     |
     |      :rtype: list(Production)
     |
     |  subtrees(self, filter=None)
     |      Generate all the subtrees of this tree, optionally restricted
     |      to trees matching the filter function.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> for s in t.subtrees(lambda t: t.height() == 2):
     |          ...     print(s)
     |          (D the)
     |          (N dog)
     |          (V chased)
     |          (D the)
     |          (N cat)
     |
     |      :type filter: function
     |      :param filter: the function to filter all local trees
     |
     |  treeposition_spanning_leaves(self, start, end)
     |      :return: The tree position of the lowest descendant of this
     |          tree that dominates ``self.leaves()[start:end]``.
     |      :raise ValueError: if ``end <= start``
     |
     |  treepositions(self, order='preorder')
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.treepositions() # doctest: +ELLIPSIS
     |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
     |          >>> for pos in t.treepositions('leaves'):
     |          ...     t[pos] = t[pos][::-1].upper()
     |          >>> print(t)
     |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
     |
     |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
     |          ``leaves``.
     |
     |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
     |      This method modifies the tree in three ways:
     |
     |        1. Transforms a tree in Chomsky Normal Form back to its
     |           original structure (branching greater than two)
     |        2. Removes any parent annotation (if it exists)
     |        3. (optional) expands unary subtrees (if previously
     |           collapsed with collapseUnary(...) )
     |
     |      :param expandUnary: Flag to expand unary or not (default = True)
     |      :type  expandUnary: bool
     |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
     |      :type  parentChar: str
     |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
     |      :type  unaryChar: str
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from nltk.tree.tree.Tree:
     |
     |  fromlist(l)
     |      :type l: list
     |      :param l: a tree represented as nested lists
     |
     |      :return: A tree corresponding to the list representation ``l``.
     |      :rtype: Tree
     |
     |      Convert nested lists to a NLTK Tree
     |
     |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
     |      Read a bracketed tree string and return the resulting tree.
     |      Trees are represented as nested brackettings, such as::
     |
     |        (S (NP (NNP John)) (VP (V runs)))
     |
     |      :type s: str
     |      :param s: The string to read
     |
     |      :type brackets: str (length=2)
     |      :param brackets: The bracket characters used to mark the
     |          beginning and end of trees and subtrees.
     |
     |      :type read_node: function
     |      :type read_leaf: function
     |      :param read_node, read_leaf: If specified, these functions
     |          are applied to the substrings of ``s`` corresponding to
     |          nodes and leaves (respectively) to obtain the values for
     |          those nodes and leaves.  They should have the following
     |          signature:
     |
     |             read_node(str) -> value
     |
     |          For example, these functions could be used to process nodes
     |          and leaves whose values should be some type other than
     |          string (such as ``FeatStruct``).
     |          Note that by default, node strings and leaf strings are
     |          delimited by whitespace and brackets; to override this
     |          default, use the ``node_pattern`` and ``leaf_pattern``
     |          arguments.
     |
     |      :type node_pattern: str
     |      :type leaf_pattern: str
     |      :param node_pattern, leaf_pattern: Regular expression patterns
     |          used to find node and leaf substrings in ``s``.  By
     |          default, both nodes patterns are defined to match any
     |          sequence of non-whitespace non-bracket characters.
     |
     |      :type remove_empty_top_bracketing: bool
     |      :param remove_empty_top_bracketing: If the resulting tree has
     |          an empty node label, and is length one, then return its
     |          single child instead.  This is useful for treebank trees,
     |          which sometimes contain an extra level of bracketing.
     |
     |      :return: A tree corresponding to the string representation ``s``.
     |          If this class method is called using a subclass of Tree,
     |          then it will return a tree of that type.
     |      :rtype: Tree
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tree.tree.Tree:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  node
     |      Outdated method to access the node value; use the label() method instead.
     |
     |      @deprecated: Use label() instead
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  insert(self, index, object, /)
     |      Insert object before index.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.probability.ProbabilisticMixIn:
     |
     |  logprob(self)
     |      Return ``log(p)``, where ``p`` is the probability associated
     |      with this object.
     |
     |      :rtype: float
     |
     |  prob(self)
     |      Return the probability associated with this object.
     |
     |      :rtype: float
     |
     |  set_logprob(self, logprob)
     |      Set the log probability associated with this object to
     |      ``logprob``.  I.e., set the probability associated with this
     |      object to ``2**(logprob)``.
     |
     |      :param logprob: The new log probability
     |      :type logprob: float
     |
     |  set_prob(self, prob)
     |      Set the probability associated with this object to ``prob``.
     |
     |      :param prob: The new probability
     |      :type prob: float

    class ImmutableTree(nltk.tree.tree.Tree)
     |  ImmutableTree(node, children=None)
     |
     |  Method resolution order:
     |      ImmutableTree
     |      nltk.tree.tree.Tree
     |      builtins.list
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __delitem__(self, index)
     |      Delete self[key].
     |
     |  __delslice__(self, i, j)
     |
     |  __hash__(self)
     |      Return hash(self).
     |
     |  __iadd__(self, other)
     |      Implement self+=value.
     |
     |  __imul__(self, other)
     |      Implement self*=value.
     |
     |  __init__(self, node, children=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __setitem__(self, index, value)
     |      Set self[key] to value.
     |
     |  __setslice__(self, i, j, value)
     |
     |  append(self, v)
     |      Append object to the end of the list.
     |
     |  extend(self, v)
     |      Extend list by appending elements from the iterable.
     |
     |  pop(self, v=None)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, v)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self)
     |      Reverse *IN PLACE*.
     |
     |  set_label(self, value)
     |      Set the node label.  This will only succeed the first time the
     |      node label is set, which should occur in ImmutableTree.__init__().
     |
     |  sort(self)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.tree.Tree:
     |
     |  __add__(self, v)
     |      Return self+value.
     |
     |  __copy__(self)
     |
     |  __deepcopy__(self, memo)
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__ lambda self, other
     |
     |  __getitem__(self, index)
     |      Return self[index].
     |
     |  __gt__ lambda self, other
     |
     |  __le__ lambda self, other
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, v)
     |      Return self*value.
     |
     |  __ne__ lambda self, other
     |      # @total_ordering doesn't work here, since the class inherits from a builtin class
     |
     |  __radd__(self, v)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __rmul__(self, v)
     |      Return value*self.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
     |      This method can modify a tree in three ways:
     |
     |        1. Convert a tree into its Chomsky Normal Form (CNF)
     |           equivalent -- Every subtree has either two non-terminals
     |           or one terminal as its children.  This process requires
     |           the creation of more"artificial" non-terminal nodes.
     |        2. Markov (vertical) smoothing of children in new artificial
     |           nodes
     |        3. Horizontal (parent) annotation of nodes
     |
     |      :param factor: Right or left factoring method (default = "right")
     |      :type  factor: str = [left|right]
     |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
     |      :type  horzMarkov: int | None
     |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
     |      :type  vertMarkov: int | None
     |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
     |                        original subtree from the child nodes that have yet to be expanded (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string used to separate the node representation from its vertical annotation
     |      :type  parentChar: str
     |
     |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
     |      Collapse subtrees with a single child (ie. unary productions)
     |      into a new non-terminal (Tree node) joined by 'joinChar'.
     |      This is useful when working with algorithms that do not allow
     |      unary productions, and completely removing the unary productions
     |      would require loss of useful information.  The Tree is modified
     |      directly (since it is passed by reference) and no value is returned.
     |
     |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
     |                          Part-of-Speech tags) since they are always unary productions
     |      :type  collapsePOS: bool
     |      :param collapseRoot: 'False' (default) will not modify the root production
     |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
     |                           to the TOP -> productions.
     |      :type collapseRoot: bool
     |      :param joinChar: A string used to connect collapsed node values (default = "+")
     |      :type  joinChar: str
     |
     |  copy(self, deep=False)
     |      Return a shallow copy of the list.
     |
     |  draw(self)
     |      Open a new window containing a graphical diagram of this tree.
     |
     |  flatten(self)
     |      Return a flat version of the tree, with all non-root non-terminals removed.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> print(t.flatten())
     |          (S the dog chased the cat)
     |
     |      :return: a tree consisting of this tree's root connected directly to
     |          its leaves, omitting all intervening non-terminal nodes.
     |      :rtype: Tree
     |
     |  freeze(self, leaf_freezer=None)
     |
     |  height(self)
     |      Return the height of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.height()
     |          5
     |          >>> print(t[0,0])
     |          (D the)
     |          >>> t[0,0].height()
     |          2
     |
     |      :return: The height of this tree.  The height of a tree
     |          containing no children is 1; the height of a tree
     |          containing only leaves is 2; and the height of any other
     |          tree is one plus the maximum of its children's
     |          heights.
     |      :rtype: int
     |
     |  label(self)
     |      Return the node label of the tree.
     |
     |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
     |          >>> t.label()
     |          'S'
     |
     |      :return: the node label (typically a string)
     |      :rtype: any
     |
     |  leaf_treeposition(self, index)
     |      :return: The tree position of the ``index``-th leaf in this
     |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
     |          ``self[tp]==self.leaves()[i]``.
     |
     |      :raise IndexError: If this tree contains fewer than ``index+1``
     |          leaves, or if ``index<0``.
     |
     |  leaves(self)
     |      Return the leaves of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.leaves()
     |          ['the', 'dog', 'chased', 'the', 'cat']
     |
     |      :return: a list containing this tree's leaves.
     |          The order reflects the order of the
     |          leaves in the tree's hierarchical structure.
     |      :rtype: list
     |
     |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
     |      :return: A pretty-printed string representation of this tree.
     |      :rtype: str
     |      :param margin: The right margin at which to do line-wrapping.
     |      :type margin: int
     |      :param indent: The indentation level at which printing
     |          begins.  This number is used to decide how far to indent
     |          subsequent lines.
     |      :type indent: int
     |      :param nodesep: A string that is used to separate the node
     |          from the children.  E.g., the default value ``':'`` gives
     |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
     |
     |  pformat_latex_qtree(self)
     |      Returns a representation of the tree compatible with the
     |      LaTeX qtree package. This consists of the string ``\Tree``
     |      followed by the tree represented in bracketed notation.
     |
     |      For example, the following result was generated from a parse tree of
     |      the sentence ``The announcement astounded us``::
     |
     |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
     |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
     |
     |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
     |      style file for the qtree package.
     |
     |      :return: A latex qtree representation of this tree.
     |      :rtype: str
     |
     |  pos(self)
     |      Return a sequence of pos-tagged words extracted from the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.pos()
     |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
     |
     |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
     |          The order reflects the order of the leaves in the tree's hierarchical structure.
     |      :rtype: list(tuple)
     |
     |  pprint(self, **kwargs)
     |      Print a string representation of this Tree to 'stream'
     |
     |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
     |      Pretty-print this tree as ASCII or Unicode art.
     |      For explanation of the arguments, see the documentation for
     |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
     |
     |  productions(self)
     |      Generate the productions that correspond to the non-terminal nodes of the tree.
     |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
     |      form P -> C1 C2 ... Cn.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
     |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
     |          NP -> D N, D -> 'the', N -> 'cat']
     |
     |      :rtype: list(Production)
     |
     |  subtrees(self, filter=None)
     |      Generate all the subtrees of this tree, optionally restricted
     |      to trees matching the filter function.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> for s in t.subtrees(lambda t: t.height() == 2):
     |          ...     print(s)
     |          (D the)
     |          (N dog)
     |          (V chased)
     |          (D the)
     |          (N cat)
     |
     |      :type filter: function
     |      :param filter: the function to filter all local trees
     |
     |  treeposition_spanning_leaves(self, start, end)
     |      :return: The tree position of the lowest descendant of this
     |          tree that dominates ``self.leaves()[start:end]``.
     |      :raise ValueError: if ``end <= start``
     |
     |  treepositions(self, order='preorder')
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.treepositions() # doctest: +ELLIPSIS
     |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
     |          >>> for pos in t.treepositions('leaves'):
     |          ...     t[pos] = t[pos][::-1].upper()
     |          >>> print(t)
     |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
     |
     |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
     |          ``leaves``.
     |
     |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
     |      This method modifies the tree in three ways:
     |
     |        1. Transforms a tree in Chomsky Normal Form back to its
     |           original structure (branching greater than two)
     |        2. Removes any parent annotation (if it exists)
     |        3. (optional) expands unary subtrees (if previously
     |           collapsed with collapseUnary(...) )
     |
     |      :param expandUnary: Flag to expand unary or not (default = True)
     |      :type  expandUnary: bool
     |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
     |      :type  parentChar: str
     |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
     |      :type  unaryChar: str
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from nltk.tree.tree.Tree:
     |
     |  convert(tree)
     |      Convert a tree between different subtypes of Tree.  ``cls`` determines
     |      which class will be used to encode the new tree.
     |
     |      :type tree: Tree
     |      :param tree: The tree that should be converted.
     |      :return: The new Tree.
     |
     |  fromlist(l)
     |      :type l: list
     |      :param l: a tree represented as nested lists
     |
     |      :return: A tree corresponding to the list representation ``l``.
     |      :rtype: Tree
     |
     |      Convert nested lists to a NLTK Tree
     |
     |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
     |      Read a bracketed tree string and return the resulting tree.
     |      Trees are represented as nested brackettings, such as::
     |
     |        (S (NP (NNP John)) (VP (V runs)))
     |
     |      :type s: str
     |      :param s: The string to read
     |
     |      :type brackets: str (length=2)
     |      :param brackets: The bracket characters used to mark the
     |          beginning and end of trees and subtrees.
     |
     |      :type read_node: function
     |      :type read_leaf: function
     |      :param read_node, read_leaf: If specified, these functions
     |          are applied to the substrings of ``s`` corresponding to
     |          nodes and leaves (respectively) to obtain the values for
     |          those nodes and leaves.  They should have the following
     |          signature:
     |
     |             read_node(str) -> value
     |
     |          For example, these functions could be used to process nodes
     |          and leaves whose values should be some type other than
     |          string (such as ``FeatStruct``).
     |          Note that by default, node strings and leaf strings are
     |          delimited by whitespace and brackets; to override this
     |          default, use the ``node_pattern`` and ``leaf_pattern``
     |          arguments.
     |
     |      :type node_pattern: str
     |      :type leaf_pattern: str
     |      :param node_pattern, leaf_pattern: Regular expression patterns
     |          used to find node and leaf substrings in ``s``.  By
     |          default, both nodes patterns are defined to match any
     |          sequence of non-whitespace non-bracket characters.
     |
     |      :type remove_empty_top_bracketing: bool
     |      :param remove_empty_top_bracketing: If the resulting tree has
     |          an empty node label, and is length one, then return its
     |          single child instead.  This is useful for treebank trees,
     |          which sometimes contain an extra level of bracketing.
     |
     |      :return: A tree corresponding to the string representation ``s``.
     |          If this class method is called using a subclass of Tree,
     |          then it will return a tree of that type.
     |      :rtype: Tree
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tree.tree.Tree:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  node
     |      Outdated method to access the node value; use the label() method instead.
     |
     |      @deprecated: Use label() instead
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  insert(self, index, object, /)
     |      Insert object before index.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.

    class MultiParentedTree(AbstractParentedTree)
     |  MultiParentedTree(node, children=None)
     |
     |  A ``Tree`` that automatically maintains parent pointers for
     |  multi-parented trees.  The following are methods for querying the
     |  structure of a multi-parented tree: ``parents()``, ``parent_indices()``,
     |  ``left_siblings()``, ``right_siblings()``, ``roots``, ``treepositions``.
     |
     |  Each ``MultiParentedTree`` may have zero or more parents.  In
     |  particular, subtrees may be shared.  If a single
     |  ``MultiParentedTree`` is used as multiple children of the same
     |  parent, then that parent will appear multiple times in its
     |  ``parents()`` method.
     |
     |  ``MultiParentedTrees`` should never be used in the same tree as
     |  ``Trees`` or ``ParentedTrees``.  Mixing tree implementations may
     |  result in incorrect parent pointers and in ``TypeError`` exceptions.
     |
     |  Method resolution order:
     |      MultiParentedTree
     |      AbstractParentedTree
     |      nltk.tree.tree.Tree
     |      builtins.list
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, node, children=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  left_siblings(self)
     |      A list of all left siblings of this tree, in any of its parent
     |      trees.  A tree may be its own left sibling if it is used as
     |      multiple contiguous children of the same parent.  A tree may
     |      appear multiple times in this list if it is the left sibling
     |      of this tree with respect to multiple parents.
     |
     |      :type: list(MultiParentedTree)
     |
     |  parent_indices(self, parent)
     |      Return a list of the indices where this tree occurs as a child
     |      of ``parent``.  If this child does not occur as a child of
     |      ``parent``, then the empty list is returned.  The following is
     |      always true::
     |
     |        for parent_index in ptree.parent_indices(parent):
     |            parent[parent_index] is ptree
     |
     |  parents(self)
     |      The set of parents of this tree.  If this tree has no parents,
     |      then ``parents`` is the empty set.  To check if a tree is used
     |      as multiple children of the same parent, use the
     |      ``parent_indices()`` method.
     |
     |      :type: list(MultiParentedTree)
     |
     |  right_siblings(self)
     |      A list of all right siblings of this tree, in any of its parent
     |      trees.  A tree may be its own right sibling if it is used as
     |      multiple contiguous children of the same parent.  A tree may
     |      appear multiple times in this list if it is the right sibling
     |      of this tree with respect to multiple parents.
     |
     |      :type: list(MultiParentedTree)
     |
     |  roots(self)
     |      The set of all roots of this tree.  This set is formed by
     |      tracing all possible parent paths until trees with no parents
     |      are found.
     |
     |      :type: list(MultiParentedTree)
     |
     |  treepositions(self, root)
     |      Return a list of all tree positions that can be used to reach
     |      this multi-parented tree starting from ``root``.  I.e., the
     |      following is always true::
     |
     |        for treepos in ptree.treepositions(root):
     |            root[treepos] is ptree
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractParentedTree:
     |
     |  __delitem__(self, index)
     |      Delete self[key].
     |
     |  __getnewargs__(self)
     |      Method used by the pickle module when un-pickling.
     |      This method provides the arguments passed to ``__new__``
     |      upon un-pickling. Without this method, ParentedTree instances
     |      cannot be pickled and unpickled in Python 3.7+ onwards.
     |
     |      :return: Tuple of arguments for ``__new__``, i.e. the label
     |          and the children of this node.
     |      :rtype: Tuple[Any, List[AbstractParentedTree]]
     |
     |  __setitem__(self, index, value)
     |      Set self[key] to value.
     |
     |  append(self, child)
     |      Append object to the end of the list.
     |
     |  extend(self, children)
     |      Extend list by appending elements from the iterable.
     |
     |  insert(self, index, child)
     |      Insert object before index.
     |
     |  pop(self, index=-1)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, child)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.tree.Tree:
     |
     |  __add__(self, v)
     |      Return self+value.
     |
     |  __copy__(self)
     |
     |  __deepcopy__(self, memo)
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__ lambda self, other
     |
     |  __getitem__(self, index)
     |      Return self[index].
     |
     |  __gt__ lambda self, other
     |
     |  __le__ lambda self, other
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, v)
     |      Return self*value.
     |
     |  __ne__ lambda self, other
     |      # @total_ordering doesn't work here, since the class inherits from a builtin class
     |
     |  __radd__(self, v)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __rmul__(self, v)
     |      Return value*self.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
     |      This method can modify a tree in three ways:
     |
     |        1. Convert a tree into its Chomsky Normal Form (CNF)
     |           equivalent -- Every subtree has either two non-terminals
     |           or one terminal as its children.  This process requires
     |           the creation of more"artificial" non-terminal nodes.
     |        2. Markov (vertical) smoothing of children in new artificial
     |           nodes
     |        3. Horizontal (parent) annotation of nodes
     |
     |      :param factor: Right or left factoring method (default = "right")
     |      :type  factor: str = [left|right]
     |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
     |      :type  horzMarkov: int | None
     |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
     |      :type  vertMarkov: int | None
     |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
     |                        original subtree from the child nodes that have yet to be expanded (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string used to separate the node representation from its vertical annotation
     |      :type  parentChar: str
     |
     |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
     |      Collapse subtrees with a single child (ie. unary productions)
     |      into a new non-terminal (Tree node) joined by 'joinChar'.
     |      This is useful when working with algorithms that do not allow
     |      unary productions, and completely removing the unary productions
     |      would require loss of useful information.  The Tree is modified
     |      directly (since it is passed by reference) and no value is returned.
     |
     |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
     |                          Part-of-Speech tags) since they are always unary productions
     |      :type  collapsePOS: bool
     |      :param collapseRoot: 'False' (default) will not modify the root production
     |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
     |                           to the TOP -> productions.
     |      :type collapseRoot: bool
     |      :param joinChar: A string used to connect collapsed node values (default = "+")
     |      :type  joinChar: str
     |
     |  copy(self, deep=False)
     |      Return a shallow copy of the list.
     |
     |  draw(self)
     |      Open a new window containing a graphical diagram of this tree.
     |
     |  flatten(self)
     |      Return a flat version of the tree, with all non-root non-terminals removed.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> print(t.flatten())
     |          (S the dog chased the cat)
     |
     |      :return: a tree consisting of this tree's root connected directly to
     |          its leaves, omitting all intervening non-terminal nodes.
     |      :rtype: Tree
     |
     |  freeze(self, leaf_freezer=None)
     |
     |  height(self)
     |      Return the height of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.height()
     |          5
     |          >>> print(t[0,0])
     |          (D the)
     |          >>> t[0,0].height()
     |          2
     |
     |      :return: The height of this tree.  The height of a tree
     |          containing no children is 1; the height of a tree
     |          containing only leaves is 2; and the height of any other
     |          tree is one plus the maximum of its children's
     |          heights.
     |      :rtype: int
     |
     |  label(self)
     |      Return the node label of the tree.
     |
     |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
     |          >>> t.label()
     |          'S'
     |
     |      :return: the node label (typically a string)
     |      :rtype: any
     |
     |  leaf_treeposition(self, index)
     |      :return: The tree position of the ``index``-th leaf in this
     |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
     |          ``self[tp]==self.leaves()[i]``.
     |
     |      :raise IndexError: If this tree contains fewer than ``index+1``
     |          leaves, or if ``index<0``.
     |
     |  leaves(self)
     |      Return the leaves of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.leaves()
     |          ['the', 'dog', 'chased', 'the', 'cat']
     |
     |      :return: a list containing this tree's leaves.
     |          The order reflects the order of the
     |          leaves in the tree's hierarchical structure.
     |      :rtype: list
     |
     |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
     |      :return: A pretty-printed string representation of this tree.
     |      :rtype: str
     |      :param margin: The right margin at which to do line-wrapping.
     |      :type margin: int
     |      :param indent: The indentation level at which printing
     |          begins.  This number is used to decide how far to indent
     |          subsequent lines.
     |      :type indent: int
     |      :param nodesep: A string that is used to separate the node
     |          from the children.  E.g., the default value ``':'`` gives
     |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
     |
     |  pformat_latex_qtree(self)
     |      Returns a representation of the tree compatible with the
     |      LaTeX qtree package. This consists of the string ``\Tree``
     |      followed by the tree represented in bracketed notation.
     |
     |      For example, the following result was generated from a parse tree of
     |      the sentence ``The announcement astounded us``::
     |
     |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
     |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
     |
     |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
     |      style file for the qtree package.
     |
     |      :return: A latex qtree representation of this tree.
     |      :rtype: str
     |
     |  pos(self)
     |      Return a sequence of pos-tagged words extracted from the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.pos()
     |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
     |
     |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
     |          The order reflects the order of the leaves in the tree's hierarchical structure.
     |      :rtype: list(tuple)
     |
     |  pprint(self, **kwargs)
     |      Print a string representation of this Tree to 'stream'
     |
     |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
     |      Pretty-print this tree as ASCII or Unicode art.
     |      For explanation of the arguments, see the documentation for
     |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
     |
     |  productions(self)
     |      Generate the productions that correspond to the non-terminal nodes of the tree.
     |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
     |      form P -> C1 C2 ... Cn.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
     |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
     |          NP -> D N, D -> 'the', N -> 'cat']
     |
     |      :rtype: list(Production)
     |
     |  set_label(self, label)
     |      Set the node label of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.set_label("T")
     |          >>> print(t)
     |          (T (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))
     |
     |      :param label: the node label (typically a string)
     |      :type label: any
     |
     |  subtrees(self, filter=None)
     |      Generate all the subtrees of this tree, optionally restricted
     |      to trees matching the filter function.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> for s in t.subtrees(lambda t: t.height() == 2):
     |          ...     print(s)
     |          (D the)
     |          (N dog)
     |          (V chased)
     |          (D the)
     |          (N cat)
     |
     |      :type filter: function
     |      :param filter: the function to filter all local trees
     |
     |  treeposition_spanning_leaves(self, start, end)
     |      :return: The tree position of the lowest descendant of this
     |          tree that dominates ``self.leaves()[start:end]``.
     |      :raise ValueError: if ``end <= start``
     |
     |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
     |      This method modifies the tree in three ways:
     |
     |        1. Transforms a tree in Chomsky Normal Form back to its
     |           original structure (branching greater than two)
     |        2. Removes any parent annotation (if it exists)
     |        3. (optional) expands unary subtrees (if previously
     |           collapsed with collapseUnary(...) )
     |
     |      :param expandUnary: Flag to expand unary or not (default = True)
     |      :type  expandUnary: bool
     |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
     |      :type  parentChar: str
     |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
     |      :type  unaryChar: str
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from nltk.tree.tree.Tree:
     |
     |  convert(tree)
     |      Convert a tree between different subtypes of Tree.  ``cls`` determines
     |      which class will be used to encode the new tree.
     |
     |      :type tree: Tree
     |      :param tree: The tree that should be converted.
     |      :return: The new Tree.
     |
     |  fromlist(l)
     |      :type l: list
     |      :param l: a tree represented as nested lists
     |
     |      :return: A tree corresponding to the list representation ``l``.
     |      :rtype: Tree
     |
     |      Convert nested lists to a NLTK Tree
     |
     |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
     |      Read a bracketed tree string and return the resulting tree.
     |      Trees are represented as nested brackettings, such as::
     |
     |        (S (NP (NNP John)) (VP (V runs)))
     |
     |      :type s: str
     |      :param s: The string to read
     |
     |      :type brackets: str (length=2)
     |      :param brackets: The bracket characters used to mark the
     |          beginning and end of trees and subtrees.
     |
     |      :type read_node: function
     |      :type read_leaf: function
     |      :param read_node, read_leaf: If specified, these functions
     |          are applied to the substrings of ``s`` corresponding to
     |          nodes and leaves (respectively) to obtain the values for
     |          those nodes and leaves.  They should have the following
     |          signature:
     |
     |             read_node(str) -> value
     |
     |          For example, these functions could be used to process nodes
     |          and leaves whose values should be some type other than
     |          string (such as ``FeatStruct``).
     |          Note that by default, node strings and leaf strings are
     |          delimited by whitespace and brackets; to override this
     |          default, use the ``node_pattern`` and ``leaf_pattern``
     |          arguments.
     |
     |      :type node_pattern: str
     |      :type leaf_pattern: str
     |      :param node_pattern, leaf_pattern: Regular expression patterns
     |          used to find node and leaf substrings in ``s``.  By
     |          default, both nodes patterns are defined to match any
     |          sequence of non-whitespace non-bracket characters.
     |
     |      :type remove_empty_top_bracketing: bool
     |      :param remove_empty_top_bracketing: If the resulting tree has
     |          an empty node label, and is length one, then return its
     |          single child instead.  This is useful for treebank trees,
     |          which sometimes contain an extra level of bracketing.
     |
     |      :return: A tree corresponding to the string representation ``s``.
     |          If this class method is called using a subclass of Tree,
     |          then it will return a tree of that type.
     |      :rtype: Tree
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tree.tree.Tree:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  node
     |      Outdated method to access the node value; use the label() method instead.
     |
     |      @deprecated: Use label() instead
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.tree.tree.Tree:
     |
     |  __hash__ = None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __iadd__(self, value, /)
     |      Implement self+=value.
     |
     |  __imul__(self, value, /)
     |      Implement self*=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self, /)
     |      Reverse *IN PLACE*.
     |
     |  sort(self, /, *, key=None, reverse=False)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.

    class ParentedTree(AbstractParentedTree)
     |  ParentedTree(node, children=None)
     |
     |  A ``Tree`` that automatically maintains parent pointers for
     |  single-parented trees.  The following are methods for querying
     |  the structure of a parented tree: ``parent``, ``parent_index``,
     |  ``left_sibling``, ``right_sibling``, ``root``, ``treeposition``.
     |
     |  Each ``ParentedTree`` may have at most one parent.  In
     |  particular, subtrees may not be shared.  Any attempt to reuse a
     |  single ``ParentedTree`` as a child of more than one parent (or
     |  as multiple children of the same parent) will cause a
     |  ``ValueError`` exception to be raised.
     |
     |  ``ParentedTrees`` should never be used in the same tree as ``Trees``
     |  or ``MultiParentedTrees``.  Mixing tree implementations may result
     |  in incorrect parent pointers and in ``TypeError`` exceptions.
     |
     |  Method resolution order:
     |      ParentedTree
     |      AbstractParentedTree
     |      nltk.tree.tree.Tree
     |      builtins.list
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, node, children=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  copy(self, deep=False)
     |      Return a shallow copy of the list.
     |
     |  left_sibling(self)
     |      The left sibling of this tree, or None if it has none.
     |
     |  parent(self)
     |      The parent of this tree, or None if it has no parent.
     |
     |  parent_index(self)
     |      The index of this tree in its parent.  I.e.,
     |      ``ptree.parent()[ptree.parent_index()] is ptree``.  Note that
     |      ``ptree.parent_index()`` is not necessarily equal to
     |      ``ptree.parent.index(ptree)``, since the ``index()`` method
     |      returns the first child that is equal to its argument.
     |
     |  right_sibling(self)
     |      The right sibling of this tree, or None if it has none.
     |
     |  root(self)
     |      The root of this tree.  I.e., the unique ancestor of this tree
     |      whose parent is None.  If ``ptree.parent()`` is None, then
     |      ``ptree`` is its own root.
     |
     |  treeposition(self)
     |      The tree position of this tree, relative to the root of the
     |      tree.  I.e., ``ptree.root[ptree.treeposition] is ptree``.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from AbstractParentedTree:
     |
     |  __delitem__(self, index)
     |      Delete self[key].
     |
     |  __getnewargs__(self)
     |      Method used by the pickle module when un-pickling.
     |      This method provides the arguments passed to ``__new__``
     |      upon un-pickling. Without this method, ParentedTree instances
     |      cannot be pickled and unpickled in Python 3.7+ onwards.
     |
     |      :return: Tuple of arguments for ``__new__``, i.e. the label
     |          and the children of this node.
     |      :rtype: Tuple[Any, List[AbstractParentedTree]]
     |
     |  __setitem__(self, index, value)
     |      Set self[key] to value.
     |
     |  append(self, child)
     |      Append object to the end of the list.
     |
     |  extend(self, children)
     |      Extend list by appending elements from the iterable.
     |
     |  insert(self, index, child)
     |      Insert object before index.
     |
     |  pop(self, index=-1)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, child)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.tree.Tree:
     |
     |  __add__(self, v)
     |      Return self+value.
     |
     |  __copy__(self)
     |
     |  __deepcopy__(self, memo)
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__ lambda self, other
     |
     |  __getitem__(self, index)
     |      Return self[index].
     |
     |  __gt__ lambda self, other
     |
     |  __le__ lambda self, other
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, v)
     |      Return self*value.
     |
     |  __ne__ lambda self, other
     |      # @total_ordering doesn't work here, since the class inherits from a builtin class
     |
     |  __radd__(self, v)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __rmul__(self, v)
     |      Return value*self.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
     |      This method can modify a tree in three ways:
     |
     |        1. Convert a tree into its Chomsky Normal Form (CNF)
     |           equivalent -- Every subtree has either two non-terminals
     |           or one terminal as its children.  This process requires
     |           the creation of more"artificial" non-terminal nodes.
     |        2. Markov (vertical) smoothing of children in new artificial
     |           nodes
     |        3. Horizontal (parent) annotation of nodes
     |
     |      :param factor: Right or left factoring method (default = "right")
     |      :type  factor: str = [left|right]
     |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
     |      :type  horzMarkov: int | None
     |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
     |      :type  vertMarkov: int | None
     |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
     |                        original subtree from the child nodes that have yet to be expanded (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string used to separate the node representation from its vertical annotation
     |      :type  parentChar: str
     |
     |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
     |      Collapse subtrees with a single child (ie. unary productions)
     |      into a new non-terminal (Tree node) joined by 'joinChar'.
     |      This is useful when working with algorithms that do not allow
     |      unary productions, and completely removing the unary productions
     |      would require loss of useful information.  The Tree is modified
     |      directly (since it is passed by reference) and no value is returned.
     |
     |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
     |                          Part-of-Speech tags) since they are always unary productions
     |      :type  collapsePOS: bool
     |      :param collapseRoot: 'False' (default) will not modify the root production
     |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
     |                           to the TOP -> productions.
     |      :type collapseRoot: bool
     |      :param joinChar: A string used to connect collapsed node values (default = "+")
     |      :type  joinChar: str
     |
     |  draw(self)
     |      Open a new window containing a graphical diagram of this tree.
     |
     |  flatten(self)
     |      Return a flat version of the tree, with all non-root non-terminals removed.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> print(t.flatten())
     |          (S the dog chased the cat)
     |
     |      :return: a tree consisting of this tree's root connected directly to
     |          its leaves, omitting all intervening non-terminal nodes.
     |      :rtype: Tree
     |
     |  freeze(self, leaf_freezer=None)
     |
     |  height(self)
     |      Return the height of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.height()
     |          5
     |          >>> print(t[0,0])
     |          (D the)
     |          >>> t[0,0].height()
     |          2
     |
     |      :return: The height of this tree.  The height of a tree
     |          containing no children is 1; the height of a tree
     |          containing only leaves is 2; and the height of any other
     |          tree is one plus the maximum of its children's
     |          heights.
     |      :rtype: int
     |
     |  label(self)
     |      Return the node label of the tree.
     |
     |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
     |          >>> t.label()
     |          'S'
     |
     |      :return: the node label (typically a string)
     |      :rtype: any
     |
     |  leaf_treeposition(self, index)
     |      :return: The tree position of the ``index``-th leaf in this
     |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
     |          ``self[tp]==self.leaves()[i]``.
     |
     |      :raise IndexError: If this tree contains fewer than ``index+1``
     |          leaves, or if ``index<0``.
     |
     |  leaves(self)
     |      Return the leaves of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.leaves()
     |          ['the', 'dog', 'chased', 'the', 'cat']
     |
     |      :return: a list containing this tree's leaves.
     |          The order reflects the order of the
     |          leaves in the tree's hierarchical structure.
     |      :rtype: list
     |
     |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
     |      :return: A pretty-printed string representation of this tree.
     |      :rtype: str
     |      :param margin: The right margin at which to do line-wrapping.
     |      :type margin: int
     |      :param indent: The indentation level at which printing
     |          begins.  This number is used to decide how far to indent
     |          subsequent lines.
     |      :type indent: int
     |      :param nodesep: A string that is used to separate the node
     |          from the children.  E.g., the default value ``':'`` gives
     |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
     |
     |  pformat_latex_qtree(self)
     |      Returns a representation of the tree compatible with the
     |      LaTeX qtree package. This consists of the string ``\Tree``
     |      followed by the tree represented in bracketed notation.
     |
     |      For example, the following result was generated from a parse tree of
     |      the sentence ``The announcement astounded us``::
     |
     |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
     |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
     |
     |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
     |      style file for the qtree package.
     |
     |      :return: A latex qtree representation of this tree.
     |      :rtype: str
     |
     |  pos(self)
     |      Return a sequence of pos-tagged words extracted from the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.pos()
     |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
     |
     |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
     |          The order reflects the order of the leaves in the tree's hierarchical structure.
     |      :rtype: list(tuple)
     |
     |  pprint(self, **kwargs)
     |      Print a string representation of this Tree to 'stream'
     |
     |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
     |      Pretty-print this tree as ASCII or Unicode art.
     |      For explanation of the arguments, see the documentation for
     |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
     |
     |  productions(self)
     |      Generate the productions that correspond to the non-terminal nodes of the tree.
     |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
     |      form P -> C1 C2 ... Cn.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
     |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
     |          NP -> D N, D -> 'the', N -> 'cat']
     |
     |      :rtype: list(Production)
     |
     |  set_label(self, label)
     |      Set the node label of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.set_label("T")
     |          >>> print(t)
     |          (T (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))
     |
     |      :param label: the node label (typically a string)
     |      :type label: any
     |
     |  subtrees(self, filter=None)
     |      Generate all the subtrees of this tree, optionally restricted
     |      to trees matching the filter function.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> for s in t.subtrees(lambda t: t.height() == 2):
     |          ...     print(s)
     |          (D the)
     |          (N dog)
     |          (V chased)
     |          (D the)
     |          (N cat)
     |
     |      :type filter: function
     |      :param filter: the function to filter all local trees
     |
     |  treeposition_spanning_leaves(self, start, end)
     |      :return: The tree position of the lowest descendant of this
     |          tree that dominates ``self.leaves()[start:end]``.
     |      :raise ValueError: if ``end <= start``
     |
     |  treepositions(self, order='preorder')
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.treepositions() # doctest: +ELLIPSIS
     |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
     |          >>> for pos in t.treepositions('leaves'):
     |          ...     t[pos] = t[pos][::-1].upper()
     |          >>> print(t)
     |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
     |
     |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
     |          ``leaves``.
     |
     |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
     |      This method modifies the tree in three ways:
     |
     |        1. Transforms a tree in Chomsky Normal Form back to its
     |           original structure (branching greater than two)
     |        2. Removes any parent annotation (if it exists)
     |        3. (optional) expands unary subtrees (if previously
     |           collapsed with collapseUnary(...) )
     |
     |      :param expandUnary: Flag to expand unary or not (default = True)
     |      :type  expandUnary: bool
     |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
     |      :type  parentChar: str
     |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
     |      :type  unaryChar: str
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from nltk.tree.tree.Tree:
     |
     |  convert(tree)
     |      Convert a tree between different subtypes of Tree.  ``cls`` determines
     |      which class will be used to encode the new tree.
     |
     |      :type tree: Tree
     |      :param tree: The tree that should be converted.
     |      :return: The new Tree.
     |
     |  fromlist(l)
     |      :type l: list
     |      :param l: a tree represented as nested lists
     |
     |      :return: A tree corresponding to the list representation ``l``.
     |      :rtype: Tree
     |
     |      Convert nested lists to a NLTK Tree
     |
     |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
     |      Read a bracketed tree string and return the resulting tree.
     |      Trees are represented as nested brackettings, such as::
     |
     |        (S (NP (NNP John)) (VP (V runs)))
     |
     |      :type s: str
     |      :param s: The string to read
     |
     |      :type brackets: str (length=2)
     |      :param brackets: The bracket characters used to mark the
     |          beginning and end of trees and subtrees.
     |
     |      :type read_node: function
     |      :type read_leaf: function
     |      :param read_node, read_leaf: If specified, these functions
     |          are applied to the substrings of ``s`` corresponding to
     |          nodes and leaves (respectively) to obtain the values for
     |          those nodes and leaves.  They should have the following
     |          signature:
     |
     |             read_node(str) -> value
     |
     |          For example, these functions could be used to process nodes
     |          and leaves whose values should be some type other than
     |          string (such as ``FeatStruct``).
     |          Note that by default, node strings and leaf strings are
     |          delimited by whitespace and brackets; to override this
     |          default, use the ``node_pattern`` and ``leaf_pattern``
     |          arguments.
     |
     |      :type node_pattern: str
     |      :type leaf_pattern: str
     |      :param node_pattern, leaf_pattern: Regular expression patterns
     |          used to find node and leaf substrings in ``s``.  By
     |          default, both nodes patterns are defined to match any
     |          sequence of non-whitespace non-bracket characters.
     |
     |      :type remove_empty_top_bracketing: bool
     |      :param remove_empty_top_bracketing: If the resulting tree has
     |          an empty node label, and is length one, then return its
     |          single child instead.  This is useful for treebank trees,
     |          which sometimes contain an extra level of bracketing.
     |
     |      :return: A tree corresponding to the string representation ``s``.
     |          If this class method is called using a subclass of Tree,
     |          then it will return a tree of that type.
     |      :rtype: Tree
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tree.tree.Tree:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  node
     |      Outdated method to access the node value; use the label() method instead.
     |
     |      @deprecated: Use label() instead
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes inherited from nltk.tree.tree.Tree:
     |
     |  __hash__ = None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __iadd__(self, value, /)
     |      Implement self+=value.
     |
     |  __imul__(self, value, /)
     |      Implement self*=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self, /)
     |      Reverse *IN PLACE*.
     |
     |  sort(self, /, *, key=None, reverse=False)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.

    class ProbabilisticTree(nltk.tree.tree.Tree, nltk.probability.ProbabilisticMixIn)
     |  ProbabilisticTree(node, children=None, **prob_kwargs)
     |
     |  Method resolution order:
     |      ProbabilisticTree
     |      nltk.tree.tree.Tree
     |      builtins.list
     |      nltk.probability.ProbabilisticMixIn
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __init__(self, node, children=None, **prob_kwargs)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  copy(self, deep=False)
     |      Return a shallow copy of the list.
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  convert(val)
     |      Convert a tree between different subtypes of Tree.  ``cls`` determines
     |      which class will be used to encode the new tree.
     |
     |      :type tree: Tree
     |      :param tree: The tree that should be converted.
     |      :return: The new Tree.
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tree.tree.Tree:
     |
     |  __add__(self, v)
     |      Return self+value.
     |
     |  __copy__(self)
     |
     |  __deepcopy__(self, memo)
     |
     |  __delitem__(self, index)
     |      Delete self[key].
     |
     |  __ge__ lambda self, other
     |
     |  __getitem__(self, index)
     |      Return self[index].
     |
     |  __gt__ lambda self, other
     |
     |  __le__ lambda self, other
     |
     |  __mul__(self, v)
     |      Return self*value.
     |
     |  __ne__ lambda self, other
     |      # @total_ordering doesn't work here, since the class inherits from a builtin class
     |
     |  __radd__(self, v)
     |
     |  __rmul__(self, v)
     |      Return value*self.
     |
     |  __setitem__(self, index, value)
     |      Set self[key] to value.
     |
     |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
     |      This method can modify a tree in three ways:
     |
     |        1. Convert a tree into its Chomsky Normal Form (CNF)
     |           equivalent -- Every subtree has either two non-terminals
     |           or one terminal as its children.  This process requires
     |           the creation of more"artificial" non-terminal nodes.
     |        2. Markov (vertical) smoothing of children in new artificial
     |           nodes
     |        3. Horizontal (parent) annotation of nodes
     |
     |      :param factor: Right or left factoring method (default = "right")
     |      :type  factor: str = [left|right]
     |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
     |      :type  horzMarkov: int | None
     |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
     |      :type  vertMarkov: int | None
     |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
     |                        original subtree from the child nodes that have yet to be expanded (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string used to separate the node representation from its vertical annotation
     |      :type  parentChar: str
     |
     |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
     |      Collapse subtrees with a single child (ie. unary productions)
     |      into a new non-terminal (Tree node) joined by 'joinChar'.
     |      This is useful when working with algorithms that do not allow
     |      unary productions, and completely removing the unary productions
     |      would require loss of useful information.  The Tree is modified
     |      directly (since it is passed by reference) and no value is returned.
     |
     |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
     |                          Part-of-Speech tags) since they are always unary productions
     |      :type  collapsePOS: bool
     |      :param collapseRoot: 'False' (default) will not modify the root production
     |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
     |                           to the TOP -> productions.
     |      :type collapseRoot: bool
     |      :param joinChar: A string used to connect collapsed node values (default = "+")
     |      :type  joinChar: str
     |
     |  draw(self)
     |      Open a new window containing a graphical diagram of this tree.
     |
     |  flatten(self)
     |      Return a flat version of the tree, with all non-root non-terminals removed.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> print(t.flatten())
     |          (S the dog chased the cat)
     |
     |      :return: a tree consisting of this tree's root connected directly to
     |          its leaves, omitting all intervening non-terminal nodes.
     |      :rtype: Tree
     |
     |  freeze(self, leaf_freezer=None)
     |
     |  height(self)
     |      Return the height of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.height()
     |          5
     |          >>> print(t[0,0])
     |          (D the)
     |          >>> t[0,0].height()
     |          2
     |
     |      :return: The height of this tree.  The height of a tree
     |          containing no children is 1; the height of a tree
     |          containing only leaves is 2; and the height of any other
     |          tree is one plus the maximum of its children's
     |          heights.
     |      :rtype: int
     |
     |  label(self)
     |      Return the node label of the tree.
     |
     |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
     |          >>> t.label()
     |          'S'
     |
     |      :return: the node label (typically a string)
     |      :rtype: any
     |
     |  leaf_treeposition(self, index)
     |      :return: The tree position of the ``index``-th leaf in this
     |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
     |          ``self[tp]==self.leaves()[i]``.
     |
     |      :raise IndexError: If this tree contains fewer than ``index+1``
     |          leaves, or if ``index<0``.
     |
     |  leaves(self)
     |      Return the leaves of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.leaves()
     |          ['the', 'dog', 'chased', 'the', 'cat']
     |
     |      :return: a list containing this tree's leaves.
     |          The order reflects the order of the
     |          leaves in the tree's hierarchical structure.
     |      :rtype: list
     |
     |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
     |      :return: A pretty-printed string representation of this tree.
     |      :rtype: str
     |      :param margin: The right margin at which to do line-wrapping.
     |      :type margin: int
     |      :param indent: The indentation level at which printing
     |          begins.  This number is used to decide how far to indent
     |          subsequent lines.
     |      :type indent: int
     |      :param nodesep: A string that is used to separate the node
     |          from the children.  E.g., the default value ``':'`` gives
     |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
     |
     |  pformat_latex_qtree(self)
     |      Returns a representation of the tree compatible with the
     |      LaTeX qtree package. This consists of the string ``\Tree``
     |      followed by the tree represented in bracketed notation.
     |
     |      For example, the following result was generated from a parse tree of
     |      the sentence ``The announcement astounded us``::
     |
     |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
     |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
     |
     |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
     |      style file for the qtree package.
     |
     |      :return: A latex qtree representation of this tree.
     |      :rtype: str
     |
     |  pos(self)
     |      Return a sequence of pos-tagged words extracted from the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.pos()
     |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
     |
     |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
     |          The order reflects the order of the leaves in the tree's hierarchical structure.
     |      :rtype: list(tuple)
     |
     |  pprint(self, **kwargs)
     |      Print a string representation of this Tree to 'stream'
     |
     |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
     |      Pretty-print this tree as ASCII or Unicode art.
     |      For explanation of the arguments, see the documentation for
     |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
     |
     |  productions(self)
     |      Generate the productions that correspond to the non-terminal nodes of the tree.
     |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
     |      form P -> C1 C2 ... Cn.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
     |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
     |          NP -> D N, D -> 'the', N -> 'cat']
     |
     |      :rtype: list(Production)
     |
     |  set_label(self, label)
     |      Set the node label of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.set_label("T")
     |          >>> print(t)
     |          (T (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))
     |
     |      :param label: the node label (typically a string)
     |      :type label: any
     |
     |  subtrees(self, filter=None)
     |      Generate all the subtrees of this tree, optionally restricted
     |      to trees matching the filter function.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> for s in t.subtrees(lambda t: t.height() == 2):
     |          ...     print(s)
     |          (D the)
     |          (N dog)
     |          (V chased)
     |          (D the)
     |          (N cat)
     |
     |      :type filter: function
     |      :param filter: the function to filter all local trees
     |
     |  treeposition_spanning_leaves(self, start, end)
     |      :return: The tree position of the lowest descendant of this
     |          tree that dominates ``self.leaves()[start:end]``.
     |      :raise ValueError: if ``end <= start``
     |
     |  treepositions(self, order='preorder')
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.treepositions() # doctest: +ELLIPSIS
     |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
     |          >>> for pos in t.treepositions('leaves'):
     |          ...     t[pos] = t[pos][::-1].upper()
     |          >>> print(t)
     |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
     |
     |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
     |          ``leaves``.
     |
     |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
     |      This method modifies the tree in three ways:
     |
     |        1. Transforms a tree in Chomsky Normal Form back to its
     |           original structure (branching greater than two)
     |        2. Removes any parent annotation (if it exists)
     |        3. (optional) expands unary subtrees (if previously
     |           collapsed with collapseUnary(...) )
     |
     |      :param expandUnary: Flag to expand unary or not (default = True)
     |      :type  expandUnary: bool
     |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
     |      :type  parentChar: str
     |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
     |      :type  unaryChar: str
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from nltk.tree.tree.Tree:
     |
     |  fromlist(l)
     |      :type l: list
     |      :param l: a tree represented as nested lists
     |
     |      :return: A tree corresponding to the list representation ``l``.
     |      :rtype: Tree
     |
     |      Convert nested lists to a NLTK Tree
     |
     |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
     |      Read a bracketed tree string and return the resulting tree.
     |      Trees are represented as nested brackettings, such as::
     |
     |        (S (NP (NNP John)) (VP (V runs)))
     |
     |      :type s: str
     |      :param s: The string to read
     |
     |      :type brackets: str (length=2)
     |      :param brackets: The bracket characters used to mark the
     |          beginning and end of trees and subtrees.
     |
     |      :type read_node: function
     |      :type read_leaf: function
     |      :param read_node, read_leaf: If specified, these functions
     |          are applied to the substrings of ``s`` corresponding to
     |          nodes and leaves (respectively) to obtain the values for
     |          those nodes and leaves.  They should have the following
     |          signature:
     |
     |             read_node(str) -> value
     |
     |          For example, these functions could be used to process nodes
     |          and leaves whose values should be some type other than
     |          string (such as ``FeatStruct``).
     |          Note that by default, node strings and leaf strings are
     |          delimited by whitespace and brackets; to override this
     |          default, use the ``node_pattern`` and ``leaf_pattern``
     |          arguments.
     |
     |      :type node_pattern: str
     |      :type leaf_pattern: str
     |      :param node_pattern, leaf_pattern: Regular expression patterns
     |          used to find node and leaf substrings in ``s``.  By
     |          default, both nodes patterns are defined to match any
     |          sequence of non-whitespace non-bracket characters.
     |
     |      :type remove_empty_top_bracketing: bool
     |      :param remove_empty_top_bracketing: If the resulting tree has
     |          an empty node label, and is length one, then return its
     |          single child instead.  This is useful for treebank trees,
     |          which sometimes contain an extra level of bracketing.
     |
     |      :return: A tree corresponding to the string representation ``s``.
     |          If this class method is called using a subclass of Tree,
     |          then it will return a tree of that type.
     |      :rtype: Tree
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tree.tree.Tree:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  node
     |      Outdated method to access the node value; use the label() method instead.
     |
     |      @deprecated: Use label() instead
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __iadd__(self, value, /)
     |      Implement self+=value.
     |
     |  __imul__(self, value, /)
     |      Implement self*=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  append(self, object, /)
     |      Append object to the end of the list.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  extend(self, iterable, /)
     |      Extend list by appending elements from the iterable.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  insert(self, index, object, /)
     |      Insert object before index.
     |
     |  pop(self, index=-1, /)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, value, /)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self, /)
     |      Reverse *IN PLACE*.
     |
     |  sort(self, /, *, key=None, reverse=False)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.probability.ProbabilisticMixIn:
     |
     |  logprob(self)
     |      Return ``log(p)``, where ``p`` is the probability associated
     |      with this object.
     |
     |      :rtype: float
     |
     |  prob(self)
     |      Return the probability associated with this object.
     |
     |      :rtype: float
     |
     |  set_logprob(self, logprob)
     |      Set the log probability associated with this object to
     |      ``logprob``.  I.e., set the probability associated with this
     |      object to ``2**(logprob)``.
     |
     |      :param logprob: The new log probability
     |      :type logprob: float
     |
     |  set_prob(self, prob)
     |      Set the probability associated with this object to ``prob``.
     |
     |      :param prob: The new probability
     |      :type prob: float

    class Tree(builtins.list)
     |  Tree(node, children=None)
     |
     |  A Tree represents a hierarchical grouping of leaves and subtrees.
     |  For example, each constituent in a syntax tree is represented by a single Tree.
     |
     |  A tree's children are encoded as a list of leaves and subtrees,
     |  where a leaf is a basic (non-tree) value; and a subtree is a
     |  nested Tree.
     |
     |      >>> from nltk.tree import Tree
     |      >>> print(Tree(1, [2, Tree(3, [4]), 5]))
     |      (1 2 (3 4) 5)
     |      >>> vp = Tree('VP', [Tree('V', ['saw']),
     |      ...                  Tree('NP', ['him'])])
     |      >>> s = Tree('S', [Tree('NP', ['I']), vp])
     |      >>> print(s)
     |      (S (NP I) (VP (V saw) (NP him)))
     |      >>> print(s[1])
     |      (VP (V saw) (NP him))
     |      >>> print(s[1,1])
     |      (NP him)
     |      >>> t = Tree.fromstring("(S (NP I) (VP (V saw) (NP him)))")
     |      >>> s == t
     |      True
     |      >>> t[1][1].set_label('X')
     |      >>> t[1][1].label()
     |      'X'
     |      >>> print(t)
     |      (S (NP I) (VP (V saw) (X him)))
     |      >>> t[0], t[1,1] = t[1,1], t[0]
     |      >>> print(t)
     |      (S (X him) (VP (V saw) (NP I)))
     |
     |  The length of a tree is the number of children it has.
     |
     |      >>> len(t)
     |      2
     |
     |  The set_label() and label() methods allow individual constituents
     |  to be labeled.  For example, syntax trees use this label to specify
     |  phrase tags, such as "NP" and "VP".
     |
     |  Several Tree methods use "tree positions" to specify
     |  children or descendants of a tree.  Tree positions are defined as
     |  follows:
     |
     |    - The tree position *i* specifies a Tree's *i*\ th child.
     |    - The tree position ``()`` specifies the Tree itself.
     |    - If *p* is the tree position of descendant *d*, then
     |      *p+i* specifies the *i*\ th child of *d*.
     |
     |  I.e., every tree position is either a single index *i*,
     |  specifying ``tree[i]``; or a sequence *i1, i2, ..., iN*,
     |  specifying ``tree[i1][i2]...[iN]``.
     |
     |  Construct a new tree.  This constructor can be called in one
     |  of two ways:
     |
     |  - ``Tree(label, children)`` constructs a new tree with the
     |      specified label and list of children.
     |
     |  - ``Tree.fromstring(s)`` constructs a new tree by parsing the string ``s``.
     |
     |  Method resolution order:
     |      Tree
     |      builtins.list
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __add__(self, v)
     |      Return self+value.
     |
     |  __copy__(self)
     |
     |  __deepcopy__(self, memo)
     |
     |  __delitem__(self, index)
     |      Delete self[key].
     |
     |  __eq__(self, other)
     |      Return self==value.
     |
     |  __ge__ lambda self, other
     |
     |  __getitem__(self, index)
     |      Return self[index].
     |
     |  __gt__ lambda self, other
     |
     |  __init__(self, node, children=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __le__ lambda self, other
     |
     |  __lt__(self, other)
     |      Return self<value.
     |
     |  __mul__(self, v)
     |      Return self*value.
     |
     |  __ne__ lambda self, other
     |      # @total_ordering doesn't work here, since the class inherits from a builtin class
     |
     |  __radd__(self, v)
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __rmul__(self, v)
     |      Return value*self.
     |
     |  __setitem__(self, index, value)
     |      Set self[key] to value.
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  chomsky_normal_form(self, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')
     |      This method can modify a tree in three ways:
     |
     |        1. Convert a tree into its Chomsky Normal Form (CNF)
     |           equivalent -- Every subtree has either two non-terminals
     |           or one terminal as its children.  This process requires
     |           the creation of more"artificial" non-terminal nodes.
     |        2. Markov (vertical) smoothing of children in new artificial
     |           nodes
     |        3. Horizontal (parent) annotation of nodes
     |
     |      :param factor: Right or left factoring method (default = "right")
     |      :type  factor: str = [left|right]
     |      :param horzMarkov: Markov order for sibling smoothing in artificial nodes (None (default) = include all siblings)
     |      :type  horzMarkov: int | None
     |      :param vertMarkov: Markov order for parent smoothing (0 (default) = no vertical annotation)
     |      :type  vertMarkov: int | None
     |      :param childChar: A string used in construction of the artificial nodes, separating the head of the
     |                        original subtree from the child nodes that have yet to be expanded (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string used to separate the node representation from its vertical annotation
     |      :type  parentChar: str
     |
     |  collapse_unary(self, collapsePOS=False, collapseRoot=False, joinChar='+')
     |      Collapse subtrees with a single child (ie. unary productions)
     |      into a new non-terminal (Tree node) joined by 'joinChar'.
     |      This is useful when working with algorithms that do not allow
     |      unary productions, and completely removing the unary productions
     |      would require loss of useful information.  The Tree is modified
     |      directly (since it is passed by reference) and no value is returned.
     |
     |      :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
     |                          Part-of-Speech tags) since they are always unary productions
     |      :type  collapsePOS: bool
     |      :param collapseRoot: 'False' (default) will not modify the root production
     |                           if it is unary.  For the Penn WSJ treebank corpus, this corresponds
     |                           to the TOP -> productions.
     |      :type collapseRoot: bool
     |      :param joinChar: A string used to connect collapsed node values (default = "+")
     |      :type  joinChar: str
     |
     |  copy(self, deep=False)
     |      Return a shallow copy of the list.
     |
     |  draw(self)
     |      Open a new window containing a graphical diagram of this tree.
     |
     |  flatten(self)
     |      Return a flat version of the tree, with all non-root non-terminals removed.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> print(t.flatten())
     |          (S the dog chased the cat)
     |
     |      :return: a tree consisting of this tree's root connected directly to
     |          its leaves, omitting all intervening non-terminal nodes.
     |      :rtype: Tree
     |
     |  freeze(self, leaf_freezer=None)
     |
     |  height(self)
     |      Return the height of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.height()
     |          5
     |          >>> print(t[0,0])
     |          (D the)
     |          >>> t[0,0].height()
     |          2
     |
     |      :return: The height of this tree.  The height of a tree
     |          containing no children is 1; the height of a tree
     |          containing only leaves is 2; and the height of any other
     |          tree is one plus the maximum of its children's
     |          heights.
     |      :rtype: int
     |
     |  label(self)
     |      Return the node label of the tree.
     |
     |          >>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
     |          >>> t.label()
     |          'S'
     |
     |      :return: the node label (typically a string)
     |      :rtype: any
     |
     |  leaf_treeposition(self, index)
     |      :return: The tree position of the ``index``-th leaf in this
     |          tree.  I.e., if ``tp=self.leaf_treeposition(i)``, then
     |          ``self[tp]==self.leaves()[i]``.
     |
     |      :raise IndexError: If this tree contains fewer than ``index+1``
     |          leaves, or if ``index<0``.
     |
     |  leaves(self)
     |      Return the leaves of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.leaves()
     |          ['the', 'dog', 'chased', 'the', 'cat']
     |
     |      :return: a list containing this tree's leaves.
     |          The order reflects the order of the
     |          leaves in the tree's hierarchical structure.
     |      :rtype: list
     |
     |  pformat(self, margin=70, indent=0, nodesep='', parens='()', quotes=False)
     |      :return: A pretty-printed string representation of this tree.
     |      :rtype: str
     |      :param margin: The right margin at which to do line-wrapping.
     |      :type margin: int
     |      :param indent: The indentation level at which printing
     |          begins.  This number is used to decide how far to indent
     |          subsequent lines.
     |      :type indent: int
     |      :param nodesep: A string that is used to separate the node
     |          from the children.  E.g., the default value ``':'`` gives
     |          trees like ``(S: (NP: I) (VP: (V: saw) (NP: it)))``.
     |
     |  pformat_latex_qtree(self)
     |      Returns a representation of the tree compatible with the
     |      LaTeX qtree package. This consists of the string ``\Tree``
     |      followed by the tree represented in bracketed notation.
     |
     |      For example, the following result was generated from a parse tree of
     |      the sentence ``The announcement astounded us``::
     |
     |        \Tree [.I'' [.N'' [.D The ] [.N' [.N announcement ] ] ]
     |            [.I' [.V'' [.V' [.V astounded ] [.N'' [.N' [.N us ] ] ] ] ] ] ]
     |
     |      See https://www.ling.upenn.edu/advice/latex.html for the LaTeX
     |      style file for the qtree package.
     |
     |      :return: A latex qtree representation of this tree.
     |      :rtype: str
     |
     |  pos(self)
     |      Return a sequence of pos-tagged words extracted from the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.pos()
     |          [('the', 'D'), ('dog', 'N'), ('chased', 'V'), ('the', 'D'), ('cat', 'N')]
     |
     |      :return: a list of tuples containing leaves and pre-terminals (part-of-speech tags).
     |          The order reflects the order of the leaves in the tree's hierarchical structure.
     |      :rtype: list(tuple)
     |
     |  pprint(self, **kwargs)
     |      Print a string representation of this Tree to 'stream'
     |
     |  pretty_print(self, sentence=None, highlight=(), stream=None, **kwargs)
     |      Pretty-print this tree as ASCII or Unicode art.
     |      For explanation of the arguments, see the documentation for
     |      `nltk.tree.prettyprinter.TreePrettyPrinter`.
     |
     |  productions(self)
     |      Generate the productions that correspond to the non-terminal nodes of the tree.
     |      For each subtree of the form (P: C1 C2 ... Cn) this produces a production of the
     |      form P -> C1 C2 ... Cn.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.productions() # doctest: +NORMALIZE_WHITESPACE
     |          [S -> NP VP, NP -> D N, D -> 'the', N -> 'dog', VP -> V NP, V -> 'chased',
     |          NP -> D N, D -> 'the', N -> 'cat']
     |
     |      :rtype: list(Production)
     |
     |  set_label(self, label)
     |      Set the node label of the tree.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.set_label("T")
     |          >>> print(t)
     |          (T (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))
     |
     |      :param label: the node label (typically a string)
     |      :type label: any
     |
     |  subtrees(self, filter=None)
     |      Generate all the subtrees of this tree, optionally restricted
     |      to trees matching the filter function.
     |
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> for s in t.subtrees(lambda t: t.height() == 2):
     |          ...     print(s)
     |          (D the)
     |          (N dog)
     |          (V chased)
     |          (D the)
     |          (N cat)
     |
     |      :type filter: function
     |      :param filter: the function to filter all local trees
     |
     |  treeposition_spanning_leaves(self, start, end)
     |      :return: The tree position of the lowest descendant of this
     |          tree that dominates ``self.leaves()[start:end]``.
     |      :raise ValueError: if ``end <= start``
     |
     |  treepositions(self, order='preorder')
     |          >>> t = Tree.fromstring("(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))")
     |          >>> t.treepositions() # doctest: +ELLIPSIS
     |          [(), (0,), (0, 0), (0, 0, 0), (0, 1), (0, 1, 0), (1,), (1, 0), (1, 0, 0), ...]
     |          >>> for pos in t.treepositions('leaves'):
     |          ...     t[pos] = t[pos][::-1].upper()
     |          >>> print(t)
     |          (S (NP (D EHT) (N GOD)) (VP (V DESAHC) (NP (D EHT) (N TAC))))
     |
     |      :param order: One of: ``preorder``, ``postorder``, ``bothorder``,
     |          ``leaves``.
     |
     |  un_chomsky_normal_form(self, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
     |      This method modifies the tree in three ways:
     |
     |        1. Transforms a tree in Chomsky Normal Form back to its
     |           original structure (branching greater than two)
     |        2. Removes any parent annotation (if it exists)
     |        3. (optional) expands unary subtrees (if previously
     |           collapsed with collapseUnary(...) )
     |
     |      :param expandUnary: Flag to expand unary or not (default = True)
     |      :type  expandUnary: bool
     |      :param childChar: A string separating the head node from its children in an artificial node (default = "|")
     |      :type  childChar: str
     |      :param parentChar: A string separating the node label from its parent annotation (default = "^")
     |      :type  parentChar: str
     |      :param unaryChar: A string joining two non-terminals in a unary production (default = "+")
     |      :type  unaryChar: str
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  convert(tree)
     |      Convert a tree between different subtypes of Tree.  ``cls`` determines
     |      which class will be used to encode the new tree.
     |
     |      :type tree: Tree
     |      :param tree: The tree that should be converted.
     |      :return: The new Tree.
     |
     |  fromlist(l)
     |      :type l: list
     |      :param l: a tree represented as nested lists
     |
     |      :return: A tree corresponding to the list representation ``l``.
     |      :rtype: Tree
     |
     |      Convert nested lists to a NLTK Tree
     |
     |  fromstring(s, brackets='()', read_node=None, read_leaf=None, node_pattern=None, leaf_pattern=None, remove_empty_top_bracketing=False)
     |      Read a bracketed tree string and return the resulting tree.
     |      Trees are represented as nested brackettings, such as::
     |
     |        (S (NP (NNP John)) (VP (V runs)))
     |
     |      :type s: str
     |      :param s: The string to read
     |
     |      :type brackets: str (length=2)
     |      :param brackets: The bracket characters used to mark the
     |          beginning and end of trees and subtrees.
     |
     |      :type read_node: function
     |      :type read_leaf: function
     |      :param read_node, read_leaf: If specified, these functions
     |          are applied to the substrings of ``s`` corresponding to
     |          nodes and leaves (respectively) to obtain the values for
     |          those nodes and leaves.  They should have the following
     |          signature:
     |
     |             read_node(str) -> value
     |
     |          For example, these functions could be used to process nodes
     |          and leaves whose values should be some type other than
     |          string (such as ``FeatStruct``).
     |          Note that by default, node strings and leaf strings are
     |          delimited by whitespace and brackets; to override this
     |          default, use the ``node_pattern`` and ``leaf_pattern``
     |          arguments.
     |
     |      :type node_pattern: str
     |      :type leaf_pattern: str
     |      :param node_pattern, leaf_pattern: Regular expression patterns
     |          used to find node and leaf substrings in ``s``.  By
     |          default, both nodes patterns are defined to match any
     |          sequence of non-whitespace non-bracket characters.
     |
     |      :type remove_empty_top_bracketing: bool
     |      :param remove_empty_top_bracketing: If the resulting tree has
     |          an empty node label, and is length one, then return its
     |          single child instead.  This is useful for treebank trees,
     |          which sometimes contain an extra level of bracketing.
     |
     |      :return: A tree corresponding to the string representation ``s``.
     |          If this class method is called using a subclass of Tree,
     |          then it will return a tree of that type.
     |      :rtype: Tree
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object
     |
     |  node
     |      Outdated method to access the node value; use the label() method instead.
     |
     |      @deprecated: Use label() instead
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  __hash__ = None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from builtins.list:
     |
     |  __contains__(self, key, /)
     |      Return bool(key in self).
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  __iadd__(self, value, /)
     |      Implement self+=value.
     |
     |  __imul__(self, value, /)
     |      Implement self*=value.
     |
     |  __iter__(self, /)
     |      Implement iter(self).
     |
     |  __len__(self, /)
     |      Return len(self).
     |
     |  __reversed__(self, /)
     |      Return a reverse iterator over the list.
     |
     |  __sizeof__(self, /)
     |      Return the size of the list in memory, in bytes.
     |
     |  append(self, object, /)
     |      Append object to the end of the list.
     |
     |  clear(self, /)
     |      Remove all items from list.
     |
     |  count(self, value, /)
     |      Return number of occurrences of value.
     |
     |  extend(self, iterable, /)
     |      Extend list by appending elements from the iterable.
     |
     |  index(self, value, start=0, stop=9223372036854775807, /)
     |      Return first index of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  insert(self, index, object, /)
     |      Insert object before index.
     |
     |  pop(self, index=-1, /)
     |      Remove and return item at index (default last).
     |
     |      Raises IndexError if list is empty or index is out of range.
     |
     |  remove(self, value, /)
     |      Remove first occurrence of value.
     |
     |      Raises ValueError if the value is not present.
     |
     |  reverse(self, /)
     |      Reverse *IN PLACE*.
     |
     |  sort(self, /, *, key=None, reverse=False)
     |      Sort the list in ascending order and return None.
     |
     |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
     |      order of two equal elements is maintained).
     |
     |      If a key function is given, apply it once to each list item and sort them,
     |      ascending or descending, according to their function values.
     |
     |      The reverse flag can be set to sort in descending order.
     |
     |  ----------------------------------------------------------------------
     |  Class methods inherited from builtins.list:
     |
     |  __class_getitem__(...)
     |      See PEP 585
     |
     |  ----------------------------------------------------------------------
     |  Static methods inherited from builtins.list:
     |
     |  __new__(*args, **kwargs) class method of builtins.list
     |      Create and return a new object.  See help(type) for accurate signature.

    class TreePrettyPrinter(builtins.object)
     |  TreePrettyPrinter(tree, sentence=None, highlight=())
     |
     |  Pretty-print a tree in text format, either as ASCII or Unicode.
     |  The tree can be a normal tree, or discontinuous.
     |
     |  ``TreePrettyPrinter(tree, sentence=None, highlight=())``
     |  creates an object from which different visualizations can be created.
     |
     |  :param tree: a Tree object.
     |  :param sentence: a list of words (strings). If `sentence` is given,
     |      `tree` must contain integers as leaves, which are taken as indices
     |      in `sentence`. Using this you can display a discontinuous tree.
     |  :param highlight: Optionally, a sequence of Tree objects in `tree` which
     |      should be highlighted. Has the effect of only applying colors to nodes
     |      in this sequence (nodes should be given as Tree objects, terminals as
     |      indices).
     |
     |  >>> from nltk.tree import Tree
     |  >>> tree = Tree.fromstring('(S (NP Mary) (VP walks))')
     |  >>> print(TreePrettyPrinter(tree).text())
     |  ... # doctest: +NORMALIZE_WHITESPACE
     |        S
     |    ____|____
     |   NP        VP
     |   |         |
     |  Mary     walks
     |
     |  Methods defined here:
     |
     |  __init__(self, tree, sentence=None, highlight=())
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  __str__(self)
     |      Return str(self).
     |
     |  svg(self, nodecolor='blue', leafcolor='red', funccolor='green')
     |      :return: SVG representation of a tree.
     |
     |  text(self, nodedist=1, unicodelines=False, html=False, ansi=False, nodecolor='blue', leafcolor='red', funccolor='green', abbreviate=None, maxwidth=16)
     |      :return: ASCII art for a discontinuous tree.
     |
     |      :param unicodelines: whether to use Unicode line drawing characters
     |          instead of plain (7-bit) ASCII.
     |      :param html: whether to wrap output in html code (default plain text).
     |      :param ansi: whether to produce colors with ANSI escape sequences
     |          (only effective when html==False).
     |      :param leafcolor, nodecolor: specify colors of leaves and phrasal
     |          nodes; effective when either html or ansi is True.
     |      :param abbreviate: if True, abbreviate labels longer than 5 characters.
     |          If integer, abbreviate labels longer than `abbr` characters.
     |      :param maxwidth: maximum number of characters before a label starts to
     |          wrap; pass None to disable.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  nodecoords(tree, sentence, highlight)
     |      Produce coordinates of nodes on a grid.
     |
     |      Objective:
     |
     |      - Produce coordinates for a non-overlapping placement of nodes and
     |          horizontal lines.
     |      - Order edges so that crossing edges cross a minimal number of previous
     |          horizontal lines (never vertical lines).
     |
     |      Approach:
     |
     |      - bottom up level order traversal (start at terminals)
     |      - at each level, identify nodes which cannot be on the same row
     |      - identify nodes which cannot be in the same column
     |      - place nodes into a grid at (row, column)
     |      - order child-parent edges with crossing edges last
     |
     |      Coordinates are (row, column); the origin (0, 0) is at the top left;
     |      the root node is on row 0. Coordinates do not consider the size of a
     |      node (which depends on font, &c), so the width of a column of the grid
     |      should be automatically determined by the element with the greatest
     |      width in that column. Alternatively, the integer coordinates could be
     |      converted to coordinates in which the distances between adjacent nodes
     |      are non-uniform.
     |
     |      Produces tuple (nodes, coords, edges, highlighted) where:
     |
     |      - nodes[id]: Tree object for the node with this integer id
     |      - coords[id]: (n, m) coordinate where to draw node with id in the grid
     |      - edges[id]: parent id of node with this id (ordered dictionary)
     |      - highlighted: set of ids that should be highlighted
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    bracket_parse(s)
        Use Tree.read(s, remove_empty_top_bracketing=True) instead.

    chomsky_normal_form(tree, factor='right', horzMarkov=None, vertMarkov=0, childChar='|', parentChar='^')

    collapse_unary(tree, collapsePOS=False, collapseRoot=False, joinChar='+')
        Collapse subtrees with a single child (ie. unary productions)
        into a new non-terminal (Tree node) joined by 'joinChar'.
        This is useful when working with algorithms that do not allow
        unary productions, and completely removing the unary productions
        would require loss of useful information.  The Tree is modified
        directly (since it is passed by reference) and no value is returned.

        :param tree: The Tree to be collapsed
        :type  tree: Tree
        :param collapsePOS: 'False' (default) will not collapse the parent of leaf nodes (ie.
                            Part-of-Speech tags) since they are always unary productions
        :type  collapsePOS: bool
        :param collapseRoot: 'False' (default) will not modify the root production
                             if it is unary.  For the Penn WSJ treebank corpus, this corresponds
                             to the TOP -> productions.
        :type collapseRoot: bool
        :param joinChar: A string used to connect collapsed node values (default = "+")
        :type  joinChar: str

    sinica_parse(s)
        Parse a Sinica Treebank string and return a tree.  Trees are represented as nested brackettings,
        as shown in the following example (X represents a Chinese character):
        S(goal:NP(Head:Nep:XX)|theme:NP(Head:Nhaa:X)|quantity:Dab:X|Head:VL2:X)#0(PERIODCATEGORY)

        :return: A tree corresponding to the string representation.
        :rtype: Tree
        :param s: The string to be converted
        :type s: str

    un_chomsky_normal_form(tree, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')

DATA
    __all__ = ['ImmutableMultiParentedTree', 'ImmutableParentedTree', 'Imm...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tree\__init__.py

nltk.tree2conllstr
Python Library Documentation: function tree2conllstr in module nltk.chunk.util

tree2conllstr(t)
    Return a multiline string where each line contains a word, tag and IOB tag.
    Convert a tree to the CoNLL IOB string format

    :param t: The tree to be converted.
    :type t: Tree
    :rtype: str
nltk.tree2conlltags
Python Library Documentation: function tree2conlltags in module nltk.chunk.util

tree2conlltags(t)
    Return a list of 3-tuples containing ``(word, tag, IOB-tag)``.
    Convert a tree to the CoNLL IOB tag format.

    :param t: The tree to be converted.
    :type t: Tree
    :rtype: list(tuple)
nltk.treebank
Python Library Documentation: module nltk.tokenize.treebank in nltk.tokenize

NAME
    nltk.tokenize.treebank - Penn Treebank Tokenizer

DESCRIPTION
    The Treebank tokenizer uses regular expressions to tokenize text as in Penn Treebank.
    This implementation is a port of the tokenizer sed script written by Robert McIntyre
    and available at http://www.cis.upenn.edu/~treebank/tokenizer.sed.

CLASSES
    nltk.tokenize.api.TokenizerI(abc.ABC)
        TreebankWordDetokenizer
        TreebankWordTokenizer

    class TreebankWordDetokenizer(nltk.tokenize.api.TokenizerI)
     |  The Treebank detokenizer uses the reverse regex operations corresponding to
     |  the Treebank tokenizer's regexes.
     |
     |  Note:
     |
     |  - There're additional assumption mades when undoing the padding of ``[;@#$%&]``
     |    punctuation symbols that isn't presupposed in the TreebankTokenizer.
     |  - There're additional regexes added in reversing the parentheses tokenization,
     |     such as the ``r'([\]\)\}\>])\s([:;,.])'``, which removes the additional right
     |     padding added to the closing parentheses precedding ``[:;,.]``.
     |  - It's not possible to return the original whitespaces as they were because
     |    there wasn't explicit records of where `'\n'`, `'\t'` or `'\s'` were removed at
     |    the text.split() operation.
     |
     |  >>> from nltk.tokenize.treebank import TreebankWordTokenizer, TreebankWordDetokenizer
     |  >>> s = '''Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\nThanks.'''
     |  >>> d = TreebankWordDetokenizer()
     |  >>> t = TreebankWordTokenizer()
     |  >>> toks = t.tokenize(s)
     |  >>> d.detokenize(toks)
     |  'Good muffins cost $3.88 in New York. Please buy me two of them. Thanks.'
     |
     |  The MXPOST parentheses substitution can be undone using the ``convert_parentheses``
     |  parameter:
     |
     |  >>> s = '''Good muffins cost $3.88\nin New (York).  Please (buy) me\ntwo of them.\n(Thanks).'''
     |  >>> expected_tokens = ['Good', 'muffins', 'cost', '$', '3.88', 'in',
     |  ... 'New', '-LRB-', 'York', '-RRB-', '.', 'Please', '-LRB-', 'buy',
     |  ... '-RRB-', 'me', 'two', 'of', 'them.', '-LRB-', 'Thanks', '-RRB-', '.']
     |  >>> expected_tokens == t.tokenize(s, convert_parentheses=True)
     |  True
     |  >>> expected_detoken = 'Good muffins cost $3.88 in New (York). Please (buy) me two of them. (Thanks).'
     |  >>> expected_detoken == d.detokenize(t.tokenize(s, convert_parentheses=True), convert_parentheses=True)
     |  True
     |
     |  During tokenization it's safe to add more spaces but during detokenization,
     |  simply undoing the padding doesn't really help.
     |
     |  - During tokenization, left and right pad is added to ``[!?]``, when
     |    detokenizing, only left shift the ``[!?]`` is needed.
     |    Thus ``(re.compile(r'\s([?!])'), r'\g<1>')``.
     |
     |  - During tokenization ``[:,]`` are left and right padded but when detokenizing,
     |    only left shift is necessary and we keep right pad after comma/colon
     |    if the string after is a non-digit.
     |    Thus ``(re.compile(r'\s([:,])\s([^\d])'), r'\1 \2')``.
     |
     |  >>> from nltk.tokenize.treebank import TreebankWordDetokenizer
     |  >>> toks = ['hello', ',', 'i', 'ca', "n't", 'feel', 'my', 'feet', '!', 'Help', '!', '!']
     |  >>> twd = TreebankWordDetokenizer()
     |  >>> twd.detokenize(toks)
     |  "hello, i can't feel my feet! Help!!"
     |
     |  >>> toks = ['hello', ',', 'i', "can't", 'feel', ';', 'my', 'feet', '!',
     |  ... 'Help', '!', '!', 'He', 'said', ':', 'Help', ',', 'help', '?', '!']
     |  >>> twd.detokenize(toks)
     |  "hello, i can't feel; my feet! Help!! He said: Help, help?!"
     |
     |  Method resolution order:
     |      TreebankWordDetokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  detokenize(self, tokens: list[str], convert_parentheses: bool = False) -> str
     |      Duck-typing the abstract *tokenize()*.
     |
     |  tokenize(self, tokens: list[str], convert_parentheses: bool = False) -> str
     |      Treebank detokenizer, created by undoing the regexes from
     |      the TreebankWordTokenizer.tokenize.
     |
     |      :param tokens: A list of strings, i.e. tokenized text.
     |      :type tokens: List[str]
     |      :param convert_parentheses: if True, replace PTB symbols with parentheses,
     |          e.g. `-LRB-` to `(`. Defaults to False.
     |      :type convert_parentheses: bool, optional
     |      :return: str
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  CONTRACTIONS2 = [re.compile('(?i)\\b(can)\\s(not)\\b', re.IGNORECASE),...
     |
     |  CONTRACTIONS3 = [re.compile("(?i) ('t)\\s(is)\\b", re.IGNORECASE), re....
     |
     |  CONVERT_PARENTHESES = [(re.compile('-LRB-'), '('), (re.compile('-RRB-'...
     |
     |  DOUBLE_DASHES = (re.compile(' -- '), '--')
     |
     |  ENDING_QUOTES = [(re.compile("([^' ])\\s('ll|'LL|'re|'RE|'ve|'VE|n't|N...
     |
     |  PARENS_BRACKETS = [(re.compile('([\\[\\(\\{\\<])\\s'), r'\g<1>'), (re....
     |
     |  PUNCTUATION = [(re.compile("([^'])\\s'\\s"), r"\1' "), (re.compile('\\...
     |
     |  STARTING_QUOTES = [(re.compile('([ (\\[{<])\\s``'), r'\1``'), (re.comp...
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize(self, s: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Identify the tokens using integer offsets ``(start_i, end_i)``,
     |      where ``s[start_i:end_i]`` is the corresponding token.
     |
     |      :rtype: Iterator[Tuple[int, int]]
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class TreebankWordTokenizer(nltk.tokenize.api.TokenizerI)
     |  The Treebank tokenizer uses regular expressions to tokenize text as in Penn Treebank.
     |
     |  This tokenizer performs the following steps:
     |
     |  - split standard contractions, e.g. ``don't`` -> ``do n't`` and ``they'll`` -> ``they 'll``
     |  - treat most punctuation characters as separate tokens
     |  - split off commas and single quotes, when followed by whitespace
     |  - separate periods that appear at the end of line
     |
     |  >>> from nltk.tokenize import TreebankWordTokenizer
     |  >>> s = '''Good muffins cost $3.88\nin New York.  Please buy me\ntwo of them.\nThanks.'''
     |  >>> TreebankWordTokenizer().tokenize(s)
     |  ['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two', 'of', 'them.', 'Thanks', '.']
     |  >>> s = "They'll save and invest more."
     |  >>> TreebankWordTokenizer().tokenize(s)
     |  ['They', "'ll", 'save', 'and', 'invest', 'more', '.']
     |  >>> s = "hi, my name can't hello,"
     |  >>> TreebankWordTokenizer().tokenize(s)
     |  ['hi', ',', 'my', 'name', 'ca', "n't", 'hello', ',']
     |
     |  Method resolution order:
     |      TreebankWordTokenizer
     |      nltk.tokenize.api.TokenizerI
     |      abc.ABC
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  span_tokenize(self, text: str) -> collections.abc.Iterator[tuple[int, int]]
     |      Returns the spans of the tokens in ``text``.
     |      Uses the post-hoc nltk.tokens.align_tokens to return the offset spans.
     |
     |          >>> from nltk.tokenize import TreebankWordTokenizer
     |          >>> s = '''Good muffins cost $3.88\nin New (York).  Please (buy) me\ntwo of them.\n(Thanks).'''
     |          >>> expected = [(0, 4), (5, 12), (13, 17), (18, 19), (19, 23),
     |          ... (24, 26), (27, 30), (31, 32), (32, 36), (36, 37), (37, 38),
     |          ... (40, 46), (47, 48), (48, 51), (51, 52), (53, 55), (56, 59),
     |          ... (60, 62), (63, 68), (69, 70), (70, 76), (76, 77), (77, 78)]
     |          >>> list(TreebankWordTokenizer().span_tokenize(s)) == expected
     |          True
     |          >>> expected = ['Good', 'muffins', 'cost', '$', '3.88', 'in',
     |          ... 'New', '(', 'York', ')', '.', 'Please', '(', 'buy', ')',
     |          ... 'me', 'two', 'of', 'them.', '(', 'Thanks', ')', '.']
     |          >>> [s[start:end] for start, end in TreebankWordTokenizer().span_tokenize(s)] == expected
     |          True
     |
     |      :param text: A string with a sentence or sentences.
     |      :type text: str
     |      :yield: Tuple[int, int]
     |
     |  tokenize(self, text: str, convert_parentheses: bool = False, return_str: bool = False) -> list[str]
     |      Return a tokenized copy of `text`.
     |
     |      >>> from nltk.tokenize import TreebankWordTokenizer
     |      >>> s = '''Good muffins cost $3.88 (roughly 3,36 euros)\nin New York.  Please buy me\ntwo of them.\nThanks.'''
     |      >>> TreebankWordTokenizer().tokenize(s) # doctest: +NORMALIZE_WHITESPACE
     |      ['Good', 'muffins', 'cost', '$', '3.88', '(', 'roughly', '3,36',
     |      'euros', ')', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two',
     |      'of', 'them.', 'Thanks', '.']
     |      >>> TreebankWordTokenizer().tokenize(s, convert_parentheses=True) # doctest: +NORMALIZE_WHITESPACE
     |      ['Good', 'muffins', 'cost', '$', '3.88', '-LRB-', 'roughly', '3,36',
     |      'euros', '-RRB-', 'in', 'New', 'York.', 'Please', 'buy', 'me', 'two',
     |      'of', 'them.', 'Thanks', '.']
     |
     |      :param text: A string with a sentence or sentences.
     |      :type text: str
     |      :param convert_parentheses: if True, replace parentheses to PTB symbols,
     |          e.g. `(` to `-LRB-`. Defaults to False.
     |      :type convert_parentheses: bool, optional
     |      :param return_str: If True, return tokens as space-separated string,
     |          defaults to False.
     |      :type return_str: bool, optional
     |      :return: List of tokens from `text`.
     |      :rtype: List[str]
     |
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |
     |  CONTRACTIONS2 = [re.compile('(?i)\\b(can)(?#X)(not)\\b', re.IGNORECASE...
     |
     |  CONTRACTIONS3 = [re.compile("(?i) ('t)(?#X)(is)\\b", re.IGNORECASE), r...
     |
     |  CONVERT_PARENTHESES = [(re.compile('\\('), '-LRB-'), (re.compile('\\)'...
     |
     |  DOUBLE_DASHES = (re.compile('--'), ' -- ')
     |
     |  ENDING_QUOTES = [(re.compile("''"), " '' "), (re.compile('"'), " '' ")...
     |
     |  PARENS_BRACKETS = (re.compile('[\\]\\[\\(\\)\\{\\}\\<\\>]'), r' \g<0> ...
     |
     |  PUNCTUATION = [(re.compile('([:,])([^\\d])'), r' \1 \2'), (re.compile(...
     |
     |  STARTING_QUOTES = [(re.compile('^\\"'), '``'), (re.compile('(``)'), r'...
     |
     |  __abstractmethods__ = frozenset()
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.tokenize.api.TokenizerI:
     |
     |  span_tokenize_sents(self, strings: list[str]) -> collections.abc.Iterator[list[tuple[int, int]]]
     |      Apply ``self.span_tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.span_tokenize(s) for s in strings]
     |
     |      :yield: List[Tuple[int, int]]
     |
     |  tokenize_sents(self, strings: list[str]) -> list[list[str]]
     |      Apply ``self.tokenize()`` to each element of ``strings``.  I.e.:
     |
     |          return [self.tokenize(s) for s in strings]
     |
     |      :rtype: List[List[str]]
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.tokenize.api.TokenizerI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

DATA
    List = typing.List
        A generic version of list.

    Tuple = typing.Tuple
        Deprecated alias to builtins.tuple.

        Tuple[X, Y] is the cross-product type of X and Y.

        Example: Tuple[T1, T2] is a tuple of two elements corresponding
        to type variables T1 and T2.  Tuple[int, float, str] is a tuple
        of an int, a float and a string.

        To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\tokenize\treebank.py

nltk.trigrams
Python Library Documentation: function trigrams in module nltk.util

trigrams(sequence, **kwargs)
    Return the trigrams generated from a sequence of items, as an iterator.
    For example:

        >>> from nltk.util import trigrams
        >>> list(trigrams([1,2,3,4,5]))
        [(1, 2, 3), (2, 3, 4), (3, 4, 5)]

    Use trigrams for a list version of this function.

    :param sequence: the source data to be converted into trigrams
    :type sequence: sequence or iter
    :rtype: iter(tuple)
nltk.tuple2str
Python Library Documentation: function tuple2str in module nltk.tag.util

tuple2str(tagged_token, sep='/')
    Given the tuple representation of a tagged token, return the
    corresponding string representation.  This representation is
    formed by concatenating the token's word string, followed by the
    separator, followed by the token's tag.  (If the tag is None,
    then just return the bare word string.)

        >>> from nltk.tag.util import tuple2str
        >>> tagged_token = ('fly', 'NN')
        >>> tuple2str(tagged_token)
        'fly/NN'

    :type tagged_token: tuple(str, str)
    :param tagged_token: The tuple representation of a tagged token.
    :type sep: str
    :param sep: The separator string used to separate word strings
        from tags.
nltk.un_chomsky_normal_form
Python Library Documentation: function un_chomsky_normal_form in module nltk.tree.transforms

un_chomsky_normal_form(tree, expandUnary=True, childChar='|', parentChar='^', unaryChar='+')
nltk.unicodedata
Python Library Documentation: module unicodedata

NAME
    unicodedata

DESCRIPTION
    This module provides access to the Unicode Character Database which
    defines character properties for all Unicode characters. The data in
    this database is based on the UnicodeData.txt file version
    15.0.0 which is publicly available from ftp://ftp.unicode.org/.

    The module uses the same names and symbols as defined by the
    UnicodeData File Format 15.0.0.

CLASSES
    builtins.object
        UCD

    class UCD(builtins.object)
     |  Methods defined here:
     |
     |  __getattribute__(self, name, /)
     |      Return getattr(self, name).
     |
     |  bidirectional(self, chr, /)
     |      Returns the bidirectional class assigned to the character chr as string.
     |
     |      If no such value is defined, an empty string is returned.
     |
     |  category(self, chr, /)
     |      Returns the general category assigned to the character chr as string.
     |
     |  combining(self, chr, /)
     |      Returns the canonical combining class assigned to the character chr as integer.
     |
     |      Returns 0 if no combining class is defined.
     |
     |  decimal(...)
     |      Converts a Unicode character into its equivalent decimal value.
     |
     |      Returns the decimal value assigned to the character chr as integer.
     |      If no such value is defined, default is returned, or, if not given,
     |      ValueError is raised.
     |
     |  decomposition(self, chr, /)
     |      Returns the character decomposition mapping assigned to the character chr as string.
     |
     |      An empty string is returned in case no such mapping is defined.
     |
     |  digit(...)
     |      Converts a Unicode character into its equivalent digit value.
     |
     |      Returns the digit value assigned to the character chr as integer.
     |      If no such value is defined, default is returned, or, if not given,
     |      ValueError is raised.
     |
     |  east_asian_width(self, chr, /)
     |      Returns the east asian width assigned to the character chr as string.
     |
     |  is_normalized(self, form, unistr, /)
     |      Return whether the Unicode string unistr is in the normal form 'form'.
     |
     |      Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.
     |
     |  lookup(self, name, /)
     |      Look up character by name.
     |
     |      If a character with the given name is found, return the
     |      corresponding character.  If not found, KeyError is raised.
     |
     |  mirrored(self, chr, /)
     |      Returns the mirrored property assigned to the character chr as integer.
     |
     |      Returns 1 if the character has been identified as a "mirrored"
     |      character in bidirectional text, 0 otherwise.
     |
     |  name(...)
     |      Returns the name assigned to the character chr as a string.
     |
     |      If no name is defined, default is returned, or, if not given,
     |      ValueError is raised.
     |
     |  normalize(self, form, unistr, /)
     |      Return the normal form 'form' for the Unicode string unistr.
     |
     |      Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.
     |
     |  numeric(...)
     |      Converts a Unicode character into its equivalent numeric value.
     |
     |      Returns the numeric value assigned to the character chr as float.
     |      If no such value is defined, default is returned, or, if not given,
     |      ValueError is raised.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  unidata_version

FUNCTIONS
    bidirectional(chr, /)
        Returns the bidirectional class assigned to the character chr as string.

        If no such value is defined, an empty string is returned.

    category(chr, /)
        Returns the general category assigned to the character chr as string.

    combining(chr, /)
        Returns the canonical combining class assigned to the character chr as integer.

        Returns 0 if no combining class is defined.

    decimal(...)
        Converts a Unicode character into its equivalent decimal value.

        Returns the decimal value assigned to the character chr as integer.
        If no such value is defined, default is returned, or, if not given,
        ValueError is raised.

    decomposition(chr, /)
        Returns the character decomposition mapping assigned to the character chr as string.

        An empty string is returned in case no such mapping is defined.

    digit(...)
        Converts a Unicode character into its equivalent digit value.

        Returns the digit value assigned to the character chr as integer.
        If no such value is defined, default is returned, or, if not given,
        ValueError is raised.

    east_asian_width(chr, /)
        Returns the east asian width assigned to the character chr as string.

    is_normalized(form, unistr, /)
        Return whether the Unicode string unistr is in the normal form 'form'.

        Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.

    lookup(name, /)
        Look up character by name.

        If a character with the given name is found, return the
        corresponding character.  If not found, KeyError is raised.

    mirrored(chr, /)
        Returns the mirrored property assigned to the character chr as integer.

        Returns 1 if the character has been identified as a "mirrored"
        character in bidirectional text, 0 otherwise.

    name(...)
        Returns the name assigned to the character chr as a string.

        If no name is defined, default is returned, or, if not given,
        ValueError is raised.

    normalize(form, unistr, /)
        Return the normal form 'form' for the Unicode string unistr.

        Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.

    numeric(...)
        Converts a Unicode character into its equivalent numeric value.

        Returns the numeric value assigned to the character chr as float.
        If no such value is defined, default is returned, or, if not given,
        ValueError is raised.

DATA
    ucd_3_2_0 = <unicodedata.UCD object>
    unidata_version = '15.0.0'

FILE
    c:\users\youse\appdata\local\programs\python\python312\dlls\unicodedata.pyd

nltk.unify
Python Library Documentation: function unify in module nltk.featstruct

unify(fstruct1, fstruct2, bindings=None, trace=False, fail=None, rename_vars=True, fs_class='default')
    Unify ``fstruct1`` with ``fstruct2``, and return the resulting feature
    structure.  This unified feature structure is the minimal
    feature structure that contains all feature value assignments from both
    ``fstruct1`` and ``fstruct2``, and that preserves all reentrancies.

    If no such feature structure exists (because ``fstruct1`` and
    ``fstruct2`` specify incompatible values for some feature), then
    unification fails, and ``unify`` returns None.

    Bound variables are replaced by their values.  Aliased
    variables are replaced by their representative variable
    (if unbound) or the value of their representative variable
    (if bound).  I.e., if variable *v* is in ``bindings``,
    then *v* is replaced by ``bindings[v]``.  This will
    be repeated until the variable is replaced by an unbound
    variable or a non-variable value.

    Unbound variables are bound when they are unified with
    values; and aliased when they are unified with variables.
    I.e., if variable *v* is not in ``bindings``, and is
    unified with a variable or value *x*, then
    ``bindings[v]`` is set to *x*.

    If ``bindings`` is unspecified, then all variables are
    assumed to be unbound.  I.e., ``bindings`` defaults to an
    empty dict.

        >>> from nltk.featstruct import FeatStruct
        >>> FeatStruct('[a=?x]').unify(FeatStruct('[b=?x]'))
        [a=?x, b=?x2]

    :type bindings: dict(Variable -> any)
    :param bindings: A set of variable bindings to be used and
        updated during unification.
    :type trace: bool
    :param trace: If true, generate trace output.
    :type rename_vars: bool
    :param rename_vars: If True, then rename any variables in
        ``fstruct2`` that are also used in ``fstruct1``, in order to
        avoid collisions on variable names.
nltk.unique_list
Python Library Documentation: function unique_list in module nltk.util

unique_list(xs)
nltk.untag
Python Library Documentation: function untag in module nltk.tag.util

untag(tagged_sentence)
    Given a tagged sentence, return an untagged version of that
    sentence.  I.e., return a list containing the first element
    of each tuple in *tagged_sentence*.

        >>> from nltk.tag.util import untag
        >>> untag([('John', 'NNP'), ('saw', 'VBD'), ('Mary', 'NNP')])
        ['John', 'saw', 'Mary']
nltk.unweighted_minimum_spanning_dict
Python Library Documentation: function unweighted_minimum_spanning_dict in module nltk.util

unweighted_minimum_spanning_dict(tree, children=<built-in function iter>)
    :param tree: the tree root
    :param children: a function taking as argument a tree node

            Output a dictionary representing a Minimum Spanning Tree (MST)
    of an unweighted graph, by traversing the nodes of a tree in
    breadth-first order, discarding eventual cycles.

    The first argument should be the tree root;
    children should be a function taking as argument a tree node
    and returning an iterator of the node's children.

    >>> import nltk
    >>> from nltk.corpus import wordnet as wn
    >>> from nltk.util import unweighted_minimum_spanning_dict as umsd
    >>> from pprint import pprint
    >>> pprint(umsd(wn.synset('bound.a.01'), lambda s:sorted(s.also_sees())))
    {Synset('bound.a.01'): [Synset('unfree.a.02')],
     Synset('classified.a.02'): [],
     Synset('confined.a.02'): [],
     Synset('dependent.a.01'): [],
     Synset('restricted.a.01'): [Synset('classified.a.02')],
     Synset('unfree.a.02'): [Synset('confined.a.02'),
                             Synset('dependent.a.01'),
                             Synset('restricted.a.01')]}
nltk.unweighted_minimum_spanning_digraph
Python Library Documentation: function unweighted_minimum_spanning_digraph in module nltk.util

unweighted_minimum_spanning_digraph(tree, children=<built-in function iter>, shapes=None, attr=None)
    :param tree: the tree root
    :param children: a function taking as argument a tree node
    :param shapes: dictionary of strings that trigger a specified shape.
    :param attr: dictionary with global graph attributes

        Build a Minimum Spanning Tree (MST) of an unweighted graph,
    by traversing the nodes of a tree in breadth-first order,
    discarding eventual cycles.

    Return a representation of this MST as a string in the DOT graph language,
    which can be converted to an image by the 'dot' program from the Graphviz
    package, or nltk.parse.dependencygraph.dot2img(dot_string).

    The first argument should be the tree root;
    children should be a function taking as argument a tree node
    and returning an iterator of the node's children.

    >>> import nltk
    >>> wn=nltk.corpus.wordnet
    >>> from nltk.util import unweighted_minimum_spanning_digraph as umsd
    >>> print(umsd(wn.synset('bound.a.01'), lambda s:sorted(s.also_sees())))
    digraph G {
    "Synset('bound.a.01')" -> "Synset('unfree.a.02')";
    "Synset('unfree.a.02')" -> "Synset('confined.a.02')";
    "Synset('unfree.a.02')" -> "Synset('dependent.a.01')";
    "Synset('unfree.a.02')" -> "Synset('restricted.a.01')";
    "Synset('restricted.a.01')" -> "Synset('classified.a.02')";
    }
    <BLANKLINE>
nltk.unweighted_minimum_spanning_tree
Python Library Documentation: function unweighted_minimum_spanning_tree in module nltk.util

unweighted_minimum_spanning_tree(tree, children=<built-in function iter>)
    :param tree: the tree root
    :param children: a function taking as argument a tree node

       Output a Minimum Spanning Tree (MST) of an unweighted graph,
    by traversing the nodes of a tree in breadth-first order,
    discarding eventual cycles.

    The first argument should be the tree root;
    children should be a function taking as argument a tree node
    and returning an iterator of the node's children.

    >>> import nltk
    >>> from nltk.util import unweighted_minimum_spanning_tree as mst
    >>> wn=nltk.corpus.wordnet
    >>> from pprint import pprint
    >>> pprint(mst(wn.synset('bound.a.01'), lambda s:sorted(s.also_sees())))
    [Synset('bound.a.01'),
     [Synset('unfree.a.02'),
      [Synset('confined.a.02')],
      [Synset('dependent.a.01')],
      [Synset('restricted.a.01'), [Synset('classified.a.02')]]]]
nltk.usage
Python Library Documentation: function usage in module nltk.internals

usage(*args, **kwargs)
    @deprecated: Use help(obj) instead.
nltk.util
Python Library Documentation: module nltk.stem.util in nltk.stem

NAME
    nltk.stem.util

DESCRIPTION
    # Natural Language Toolkit: Stemmer Utilities
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Helder <he7d3r@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

FUNCTIONS
    prefix_replace(original, old, new)
        Replaces the old prefix of the original string by a new suffix

        :param original: string
        :param old: string
        :param new: string
        :return: string

    suffix_replace(original, old, new)
        Replaces the old suffix of the original string by a new suffix

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\util.py

nltk.version_file
Error rendering doc: No Python documentation found for 'C:\\Users\\Youse\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\nltk\\VERSION'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.
nltk.viterbi
Python Library Documentation: module nltk.parse.viterbi in nltk.parse

NAME
    nltk.parse.viterbi

DESCRIPTION
    # Natural Language Toolkit: Viterbi Probabilistic Parser
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Edward Loper <edloper@gmail.com>
    #         Steven Bird <stevenbird1@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    nltk.parse.api.ParserI(builtins.object)
        ViterbiParser

    class ViterbiParser(nltk.parse.api.ParserI)
     |  ViterbiParser(grammar, trace=0)
     |
     |  A bottom-up ``PCFG`` parser that uses dynamic programming to find
     |  the single most likely parse for a text.  The ``ViterbiParser`` parser
     |  parses texts by filling in a "most likely constituent table".
     |  This table records the most probable tree representation for any
     |  given span and node value.  In particular, it has an entry for
     |  every start index, end index, and node value, recording the most
     |  likely subtree that spans from the start index to the end index,
     |  and has the given node value.
     |
     |  The ``ViterbiParser`` parser fills in this table incrementally.  It starts
     |  by filling in all entries for constituents that span one element
     |  of text (i.e., entries where the end index is one greater than the
     |  start index).  After it has filled in all table entries for
     |  constituents that span one element of text, it fills in the
     |  entries for constitutants that span two elements of text.  It
     |  continues filling in the entries for constituents spanning larger
     |  and larger portions of the text, until the entire table has been
     |  filled.  Finally, it returns the table entry for a constituent
     |  spanning the entire text, whose node value is the grammar's start
     |  symbol.
     |
     |  In order to find the most likely constituent with a given span and
     |  node value, the ``ViterbiParser`` parser considers all productions that
     |  could produce that node value.  For each production, it finds all
     |  children that collectively cover the span and have the node values
     |  specified by the production's right hand side.  If the probability
     |  of the tree formed by applying the production to the children is
     |  greater than the probability of the current entry in the table,
     |  then the table is updated with this new tree.
     |
     |  A pseudo-code description of the algorithm used by
     |  ``ViterbiParser`` is:
     |
     |  | Create an empty most likely constituent table, *MLC*.
     |  | For width in 1...len(text):
     |  |   For start in 1...len(text)-width:
     |  |     For prod in grammar.productions:
     |  |       For each sequence of subtrees [t[1], t[2], ..., t[n]] in MLC,
     |  |         where t[i].label()==prod.rhs[i],
     |  |         and the sequence covers [start:start+width]:
     |  |           old_p = MLC[start, start+width, prod.lhs]
     |  |           new_p = P(t[1])P(t[1])...P(t[n])P(prod)
     |  |           if new_p > old_p:
     |  |             new_tree = Tree(prod.lhs, t[1], t[2], ..., t[n])
     |  |             MLC[start, start+width, prod.lhs] = new_tree
     |  | Return MLC[0, len(text), start_symbol]
     |
     |  :type _grammar: PCFG
     |  :ivar _grammar: The grammar used to parse sentences.
     |  :type _trace: int
     |  :ivar _trace: The level of tracing output that should be generated
     |      when parsing a text.
     |
     |  Method resolution order:
     |      ViterbiParser
     |      nltk.parse.api.ParserI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, grammar, trace=0)
     |      Create a new ``ViterbiParser`` parser, that uses ``grammar`` to
     |      parse texts.
     |
     |      :type grammar: PCFG
     |      :param grammar: The grammar used to parse texts.
     |      :type trace: int
     |      :param trace: The level of tracing that should be used when
     |          parsing a text.  ``0`` will generate no tracing output;
     |          and higher numbers will produce more verbose tracing
     |          output.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  grammar(self)
     |      :return: The grammar used by this parser.
     |
     |  parse(self, tokens)
     |      :return: An iterator that generates parse trees for the sentence.
     |          When possible this list is sorted from most likely to least likely.
     |
     |      :param sent: The sentence to be parsed
     |      :type sent: list(str)
     |      :rtype: iter(Tree)
     |
     |  trace(self, trace=2)
     |      Set the level of tracing output that should be generated when
     |      parsing a text.
     |
     |      :type trace: int
     |      :param trace: The trace level.  A trace level of ``0`` will
     |          generate no tracing output; and higher trace levels will
     |          produce more verbose tracing output.
     |      :rtype: None
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.parse.api.ParserI:
     |
     |  parse_all(self, sent, *args, **kwargs)
     |      :rtype: list(Tree)
     |
     |  parse_one(self, sent, *args, **kwargs)
     |      :rtype: Tree or None
     |
     |  parse_sents(self, sents, *args, **kwargs)
     |      Apply ``self.parse()`` to each element of ``sents``.
     |      :rtype: iter(iter(Tree))
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.parse.api.ParserI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    demo()
        A demonstration of the probabilistic parsers.  The user is
        prompted to select which demo to run, and how many parses should
        be found; and then each parser is run on the same demo, and a
        summary of the results are displayed.

    reduce(...)
        reduce(function, iterable[, initial]) -> value

        Apply a function of two arguments cumulatively to the items of a sequence
        or iterable, from left to right, so as to reduce the iterable to a single
        value.  For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
        ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
        of the iterable in the calculation, and serves as a default when the
        iterable is empty.

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\parse\viterbi.py

nltk.warnings
Python Library Documentation: module warnings

NAME
    warnings - Python part of the warnings subsystem.

MODULE REFERENCE
    https://docs.python.org/3.12/library/warnings.html

    The following documentation is automatically generated from the Python
    source files.  It may be incomplete, incorrect or include features that
    are considered implementation detail and may vary between Python
    implementations.  When in doubt, consult the module reference at the
    location listed above.

CLASSES
    builtins.object
        catch_warnings

    class catch_warnings(builtins.object)
     |  catch_warnings(*, record=False, module=None, action=None, category=<class 'Warning'>, lineno=0, append=False)
     |
     |  A context manager that copies and restores the warnings filter upon
     |  exiting the context.
     |
     |  The 'record' argument specifies whether warnings should be captured by a
     |  custom implementation of warnings.showwarning() and be appended to a list
     |  returned by the context manager. Otherwise None is returned by the context
     |  manager. The objects appended to the list are arguments whose attributes
     |  mirror the arguments to showwarning().
     |
     |  The 'module' argument is to specify an alternative module to the module
     |  named 'warnings' and imported under that name. This argument is only useful
     |  when testing the warnings module itself.
     |
     |  If the 'action' argument is not None, the remaining arguments are passed
     |  to warnings.simplefilter() as if it were called immediately on entering the
     |  context.
     |
     |  Methods defined here:
     |
     |  __enter__(self)
     |
     |  __exit__(self, *exc_info)
     |
     |  __init__(self, *, record=False, module=None, action=None, category=<class 'Warning'>, lineno=0, append=False)
     |      Specify whether to record warnings and if an alternative module
     |      should be used other than sys.modules['warnings'].
     |
     |      For compatibility with Python 3.0, please consider all arguments to be
     |      keyword-only.
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    filterwarnings(action, message='', category=<class 'Warning'>, module='', lineno=0, append=False)
        Insert an entry into the list of warnings filters (at the front).

        'action' -- one of "error", "ignore", "always", "default", "module",
                    or "once"
        'message' -- a regex that the warning message must match
        'category' -- a class that the warning must be a subclass of
        'module' -- a regex that the module name must match
        'lineno' -- an integer line number, 0 matches all warnings
        'append' -- if true, append to the list of filters

    formatwarning(message, category, filename, lineno, line=None)
        Function to format a warning the standard way.

    resetwarnings()
        Clear the list of warning filters, so that no filters are active.

    showwarning(message, category, filename, lineno, file=None, line=None)
        Hook to write a warning to a file; replace if you like.

    simplefilter(action, category=<class 'Warning'>, lineno=0, append=False)
        Insert a simple entry into the list of warnings filters (at the front).

        A simple filter matches all modules and messages.
        'action' -- one of "error", "ignore", "always", "default", "module",
                    or "once"
        'category' -- a class that the warning must be a subclass of
        'lineno' -- an integer line number, 0 matches all warnings
        'append' -- if true, append to the list of filters

    warn(...)
        Issue a warning, or maybe ignore it or raise an exception.

        message
          Text of the warning message.
        category
          The Warning category subclass. Defaults to UserWarning.
        stacklevel
          How far up the call stack to make this warning appear. A value of 2 for
          example attributes the warning to the caller of the code calling warn().
        source
          If supplied, the destroyed object which emitted a ResourceWarning
        skip_file_prefixes
          An optional tuple of module filename prefixes indicating frames to skip
          during stacklevel computations for stack frame attribution.

    warn_explicit(...)
        Issue a warning, or maybe ignore it or raise an exception.

DATA
    __all__ = ['warn', 'warn_explicit', 'showwarning', 'formatwarning', 'f...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\warnings.py

nltk.weka
Python Library Documentation: module nltk.classify.weka in nltk.classify

NAME
    nltk.classify.weka - Classifiers that make use of the external 'Weka' package.

CLASSES
    builtins.object
        ARFF_Formatter
    nltk.classify.api.ClassifierI(builtins.object)
        WekaClassifier

    class ARFF_Formatter(builtins.object)
     |  ARFF_Formatter(labels, features)
     |
     |  Converts featuresets and labeled featuresets to ARFF-formatted
     |  strings, appropriate for input into Weka.
     |
     |  Features and classes can be specified manually in the constructor, or may
     |  be determined from data using ``from_train``.
     |
     |  Methods defined here:
     |
     |  __init__(self, labels, features)
     |      :param labels: A list of all class labels that can be generated.
     |      :param features: A list of feature specifications, where
     |          each feature specification is a tuple (fname, ftype);
     |          and ftype is an ARFF type string such as NUMERIC or
     |          STRING.
     |
     |  data_section(self, tokens, labeled=None)
     |      Returns the ARFF data section for the given data.
     |
     |      :param tokens: a list of featuresets (dicts) or labelled featuresets
     |          which are tuples (featureset, label).
     |      :param labeled: Indicates whether the given tokens are labeled
     |          or not.  If None, then the tokens will be assumed to be
     |          labeled if the first token's value is a tuple or list.
     |
     |  format(self, tokens)
     |      Returns a string representation of ARFF output for the given data.
     |
     |  header_section(self)
     |      Returns an ARFF header as a string.
     |
     |  labels(self)
     |      Returns the list of classes.
     |
     |  write(self, outfile, tokens)
     |      Writes ARFF data to a file for the given data.
     |
     |  ----------------------------------------------------------------------
     |  Static methods defined here:
     |
     |  from_train(tokens)
     |      Constructs an ARFF_Formatter instance with class labels and feature
     |      types determined from the given data. Handles boolean, numeric and
     |      string (note: not nominal) types.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

    class WekaClassifier(nltk.classify.api.ClassifierI)
     |  WekaClassifier(formatter, model_filename)
     |
     |  Method resolution order:
     |      WekaClassifier
     |      nltk.classify.api.ClassifierI
     |      builtins.object
     |
     |  Methods defined here:
     |
     |  __init__(self, formatter, model_filename)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  classify_many(self, featuresets)
     |      Apply ``self.classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.classify(fs) for fs in featuresets]
     |
     |      :rtype: list(label)
     |
     |  parse_weka_distribution(self, s)
     |
     |  parse_weka_output(self, lines)
     |
     |  prob_classify_many(self, featuresets)
     |      Apply ``self.prob_classify()`` to each element of ``featuresets``.  I.e.:
     |
     |          return [self.prob_classify(fs) for fs in featuresets]
     |
     |      :rtype: list(ProbDistI)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  train(model_filename, featuresets, classifier='naivebayes', options=[], quiet=True)
     |
     |  ----------------------------------------------------------------------
     |  Methods inherited from nltk.classify.api.ClassifierI:
     |
     |  classify(self, featureset)
     |      :return: the most appropriate label for the given featureset.
     |      :rtype: label
     |
     |  labels(self)
     |      :return: the list of category labels used by this classifier.
     |      :rtype: list of (immutable)
     |
     |  prob_classify(self, featureset)
     |      :return: a probability distribution over labels for the given
     |          featureset.
     |      :rtype: ProbDistI
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors inherited from nltk.classify.api.ClassifierI:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FUNCTIONS
    config_weka(classpath=None)

DATA
    stdin = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\classify\weka.py

nltk.windowdiff
Python Library Documentation: function windowdiff in module nltk.metrics.segmentation

windowdiff(seg1, seg2, k, boundary='1', weighted=False)
    Compute the windowdiff score for a pair of segmentations.  A
    segmentation is any sequence over a vocabulary of two items
    (e.g. "0", "1"), where the specified boundary value is used to
    mark the edge of a segmentation.

    From Pevzner & Hearst (2002), the WindowDiff metric is defined as::

        WindowDiff(ref, hyp, k) =
            1 / (N - k) * sum_{i=1}^{N-k} (
                |b(ref, i, i+k) - b(hyp, i, i+k)| > 0
            )

    where ``b(seg, i, j)`` counts the number of boundaries in ``seg``
    between positions ``i`` and ``j``, and ``N = len(seg)``.

    The weighted variant sums the absolute differences instead
    of thresholding at 1.

        >>> s1 = "000100000010"
        >>> s2 = "000010000100"
        >>> s3 = "100000010000"
        >>> '%.2f' % windowdiff(s1, s1, 3)
        '0.00'
        >>> '%.2f' % windowdiff(s1, s2, 3)
        '0.30'
        >>> '%.2f' % windowdiff(s2, s3, 3)
        '0.80'

    :param seg1: a segmentation
    :type seg1: str or list
    :param seg2: a segmentation
    :type seg2: str or list
    :param k: window width
    :type k: int
    :param boundary: boundary value
    :type boundary: str or int or bool
    :param weighted: use the weighted variant of windowdiff
    :type weighted: boolean
    :rtype: float
nltk.word_tokenize
Python Library Documentation: function word_tokenize in module nltk.tokenize

word_tokenize(text, language='english', preserve_line=False)
    Return a tokenized copy of *text*,
    using NLTK's recommended word tokenizer
    (currently an improved :class:`.TreebankWordTokenizer`
    along with :class:`.PunktSentenceTokenizer`
    for the specified language).

    :param text: text to split into words
    :type text: str
    :param language: the model name in the Punkt corpus
    :type language: str
    :param preserve_line: A flag to decide whether to sentence tokenize the text or not.
    :type preserve_line: bool
nltk.wordnet
Python Library Documentation: module nltk.stem.wordnet in nltk.stem

NAME
    nltk.stem.wordnet

DESCRIPTION
    # Natural Language Toolkit: WordNet stemmer interface
    #
    # Copyright (C) 2001-2026 NLTK Project
    # Author: Steven Bird <stevenbird1@gmail.com>
    #         Edward Loper <edloper@gmail.com>
    #         Eric Kafe <kafe.eric@gmail.com>
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

CLASSES
    builtins.object
        WordNetLemmatizer

    class WordNetLemmatizer(builtins.object)
     |  WordNet Lemmatizer
     |
     |  Provides 3 lemmatizer modes: _morphy(), morphy() and lemmatize().
     |
     |  lemmatize() is a permissive wrapper around _morphy().
     |  It returns the shortest lemma found in WordNet,
     |  or the input string unchanged if nothing is found.
     |
     |  >>> from nltk.stem import WordNetLemmatizer as wnl
     |  >>> print(wnl().lemmatize('us', 'n'))
     |  u
     |
     |  >>> print(wnl().lemmatize('Anythinggoeszxcv'))
     |  Anythinggoeszxcv
     |
     |  Methods defined here:
     |
     |  __repr__(self)
     |      Return repr(self).
     |
     |  lemmatize(self, word: str, pos: str = 'n') -> str
     |      Lemmatize `word` by picking the shortest of the possible lemmas,
     |      using the wordnet corpus reader's built-in _morphy function.
     |      Returns the input word unchanged if it cannot be found in WordNet.
     |
     |      >>> from nltk.stem import WordNetLemmatizer as wnl
     |      >>> print(wnl().lemmatize('dogs'))
     |      dog
     |      >>> print(wnl().lemmatize('churches'))
     |      church
     |      >>> print(wnl().lemmatize('aardwolves'))
     |      aardwolf
     |      >>> print(wnl().lemmatize('abaci'))
     |      abacus
     |      >>> print(wnl().lemmatize('hardrock'))
     |      hardrock
     |
     |      :param word: The input word to lemmatize.
     |      :type word: str
     |      :param pos: The Part Of Speech tag. Valid options are `"n"` for nouns,
     |          `"v"` for verbs, `"a"` for adjectives, `"r"` for adverbs and `"s"`
     |          for satellite adjectives.
     |      :type pos: str
     |      :return: The shortest lemma of `word`, for the given `pos`.
     |
     |  morphy(self, form, pos=None, check_exceptions=True)
     |      morphy() is a restrictive wrapper around _morphy().
     |      It returns the first lemma found in WordNet,
     |      or None if no lemma is found.
     |
     |      >>> from nltk.stem import WordNetLemmatizer as wnl
     |      >>> print(wnl().morphy('us', 'n'))
     |      us
     |
     |      >>> print(wnl().morphy('catss'))
     |      None
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\stem\wordnet.py

nltk.wordpunct_tokenize
Python Library Documentation: method tokenize in module nltk.tokenize.regexp

tokenize(text) method of nltk.tokenize.regexp.WordPunctTokenizer instance
    Return a tokenized copy of *s*.

    :rtype: List[str]
nltk.wsd
Python Library Documentation: module nltk.wsd in nltk

NAME
    nltk.wsd

DESCRIPTION
    # Natural Language Toolkit: Word Sense Disambiguation Algorithms
    #
    # Authors: Liling Tan <alvations@gmail.com>,
    #          Dmitrijs Milajevs <dimazest@gmail.com>
    #
    # Copyright (C) 2001-2026 NLTK Project
    # URL: <https://www.nltk.org/>
    # For license information, see LICENSE.TXT

FUNCTIONS
    lesk(context_sentence, ambiguous_word, pos=None, synsets=None, lang='eng')
        Return a synset for an ambiguous word in a context.

        :param iter context_sentence: The context sentence where the ambiguous word
             occurs, passed as an iterable of words.
        :param str ambiguous_word: The ambiguous word that requires WSD.
        :param str pos: A specified Part-of-Speech (POS).
        :param iter synsets: Possible synsets of the ambiguous word.
        :param str lang: WordNet language.
        :return: ``lesk_sense`` The Synset() object with the highest signature overlaps.

        This function is an implementation of the original Lesk algorithm (1986) [1].

        Usage example::

            >>> lesk(['I', 'went', 'to', 'the', 'bank', 'to', 'deposit', 'money', '.'], 'bank', 'n')
            Synset('depository_financial_institution.n.01')

        [1] Lesk, Michael. "Automatic sense disambiguation using machine
        readable dictionaries: how to tell a pine cone from an ice cream
        cone." Proceedings of the 5th Annual International Conference on
        Systems Documentation. ACM, 1986.
        https://dl.acm.org/citation.cfm?id=318728

DATA
    wordnet = <WordNetCorpusReader in '.../corpora/wordnet' (not loaded ye...

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\nltk\wsd.py