Cleans up references to the plot on the attached Stream
        subscribers.
195007
def cleanup(self):
        
        plots = self.traverse(lambda x: x, [Plot])
        for plot in plots:
            if not isinstance(plot, (GenericCompositePlot, GenericElementPlot, GenericOverlayPlot)):
                continue
            for stream in set(plot.streams):
                stream._subscribers = [
                    (p, subscriber) for p, subscriber in stream._subscribers
                    if util.get_method_owner(subscriber) not in plots]
        if self.comm:
            self.comm.close()
670657
protected void clearSubscrips (boolean verbose)
    {
        for (ClientProxy rec : _subscrips.values()) {
            if (verbose) {
                log.info("Clearing subscription", "client", this, "obj", rec.object.getOid());
            }
            rec.unsubscribe();
        }
        _subscrips.clear();
    }
1363096
private synchronized void cleanSubsequentStalePages()
   {
      // FIXME: Workaround until FORGE-1704 is fixed
      if (flowPointer == 0)
      {
         flow.subList(1, flow.size()).clear();
         subflow.clear();
      }
      else
      {
         // Remove subsequent pages and push the subflows back to the stack
         Iterator<WizardStepEntry> it = flow.listIterator(flowPointer + 1);
         int subflowIdx = 0;
         while (it.hasNext())
         {
            WizardStepEntry entry = it.next();
            if (entry.subflowHead && !subflow.contains(entry))
            {
               subflow.add(subflowIdx++, entry);
            }
            it.remove();
         }
      }
   }
256966
private void cleanup_heartbeat_filters() {
        Enumeration channel_names = channel_map.keys();
        while (channel_names.hasMoreElements()) {
            String name = (String) channel_names.nextElement();
            EventChannelStruct eventChannelStruct = channel_map.get(name);
            if (eventChannelStruct.consumer instanceof NotifdEventConsumer) {
                try {
                    int filter_id = eventChannelStruct.heartbeat_filter_id;
                    Filter filter =
                            eventChannelStruct.structuredProxyPushSupplier.get_filter(filter_id);
                    eventChannelStruct.structuredProxyPushSupplier.remove_filter(filter_id);
                    filter.destroy();
                } catch (FilterNotFound e) {
                    //  do nothing
                }
            }
        }
    }
1029680
def attach_streams(plot, obj, precedence=1.1):
    
    def append_refresh(dmap):
        for stream in get_nested_streams(dmap):
            if plot.refresh not in stream._subscribers:
                stream.add_subscriber(plot.refresh, precedence)
    return obj.traverse(append_refresh, [DynamicMap])
783175
public void dispose() {
        if (onSubscribe.disposed.compareAndSet(false, true)) {
            for (Object chunk : onSubscribe.chunks) {
                ReferenceCountUtil.release(chunk);
            }
            onSubscribe.chunks.clear();
        }
    }
1164240
public void cleanUpNullReferences() {
        synchronized (map) {
            final Iterator<Map.Entry<K, V>> iterator = map.entrySet().iterator();
            while (iterator.hasNext()) {
                final Map.Entry<K, V> entry = iterator.next();
                final Object value = entry.getValue();

                if (!(value instanceof SoftReference)) continue;
                if (((SoftReference) value).get() == null) iterator.remove();
            }
        }
    }
777553
function removePlotBandOrLine(id) {
			var i = plotLinesAndBands.length;
			while (i--) {
				if (plotLinesAndBands[i].id === id) {
					plotLinesAndBands[i].destroy();
				}
			}
		}
148498
void cleanUpStaleEntries() {
        for (KeyedRef<K, V> ref = q.poll(); ref != null; ref = q.poll()) {
            map.remove(ref.getKey(), ref); // CONCURRENT remove() operation
        }
    }
260696
function cleanup(client) {
  if(client.pubsub
    && client.pubsub.channels
    && client.pubsub.patterns
    && !client.pubsub.channels.length
    && !client.pubsub.patterns.length) {
    client.pubsub = null;
  }
}
1168753
def clean(self):
        
        self._table.clear()
        for item in self._usage_recency:
            self._usage_recency.remove(item)
646908
def cleanup_relations(self):
        """"""
        collections = self.collections
        for relation in [x for col in collections.values()
                         for x in col.model.relations.values()]:
            db.session.query(relation)\
                       .filter(~relation.listing.any())\
                       .delete(synchronize_session=False)
        db.session.commit()
647147
function () {
		var point = this,
			series = point.series,
			hoverPoints = series.chart.hoverPoints,
			prop;

		series.chart.pointCount--;

		if (hoverPoints) {
			point.setState();
			erase(hoverPoints, point);
		}
		if (point === series.chart.hoverPoint) {
			point.onMouseOut();
		}


		// remove all events
		removeEvent(point);

		each(['graphic', 'tracker', 'group', 'dataLabel', 'connector', 'shadowGroup'], function (prop) {
			if (point[prop]) {
				point[prop].destroy();
			}
		});

		if (point.legendItem) { // pies have legend items
			point.series.chart.legend.destroyItem(point);
		}

		for (prop in point) {
			point[prop] = null;
		}


	}
703628
def cut_references(text_lines):
    """"""
    ref_sect_start = find_reference_section(text_lines)
    if ref_sect_start is not None:
        start = ref_sect_start["start_line"]
        end = find_end_of_reference_section(text_lines, start,
                                            ref_sect_start["marker"],
                                            ref_sect_start["marker_pattern"])
        del text_lines[start:end + 1]
    else:
        current_app.logger.warning("Found no references to remove.")
        return text_lines

    return text_lines
368918
def clear_diagram(self, diagram):
        
        plot = self.subplots[diagram[1]][diagram[0]]
        plot.cla()
919841
public void cleanUpNullReferences() {
        final Iterator<Map.Entry<Object, Object>> iterator = cache.entrySet().iterator();
        while (iterator.hasNext()) {
            final Map.Entry<Object, Object> entry = iterator.next();
            Object entryVal = entry.getValue();
            if (entryVal != null && ((SoftReference) entryVal).get() == null) cache.remove(entry.getKey(), entryVal);
        }
    }
1355412
def _cleanup(self, ref):
        ''
        self.transitor_states[self._weakref_holder[ref]] -= 1
        del self._weakref_holder[ref]