Save the alarm to the Sonos system.

        Raises:
            ~soco.exceptions.SoCoUPnPException: if the alarm cannot be created
                because there
                is already an alarm for this room at the specified time.
169739
def save(self):
        
        # pylint: disable=bad-continuation
        args = [
            ('StartLocalTime', self.start_time.strftime(TIME_FORMAT)),
            ('Duration', '' if self.duration is None else
                self.duration.strftime(TIME_FORMAT)),
            ('Recurrence', self.recurrence),
            ('Enabled', '1' if self.enabled else '0'),
            ('RoomUUID', self.zone.uid),
            ('ProgramURI', "x-rincon-buzzer:0" if self.program_uri is None
                else self.program_uri),
            ('ProgramMetaData', self.program_metadata),
            ('PlayMode', self.play_mode),
            ('Volume', self.volume),
            ('IncludeLinkedZones', '1' if self.include_linked_zones else '0')
        ]
        if self._alarm_id is None:
            response = self.zone.alarmClock.CreateAlarm(args)
            self._alarm_id = response['AssignedID']
            Alarm._all_alarms[self._alarm_id] = self
        else:
            # The alarm has been saved before. Update it instead.
            args.insert(0, ('ID', self._alarm_id))
            self.zone.alarmClock.UpdateAlarm(args)
1006113
def pop
      alarm = (Time.now + @wait_timeout)
      clnt = nil
      dirty = false
      while !@shutdown
        raise_alarm if (Time.now > alarm)
        @mutex.synchronize do
          begin
            if clnt = @_pool.pop
              dirty = true
            else
              clnt = _fetch_new(&@client_block)
            end
          ensure
            if clnt
              _checkout(clnt)
              @cond.signal
            else
              @reaper.wakeup if @reaper && _dead_clients?
              @cond.wait(@mutex,@wait_timeout)
            end
          end
        end
        break if clnt
      end
      clean_client(clnt) if dirty && clnt
      clnt
    end
712581
private function _save() : void
    {
        $this->_storage->save(
            $this->_host,
            $this->_storageKey,
            $this->_requestCount,
            $this->_timekeeper->getExpiration(),
            $this->getRemainingSeconds()
        );
    }
558037
public function save()
    {
        if (!$this->oxrecommlists__oxtitle->value) {
            throw oxNew(\OxidEsales\Eshop\Core\Exception\ObjectException::class, 'EXCEPTION_RECOMMLIST_NOTITLE');
        }
        $this->onSave();

        return parent::save();
    }
173675
void reset(long time,
             long latest,
             AlarmListener listener,
             Object context,
             long index)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "reset",
        new Object[] { new Long(time), new Long(latest), listener, context, new Long(index) });
    
    data = listener;
    this.time = time;
    this.latest = latest;
    this.context = context;
    this.index = index;
    //check if this alarm has a group listener
    groupListener = (listener instanceof GroupAlarmListener);
    //flag as not canceled 
    active = true;
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "reset");
  }
528479
public synchronized void startPeriodicReplication() {
        if (!isPeriodicReplicationEnabled()) {
            setPeriodicReplicationEnabled(true);
            AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
            Intent alarmIntent = new Intent(this, clazz);
            alarmIntent.setAction(PeriodicReplicationReceiver.ALARM_ACTION);
            // We need to use a BroadcastReceiver rather than sending the Intent directly to the
            // Service to ensure the device wakes up if it's asleep. Sending the Intent directly
            // to the Service would be unreliable.
            PendingIntent pendingAlarmIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, 0);

            long initialTriggerTime;
            if (explicitlyStopped()) {
                // Replications were explicitly stopped, so we want the first replication to
                // happen immediately.
                initialTriggerTime = SystemClock.elapsedRealtime();
                setExplicitlyStopped(false);
            } else {
                // Replications were implicitly stopped (e.g. by rebooting the device), so we
                // want to resume the previous schedule.
                initialTriggerTime = getNextAlarmDueElapsedTime();
            }

            alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                initialTriggerTime,
                getIntervalInSeconds() * MILLISECONDS_IN_SECOND,
                pendingAlarmIntent);
        } else {
            Log.i(TAG, "Attempted to start an already running alarm manager");
        }
    }
1009294
def save(self):
        
        d = self._to_dict()
        if len(d.get('videoIds', [])) > 0:
            if not self.id:
                self.id = self.connection.post('create_playlist', playlist=d)
            else:
                data = self.connection.post('update_playlist', playlist=d)
                if data:
                    self._load(data)
1076711
def register_alarm(self, alarm):
        
        for alarm in listify(alarm):
            if alarm not in self._alarms:
                self._set('alarm', alarm, multi=True)
                self._alarms.append(alarm)

        return self._section
1211617
def _create_scheduler(self, save_sensors):
        """"""
        def schedule_save():
            """Save sensors and schedule a new save."""
            save_sensors()
            scheduler = threading.Timer(10.0, schedule_save)
            scheduler.start()
            self._cancel_save = scheduler.cancel
        return schedule_save
58966
def save(self, *args, **kwargs):
        
        self.host = self.host.strip()

        if not self.id:
            self.device = self.__create_device()

        if self.store is True:
            super(DeviceConnector, self).save(*args, **kwargs)
1079276
def save(self):
        
        self.stack.append(self.dispatch_table)
        self.dispatch_table = self.default_table.copy()
591695
def save(self, *args, **kwargs):
        
        new_post = self.pk is None
        super().save(*args, **kwargs)

        # Ensures that the subject of the thread corresponds to the one associated
        # with the first post. Do the same with the 'approved' flag.
        if (new_post and self.topic.first_post is None) or self.is_topic_head:
            if self.subject != self.topic.subject or self.approved != self.topic.approved:
                self.topic.subject = self.subject
                self.topic.approved = self.approved

        # Trigger the topic-level trackers update
        self.topic.update_trackers()
1230961
def set_alarm_state(self, state):
        
        values = {"desired_state": {"alarm_enabled": state}}
        response = self.api_interface.set_device_state(self, values)
        self._update_state_from_response(response)
1329936
public void alarm (Object alarmContext)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "alarm", alarmContext);

    synchronized(this) {
      _alarm = null;
    }

    try {
      completeBatch(true);
    } catch(SIException e) {
      //No FFDC code needed
      SibTr.exception(this, tc, e);
      //can't do anything else here
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "alarm");
  }
598601
public void alarm(Object thandle)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "alarm", thandle);

    parent.expiryAlarm(this);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "alarm");
  }
662492
def update(self, alarm, criteria=None, disabled=False, label=None,
            name=None, metadata=None):
        
        uri = "/%s/%s" % (self.uri_base, utils.get_id(alarm))
        body = {}
        if criteria:
            body["criteria"] = criteria
        if disabled is not None:
            body["disabled"] = disabled
        label_name = label or name
        if label_name:
            body["label"] = label_name
        if metadata:
            body["metadata"] = metadata
        resp, resp_body = self.api.method_put(uri, body=body)
1236302
def save(self, *args, **kwargs):
        
        self.__class__.objects.exclude(id=self.id).delete()
        super(SingletonModel, self).save(*args, **kwargs)