Get curtains state.

        Refresh data from Vera if refresh is True, otherwise use local cache.
        Refresh is only needed if you're not using subscriptions.
511902
def is_open(self, refresh=False):
        
        if refresh:
            self.refresh()
        return self.get_level(refresh) > 0
1156766
def refresh(self):
        
        if not self._client:
            return
        current_networks = self._client.networks()
        self.clear()
        self.update((net['Name'], net['Id'])
                    for net in current_networks)
1243446
public function refresh()
    {
        if ($data = $this->myCollection->findOne(['_id' => $this->myData['_id']])) {
            $this->myData = $data;
        }
    }
233013
def refresh(self):
        
        if not self._client:
            return
        current_containers = self._client.containers(all=True)
        self.clear()
        for container in current_containers:
            container_names = container.get('Names')
            if container_names:
                c_id = container['Id']
                self.update((name[1:], c_id)
                            for name in container_names)
250037
private void refresh() {
        if (this.previewedThread != null) {
            if (this.previewedThread.isComplete()) {
                setLatestPreview();
                disableRefresh();
            } else {
                this.previewedThread.getPreview(ALPreviewPanel.this);
            }
        }
    }
292382
def _refresh_state(self):
    
    # TODO(gram): should we put a choke on refreshes? E.g. if the last call was less than
    # a second ago should we return the cached value?
    if self._is_complete:
      return

    try:
      response = self._api.jobs_get(self._job_id)
    except Exception as e:
      raise e

    if 'status' in response:
      status = response['status']
      if 'state' in status and status['state'] == 'DONE':
        self._end_time = datetime.datetime.utcnow()
        self._is_complete = True
        self._process_job_status(status)

    if 'statistics' in response:
      statistics = response['statistics']
      start_time = statistics.get('creationTime', None)
      end_time = statistics.get('endTime', None)
      if start_time and end_time and end_time >= start_time:
        self._start_time = datetime.datetime.fromtimestamp(float(start_time) / 1000.0)
        self._end_time = datetime.datetime.fromtimestamp(float(end_time) / 1000.0)
104736
function(refresh_id) {

		if (Lava.schema.DEBUG && !this._container) Lava.t("Refresh on a view without container");

		this._is_queued_for_refresh = false;

		if (this._is_inDOM && this._is_dirty) {

			if (this._last_refresh_id == refresh_id) {

				this._refresh_cycle_count++;
				if (this._refresh_cycle_count > Lava.schema.system.REFRESH_INFINITE_LOOP_THRESHOLD) {

					// schedule this view for refresh in the next refresh loop
					Lava.view_manager.scheduleViewRefresh(this);
					this._is_queued_for_refresh = true;
					// when refresh returns true - it means an infinite loop exception,
					// it stops current refresh loop.
					return true;

				}

			} else {

				this._last_refresh_id = refresh_id;
				this._refresh_cycle_count = 0;

			}

			this._refresh();
			this._is_dirty = false;

		}

		return false;

	}
438888
def refresh(self, reload=False):
        
        util.cached_property.bust_caches(self, excludes=('authcode'))
        self.questions = self.question_fetchable()
        if reload:
            return self.profile_tree
1150061
function refresh() {
    if( active ) {
      requestAnimFrame( refresh );
      
      for( var i = 0, len = lists.length; i < len; i++ ) {
        lists[i].update();
      }
    }
  }
695559
public function getData()
    {
        if (!Cache::has($this->cacheKey)) {
            $this->refreshCache();
        }

        return Cache::get($this->cacheKey);
    }
308021
def refresh_views(self, change=None):
        
        adapter = self.adapter

        # Set initial ListItem state
        item_mapping = self.item_mapping
        for i, item in enumerate(self.list_items):
            item_mapping[i] = item
            item.recycle_view(i)

        if adapter:
           adapter.clearRecycleViews()
           adapter.setRecycleViews(
                [encode(li.get_view()) for li in self.list_items])
518434
function refresh() {
		$this->data = $this->table->find($this->criteria(), null, 1, 0)->current()->data;
		$this->cell = array();
		return $this;
	}
86516
function(dirty_views) {

		var level = 0,
			deepness,
			views_list,
			has_exceptions = false,
			i,
			count;

		deepness = dirty_views.length; // this line must be after ScopeManager#refresh()

		for (; level < deepness; level++) {

			if (level in dirty_views) {

				views_list = dirty_views[level];

				for (i = 0, count = views_list.length; i < count; i++) {

					if (views_list[i].refresh(this._refresh_id)) {
						Lava.logError("ViewManager: view was refreshed several times in one refresh loop. Aborting.");
						has_exceptions = true;
					}

				}

			}

		}

		return has_exceptions;

	}
