code: def handle_modulation_of_duplicate_events(events):
      """Deal with modulation of duplicate events if they have one.
  
      Currently the strategy is to sum the modulation values of duplicate events.
      """
      cleaned_events = (
          events.groupby(COLUMN_DEFINING_EVENT_IDENTITY, sort=False)
          .agg(STRATEGY)
          .reset_index()
      )
  
      # If there are duplicates, give a warning
      if len(cleaned_events) != len(events):
          warnings.warn(
              "Duplicated events were detected. "
              "Amplitudes of these events will be summed. "
              "You might want to verify your inputs."
          )
  
      return cleaned_events
  
file_path: nilearn/nilearn/glm/first_level/experimental_paradigm.py
imports: import warnings
  import pandas
  from pandas.api.types import is_numeric_dtype
label_desc: Use image node_id 7 for calling a global function with example usage: handle_modulation_of_duplicate_events(events) and returns: cleaned_events