Rule 3: Check compound slot definitions to have unique slot's.
769342
function () {
      var doUniqueSlotIdsCheck = function (compound) {
        var duplicateSlotIds = [];
        compound.slots.forEach(function (slot) {
          var slotId = slot.slotId;

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

          var arrayByUniqueSlotIds = compound.slots.filter(filterBySlotId);
          if (arrayByUniqueSlotIds.length > 1 && duplicateSlotIds.indexOf(slotId) < 0) {
            duplicateSlotIds.push(slotId);
          }
        });
        duplicateSlotIds.forEach(function (slotId) {
          errors.push('RuleViolation identified: Artifact \'' + compound.artifactId +
            '\' contains multiple slots with \'slotId\'=\'' + slotId + '\'');
        });
      };
      //
      if (doc.artifacts && doc.artifacts.compoundComponents) {
        doc.artifacts.compoundComponents.forEach(function (compound) {
          if (compound.slots) {
            doUniqueSlotIdsCheck(compound);
          }
        });
      }
    }
543760
def unique(flags_class):
    
    if not is_flags_class_final(flags_class):
        raise TypeError('unique check can be applied only to flags classes that have members')
    if not flags_class.__member_aliases__:
        return flags_class
    aliases = ', '.join('%s -> %s' % (alias, name) for alias, name in flags_class.__member_aliases__.items())
    raise ValueError('duplicate values found in %r: %s' % (flags_class, aliases))
456881
def check_abbreviation_unique(self, abbreviation, newFilterPattern, targetItem):
        
        for item in self.allFolders:
            if model.TriggerMode.ABBREVIATION in item.modes:
                if abbreviation in item.abbreviations and item.filter_matches(newFilterPattern):
                    return item is targetItem, item
            
        for item in self.allItems:
            if model.TriggerMode.ABBREVIATION in item.modes:
                if abbreviation in item.abbreviations and item.filter_matches(newFilterPattern):
                    return item is targetItem, item

        return True, None
860688
function hasDuplicateDependentKeys(callExp) {
  if (!isComputedProp(callExp)) return false;

  const dependentKeys = parseDependentKeys(callExp);
  const uniqueKeys = dependentKeys
    .filter((val, index, self) => self.indexOf(val) === index);

  return uniqueKeys.length !== dependentKeys.length;
}
109916
def _get_all_slots(self):
        """"""
        all_slots = (getattr(cls, '__slots__', [])
                         for cls in self.__class__.__mro__)
        return set(slot for slots in all_slots for slot in slots)
265424
function unique(oldArray) {
    var nIndex,
      nLen = oldArray.length,
      aArr = [];
    for (nIndex = 0; nIndex < nLen; nIndex++) {
      if (!contains(aArr, oldArray[nIndex][1])) {
        aArr.push(oldArray[nIndex]);
      }
    }
    return aArr;
  }
903457
def slots_overlap(slot, other_slot):
    
    slot_ends_at = ends_at(slot)
    other_ends_at = ends_at(other_slot)
    if (slot.starts_at >= other_slot.starts_at and
        slot_ends_at <= other_ends_at
    ):
        return True
    if (other_slot.starts_at >= slot.starts_at and
        other_ends_at <= slot_ends_at
    ):
        return True
    return False
298387
def make_unique_ngrams(s, n):
    """"""
    return set(s[i:i + n] for i in range(len(s) - n + 1))
783763
def aliased_slot_name(self, slot: SLOT_OR_SLOTNAME) -> str:
        
        if isinstance(slot, str):
            slot = self.schema.slots[slot]
        return slot.alias if slot.alias else slot.name
1010903
public function unique()
    {
        $exist = $remove = array();

        $old = $this->_filter;
        $this->setIteratorFilter(self::HIDE_GROUPS | self::BASE_ELEMENTS);

        // For duplicates, we use the first address that contains personal
        // information.
        foreach ($this as $key => $val) {
            $bare = $val->bare_address;
            if (isset($exist[$bare])) {
                if (($exist[$bare] == -1) || is_null($val->personal)) {
                    $remove[] = $key;
                } else {
                    $remove[] = $exist[$bare];
                    $exist[$bare] = -1;
                }
            } else {
                $exist[$bare] = is_null($val->personal)
                    ? $key
                    : -1;
            }
        }

        foreach (array_reverse($remove) as $key) {
            unset($this[$key]);
        }

        $this->_filter = $old;
    }
748068
def _check_compound_pillar_exact_minions(self, expr, delimiter, greedy):
        '''
        
        '''
        return self._check_compound_minions(expr,
                                            delimiter,
                                            greedy,
                                            pillar_exact=True)
863365
def _unique_constrains(cls):
        """"""
        unique = [{c.name for c in u.columns} for u in cls.__table_args__
                  if isinstance(u, UniqueConstraint)]
        unique.extend({c.name} for c in cls.__table__.columns if c.unique)
        return unique
338371
function validateUniqueness(attr, conf, err, done) {
    var cond = {where: {}};
    cond.where[attr] = this[attr];
    this.constructor.all(cond, function (error, found) {
        if (found.length > 1) {
            err();
        } else if (found.length === 1 && (!this.id || !found[0].id || found[0].id.toString() !== this.id.toString())) {
            err();
        }
        done();
    }.bind(this));
}
310805
def uniqueify_all(init_reqs, *other_reqs):
    """"""
    union = set(init_reqs)
    for reqs in other_reqs:
        union.update(reqs)
    return list(union)
63490
def unique(enumeration):
    """"""
    duplicates = []
    for name, member in enumeration.__members__.items():
        if name != member.name:
            duplicates.append((name, member.name))
    if duplicates:
        duplicate_names = ', '.join(
                ["%s -> %s" % (alias, name) for (alias, name) in duplicates]
                )
        raise ValueError('duplicate names found in %r: %s' %
                (enumeration, duplicate_names)
                )
    return enumeration
265616
def with_slots(cls):
    
    def _compare(self, other):
        for slot in self.__class__._slots_:
            attr = operator.attrgetter(slot)
            source = attr(self)
            target = attr(other)
            if isinstance(source, numpy.ndarray):
                eq = numpy.array_equal(source, target)
            elif hasattr(source, '_slots_'):
                source.assert_equal(target)
                eq = True
            else:
                eq = source == target
            yield slot, source, target, eq

    def __eq__(self, other):
        return all(eq for slot, source, target, eq in _compare(self, other))

    def __ne__(self, other):
        return not self.__eq__(other)

    def assert_equal(self, other, ignore=()):
        for slot, source, target, eq in _compare(self, other):
            if not eq and slot not in ignore:
                raise AssertionError('slot %s: %s is different from %s' %
                                     (slot, source, target))

    cls._slots_  # raise an AttributeError for missing slots
    cls.__eq__ = __eq__
    cls.__ne__ = __ne__
    cls.assert_equal = assert_equal
    return cls
52227
def unique(seq):
    """"""
    seen = {}
    result = []
    for item in seq:
        marker = item
        if marker in seen:
            continue
        seen[marker] = 1
        result.append(item)
    return result