Return all views associated with the given model.
@param {Core.Model} model Model element.
@return {Array<Core.View>} View elements associated with.
965240
function getViewsOf(model) {
        return getRefsTo(model, function (ref) {
            return (ref instanceof Core.View) && (ref.model === model);
        });
    }
1276501
function (model) {
            if (!this.ngModel) {
                return;
            }
            var index = this.selected.indexOf(model);
            if (index !== -1) {
                this.selected.splice(index, 1);
                if (this.multiple) {
                    this.ngModel.$setViewValue(this.selected);
                } else {
                    this.ngModel.$setViewValue(undefined);
                }
            }

        }
1132519
@RequestMapping(value = "api/group", method = RequestMethod.GET)
    public
    @ResponseBody
    HashMap<String, Object> getAllGroups(Model model) {
        return Utils.getJQGridJSON(pathOverrideService.findAllGroups(), "groups");
    }
1027039
def get_models(self, model, page=None):
        
        if page is not None:
            return self._store.find_all(self._get_model_class(model), params={'page': int(page)})
        else:
            return self._store.find_all(self._get_model_class(model))
214468
function getAvailableViewTypes(diagramTypeName) {
        var metaClass = _global.meta[diagramTypeName],
            views     = [];
        if (metaClass.super) {
            views = getAvailableViewTypes(metaClass.super);
        }
        if (metaClass.views) {
            var i, len, item;
            for (i = 0, len = metaClass.views.length; i < len; i++) {
                item = metaClass.views[i];
                views.push(item);
            }
        }
        return views;
    }
221272
function() {
      _.each(cdb.core.View.views, function(view) {
        _.each(view, function(prop, k) {
          if( k !== '_parent' &&
              view.hasOwnProperty(k) &&
              prop instanceof cdb.core.View &&
              view._subviews[prop.cid] === undefined) {
            console.log("=========");
            console.log("untracked view: ");
            console.log(prop.el);
            console.log('parent');
            console.log(view.el);
            console.log(" ");
          }
        });
      });
    }
85798
function (model) {
            //if we have them return them;
            if (this.associationLoaded(model)) {
                var assoc = this.getAssociation(model);
                return this.isEager() ? assoc : when(assoc);
            } else if (model.isNew) {
                return null;
            } else {
                return this.fetch(model);
            }
        }
524141
def _check_model_types(self, models):
        
        if not hasattr(models, "__iter__"):
            models = {models}
        if not all([isinstance(model, (AbstractStateModel, StateElementModel)) for model in models]):
            raise TypeError("The selection supports only models with base class AbstractStateModel or "
                            "StateElementModel, see handed elements {0}".format(models))
        return models if isinstance(models, set) else set(models)
847031
function modelQuery(options) {
            return models.Role.findAll(options)
                .then((models) => {
                    let roles = models.map((role) => {
                        return role.toJSON();
                    });

                    if (options.permissions !== 'assign') {
                        return {roles: roles};
                    }

                    return Promise.filter(roles.map((role) => {
                        return canThis(options.context).assign.role(role)
                            .return(role)
                            .catch(() => {});
                    }), (value) => {
                        return value && value.name !== 'Owner';
                    }).then((roles) => {
                        return {
                            roles: roles
                        };
                    });
                });
        }
9030
function(model)
  {
    var exists = this.has( model.$key() );
    var matches = this.filter( model );

    if ( exists && !matches )
    {
      this.remove( model );
    }
    if ( !exists && matches )
    {
      this.add( model );
    }
  }
992924
function ImmutableCoreModelQuery (args) {
    // require model
    this.assert(defined(args.model) && args.model.ImmutableCoreModel, 'model required')
    // set model for query
    this.model = args.model
    // args and session are both optional in some cases
    this.args = _.cloneDeep( requireValidOptionalObject(args.args) )
    this.session = requireValidOptionalObject(args.session)
    // validate and normalize args
    this.initArgs()
    // valid view args and instantiate model view engine if there are views
    this.initViews()
}
672955
function(model, view) {
      if (view && model.associatedViews && model.associatedViews.length > 1){
        model.associatedViews = _.without(model.associatedViews, view);
      } else {
        delete model.validate;
        delete model.preValidate;
        delete model.isValid;
        delete model.associatedViews;
      }
    }
970072
def _get_selected_items(self):
        
        return set(self.canvas.get_view_for_model(model) for model in self._selection)
502822
def get_all_models_including_attached_models(model):
    
    if (hasattr(model, "_tx_model_repository")):
        models = list(
            model._tx_model_repository.all_models.filename_to_model.values())
        if model not in models:
            models.append(model)
    else:
        models = [model]
    return models
949607
function getProcessedViews(id, next){

	// Create query
	if(id) query = {id: id};
	else   query = {};

	app.models.View.find(query, function(err, models){
		if(err) return next(err);

		processView(models, next);
	});
}
1065389
function(p) {

        p = new g.Point(p);

        var views = this.model.getElements().map(this.findViewByModel, this);

        return views.filter(function(view) {
            return view && view.vel.getBBox({ target: this.viewport }).containsPoint(p);
        }, this);
    }
760417
function(model, options) {
            var item, tag;

            // Define options
            options = _.defaults(options || {}, {
                silent: false,
                render: true,
                at: _.size(this.items),
            });

            if (this.items[model.id] != null) {
                this.removeModel(model);
            }

            item = new this.Item({
                "model": model,
                "list": this,
                "collection": this.collection
            }, this);
            this.listenTo(model, "set", function() {
                item.update();
                this.applyFilter(item);
            });
            this.listenTo(model, "id", function(newId, oldId) {
                this.items[newId] = this.items[oldId];
                delete this.items[oldId];
            });

            item.update();
            tag = this.Item.prototype.tagName;
            if (this.Item.prototype.className) tag = tag+"."+this.Item.prototype.className.split(" ")[0];

            if (options.at > 0) {
                this.$("> "+tag).eq(options.at-1).after(item.$el);
            } else {
                this.$el.prepend(item.$el);
            }
            this.items[model.id] = item;

            this.applyFilter(item);

            if (!options.silent) this.trigger("add", model);
            if (options.render) this.update();

            return this;
        }