Returns the layout with the given name
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
1014730
def register_layout(self, name, layout):
        

        if name in self:
            raise umbra.exceptions.LayoutRegistrationError("{0} | '{1}' layout is already registered!".format(
                self.__class__.__name__, name))

        self.__layouts[name] = layout
        return True
206830
def get_wx_window_layout(wx_window):
    ''''''
    dsize = wx.DisplaySize()
    pos = wx_window.GetPosition()
    size = wx_window.GetSize()
    name = wx_window.GetTitle()
    return WinLayout(name, pos, size, dsize)
367632
protected TextLayout getTextLayout()
    {
        if (refreshTextLayout)
        {
            refreshTextLayout = false;
            layout = new TextLayout(getText(), getFont(), new FontRenderContext(transform, true, false));
        }

        return layout;
    }
1196727
function (layoutName, data, moduleName) {
            if (layoutName === undefined) {
                return '';
            }

            if (moduleName === undefined && typeof data === 'string') {
                moduleName = data;
                data = undefined;
            }

            if (moduleName === undefined) {
                // 未指定模块时默认渲染当前模块下layout
                moduleName = resLocals.current_module;
                return renderLayout(layoutName, data, moduleName);
            } else {
                // 跨模块渲染, 在指定模块下完成layout渲染, 完成后切换回原模块
                var lastModule = resLocals.current_module;
                self.logger.trace('set current module from:%s to:%s', resLocals.current_module, moduleName);
                resLocals.current_module = moduleName;
                var html = renderLayout(layoutName, data, moduleName);
                self.logger.trace('set current module from:%s to:%s', resLocals.current_module, lastModule);
                resLocals.current_module = lastModule;
                return html;
            }
        }
1337161
public function view($layout, $name=null)
	{
		// If we were passed only a view model, just render it.
		if ($layout instanceof AbstractView)
		{
			return $layout;
		}

		$view = new self(array(
			'folder'  => $this->_folder,
			'element' => $this->_element,
			'name'    => ($name ? $name : $this->_name),
			'layout'  => $layout
		));
		$view->set('folder', $this->_folder)
		     ->set('element', $this->_element);

		return $view;
	}
992867
@Override
    public String getLayoutContentByAppId(String appId) {
        String value = propertyService.getValue(PROPERTY_LAYOUT_ASSOCIATION, appId);
        return value == null ? null : getLayoutContent(new LayoutIdentifier(value, true));
    }
222279
def get_by_name(self, name, default=None):
        """"""
        for slide_layout in self:
            if slide_layout.name == name:
                return slide_layout
        return default
1340376
def _layout_for_ajax(default) #:nodoc:
      ajax_layout = self.class.read_inheritable_attribute(:ajax_layout)
      ajax_layout = if ajax_layout.nil? && default.nil?
          nil
        elsif ajax_layout.nil? && !default.nil? # look for one with the default name in layouts/ajax
          if default =~ /^layouts\/ajax\//
            default
          elsif !(default =~ /^ajax\//)
            "ajax/#{default.sub(/layouts(\/)?/, '')}"
          else
            default
          end
        elsif ajax_layout.include?(?/) # path to specific layout
          ajax_layout
        else # layout name, look in ajax/
          "ajax/#{ajax_layout}"
        end
      ajax_layout = ajax_layout =~ /\blayouts/ ? ajax_layout : "layouts/#{ajax_layout}" if ajax_layout
      ajax_layout
    end
831268
function layoutNode (root) {
  var rootNode = createNode(root);
  computeLayout(rootNode);
  walkNode(rootNode);
  return rootNode;
}
1071285
private Layout getActiveLayout(Project phoenixProject)
   {
      //
      // Start with the first layout we find
      //
      Layout activeLayout = phoenixProject.getLayouts().getLayout().get(0);

      //
      // If this isn't active, find one which is... and if none are,
      // we'll just use the first.
      //
      if (!activeLayout.isActive().booleanValue())
      {
         for (Layout layout : phoenixProject.getLayouts().getLayout())
         {
            if (layout.isActive().booleanValue())
            {
               activeLayout = layout;
               break;
            }
         }
      }

      return activeLayout;
   }
984528
protected function _loadLayoutXml() {
        Varien_Profiler::start('turpentine::helper::esi::_loadLayoutXml');
        $design = Mage::getDesign();
        $layoutXml = Mage::getSingleton('core/layout')
            ->getUpdate()
            ->getFileLayoutUpdatesXml(
                $design->getArea(),
                $design->getPackageName(),
                $design->getTheme('layout'),
                Mage::app()->getStore()->getId() );
        Varien_Profiler::stop('turpentine::helper::esi::_loadLayoutXml');
        return $layoutXml;
    }
3952
def get(self, layout, default=None):
        

        try:
            return self.__getitem__(layout)
        except KeyError as error:
            return default
1090573
def get_layout(self):
        
        if self.request.is_ajax():
            layout = ['modal', ]
        else:
            layout = ['static_page', ]

        if self.workflow_class.wizard:
            layout += ['wizard', ]

        return layout
186431
def get_format(self, name):
        

        formats = [format for format in self.list_formats(self.__root_node) if format in name]
        if not formats:
            return QTextCharFormat()

        name = max(formats)

        format = None
        current_node = self.__root_node
        for selector in name.split("."):
            nodes = [node for node in current_node.children if node.name == selector]
            format_node = nodes and nodes[0] or None
            if not format_node:
                break

            current_node = format_node

            if not format_node.format:
                continue

            format = format_node.format
        return format
140721
public function getLayoutName($layoutId): string
    {
        try {
            $layout = $this->layoutService->loadLayout($layoutId);

            return $layout->getName();
        } catch (Throwable $t) {
            return '';
        }
    }
561272
public static Integer getLayoutId(Class myClass) {
        Annotation annotation = myClass.getAnnotation(LayoutId.class);

        if (annotation instanceof LayoutId) {
            LayoutId layoutIdAnnotation = (LayoutId) annotation;
            return layoutIdAnnotation.value();
        }

        return null;
    }