Get color.

        Refresh data from Vera if refresh is True, otherwise use local cache.
347202
def get_color(self, refresh=False):
        
        if refresh:
            self.refresh_complex_value('CurrentColor')

        ci = self.get_color_index(['R', 'G', 'B'], refresh)
        cur = self.get_complex_value('CurrentColor')
        if ci is None or cur is None:
            return None

        try:
            val = [cur.split(',')[c] for c in ci]
            return [int(v.split('=')[1]) for v in val]
        except IndexError:
            return None
84780
function getColor(varName, mappings) {
  const color = mappings[varName];
  if (color in mappings) {
    return getColor(color, mappings);
  } else {
    return color;
  }
}
1344209
function getColors(rawData) {

    // Regular expression matching colors variables naming pattern
    var REGEX = /^dc-(.*?)[0-9]+$/;

    var content = rawData
        .filter((item) => {
            var group = item.group[0];
            return group === 'colors'
                && item.context.type === 'variable'
                && item.context.name.match(REGEX);
        })
        .map((item) => {
            // extract color name (eg. `dc-magenta10 -> magenta`)
            item.color = item.context.name.replace(REGEX, '$1');
            item.color = _.capitalize(item.color);
            return item;
        });

    // transform colors array in a object, shaped as the view layer expect
    content = _.groupBy(content, (c) => c.color );
    Object.keys(content).forEach((color) => {
        content[color] = content[color].reduce((acc, c) => {
            acc['$' + c.context.name] = c.context.value;
            return acc;
        }, {});
    });
    return content;
}
505573
def cache_results(function):
    """"""
    def save_to_permacache():
        """Save the in-memory cache data to the permacache.

        There is a race condition here between two processes updating at the
        same time. It's perfectly acceptable to lose and/or corrupt the
        permacache information as each process's in-memory cache will remain
        in-tact.

        """
        update_from_permacache()
        try:
            with open(filename, 'wb') as fp:
                pickle.dump(cache, fp, pickle.HIGHEST_PROTOCOL)
        except IOError:
            pass  # Ignore permacache saving exceptions

    def update_from_permacache():
        """Attempt to update newer items from the permacache."""
        try:
            with open(filename, 'rb') as fp:
                permacache = pickle.load(fp)
        except Exception:  # TODO: Handle specific exceptions
            return  # It's okay if it cannot load
        for key, value in permacache.items():
            if key not in cache or value[0] > cache[key][0]:
                cache[key] = value

    cache = {}
    cache_expire_time = 3600
    try:
        filename = os.path.join(gettempdir(), 'update_checker_cache.pkl')
        update_from_permacache()
    except NotImplementedError:
        filename = None

    @wraps(function)
    def wrapped(obj, package_name, package_version, **extra_data):
        """Return cached results if available."""
        now = time.time()
        key = (package_name, package_version)
        if not obj.bypass_cache and key in cache:  # Check the in-memory cache
            cache_time, retval = cache[key]
            if now - cache_time < cache_expire_time:
                return retval
        retval = function(obj, package_name, package_version, **extra_data)
        cache[key] = now, retval
        if filename:
            save_to_permacache()
        return retval
    return wrapped
1326524
def get_color(self):
        """"""
        self.get_status()
        try:
            self.color = self.data['color']
            self.mode = self.data['mode']
        except TypeError:
            self.color = 0
            self.mode = ''

        return {'color': self.color, 'mode': self.mode}
599484
def refreshFromIndex( self ):
        
        item = self.uiIndexTREE.currentItem()
        if ( not item ):
            return
        
        self.gotoUrl(item.toolTip(0))
