def make_multibonacci_modulo(history_length, limit):
  """Creates a function that generates the Multibonacci sequence modulo n."""
  def sequence_fn(seq):
    return np.sum(seq[-history_length:]) % limit
  return sequence_fn
Creates a function that generates the Multibonacci sequence modulo n.
trax/supervised/callbacks_test.py