Define a function that unlinks the device manager from several of the curated device's events.
323606
function unlinkFromCuratedDeviceEvents() {
        self.curatedDevice.removeListener(
            'DEVICE_DISCONNECTED',
            curatedDeviceDisconnected
        );
        self.curatedDevice.removeListener(
            'DEVICE_RECONNECTED',
            curatedDeviceReconnected
        );
        self.curatedDevice.removeListener(
            'DEVICE_ERROR',
            curatedDeviceError
        );
        self.curatedDevice.removeListener(
            'DEVICE_RECONNECTING',
            curatedDeviceReconnecting
        );
        self.curatedDevice.removeListener(
            'DEVICE_ATTRIBUTES_CHANGED',
            cureatedDeviceAttributesChanged
        );
    }
283259
def cancel_all_linking(self):
        """"""
        self.logger.info("Cancel_all_linking for device %s", self.device_id)
        self.hub.direct_command(self.device_id, '02', '65')
1016914
function removeOldOptions(manifestData) {
  var cleanManifest = manifestData;
  var activities = manifestData['manifest']['application'][0]['activity'];

  activities.forEach(removeIntentFiltersFromActivity);
  cleanManifest['manifest']['application'][0]['activity'] = activities;

  return cleanManifest;
}
765178
function () {
    if (!this._collectorsStarted) { return; }

    if (window.removeEventListener) {
      window.removeEventListener("load", this._eventListener.loadTimeCollector, false);
      window.removeEventListener("mousemove", this._eventListener.mouseCollector, false);
      window.removeEventListener("keypress", this._eventListener.keyboardCollector, false);
      window.removeEventListener("devicemotion", this._eventListener.accelerometerCollector, false);
      window.removeEventListener("touchmove", this._eventListener.touchCollector, false);
    } else if (document.detachEvent) {
      document.detachEvent("onload", this._eventListener.loadTimeCollector);
      document.detachEvent("onmousemove", this._eventListener.mouseCollector);
      document.detachEvent("keypress", this._eventListener.keyboardCollector);
    }

    this._collectorsStarted = false;
  }
1262525
function destroy(self, connections, options, callback) {
  let connectionCount = connections.length;
  function connectionDestroyed() {
    connectionCount--;
    if (connectionCount > 0) {
      return;
    }

    // Zero out all connections
    self.inUseConnections = [];
    self.availableConnections = [];
    self.connectingConnections = 0;

    // Set state to destroyed
    stateTransition(self, DESTROYED);
    if (typeof callback === 'function') {
      callback(null, null);
    }
  }

  if (connectionCount === 0) {
    connectionDestroyed();
    return;
  }

  // Destroy all connections
  connections.forEach(conn => {
    for (var i = 0; i < events.length; i++) {
      conn.removeAllListeners(events[i]);
    }

    conn.destroy(options, connectionDestroyed);
  });
}
1111359
def unschedule(self):
        

        # Run even if events are not defined to remove previously existing ones (thus default to []).
        events = self.stage_config.get('events', [])

        if not isinstance(events, list): # pragma: no cover
            print("Events must be supplied as a list.")
            return

        function_arn = None
        try:
            function_response = self.zappa.lambda_client.get_function(FunctionName=self.lambda_name)
            function_arn = function_response['Configuration']['FunctionArn']
        except botocore.exceptions.ClientError as e: # pragma: no cover
            raise ClickException("Function does not exist, you should deploy first. Ex: zappa deploy {}. "
                  "Proceeding to unschedule CloudWatch based events.".format(self.api_stage))

        print("Unscheduling..")
        self.zappa.unschedule_events(
            lambda_name=self.lambda_name,
            lambda_arn=function_arn,
            events=events,
            )

        # Remove async task SNS
        if self.stage_config.get('async_source', None) == 'sns' \
           and self.stage_config.get('async_resources', True):
            removed_arns = self.zappa.remove_async_sns_topic(self.lambda_name)
            click.echo('SNS Topic removed: %s' % ', '.join(removed_arns))
587839
function curatedDeviceDisconnected(eventData) {
        self.log(' *** Handle', self.handle, 'triggered event: DEVICE_DISCONNECTED', eventData.name, eventData.operation);
    }
390911
function(events) {
	return {
		remove: function() { // Remove multiple events.
			for (var key in events) {
				events[key].remove();
			}
		},
		add: function() { // Add multiple events.
			for (var key in events) {
				events[key].add();
			}
		}
	};
}
219101
def deregister(self, event, fn):
        
        if event in self._handler_dict and fn in self._handler_dict[event]:
            self._handler_dict[event].remove(fn)
39448
function off(event, callback) {
    if (callback) {
      listeners[event].splice(listeners[event].indexOf(callback), 1);
    }
    else {
      listeners[event] = [];
    }
  }
892523
def disconnect(self, func):
        """"""
        if id(self) not in _alleged_receivers:
            return
        l = _alleged_receivers[id(self)]
        try:
            l.remove(func)
        except ValueError:
            return
        if not l:
            del _alleged_receivers[id(self)]
248469
def off(self, dev_id):
        
        path = 'device/off'
        payload = {'id': dev_id}
        return self.rachio.put(path, payload)
1231454
def _remove_trustee(self, device):
        '''
        '''

        trustee_name = get_device_info(device).name
        name_object_map = get_device_names_to_objects(self.devices)
        delete_func = self._get_delete_trustee_cmd

        for truster in self.domain:
            if trustee_name in self.domain[truster] and \
                    truster != trustee_name:
                truster_obj = name_object_map[truster]
                self._modify_trust(truster_obj, delete_func, trustee_name)
            self._populate_domain()

        for trustee in self.domain[trustee_name]:
            if trustee_name != trustee:
                self._modify_trust(device, delete_func, trustee)

        self.devices.remove(name_object_map[trustee_name])
250475
def remove_port_profile_to_delete(self, profile_name, device_id):
        """"""
        with self.session.begin(subtransactions=True):
            self.session.query(ucsm_model.PortProfileDelete).filter_by(
                profile_id=profile_name, device_id=device_id).delete()
137619
function deleteSystemD (name, callback) {
  const filepath = `/etc/systemd/system/${name}.service`
  console.log(`Removing service on: ${filepath}`)
  fs.exists(filepath, exists => {
    if (exists) {
      fs.unlink(filepath, err => {
        if (err) {
          callback(err)
          return
        }

        let cmd = 'systemctl daemon-reload'
        console.log('Running %s...', cmd)
        exec(cmd, err => {
          callback(err, 'SystemD service removed succesfully')
        })
      })
    } else {
      callback(`Service doesn't exists, nothing to uninstall`)
    }
  })
}
1309520
function unlinkIfExistsSync(filePath: string) {
  try {
    fs.unlinkSync(filePath);
  } catch (error) {
    if (error.code === 'ENOENT') {
      return;
    }
    throw error;
  }
}
1020584
def off(self, name, callback, once=False):
        

        if name not in self.event_listeners:
            return

        self.event_listeners[name].remove((callback, once))