427168
def __refresh(self):
        """"""
        raw_values = self.__get_values()
        if not raw_values:
            raise RefreshException('Point has no values')

        # individual templates
        templates = []
        # lookup tables by type and unit of value
        by_type = {}
        by_unit = {}

        for raw_value in raw_values:
            label = raw_value['label']
            if not valid_identifier(label) or label.startswith('__'):
                raise RefreshException('Value "%s" unsuitable for object wrapper' % label)
            value = Value(label, raw_value['type'], raw_value['unit'], raw_value['comment'])
            templates.append(value)
            try:
                by_type[value.type_].add(label)
            except KeyError:
                by_type[value.type_] = {label}
            if value.unit:
                try:
                    by_unit[value.unit].add(label)
                except KeyError:
                    by_unit[value.unit] = {label}

        self.__value_templates = templates
        self.__filter = _ValueFilter(by_type, by_unit)
1192059
def refresh(self):
        """"""
        d = self.request('get', self.instance_url())
        return d.addCallback(self.refresh_from).addCallback(lambda _: self)
163569
function(bs, data) {
        if (canLogFileChange(bs, data)) {
            if (data.path[0] === "*") {
                return logger.info(
                    "{cyan:Reloading files that match: {magenta:%s",
                    data.path
                );
            }

            logger.info(
                "{cyan:File event [" + data.event + "] : {magenta:%s",
                data.path
            );
        }
    }
592689
def refresh(self):
        # type: () -> None
        """"""
        from pykechain.client import API_EXTRA_PARAMS
        src = self._client.reload(self, extra_params=API_EXTRA_PARAMS['activity'])
        self.__dict__.update(src.__dict__)
493821
def getIRData(self):
        '''
        

        '''     
        if self.hasproxy():
            self.lock.acquire()
            ir = self.ir
            self.lock.release()
            return ir

        return None
470313
function refresh(element) {
  const url = window.location.href;
  let match;
  if (element.areaLink) {
    // Match prefix
    let prefix = element.href;
    // If prefix doesn't end in slash, add a slash.
    // We want to avoid matching in the middle of a folder name.
    if (prefix.length < url.length && prefix.substr(-1) !== '/') {
      prefix += '/';
    }
    match = (url.substr(0, prefix.length) === prefix);
  } else {
    // Match whole path
    match = (url === element.href);
  }
  element.current = match;
}
493073
def get_data(url, gallery_dir):
    """"""

    # shelve keys need to be str in python 2
    if sys.version_info[0] == 2 and isinstance(url, unicode):
        url = url.encode('utf-8')

    cached_file = os.path.join(gallery_dir, 'searchindex')
    search_index = shelve.open(cached_file)
    if url in search_index:
        data = search_index[url]
    else:
        data = _get_data(url)
        search_index[url] = data
    search_index.close()

    return data
249764
def refresh(self):
        ''''''

        if not self._item_path:
            raise AttributeError('refresh is not available for %s' % self._type)
        if not self.id:
            raise RedmineError('%s did not come from the Redmine server - no link.' % self._type)

        try:
            self.save()
        except:
            pass

        # Mimic the Redmine_Item_Manager.get command
        target = self._item_path % self.id
        json_data = self._redmine.get(target)
        data = self._redmine.unwrap_json(self._type, json_data)
        self._update_data(data=data)
84868
function refreshInstance (
  instanceId,
  data
) {
  var instance = instanceOptions[instanceId];
  if (!instance || !(instance.app instanceof instance.Vue)) {
    return new Error(("refreshInstance: instance " + instanceId + " not found!"))
  }
  if (instance.Vue && instance.Vue.set) {
    for (var key in data) {
      instance.Vue.set(instance.app, key, data[key]);
    }
  }
  // Finally `refreshFinish` signal needed.
  instance.document.taskCenter.send('dom', { action: 'refreshFinish' }, []);
}
772396
def refresh(self):
        """"""
        if self._source_tree.cache_is_stale():
            self._source_tree.refresh()
            logging.info('Refreshing object tree')
            self._init_cache()
            self.sync_cache_with_source_tree()
232870
function() {

		if (Lava.schema.DEBUG && (this._argument.isWaitingRefresh() || this._foreach_scope.isWaitingRefresh())) Lava.t("Rendering a view in dirty state");
		this._requires_refresh_children && this._refreshChildren();
		return this._refresher.render(this._current_templates);

	}