Remove duplicate and enharmonic notes from the container.
505695
def remove_duplicate_notes(self):
        """"""
        res = []
        for x in self.notes:
            if x not in res:
                res.append(x)
        self.notes = res
        return res
1098148
public void removeDuplicatedAlgorithms() {
    List<ExperimentAlgorithm<S, Result>> algorithmList = new ArrayList<>() ;
    HashSet<String> algorithmTagList = new HashSet<>() ;


    getAlgorithmList().removeIf(alg -> !algorithmTagList.add(alg.getAlgorithmTag())) ;
  }
940351
protected function cleanOriginalSource()
    {
        $patterns     = synapse()->memory->substitute()->keys()->all();
        $replacements = synapse()->memory->substitute()->values()->all();

        $this->source = mb_strtolower($this->original);
        $this->source = preg_replace($patterns, $replacements, $this->source);
        $this->source = preg_replace('/[^\pL\d\s]+/u', '', $this->source);
        $this->source = remove_whitespace($this->source);
    }
1152503
function (notes, settings) {
  var restBuffer = 0;

  var events = _.reduce(notes, function (arr, obj) {
    var time = noteLength(obj.duration, settings);

    if (obj.note) {
      arr.push(makeNoteEvent(restBuffer, true, 0, noteValue(obj.note), settings.noteVelocity)); // On
      arr.push(makeNoteEvent(time, false, 0, noteValue(obj.note), settings.noteVelocity)); // Off
      restBuffer = 0;
    }
    else {
      restBuffer += time;
    }

    return arr;
  }, []);

  return Buffer.concat(events);
}
88333
def remove_duplicates(self, ws):
        
        for analysis in ws.objectValues():
            if IDuplicateAnalysis.providedBy(analysis) \
                    and analysis.getAnalysis().UID() == self.UID():
                ws.removeAnalysis(analysis)
980680
def _format_notes(self, record):
        
        notes = []
        for note in record["notes"]:
            if note.get("type"):
                n = {}
                n["type"] = note["type"]
                try:
                    if note["jsonmodel_type"] == "note_singlepart":
                        n["content"] = note["content"][0]
                    else:
                        n["content"] = note["subnotes"][0]["content"]
                except (IndexError, KeyError):
                    n["content"] = ""

                notes.append(n)

        return notes
913514
def stop_NoteContainer(self, notecontainer):
        """"""
        # if there is more than one note in the container, the deltatime should
        # be set back to zero after the first one has been stopped
        if len(notecontainer) <= 1:
            [self.stop_Note(x) for x in notecontainer]
        else:
            self.stop_Note(notecontainer[0])
            self.set_deltatime(0)
            [self.stop_Note(x) for x in notecontainer[1:]]
572188
private void cleanupIfNeccessary(JsonGetterContext excluded) {
        int cacheCount;
        while ((cacheCount = internalCache.size()) > maxContexts) {
            int sampleCount = Math.max(cacheCount - maxContexts, cleanupRemoveAtLeastItems) + 1;
            for (SamplingEntry sample: internalCache.getRandomSamples(sampleCount)) {
                if (excluded != sample.getEntryValue()) {
                    internalCache.remove(sample.getEntryKey());
                }
            }
        }
    }
1350362
def clean(self):
        """"""
        doc = self._resource
        result = {k: v for k, v in doc.iteritems() if k not in
                  self.internal_fields}

        if '_id' in doc and 'id' not in result:
            result['id'] = doc['_id']

        return result
840614
def copy(self):
        '''

        '''
        return type(self)(self.anneal, self.tm, overhang=self.overhang,
                          name=self.name, note=self.note)
544125
public void trim() {
    keys = Arrays.copyOf(keys, size);
    values = Arrays.copyOf(values, size);
    for (MappeableContainer c : values) {
      c.trim();
    }
  }
978996
def clear_extra_selections(self, key):
        
        for decoration in self.extra_selections_dict.get(key, []):
            self.decorations.remove(decoration)
        self.extra_selections_dict[key] = []
842168
private void cleanup() {
        Entry<K, V>[] tab = this.table;

        for (int i = tab.length ; i-- > 0 ;) {
            for (Entry<K, V> e = tab[i], prev = null; e != null; e = e.next) {
                if (e.get() == null) {
                    // Clean up after a cleared Reference.
                    this.modCount++;
                    if (prev != null) {
                        prev.next = e.next;
                    } else {
                        tab[i] = e.next;
                    }
                    this.count--;
                } else {
                    prev = e;
                }
            }
        }
    }
868535
public void cleanup() {
    keys.cleanup();
    counts.cleanup();
    dictionary.cleanup();
    // Decrement the dictionary memory by the total size of all the elements
    memoryEstimate.decrementDictionaryMemory(SizeOf.SIZE_OF_LONG * numElements);
  }
740450
public void unloadAllSounds(){
        stopAllSounds();
        for(String s : buffers.keySet()){
            SoundBufferEntry e = buffers.get(s);
            AL10.alDeleteBuffers(e.bufferId);
        }
        buffers.clear();
    }
720795
def stop_Note(self, note):
        """"""
        velocity = 64
        channel = 1
        if hasattr(note, 'dynamics'):
            if 'velocity' in note.dynamics:
                velocity = note.dynamics['velocity']
            if 'channel' in note.dynamics:
                channel = note.dynamics['channel']
        if hasattr(note, 'channel'):
            channel = note.channel
        if hasattr(note, 'velocity'):
            velocity = note.velocity
        self.track_data += self.note_off(channel, int(note) + 12, velocity)
860882
def write_NoteContainer(file, notecontainer, bpm=120, repeat=0, verbose=False):
    """"""
    m = MidiFile()
    t = MidiTrack(bpm)
    m.tracks = [t]
    while repeat >= 0:
        t.set_deltatime('\x00')
        t.play_NoteContainer(notecontainer)
        t.set_deltatime("\x48")
        t.stop_NoteContainer(notecontainer)
        repeat -= 1
    return m.write_file(file, verbose)