Write your forwards methods here.
180569
def forwards(self, orm):
        ""

        rows = db.execute("select distinct feature_type from content_content")
        for row in rows:
            feature_type = row[0]
            try:
                ft = orm.FeatureType.objects.get(slug=slugify(feature_type))
            except orm.FeatureType.DoesNotExist:
                ft = orm.FeatureType.objects.create(
                    name=feature_type,
                    slug=slugify(feature_type)
                )
            db.execute("update content_content set feature_type_id = %s where feature_type = %s", [ft.id, feature_type])
643518
def forward(self, x):
        ''''''
        N,C,H,W = x.size()
        g = self.groups
        return x.view(N,g,C/g,H,W).permute(0,2,1,3,4).contiguous().view(N,C,H,W)
986848
def forwards(apps, schema_editor):
    
    Event = apps.get_model('spectator_events', 'Event')

    for event in Event.objects.all():
        if event.venue is not None:
            event.venue_name = event.venue.name
            event.save()
270036
public void forward() {

        m_context.getSetupBean().prepareStep10();
        CmsSetupBean bean = m_context.getSetupBean();
        VaadinServletRequest request = (VaadinServletRequest)(VaadinRequest.getCurrent());
        String servletMapping = bean.getServletMapping();
        String openLink = null;

        if (!servletMapping.startsWith("/")) {
            servletMapping = "/" + servletMapping;
        }
        if (servletMapping.endsWith("/*")) {
            // usually a mapping must be in the form "/opencms/*", cut off all slashes
            servletMapping = servletMapping.substring(0, servletMapping.length() - 2);
        }
        openLink = request.getContextPath() + servletMapping + (bean.hasIndexHtml() ? "/index.html" : "/system/login");

        A_CmsUI.get().getPage().setLocation(openLink);
    }
1086630
def forwards(self, orm):
        ""
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        for entry in orm['multilingual_news.NewsEntry'].objects.all():
            self.migrate_placeholder(
                orm, entry, 'excerpt', 'multilingual_news_excerpt', 'excerpt')
            self.migrate_placeholder(
                orm, entry, 'content', 'multilingual_news_content', 'content')
485698
def forwards(self, orm):
        ""
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        for category in Category.objects.all():
            category.slug = category._generate_slug()
            category.save()
160268
private void forward(int[] o, double[][] alpha, double[] scaling) {
        for (int k = 0; k < numStates; k++) {
            alpha[0][k] = pi[k] * b[k][o[0]];
        }
        scale(scaling, alpha, 0);

        for (int t = 1; t < o.length; t++) {
            for (int k = 0; k < numStates; k++) {
                double sum = 0.0;

                for (int i = 0; i < numStates; i++) {
                    sum += alpha[t - 1][i] * a[i][k];
                }

                alpha[t][k] = sum * b[k][o[t]];
            }
            scale(scaling, alpha, t);
        }
    }
663216
def forwards(self, orm):
        ""
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        for entry_title in orm.NewsEntryTitle.objects.all():
            entry = NewsEntry.objects.get(pk=entry_title.entry.pk)
            entry.translate(entry_title.language)
            entry.title = entry_title.title
            entry.slug = entry_title.slug
            entry.is_published = entry_title.is_published
            entry.save()
1166165
protected void writeForward(Encoder encoder) throws IOException {
    if (encoder.node.index != encoder.fromNode.index) {
      Bits bits = encoder.fromNode.bitsTo(encoder.node);
      short count = (short) (encoder.node.getDepth() - encoder.fromNode.getDepth());
      if (verbose != null) {
        verbose.println(String.format("Writing %s forward from %s to %s = %s", count, encoder.fromNode.getDebugString(), encoder.node.getDebugString(), bits));
      }
      encoder.out.writeVarShort(count, 3);
      encoder.out.write(bits);
    }
    else {
      assert (0 == encoder.node.index);
      encoder.out.writeVarShort((short) 0, 3);
    }
  }
1209144
def forward(self, observations):
        
        observations = self.input_block(observations)
        base_output = self.backbone(observations)
        q_values = self.q_head(base_output)
        return q_values
155819
def forward(data, model, mlm_loss, nsp_loss, vocab_size, dtype):
    """"""
    (input_id, masked_id, masked_position, masked_weight, \
     next_sentence_label, segment_id, valid_length) = data
    num_masks = masked_weight.sum() + 1e-8
    valid_length = valid_length.reshape(-1)
    masked_id = masked_id.reshape(-1)
    valid_length_typed = valid_length.astype(dtype, copy=False)
    _, _, classified, decoded = model(input_id, segment_id, valid_length_typed,
                                      masked_position)
    decoded = decoded.reshape((-1, vocab_size))
    ls1 = mlm_loss(decoded.astype('float32', copy=False),
                   masked_id, masked_weight.reshape((-1, 1)))
    ls2 = nsp_loss(classified.astype('float32', copy=False), next_sentence_label)
    ls1 = ls1.sum() / num_masks
    ls2 = ls2.mean()
    ls = ls1 + ls2
    return ls, next_sentence_label, classified, masked_id, decoded, \
           masked_weight, ls1, ls2, valid_length.astype('float32', copy=False)
