Create and set the model on the asset page

        :returns: None
        :rtype: None
        :raises: None
320175
def setup_asset_page(self, ):
        
        self.asset_asset_treev.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
        self.asset_task_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
357685
def create(self):
        

        # Ensure that an existing document will not be "updated"
        doc = dict(self)
        if doc.get('_rev') is not None:
            doc.__delitem__('_rev')

        headers = {'Content-Type': 'application/json'}
        resp = self.r_session.post(
            self._database.database_url,
            headers=headers,
            data=json.dumps(doc, cls=self.encoder)
        )
        resp.raise_for_status()
        data = response_to_json_dict(resp)
        super(Document, self).__setitem__('_id', data['id'])
        super(Document, self).__setitem__('_rev', data['rev'])
1209541
def set_content_model(self):
        
        if not self.content_model:
            is_base_class = (
                base_concrete_model(ContentTyped, self) == self.__class__)
            self.content_model = (
                None if is_base_class else self.get_content_model_name())
634603
def set_model(self, name, model):
        
        # Careful to not use `hasattr`
        # https://hynek.me/articles/hasattr/
        try:
            self.__getattribute__('models')
        except AttributeError:
            object.__setattr__(self, 'models',odict())
        self.models[name] = model
8477
def create(self, **kwargs):
        
        obj = self.model(**kwargs)
        meta = obj.get_meta()
        meta.connection = get_es_connection(self.es_url, self.es_kwargs)
        meta.index=self.index
        meta.type=self.type
        obj.save(force=True)
        return obj
460521
def model_setup(self):
        
        for device in self.devman.devices:
            if self.__dict__[device].n:
                try:
                    self.__dict__[device].setup()
                except Exception as e:
                    raise e
964996
def create(self, **kwargs):
        
        obj = self.resource(**kwargs)
        obj.save(force_insert=True)
        return obj
1066902
def model_page(self, request, app_label, model_name, rest_of_url=None):
        
        try:
            model = get_model(app_label, model_name)
        except LookupError:
            model = None

        if model is None:
            raise http.Http404("App %r, model %r, not found." %
                               (app_label, model_name))
        try:
            databrowse_class = self.registry[model]
        except KeyError:
            raise http.Http404("This model exists but has not been registered "
                               "with databrowse.")
        return databrowse_class(model, self).root(request, rest_of_url)
1056049
def create_model_instance(self, data):
        
        return self.model(
            session_key=self._get_or_create_session_key(),
            session_data=self.encode(data),
            expire_date=self.get_expiry_date(),
        )
378179
def _init_model(self):
        
        model = Sequential()
        model.add(Conv3D(input_shape=[self.time_delay] + list(self.image_size) + [self.channels], filters=self.filters,
                         kernel_size=self.kernel_size, activation='relu', data_format='channels_last'))
        model.add(
            Conv3D(filters=self.filters, kernel_size=self.kernel_size, activation='relu', data_format='channels_last'))
        model.add(MaxPooling3D(pool_size=(1, 2, 2), data_format='channels_last'))
        model.add(
            Conv3D(filters=self.filters, kernel_size=self.kernel_size, activation='relu', data_format='channels_last'))
        model.add(
            Conv3D(filters=self.filters, kernel_size=self.kernel_size, activation='relu', data_format='channels_last'))
        model.add(MaxPooling3D(pool_size=(1, 2, 2), data_format='channels_last'))

        model.add(Flatten())
        model.add(Dense(units=len(self.emotion_map.keys()), activation="relu"))
        if self.verbose:
            model.summary()
        self.model = model
354457
def setModelData( self, editor, model, index ):
        
        tree        = self.parent()
        querywidget = tree.parent()
        factory     = querywidget.factory()
        item        = tree.itemFromIndex(index)
        
        value = factory.editorData(editor)
        item.setValue(value)
600867
def setModel(self, model):
        

        if not model:
            return

        LOGGER.debug("> Setting '{0}' model.".format(model))

        umbra.ui.views.Abstract_QTreeView.setModel(self, model)

        # Signals / Slots.
        self.model().modelAboutToBeReset.connect(self.__model__modelAboutToBeReset)
        self.model().modelReset.connect(self.__model__modelReset)
617242
def model_setattr():
    

    def model_setattr(value, context, **_params):
        setattr(context["model"], context["key"], value)
        return _attr()

    return model_setattr
852465
def create(cls, result_id=None, summary=None, file_modified_at=None):
        """"""
        asset = cls(result_id, summary, file_modified_at)

        db.session.add(asset)
        db.session.commit()

        return asset
141079
def setup_shot_page(self, ):
        
        self.shot_asset_treev.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
        self.shot_task_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
477250
def save_model(self, file_name='model.cx'):
        
        with open(file_name, 'wt') as fh:
            cx_str = self.print_cx()
            fh.write(cx_str)
389352
def set_value_field(self, model, field_name):
        
        fields = fields_for_model(model, fields=[field_name])
        self.fields['value'] = fields[field_name]