361927
def refresh(self):
        
        self.setDirty(False)
        self.blockSignals(True)
        self.setUpdatesEnabled(False)
        self.clear()
        
        locales = self._availableLocales
        if not locales:
            locales = self.allLocales()
        
        if not self.showLanguage():
            if self.isTranslated():
                sorter = lambda x: x.get_territory_name(base)
            else:
                sorter = lambda x: x.get_territory_name()
        else:
            if self.isTranslated():
                sorter = lambda x: x.get_language_name(base)
            else:
                sorter = lambda x: x.get_language_name()
        
        locales = sorted(locales, key=sorter)
        index = 0
        for i, locale in enumerate(locales):
            babel_locale = babel.Locale.parse(locale)
            code = '{0}_{1}'.format(babel_locale.language,
                                    babel_locale.territory)
            keys = {}
            if self.isTranslated():
                keys['lang'] = babel_locale.get_language_name(base)
                keys['territory'] = babel_locale.get_territory_name(base)
                keys['script'] = babel_locale.get_script_name(base)
            else:
                keys['lang'] = babel_locale.get_language_name()
                keys['territory'] = babel_locale.get_territory_name()
                keys['script'] = babel_locale.get_script_name()
            
            if self.showLanguage():
                opts = ''
                if self.showScriptName() and keys['script']:
                    opts += keys['script']
                if self.showTerritory() and keys['territory']:
                    if opts:
                        opts += ', '
                    opts += keys['territory']
                if opts:
                    opts = ' (' + opts + ')'
                
                label = keys['lang'] + opts
                
            elif self.showTerritory():
                label = keys['territory']
            else:
                label = code
            
            self.addItem(label)
            self.setItemData(i, wrapVariant(str(code)))
            
            name = babel_locale.territory.lower()
            ico = 'img/flags/{0}.png'.format(name)
            flag = QtGui.QIcon(resources.find(ico))
            if flag.isNull():
                ico = 'img/flags/_United Nations.png'
                flag = QtGui.QIcon(resources.find(ico))
            
            self.setItemIcon(i, flag)
            if code == self.baseLocale():
                index = i
        
        self.setCurrentIndex(index)
        self.setUpdatesEnabled(True)
        self.blockSignals(False)
420547
function getCacheRefreshInterval() {
    var value = parseInt(process.env[CACHE_REFRESH_KEY]);

    // Should we 0 here to invalidate the cache immediately?
    if (value && !isNaN(value) && value > 0) {
      return value;
    }

    return DEFAULT_CACHE_REFRESH_SECONDS;
  }
794767
function() {

		if (Lava.schema.DEBUG && this._active_argument_index != -1 && this._arguments[this._active_argument_index].isWaitingRefresh()) Lava.t();
		this._active_template = this._getActiveTemplate();
		return this._refresher.render(this._active_template ? [this._active_template] : []);

	}
83997
function() {

		if (this._is_refreshing) {
			Lava.logError("ScopeManager: recursive call to ScopeManager#refresh()");
			return;
		}

		var count_refresh_cycles = 0,
			count_levels = this._scope_refresh_queues.length;

		if (count_levels == 0) {

			return;

		}

		this._is_refreshing = true;

		this._has_exceptions = false;
		this._refresh_id++;

		// find the first existent queue
		while (this._min_scope_refresh_level < count_levels) {

			if (this._min_scope_refresh_level in this._scope_refresh_queues) {

				break;

			}

			this._min_scope_refresh_level++;

		}

		if (this._min_scope_refresh_level < count_levels) {

			while (this._scopeRefreshCycle()) {

				count_refresh_cycles++;

			}

		}

		this._scopeMalfunctionCycle();

		if (this._has_exceptions) {

			this._scope_refresh_queues = this._preserveScopeRefreshQueues();

		} else {

			Lava.schema.DEBUG && this.debugVerify();
			this._scope_refresh_queues = [];

		}

		this._scope_refresh_current_indices = [];

		if (this.statistics.max_refresh_cycles < count_refresh_cycles) {

			this.statistics.max_refresh_cycles = count_refresh_cycles;

		}

		this._has_infinite_loop = this._has_exceptions;

		this._is_refreshing = false;

	}