Iterates over `renderable` view collections
and returns the first view that matches the
given `view` name
484698
function findView(app, name) {
    var keys = app.viewTypes.renderable;
    var len = keys.length;
    var i = -1;

    var res = null;
    while (++i < len) {
      res = app.find(name, keys[i]);
      if (res) {
        break;
      }
    }
    return res;
  }
775439
def _get_view_index(self, view):
        """"""
        name = view.__class__.__name__
        return len(self.list_views(name))
926207
def _slice(self, view):
        
        if self._data is not None:
            return self._data[view]
        return self._proxy.get_view(self.id, view)
77501
function(name) {

		var view = this;

		while (view && !view.isset(name)) {

			view = view.getParentView();

		}

		return view;

	}
965240
function getViewsOf(model) {
        return getRefsTo(model, function (ref) {
            return (ref instanceof Core.View) && (ref.model === model);
        });
    }
825042
function getLayout(collection, name) {
  if (!name) return;
  if (collection instanceof Map) {
    for (const [key, view] of collection) {
      if (name === key) {
        return view;
      }
      if (!view.path) continue;
      if (!view.hasPath) {
        return getView(collection, name);
      }
      if (view.hasPath(name)) {
        return view;
      }
    }
    return;
  }

  for (const key of Object.keys(collection)) {
    const view = collection[key];
    if (name === key) {
      return view;
    }
    if (!view.path) continue;
    if (!view.hasPath) {
      return getView(collection, name);
    }
    if (view.hasPath(name)) {
      return view;
    }
  }
}
828169
def create_view_from_dict(name, spec, template=None, cls=ActionsView):
    
    kwargs = dict(spec)
    if template is not None:
        kwargs.setdefault("template", template)
    actions = load_grouped_actions(kwargs, pop_keys=True)
    view = cls(name=name, **kwargs)
    if isinstance(view, ActionsView):
        view.actions.extend(actions)
    return view
241102
def render(view_name, locals = {})
      view = Massimo::View.find(view_name)
      view && view.render(locals)
    end
1185197
def get_view(cls, method_name):
        
        method = getattr(cls, method_name)

        @wraps(method)
        def view(request, **kwargs):
            handler = cls(request, kwargs)
            handler.call_processors('view')
            response = None
            try:
                response = method(handler)
                return response
            finally:
                handler.call_processors('post_view', response=response)

        return view
199097
@Nullable static View getView(Context context, int resourceId, View view) {
    LayoutInflater inflater = LayoutInflater.from(context);
    if (view != null) {
      return view;
    }
    if (resourceId != INVALID) {
      view = inflater.inflate(resourceId, null);
    }
    return view;
  }
680822
function getView(inner, type) { //view.get(inner, type)
		if (!type) {
			// view.get(type)
			type = inner;
			inner = undefined;
		}

		var views, i, l, found,
			view = this,
			root = !type || type === "root";
			// If type is undefined, returns root view (view under top view).

		if (inner) {
			// Go through views - this one, and all nested ones, depth-first - and return first one with given type.
			found = view.type === type ? view : undefined;
			if (!found) {
				views = view.views;
				if (view._.useKey) {
					for (i in views) {
						if (found = views[i].get(inner, type)) {
							break;
						}
					}
				} else for (i = 0, l = views.length; !found && i < l; i++) {
					found = views[i].get(inner, type);
				}
			}
		} else if (root) {
			// Find root view. (view whose parent is top view)
			while (view.parent.parent) {
				found = view = view.parent;
			}
		} else while (view && !found) {
			// Go through views - this one, and all parent ones - and return first one with given type.
			found = view.type === type ? view : undefined;
			view = view.parent;
		}
		return found;
	}
309197
private int compareView(ViewRef<?> viewA, 
                          ViewRef<?> viewB,
                          Class<?> type)
  {
    int cmp = viewB.priority() - viewA.priority();
    
    if (cmp != 0) {
      return cmp;
    }
    
    cmp = typeDepth(viewA.type(), type) - typeDepth(viewB.type(), type);

    if (cmp != 0) {
      return cmp;
    }
    
    // equivalent views are sorted by name to ensure consistency
    
    String nameA = viewA.resolver().getClass().getName();
    String nameB = viewB.resolver().getClass().getName();
    
    return nameA.compareTo(nameB); 
  }
810842
private void createViewIfNotExist(Map<String, MapReduce> views, String columnName)
    {
        if (views.get(columnName) == null)
        {
            createView(views, columnName);
        }
    }
1364167
function getUiViewName(attrs, inherited) {
        var name = attrs.uiView || attrs.name || '';
        return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));
    }
836703
def render_essence_view_by_name(element, name, options = {}, html_options = {})
      if element.blank?
        warning('Element is nil')
        return ""
      end
      content = element.content_by_name(name)
      render_essence_view(content, options, html_options)
    end
49188
def render(view_name = nil, context: Attributor::DEFAULT_ROOT_CONTEXT, renderer: Renderer.new, **opts)
      if !view_name.nil?
        warn 'DEPRECATED: please do not pass the view name as the first parameter in Blueprint.render, pass through the view: named param instead.'
      elsif opts.key?(:view)
        view_name = opts[:view]
      end

      fields = opts[:fields]
      view_name = :default if view_name.nil? && fields.nil?

      if view_name
        unless (view = self.class.views[view_name])
          raise "view with name '#{view_name.inspect}' is not defined in #{self.class}"
        end
        return view.render(self, context: context, renderer: renderer)
      end

      # Accept a simple array of fields, and transform it to a 1-level hash with true values
      if fields.is_a? Array
        fields = fields.each_with_object({}) { |field, hash| hash[field] = true }
      end

      # expand fields
      expanded_fields = FieldExpander.expand(self.class, fields)

      renderer.render(self, expanded_fields, context: context)
    end
1157101
def get_view_name(namespace, view):
    
    name = ""
    if namespace != "":
        name = namespace + "_"
    return sanitize(name + view.name)