523063
public static void Forward(double[] data) {

        double[] result = new double[data.length];
        double sum;
        double scale = Math.sqrt(2.0 / data.length);
        for (int f = 0; f < data.length; f++) {
            sum = 0;
            for (int t = 0; t < data.length; t++) {
                double cos = Math.cos(((2.0 * t + 1.0) * f * Math.PI) / (2.0 * data.length));
                sum += data[t] * cos * alpha(f);
            }
            result[f] = scale * sum;
        }
        for (int i = 0; i < data.length; i++) {
            data[i] = result[i];
        }
    }
977182
def forwards(self, orm):
        ""
        for qde_xtf in orm['xtf.QualifiedDublinCoreElement'].objects.all().order_by('id'):
            qde = orm.QualifiedDublinCoreElement()
            qde.content = qde_xtf.content
            qde.term = qde_xtf.term
            qde.qualifier = qde_xtf.qualifier
            #import pdb;pdb.set_trace()
            c= orm['contenttypes.ContentType'].objects.get(pk=qde_xtf.content_type.pk)
            #c.name = qde_xtf.content_type.name
            #c.app_label = qde_xtf.content_type.app_label
            #c.model = qde_xtf.content_type.model
            qde.content_type = c
            #qde.content_type = qde_xtf.content_type
            qde.object_id = qde_xtf.object_id
            qde.save()
        for qdeh_xtf in  orm['xtf.QualifiedDublinCoreElementHistory'].objects.all().order_by('id'):
            qdeh = orm.QualifiedDublinCoreElementHistory()
            qdeh.content = qdeh_xtf.content
            qdeh.term = qdeh_xtf.term
            qdeh.qualifier = qdeh_xtf.qualifier
            c= orm['contenttypes.ContentType'].objects.get(pk=qdeh_xtf.content_type.pk)
            #c.name = qdeh_xtf.content_type.name
            #c.app_label = qdeh_xtf.content_type.app_label
            #c.model = qdeh_xtf.content_type.model
            qdeh.content_type = c
            #qdeh.content_type = qdeh_xtf.content_type
            qdeh.object_id = qdeh_xtf.object_id
            qdeh.qdce = orm['dublincore.QualifiedDublinCoreElement'].objects.get(pk=qdeh_xtf.qdce.pk)
            qdeh.qdce_id_stored = qdeh_xtf.qdce_id_stored
            qdeh.save()
162593
def forwards(apps, schema_editor):
    
    Event = apps.get_model('spectator_events', 'Event')

    for ev in Event.objects.filter(kind='movie'):
        ev.kind = 'cinema'
        ev.save()

    for ev in Event.objects.filter(kind='play'):
        ev.kind = 'theatre'
        ev.save()
476458
def forwards(self, orm):
        ""
        orm['avocado.DataField'].objects.get_or_create(app_name='samples', model_name='batch', field_name='id',
                defaults=dict(published=True, name='Batch', name_plural='Batches'))
281600
def forward(self, inputs, states=None): # pylint: disable=arguments-differ
        """"""
        batch_size = inputs.shape[self._batch_axis]
        skip_states = states is None
        if skip_states:
            states = self.cell.begin_state(batch_size, ctx=inputs.context)
        if isinstance(states, ndarray.NDArray):
            states = [states]
        for state, info in zip(states, self.cell.state_info(batch_size)):
            if state.shape != info['shape']:
                raise ValueError(
                    'Invalid recurrent state shape. Expecting %s, got %s.'%(
                        str(info['shape']), str(state.shape)))
        states = sum(zip(*((j for j in i) for i in states)), ())
        outputs, states = self.cell.unroll(
            inputs.shape[self._axis], inputs, states,
            layout=self._layout, merge_outputs=True)

        if skip_states:
            return outputs
        return outputs, states
1250701
def _forwards(apps, schema_editor):
    
    # Need to work on the actual models here.
    from fluent_contents.plugins.markup.models import LANGUAGE_MODEL_CLASSES
    from fluent_contents.plugins.markup.models import MarkupItem
    from django.contrib.contenttypes.models import ContentType

    ctype = ContentType.objects.get_for_model(MarkupItem)

    for language, proxy_model in LANGUAGE_MODEL_CLASSES.items():
        proxy_ctype = ContentType.objects.get_for_model(proxy_model, for_concrete_model=False)
        MarkupItem.objects.filter(
            polymorphic_ctype=ctype, language=language
        ).update(
            polymorphic_ctype=proxy_ctype
        )