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: Pop twiddle factors for an FFT of length n from the cache.
  
  Will return None if the requested twiddle factors are not available in
  the cache.
  
  Parameters
  ----------
  n : int
      Data length for the FFT.
  
  Returns
  -------
  out : ndarray or None
      The retrieved twiddle factors if available, else None.
docstr_tok: ["Pop","twiddle","factors","for","an","FFT","of","length","n","from","the","cache",".","Will","return","None","if","the","requested","twiddle","factors","are","not","available","in","the","cache",".","Parameters","--","--","--","--","--","n",":","int","Data","length","for","the","FFT",".","Returns","--","--","--","-","out",":","ndarray","or","None","The","retrieved","twiddle","factors","if","available",",","else","None","."]
code: def pop_twiddle_factors(self, n):
      """
      Pop twiddle factors for an FFT of length n from the cache.
  
      Will return None if the requested twiddle factors are not available in
      the cache.
  
      Parameters
      ----------
      n : int
          Data length for the FFT.
  
      Returns
      -------
      out : ndarray or None
          The retrieved twiddle factors if available, else None.
      """
      with self._lock:
          if n not in self._dict or not self._dict[n]:
              return None
          # Pop + later add to move it to the end for LRU behavior.
          all_values = self._dict.pop(n)
          value = all_values.pop()
          # Only put pack if there are still some arrays left in the list.
          if all_values:
              self._dict[n] = all_values
          return value
  
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 3 for calling the _FFTCache obj's underlying member method code with example usage: obj.pop_twiddle_factors(n) and returns: value, None