Restores given layout.

        :param name: Layout name.
        :type name: unicode
        :param \*args: Arguments.
        :type \*args: \*
        :return: Method success.
        :rtype: bool
354307
def restore_layout(self, name, *args):
        

        layout = self.__layouts.get(name)
        if not layout:
            raise umbra.exceptions.LayoutExistError("{0} | '{1}' layout isn't registered!".format(
                self.__class__.__name__, name))

        LOGGER.debug("> Restoring layout '{0}'.".format(name))

        for component, profile in self.__container.components_manager:
            if profile.category == "QWidget" and component not in self.__container.visible_components:
                interface = self.__container.components_manager.get_interface(component)
                interface and interface.hide()

        self.__current_layout = name
        self.__container.centralWidget().setVisible(
            self.__settings.get_key("Layouts", "{0}_central_widget".format(name)).toBool())
        self.__container.restoreState(
            self.__settings.get_key("Layouts", "{0}_window_state".format(name)).toByteArray())
        self.__restore_geometry_on_layout_change and \
        self.__container.restoreGeometry(
            self.__settings.get_key("Layouts", "{0}_geometry".format(name)).toByteArray())
        self.layout_restored.emit(self.__current_layout)
        return True
3952
def get(self, layout, default=None):
        

        try:
            return self.__getitem__(layout)
        except KeyError as error:
            return default
1107227
@Override
    public void saveLayout(LayoutIdentifier layout, String content) {
        propertyService.saveValue(getPropertyName(layout.shared), layout.name, layout.shared, content);
    }
