code: def next_fast_len(size):
      """
      Returns the next largest number ``n >= size`` whose prime factors are all
      2, 3, or 5. These sizes are efficient for fast fourier transforms.
      Equivalent to :func:`scipy.fftpack.next_fast_len`.
  
      Implementation from pyro
  
      :param int size: A positive number.
      :returns: A possibly larger number.
      :rtype int:
      """
      try:
          return _NEXT_FAST_LEN[size]
      except KeyError:
          pass
  
      assert isinstance(size, int) and size > 0
      next_size = size
      while True:
          remaining = next_size
          for n in (2, 3, 5):
              while remaining % n == 0:
                  remaining //= n
          if remaining == 1:
              _NEXT_FAST_LEN[size] = next_size
              return next_size
          next_size += 1
  
imports: from collections import namedtuple
  from contextlib import redirect_stdout
  import inspect
  import os
  from typing import Any, Callable, Dict, List, Tuple, Union
  import lightning.pytorch
  import torch
  from torch import nn
  from torch.fft import irfft, rfft
  import torch.nn.functional
  from torch.nn.utils import rnn
label_desc: Use image node_id 6 for calling a global function with example usage: next_fast_len(size) and returns: _NEXT_FAST_LEN, next_size