toggle the display of a kml
182662
def togglekml(self, layername):
        ''''''
        #Strip quotation marks if neccessary
        if layername.startswith('"') and layername.endswith('"'):
            layername = layername[1:-1]
        #toggle layer off (plus associated text element)
        if layername in self.curlayers:
            for layer in self.curlayers:
                if layer == layername:
                    self.mpstate.map.remove_object(layer)
                    self.curlayers.remove(layername)
                    if layername in self.curtextlayers:
                        for clayer in self.curtextlayers:
                            if clayer == layername:
                                self.mpstate.map.remove_object(clayer)
                                self.curtextlayers.remove(clayer)
        #toggle layer on (plus associated text element)
        else:
            for layer in self.allayers:
                if layer.key == layername:
                    self.mpstate.map.add_object(layer)
                    self.curlayers.append(layername)
                    for alayer in self.alltextlayers:
                        if alayer.key == layername:
                            self.mpstate.map.add_object(alayer)
                            self.curtextlayers.append(layername)
        self.menu_needs_refreshing = True
165977
private void toggle(Coordinate coordinate, final boolean clearSelection, final boolean singleSelection) {
		if (null == coordinate) {
			return;
		}
		// we can clear here (but remember the selected feature for the special case of single selection) !
		final String singleSelectionId = mapWidget.getMapModel().getSelectedFeature();
		if (clearSelection) {
			mapWidget.getMapModel().clearSelectedFeatures();
		}
		MapModel mapModel = mapWidget.getMapModel();
		Coordinate worldPosition = mapModel.getMapView().getWorldViewTransformer().viewToWorld(coordinate);
		GwtCommand commandRequest = new GwtCommand(SearchByLocationRequest.COMMAND);
		SearchByLocationRequest request = new SearchByLocationRequest();
		Layer<?> layer = mapModel.getSelectedLayer();
		if (priorityToSelectedLayer && layer != null && layer instanceof VectorLayer) {
			if (!layer.isShowing()) {
				return;
			}
			request.addLayerWithFilter(layer.getId(), layer.getServerLayerId(), ((VectorLayer) layer).getFilter());
		} else {
			addVisibleLayers(request, mapModel);
		}
		Point point = mapModel.getGeometryFactory().createPoint(worldPosition);
		request.setLocation(GeometryConverter.toDto(point));
		request.setCrs(mapWidget.getMapModel().getCrs());
		request.setQueryType(SearchByLocationRequest.QUERY_INTERSECTS);
		request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
		request.setBuffer(calculateBufferFromPixelTolerance());
		request.setFeatureIncludes(GwtCommandDispatcher.getInstance().getLazyFeatureIncludesSelect());
		commandRequest.setCommandRequest(request);
		GwtCommandDispatcher.getInstance().execute(commandRequest,
				new AbstractCommandCallback<SearchByLocationResponse>() {

			public void execute(SearchByLocationResponse response) {
				Map<String, List<Feature>> featureMap = response.getFeatureMap();
				for (String layerId : featureMap.keySet()) {
					selectFeatures(layerId, featureMap.get(layerId), singleSelectionId, singleSelection);
					if (singleSelection) {
						break;
					}
				}
			}
		});
	}
1033697
def toggle_lock(self, value):
        """"""
        self.interface_locked = value
        CONF.set('main', 'panes_locked', value)

        # Apply lock to panes
        for plugin in (self.widgetlist + self.thirdparty_plugins):
            if self.interface_locked:
                if plugin.dockwidget.isFloating():
                    plugin.dockwidget.setFloating(False)
                plugin.dockwidget.setTitleBarWidget(QWidget())
            else:
                plugin.dockwidget.set_title_bar()

        # Apply lock to toolbars
        for toolbar in self.toolbarslist:
            if self.interface_locked:
                toolbar.setMovable(False)
            else:
                toolbar.setMovable(True)
1033427
function toggle(main, alt) {
		var mw = core.base();
		mw.main = main;
		mw.alt = (alt || function () {

		});
		mw.active = mw.main;
		mw.enabled = true;
		mw.swap = function () {
			mw.active = (mw.active !== mw.main ? mw.main : mw.alt);
		};
		mw.writeln = function (line) {
			if (!mw.enabled) {
				return;
			}
			if (mw.enabled) {
				mw.active.writeln(line);
			}
		};
		mw.toString = function () {
			return '<miniwrite-toggle>';
		};
		return mw;
	}
