code: def generate_event_labels(T, K, length_std):
      event_labels = np.zeros(T, dtype=int)
      start_TR = 0
      for e in range(K - 1):
          length = round(
              ((T - start_TR) / (K - e))
              * (1 + length_std * np.random.randn())
          )
          length = min(max(length, 1), T - start_TR - (K - e))
          event_labels[start_TR : (start_TR + length)] = e
          start_TR = start_TR + length
      event_labels[start_TR:] = K - 1
  
      return event_labels
  
imports: import brainiak.eventseg.event
  import numpy
  from scipy import stats
  import logging
  import matplotlib.pyplot
label_desc: Use image node_id 1 for calling a global function with example usage: generate_event_labels(T, K, length_std) and returns: event_labels