Given an array of slide configs (the events), ensure that each one has a distinct unique_id. The id of the title
is also passed in because in most ways it functions as an event slide, and the event IDs must also all be unique
from the title ID.
764855
function(title_id, array) {
		var used = [title_id];

		// establish which IDs are assigned and if any appear twice, clear out successors.
		for (var i = 0; i < array.length; i++) {
			if (TL.Util.trim(array[i].unique_id)) {
				array[i].unique_id = TL.Util.slugify(array[i].unique_id); // enforce valid
				if (used.indexOf(array[i].unique_id) == -1) {
					used.push(array[i].unique_id);
				} else { // it was already used, wipe it out
					array[i].unique_id = '';
				}
			}
		};

		if (used.length != (array.length + 1)) {
			// at least some are yet to be assigned
			for (var i = 0; i < array.length; i++) {
				if (!array[i].unique_id) {
					// use the headline for the unique ID if it's available
					var slug = (array[i].text) ? TL.Util.slugify(array[i].text.headline) : null;
					if (!slug) {
						slug = TL.Util.unique_ID(6); // or generate a random ID
					}
					if (used.indexOf(slug) != -1) {
						slug = slug + '-' + i; // use the index to get a unique ID.
					}
					used.push(slug);
					array[i].unique_id = slug;
				}
			}
		}
	}
85050
function () {
                var dynamicIds = this._dynamicIds;
                if (dynamicIds) {
                    for (var i = dynamicIds.length - 1; i >= 0; i--) {
                        idMgr.releaseId(dynamicIds[i]);
                    }
                    this._dynamicIds = null;
                }
            }
548145
def each_new_event
      new_events = []
      stack.events.each do |event|
        break if event.id == @last_processed_event_id
        new_events.unshift(event)
      end
      new_events.each do |event|
        yield event
        @last_processed_event_id = event.id
      end
    rescue Aws::CloudFormation::Errors::ValidationError => _e
    end
1198864
function () {
      var doUniqueSlotIdsCheck = function (elementary) {
        var duplicateSlotIds = [];
        elementary.slots.forEach(function (slot) {
          var slotId = slot.slotId;

          function filterBySlotId (slot) {
            return slot.slotId === slotId;
          }

          var arrayByUniqueSlotIds = elementary.slots.filter(filterBySlotId);
          if (arrayByUniqueSlotIds.length > 1 && duplicateSlotIds.indexOf(slotId) < 0) {
            duplicateSlotIds.push(slotId);
          }
        });
        duplicateSlotIds.forEach(function (slotId) {
          errors.push('RuleViolation identified: Artifact \'' + elementary.artifactId +
            '\' contains multiple slots with \'slotId\'=\'' + slotId + '\'');
        });
      };
      //
      if (doc.artifacts && doc.artifacts.elementaryComponents) {
        doc.artifacts.elementaryComponents.forEach(function (elementary) {
          if (elementary.slots) {
            doUniqueSlotIdsCheck(elementary);
          }
        });
      }
    }
1234330
def generate_id
		
		title = children_to_s
		title.gsub!(/ /,'_')
		title.downcase!
		title.gsub!(/[^\w_]/,'')
		title.strip!
		
		if title.size == 0
			$uid ||= 0
			$uid += 1
			title = "id#{$uid}"
		end

		# random is a very bad idea
#		title << "_" + rand(10000).to_s
		title
	end
599012
function _setEvents(eventsArray){

    for (let i = 0; i < eventsArray.length; i++){

        let event = eventsArray[i];
        dataManager.registerEvent(event[0], event[1], event[2]);

    }

}
234689
function() {
      var updateEventsIsArray = _.isArray(this.updateEvents);
      var updateEventsIsSingleValue = !updateEventsIsArray && (_.isObject(this.updateEvents) || _.isString(this.updateEvents));
      var updateEventsIsUndefined = _.isUndefined(this.updateEvents);
      var updateEventsIsValidType = updateEventsIsArray || updateEventsIsSingleValue || updateEventsIsUndefined;

      if (updateEventsIsSingleValue) {
        this.updateEvents = [this.updateEvents];
      }

      if (!updateEventsIsValidType) {
        throw new Error('Update events are not an array, string or object.  Please see parameters for examples of how to define updateEvents.  Configured UpdateEvents: ', this.updateEvents);
      }

      // Remove any random falsey values (mostly to get rid of undefined events).
      this.updateEvents = _.compact(this.updateEvents);
      _.each(this.updateEvents, this.__validUpdateEvent);
    }