1076081
def _on_action_toggle(self):
        """"""
        block = FoldScope.find_parent_scope(self.editor.textCursor().block())
        self.toggle_fold_trigger(block)
34014
function toggleVisibility(dom, show) {
  dom.style.display = show ? '' : 'none';
  dom['hidden'] = show ? false : true;
}
1213860
def toggle_grid(self, event=None, show=None):
        ""
        if show is None:
            show = not self.panel.conf.show_grid
        for p in (self.panel, self.panel_bot):
            p.conf.enable_grid(show)
1166456
protected void setLatLngVisible(boolean visible) {

        Style styleLat = m_latitudeLabel.getElement().getParentElement().getStyle();
        Style styleLng = m_longitudeLabel.getElement().getParentElement().getStyle();
        if (visible) {
            styleLat.clearDisplay();
            styleLng.clearDisplay();
        } else {
            styleLat.setDisplay(Display.NONE);
            styleLng.setDisplay(Display.NONE);
        }
    }
1279423
function _togglePref(key, value) {
        var val,
            oldPref = !!prefs.get(key);

        if (value === undefined) {
            val = !oldPref;
        } else {
            val = !!value;
        }

        // update menu
        if (val !== oldPref) {
            prefs.set(key, val);
        }

        return val;
    }
536663
def toggle_power(self, selector='all', duration=1.0):
        """"""

        argument_tuples = [
            ("duration", duration)
        ]

        return self.client.perform_request(
            method='post', endpoint='lights/{}/toggle',
            endpoint_args=[selector], argument_tuples=argument_tuples)
1346475
function(visible) {
        var cache = OpenLayers.Layer.Google.cache[this.map.id];
        if (cache) {
            var container = this.mapObject.getContainer();
            if (visible === true) {
                this.mapObject.setMapType(this.type);
                container.style.display = "";
                this.termsOfUse.style.left = "";
                this.termsOfUse.style.display = "";
                this.poweredBy.style.display = "";            
                cache.displayed = this.id;
            } else {
                if (cache.displayed === this.id) {
                    delete cache.displayed;
                }
                if (!cache.displayed) {
                    container.style.display = "none";
                    this.termsOfUse.style.display = "none";
                    // move ToU far to the left in addition to setting display
                    // to "none", because at the end of the GMap2 load
                    // sequence, display: none will be unset and ToU would be
                    // visible after loading a map with a google layer that is
                    // initially hidden. 
                    this.termsOfUse.style.left = "-9999px";
                    this.poweredBy.style.display = "none";
                }
            }
        }
    }
1245416
def OnMacroToolbarToggle(self, event):
        """"""

        self.main_window.macro_toolbar.SetGripperVisible(True)
        macro_toolbar_info = self.main_window._mgr.GetPane("macro_toolbar")

        self._toggle_pane(macro_toolbar_info)

        event.Skip()
656834
def display(url):
	""""""
	import os
	oscmd="curl --silent -g --fail --max-time 1800 --user jkavelaars '%s'" % (url)
	logger.debug(oscmd)
    	os.system(oscmd+' | xpaset ds9 fits')
	return
983048
def get_kml(self):
        """"""
        return etree.tostring(self.kml_root, pretty_print=True, xml_declaration=True)
293143
def switch_toggle(context, ain):
    """"""
    context.obj.login()
    actor = context.obj.get_actor_by_ain(ain)
    if actor:
        if actor.get_state():
            actor.switch_off()
            click.echo("State for {} is now OFF".format(ain))
        else:
            actor.switch_on()
            click.echo("State for {} is now ON".format(ain))
    else:
        click.echo("Actor not found: {}".format(ain))
1041702
function toggleSlideShowMode() {
  const streams = room.remoteStreams;
  const cb = (evt) => {
    console.log('SlideShowMode changed', evt);
  };
  slideShowMode = !slideShowMode;
  streams.forEach((stream) => {
    if (localStream.getID() !== stream.getID()) {
      console.log('Updating config');
      stream.updateConfiguration({ slideShowMode }, cb);
    }
  });
}
938579
def switch_on(self):
        """"""
        success = self.set_status(CONST.STATUS_OPEN_INT)

        if success:
            self._json_state['status'] = CONST.STATUS_OPEN

        return success