Check if a zone is active
431457
def is_boost_active(self, zone_name):
        
        zone = self.get_zone(zone_name)

        if zone is None:
            raise RuntimeError("Unknown zone")

        return zone['isBoostActive']
590495
protected boolean checkHandler(ZoneHandlerClass handler, ApiZone apiZone) {
        return apiZone.getName().startsWith(handler.getZoneName());
    }
995126
protected function checkInactive()
    {
        if ($this->user->status_id !== Status::INACTIVE) {
            return true;
        }

        return $this->addAction('Activate', 'check-square-o', $this->makeRoute('activate', 0));
    }
402310
@Override
  public void onActive()
  {
    _isReplay = false;
    
    if (_isActive) {
      return;
    }
    _isActive = true;
    
    _serviceSelf = ServiceRef.current();
    
    if (_journalDelay > 0) {
      Services manager = _serviceSelf.services();
      
      _timerService = manager.service("timer:").as(Timers.class);
      Consumer<Cancel> startSave = h->startSave();
      
      _startSaveRef = (Consumer<Cancel>) _serviceSelf.pin(startSave).as(Consumer.class);
    }
    
    super.onActive();
    
    startSave();
  }
337675
def zoneToRegion(zone):
    """"""
    from toil.lib.context import Context
    return Context.availability_zone_re.match(zone).group(1)
406318
def activate_boost_by_name(self,
                               zone_name,
                               target_temperature,
                               num_hours=1):
        

        zone = self.get_zone(zone_name)
        if zone is None:
            raise RuntimeError("Unknown zone")

        return self.activate_boost_by_id(zone["zoneId"],
                                         target_temperature, num_hours)
455031
public function getActiveZones()
    {
        $zones = $this
            ->createQueryBuilder('z')
            ->where('z.enabled = :enabled')
            ->setParameters([
                'enabled' => true,
            ])
            ->getQuery()
            ->getArrayResult();

        return new ArrayCollection($zones);
    }
27813
def active(self, include=None):
        
        return self._get(self._build_url(self.endpoint.active(include=include)))
1266576
def get_security_zones_activation(self) -> (bool, bool):
        
        internal_active = False
        external_active = False
        for g in self.groups:
            if isinstance(g, SecurityZoneGroup):
                if g.label == "EXTERNAL":
                    external_active = g.active
                elif g.label == "INTERNAL":
                    internal_active = g.active
        return internal_active, external_active
161971
def watch_zone(self, zone_id):
        
        r = yield from self._send_cmd(
                "WATCH %s ON" % (zone_id.device_str(), ))
        self._watched_zones.add(zone_id)
        return r
1198897
def zone_position(self):
		
		if self.zone == Zone.HAND:
			return self.controller.hand.index(self) + 1
		return 0
932472
protected function validateZone()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->zone->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('Zone'));
            return false;
        }

        $this->setUpdating($data);
        return true;
    }
1098096
def is_active(self):
        """"""
        if self._queue.exhausted:
            return False
        return any(ch.is_active for ch in self._refs.values())
634628
def active(self):
        
        if not os.path.isfile(self._paths['active_file']):
            return False
        return self._loaded
540309
def enable_zones(self, zones):
        
        if isinstance(zones, str) or isinstance(zones, unicode):
            zones = [zones]
        new_zones = self.connection.enable_availability_zones(self.name, zones)
        self.availability_zones = new_zones
632658
def is_active(self):
    
    if not self.multiplexer:
      return False

    if self._is_active:
      # We have already determined that the projector plugin should be active.
      # Do not re-compute that. We have no reason to later set this plugin to be
      # inactive.
      return True

    if self._thread_for_determining_is_active:
      # We are currently determining whether the plugin is active. Do not start
      # a separate thread.
      return self._is_active

    # The plugin is currently not active. The frontend might check again later.
    # For now, spin off a separate thread to determine whether the plugin is
    # active.
    new_thread = threading.Thread(
        target=self._determine_is_active,
        name='ProjectorPluginIsActiveThread')
    self._thread_for_determining_is_active = new_thread
    new_thread.start()
    return False
1219304
def filter_zone(self, data):
        """"""
        if self.private_zone is not None:
            if data['Config']['PrivateZone'] != self.str2bool(self.private_zone):
                return False

        if data['Name'] != '{0}.'.format(self.domain):
            return False

        return True