code: def get_frequency_modes(
      seq_len, modes=64, mode_select_method="random"
  ):
      """
      Get modes on frequency domain:
          'random' for sampling randomly
          'else' for sampling the lowest modes;
      """
      modes = min(modes, seq_len // 2)
      if mode_select_method == "random":
          index = list(range(0, seq_len // 2))
          np.random.shuffle(index)
          index = index[:modes]
      else:
          index = list(range(0, modes))
      index.sort()
      return index
  
imports: import numpy
  from typing import Optional
  import torch
  import torch.nn
  import torch.nn.functional
  from ..common._modules import DataEmbedding
  from ..common._base_windows import BaseWindows
  from ..losses.pytorch import MAE
label_desc: Use image node_id 1 for calling a global function with example usage: get_frequency_modes(seq_len, modes, mode_select_method) and returns: index