1041949
public static void saveLayout(Layout layout, LayoutIdentifier layoutId, boolean hideScope,
                                  IResponseCallback<LayoutIdentifier> callback) {
        LayoutPrompt.show(layoutId, hideScope, true, CAP_LAYOUT_SAVE, MSG_LAYOUT_SAVE, (event) -> {
            LayoutIdentifier id = event.getTarget().getAttribute("layoutId", LayoutIdentifier.class);
            
            if (id != null) {
                layout.saveToProperty(id);
                
                if (callback != null) {
                    callback.onComplete(id);
                }
            }
            
        }
227104
function(layout, fail) {
    if (_.isFunction(layout)) {
      return layout;
    }

    if (!_.isString(layout)) {
      fail('Layout should be specified by name or as a function');
    }

    if (_(defaultLayouts).has(layout)) {
      return defaultLayouts[layout];
    }

    fail('The following named layouts are supported: ' + _.keys(defaultLayouts).join(', '));
  }
1012858
def _maybe_get_default_name(self, name):
        
        if name is None and self.uri.fragment:
            name = self.uri.fragment
        return name
817901
@SuppressLint("WrongCall")
    protected boolean layout() {
        boolean relaidout = false;
        Log.v(Log.SUBSYSTEM.LAYOUT, TAG, "layout(%s): changed: %b, requested: %b", getName(),
                isChanged(), mLayoutRequested);

        if (isChanged() || mLayoutRequested) {
            Log.v(Log.SUBSYSTEM.LAYOUT, TAG, "layout(%s): calling onLayout", getName());
            relaidout = onLayout();
        }

        mLayoutRequested = false;
        mChanged = false;
        return relaidout;
    }
364729
def apply_saved_layout(self):
        """"""
        num_widgets = self.config.get(self.config_key + "/num_widgets", int)
        if num_widgets:
            sizes = []
            for i in range(num_widgets):
                key = "%s/size_%d" % (self.config_key, i)
                size = self.config.get(key, int)
                sizes.append(size)
            self.setSizes(sizes)
            return True
        return False
299654
def remake_display(self, *args):
        
        Builder.load_string(self.kv)
        if hasattr(self, '_kv_layout'):
            self.remove_widget(self._kv_layout)
            del self._kv_layout
        self._kv_layout = KvLayout()
        self.add_widget(self._kv_layout)
1135560
public void restoreOriginalParams() {
        for (int i = 0, N = mHost.getChildCount(); i < N; i++) {
            View view = mHost.getChildAt(i);
            ViewGroup.LayoutParams params = view.getLayoutParams();
            if (Log.isLoggable(TAG, Log.DEBUG)) {
                Log.d(TAG, "should restore " + view + " " + params);
            }
            if (params instanceof PercentLayoutParams) {
                PercentLayoutInfo info =
                        ((PercentLayoutParams) params).getPercentLayoutInfo();
                if (Log.isLoggable(TAG, Log.DEBUG)) {
                    Log.d(TAG, "using " + info);
                }
                if (info != null) {
                    if (params instanceof ViewGroup.MarginLayoutParams) {
                        info.restoreMarginLayoutParams((ViewGroup.MarginLayoutParams) params);
                    } else {
                        info.restoreLayoutParams(params);
                    }
                }
            }
        }
    }
1146480
def createLabel(self, name):
        
        if self.findLabel(name):
            raise exception.LabelException('Label exists')
        node = _node.Label()
        node.name = name
        self._labels[node.id] = node # pylint: disable=protected-access
        return node
1299237
def p_restore(p):
    
    if len(p) == 2:
        id_ = '__DATA__{0}'.format(len(gl.DATAS))
    else:
        id_ = p[2]

    lbl = check_and_make_label(id_, p.lineno(1))
    p[0] = make_sentence('RESTORE', lbl)
696835
def load_template(self, name):
        
        # hopefully speeds up loading of templates a little, especially when loaded multiple times
        if name in self.cached_templates:
            logger.debug("Using cached template: %s", name)
            return self.cached_templates[name]

        logger.debug("Attempting to find template by name: %s", name)
        name_with_ext, provider_name, base_path = self.find_template_details(name)

        full_path = None
        if base_path is not None:
            full_path = os.path.join(base_path, name_with_ext)

        # load it with the relevant provider
        template = template_exception_handler(
            lambda: self.get_provider(provider_name).load_template(
                name_with_ext,
                full_path=full_path
            ),
            self.error_context,
            filename=full_path
        )

        # cache it for potential later use
        self.cached_templates[name] = template
        return template
1191654
def restore(self, name, ttl, value, replace=False):
        
        params = [name, ttl, value]
        if replace:
            params.append('REPLACE')
        return self.execute_command('RESTORE', *params)
94963
def restorenx(self, name, value, pttl=0):
        
        return self.eval(lua_restorenx, 1, name, pttl, value)
1262158
def RestoreSnapshot(self,name=None):
		

		if not len(self.data['details']['snapshots']):  raise(clc.CLCException("No snapshots exist"))
		if name is None:  name = self.GetSnapshots()[0]

		name_links = [obj['links'] for obj in self.data['details']['snapshots'] if obj['name']==name][0]
		return(clc.v2.Requests(clc.v2.API.Call('POST',
											   [obj['href'] for obj in name_links if obj['rel']=='restore'][0],
											   session=self.session),
							   alias=self.alias,
							   session=self.session))
332254
def get_layout(self, name):
        '''
        
        '''
        layout_chain = []

        # Retrieve initial layout file
        try:
            json_data = self.json_files[self.layout_names[name]]
        except KeyError:
            log.error('Could not find layout: %s', name)
            log.error('Layouts path: %s', self.layout_path)
            raise
        layout_chain.append(Layout(name, json_data))

        # Recursively locate parent layout files
        parent = layout_chain[-1].parent()
        while parent is not None:
            # Find the parent
            parent_path = None
            for path in self.json_file_paths:
                if os.path.normcase(os.path.normpath(parent)) in os.path.normcase(path):
                    parent_path = path

            # Make sure a path was found
            if parent_path is None:
                raise UnknownLayoutPathException('Could not find: {}'.format(parent_path))

            # Build layout for parent
            json_data = self.json_files[parent_path]
            layout_chain.append(Layout(parent_path, json_data))

            # Check parent of parent
            parent = layout_chain[-1].parent()

        # Squash layout files
        layout = self.squash_layouts(layout_chain)
        return layout