Delete an event from the specified calendar.

        :param string calendar_id: ID of calendar to delete from.
        :param string event_id: ID of event to delete.
975865
def delete_event(self, calendar_id, event_id):
        
        self.request_handler.delete(endpoint='calendars/%s/events' % calendar_id, data={'event_id': event_id})
252525
def delete_events(self, event_collection, params):
        

        url = "{0}/{1}/projects/{2}/events/{3}".format(self.base_url,
                                                       self.api_version,
                                                       self.project_id,
                                                       event_collection)
        headers = utilities.headers(self.master_key)
        response = self.fulfill(HTTPMethods.DELETE, url, params=params, headers=headers, timeout=self.post_timeout)

        self._error_handling(response)
        return True
300101
public void deleteEntry(GoogleEntry entry, GoogleCalendar calendar) throws IOException {
        dao.events().delete(calendar.getId(), entry.getId()).execute();
    }
191973
def delete_event_view(request, id):
    
    event = get_object_or_404(Event, id=id)
    if not request.user.has_admin_permission('events'):
        raise exceptions.PermissionDenied

    if request.method == "POST":
        try:
            event.delete()
            messages.success(request, "Successfully deleted event.")
        except Event.DoesNotExist:
            pass

        return redirect("events")
    else:
        return render(request, "events/delete.html", {"event": event})
781393
public function delete(?string $id = null)
    {
        $this->request->allowMethod(['post', 'delete']);
        $calendarEvent = $this->CalendarEvents->get($id);
        if ($this->CalendarEvents->delete($calendarEvent)) {
            $this->Flash->success((string)__('The calendar event has been deleted.'));
        } else {
            $this->Flash->error((string)__('The calendar event could not be deleted. Please, try again.'));
        }

        return $this->redirect(['plugin' => 'Qobo/Calendar', 'controller' => 'Calendars', 'action' => 'index']);
    }
465171
def delete_node(self, node_id):
        

        node = None
        try:
            node = self.get_node(node_id)
            yield from self.close_node(node_id)
        finally:
            if node:
                node.project.emit("node.deleted", node)
                yield from node.project.remove_node(node)
        if node.id in self._nodes:
            del self._nodes[node.id]
        return node
661546
def destroy_session(self, session_id):
        

        try:
            del self.sessions[session_id]
        except KeyError:
            pass

        # Invoke hooks
        invoke_hooks(self.hooks, "session_destroyed", session_id)
46088
def remove_all_events(self, calendar_id):
        ''''''
        # todo: incomplete

        now = datetime.now(tz=self.timezone) # timezone?
        start_time = datetime(year=now.year - 1, month=now.month, day=now.day, hour=now.hour, minute=now.minute, second=now.second, tzinfo=self.timezone)
        end_time = datetime(year=now.year + 1, month=now.month, day=now.day, hour=now.hour, minute=now.minute, second=now.second, tzinfo=self.timezone)
        start_time = start_time.isoformat()
        end_time = end_time.isoformat()


        #events = self.service.events().list(calendarId = self.configured_calendar_ids[calendar_id], showDeleted = False).execute()
        events = self.service.events().list(calendarId = self.configured_calendar_ids[calendar_id], timeMin = start_time, timeMax = end_time, showDeleted = False).execute()

        print(len(events['items']))

        for event in events['items']:
            dt = None
            nb = DeepNonStrictNestedBunch(event)
            #print(event)
            if (nb.summary or nb.description or '').find('presentation') != -1:
                print(nb.id)
                print(nb.summary or nb.description)
                print(nb.start)
871829
def delete_session(self, client_id):
        
        try:
            session = self._sessions[client_id][0]
        except KeyError:
            session = None
        if session is None:
            self.logger.debug("Delete session : session %s doesn't exist" % client_id)
            return

        # Delete subscriptions
        self.logger.debug("deleting session %s subscriptions" % repr(session))
        self._del_all_subscriptions(session)

        self.logger.debug("deleting existing session %s" % repr(self._sessions[client_id]))
        del self._sessions[client_id]
573310
public function deleteCalendar($calendarId)
    {
        if (!is_array($calendarId)) {
            throw new \InvalidArgumentException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
        }
        list($calendarId, $instanceId) = $calendarId;

        $stmt = $this->pdo->prepare('SELECT access FROM '.$this->calendarInstancesTableName.' where id = ?');
        $stmt->execute([$instanceId]);
        $access = (int) $stmt->fetchColumn();

        if (\Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER === $access) {
            /**
             * If the user is the owner of the calendar, we delete all data and all
             * instances.
             **/
            $stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarObjectTableName.' WHERE calendarid = ?');
            $stmt->execute([$calendarId]);

            $stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarChangesTableName.' WHERE calendarid = ?');
            $stmt->execute([$calendarId]);

            $stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarInstancesTableName.' WHERE calendarid = ?');
            $stmt->execute([$calendarId]);

            $stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarTableName.' WHERE id = ?');
            $stmt->execute([$calendarId]);
        } else {
            /**
             * If it was an instance of a shared calendar, we only delete that
             * instance.
             */
            $stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarInstancesTableName.' WHERE id = ?');
            $stmt->execute([$instanceId]);
        }
    }
1242797
def delete_attachment(self, id):
        
        url = self._get_url('attachment/' + str(id))
        return self._session.delete(url)
666911
public static void deleteNode(DbConn cnx, int id)
    {
        int countRunning = cnx.runSelectSingle("ji_select_count_by_node", Integer.class, id);
        if (countRunning > 0)
        {
            cnx.setRollbackOnly();
            throw new JqmAdminApiUserException(
                    "cannot delete a node with running instances. Disable it, wait for the end of all running instances, then retry.");
        }

        try
        {
            Node n = Node.select_single(cnx, "node_select_by_id", id);
            Calendar limit = Calendar.getInstance();
            limit.add(Calendar.MINUTE, -10);
            if (n.getLastSeenAlive() != null && n.getLastSeenAlive().after(limit))
            {
                cnx.setRollbackOnly();
                throw new JqmAdminApiUserException(
                        "Can only remove a node either properly shut down or that has crashed more than 10 minutes ago.");
            }
        }
        catch (NoResultException e)
        {
            throw new JqmAdminApiUserException("no item with ID " + id);
        }

        cnx.runUpdate("dp_delete_for_node", id);
        QueryResult qr = cnx.runUpdate("node_delete_by_id", id);
        if (qr.nbUpdated != 1)
        {
            cnx.setRollbackOnly();
            throw new JqmAdminApiUserException("no item with ID " + id);
        }
    }
1064215
def delete_record(self, record_id):
        
        self._delete(
            urljoin(self.base_url, "informationobjects/{}".format(record_id)),
            expected_response=204,
        )
        return {"status": "Deleted"}
205158
def ticket_form_delete(self, id, **kwargs):
        ""
        api_path = "/api/v2/ticket_forms/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="DELETE", **kwargs)
63637
def delete_hook(self, id):
        
        assert isinstance(id, (int, long)), id
        headers, data = self._requester.requestJsonAndCheck(
            "DELETE",
            self.url + "/hooks/" + str(id)
        )
33876
def delete(self, id):
        
        if id in self._images.keys():
            del self._images[id]
        self.tk.delete(id)
379465
function deleteListener(event, id) {
    if (hasListener(event, id)) {
      delete context._events[event][id];

      if (_.keys(getListeners(event)).length === 0)
        deleteEvent(event);
      
      return true;
    }

    return false;
  }