52406
function ( eventName, handler ) {
        var events = this.events[ eventName ],
            handlers = [],
            i;
        if ( !events ) {
            return;
        }
        if ( $.isArray( events ) ) {
            for ( i = 0; i < events.length; i++ ) {
                if ( events[i].handler !== handler ) {
                    handlers.push( events[ i ] );
                }
            }
            this.events[ eventName ] = handlers;
        }
    }
980032
function(e, unique_id){
			
			var timer_str = (this._custom_timer) ? this._custom_timer : this.time;
			this['_int_id_' + unique_id] = setTimeout(function(){ 
				Gritter._fade(e, unique_id);
			}, timer_str);
		
		}
575559
function() {
            clearInterval(pgwSlideshow.intervalEvent);

            if (pgwSlideshow.slideCount > 1 && pgwSlideshow.config.autoSlide) {
                pgwSlideshow.intervalEvent = setInterval(function() {
                    if (pgwSlideshow.currentSlide + 1 <= pgwSlideshow.slideCount) {
                        var nextItem = pgwSlideshow.currentSlide + 1;
                    } else {
                        var nextItem = 1;
                    }
                    displayElement(nextItem);
                }, pgwSlideshow.config.intervalDuration);
            }

            return true;
        }
768518
function() {
            clearInterval(pgwSlider.intervalEvent);

            if (pgwSlider.slideCount > 1 && pgwSlider.config.autoSlide) {
                pgwSlider.intervalEvent = setInterval(function() {
                    if (pgwSlider.currentSlide + 1 <= pgwSlider.slideCount) {
                        var nextItem = pgwSlider.currentSlide + 1;
                    } else {
                        var nextItem = 1;
                    }
                    displayElement(nextItem);
                }, pgwSlider.config.intervalDuration);
            }

            return true;
        }
388085
function(data) {
		var unique_id = this.config.addEvent(data);

		var n = this._getEventIndex(unique_id);
		var d = this.config.events[n];

		this._storyslider.createSlide(d, this.config.title ? n+1 : n);
		this._storyslider._updateDrawSlides();

		this._timenav.createMarker(d, n);
		this._timenav._updateDrawTimeline(false);

		this.fire("added", {unique_id: unique_id});
	}
1013092
function unique(array, property) {
  
  if (!isArray(array)) {
    return array;
  }

  //store all unique identifiers
  var uniqueItems = [],
    get = $parse(property);

  return (isUndefined(property)) ?
    //if it's kind of primitive array
    array.filter(function (elm, pos, self) {
      return self.indexOf(elm) === pos;
    }) :
    //else compare with equals
    array.filter(function (elm) {
      var prop = get(elm);
      if(some(uniqueItems, prop)) {
        return false;
      }
      uniqueItems.push(prop);
      return true;
    });

  //checked if the unique identifier is already exist
  function some(array, member) {
    if(isUndefined(member)) {
      return false;
    }
    return array.some(function(el) {
      return equals(el, member);
    });
  }

}
954115
def post_event_display_settings(self, id, **data):
        
        
        return self.post("/events/{0}/display_settings/".format(id), data=data)
1210255
function(id){
        if(id){
            var plugins = this.doc.findall('./plugin/[@name="' + id + '"]')
                .concat(this.doc.findall('./feature/param[@name="id"][@value="' + id + '"]/..'));
            var children = this.doc.getroot().getchildren();
            plugins.forEach(function (plugin) {
                var idx = children.indexOf(plugin);
                if (idx > -1) {
                    children.splice(idx, 1);
                }
            });
        }
    }
288687
def _unique_id(self, prefix):
        
        _id = self._id_gen
        self._id_gen += 1
        return prefix + str(_id)
824202
def get_slide(self, slide_id):
        
        for sldId in self._element.sldIdLst:
            if sldId.id == slide_id:
                return self.related_parts[sldId.rId].slide
        return None