class_docstr: Cache for the FFT twiddle factors as an LRU (least recently used) cache.
  
  Parameters
  ----------
  max_size_in_mb : int
      Maximum memory usage of the cache before items are being evicted.
  max_item_count : int
      Maximum item count of the cache before items are being evicted.
  
  Notes
  -----
  Items will be evicted if either limit has been reached upon getting and
  setting. The maximum memory usages is not strictly the given
  ``max_size_in_mb`` but rather
  ``max(max_size_in_mb, 1.5 * size_of_largest_item)``. Thus the cache will
  never be completely cleared - at least one item will remain and a single
  large item can cause the cache to retain several smaller items even if the
  given maximum cache size has been exceeded.
class_docstr_tok: ["Cache","for","the","FFT","twiddle","factors","as","an","LRU","(","least","recently","used",")","cache",".","Parameters","--","--","--","--","--","max_size_in_mb",":","int","Maximum","memory","usage","of","the","cache","before","items","are","being","evicted",".","max_item_count",":","int","Maximum","item","count","of","the","cache","before","items","are","being","evicted",".","Notes","--","--","-","Items","will","be","evicted","if","either","limit","has","been","reached","upon","getting","and","setting",".","The","maximum","memory","usages","is","not","strictly","the","given","``","max_size_in_mb","``","but","rather","``","max","(","max_size_in_mb",",","1.5","*","size_of_largest_item",")","``",".","Thus","the","cache","will","never","be","completely","cleared","-","at","least","one","item","will","remain","and","a","single","large","item","can","cause","the","cache","to","retain","several","smaller","items","even","if","the","given","maximum","cache","size","has","been","exceeded","."]
docstr: Store twiddle factors for an FFT of length n in the cache.
  
  Putting multiple twiddle factors for a certain n will store it multiple
  times.
  
  Parameters
  ----------
  n : int
      Data length for the FFT.
  factors : ndarray
      The actual twiddle values.
docstr_tok: ["Store","twiddle","factors","for","an","FFT","of","length","n","in","the","cache",".","Putting","multiple","twiddle","factors","for","a","certain","n","will","store","it","multiple","times",".","Parameters","--","--","--","--","--","n",":","int","Data","length","for","the","FFT",".","factors",":","ndarray","The","actual","twiddle","values","."]
code: def put_twiddle_factors(self, n, factors):
      """
      Store twiddle factors for an FFT of length n in the cache.
  
      Putting multiple twiddle factors for a certain n will store it multiple
      times.
  
      Parameters
      ----------
      n : int
          Data length for the FFT.
      factors : ndarray
          The actual twiddle values.
      """
      with self._lock:
          # Pop + later add to move it to the end for LRU behavior.
          # Internally everything is stored in a dictionary whose values are
          # lists.
          try:
              value = self._dict.pop(n)
          except KeyError:
              value = []
          value.append(factors)
          self._dict[n] = value
          self._prune_cache()
  
file_path: catboost/contrib/python/numpy/py2/numpy/fft/helper.py
imports: from __future__ import division, absolute_import, print_function
  import collections
  from numpy.compat import integer_types
  from numpy.core import integer, empty, arange, asarray, roll
  from numpy.core.overrides import array_function_dispatch, set_module
label_desc: Use image node_id 2 for calling the _FFTCache obj's underlying member method code with example usage: obj.put_twiddle_factors(n, factors) without return types