Write your forwards methods here.
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()
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)
91100
def forwards(apps, schema_editor):
    
    Event = apps.get_model('spectator_events', 'Event')

    for ev in Event.objects.filter(kind='exhibition'):
        ev.kind = 'museum'
        ev.save()
43867
private void advance() {
        if (current == null || !current.hasNext()) {
            do {
                current = iters.poll();
            } while (current != null && !current.hasNext());
        }
    }
1273499
public void forward(MessageEnvelope envelope) {
		List<FbBot> bots = FbBotMillContext.getInstance().getRegisteredBots();
		for (FbBot b : bots) {
			b.processMessage(envelope);
		}
	}
246256
def forward(self, is_train=False):
        """"""
        for texec in self.train_execs:
            texec.forward(is_train=is_train)
899536
def forwards(self, orm):
        ""
        for doc in orm['document_library.Document'].objects.all():
            for title in doc.documenttitle_set.all():
                title.is_published = doc.is_published
                title.save()
513902
def forwards(self, orm):
        ""
        orm['samples.Cohort'].objects.filter(autocreated=True, batch__isnull=False).delete()
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);
        }
    }
331043
def forwards(self, orm):
        ""

        Project = orm['samples.Project']
        Cohort = orm['samples.Cohort']

        now = datetime.datetime.now()

        # Create default project
        try:
            project = Project.objects.get(name=DEFAULT_PROJECT_NAME)
        except Project.DoesNotExist:
            project = Project(name=DEFAULT_PROJECT_NAME,
                label=DEFAULT_PROJECT_NAME, created=now, modified=now)
            project.save()

        # Create default cohort
        try:
            cohort = Cohort.objects.get(name=DEFAULT_COHORT_NAME)
        except Cohort.DoesNotExist:
            cohort = Cohort(name=DEFAULT_COHORT_NAME, published=True,
                autocreated=True, created=now, modified=now)
            cohort.save()
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)
772018
def forward(self, speed=1):
        
        self.left_motor.forward(speed)
        self.right_motor.forward(speed)
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])
1061678
def forwards(self, orm):
        ""
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        for category in orm['document_library.DocumentCategory'].objects.all():
            category.slug = category.documentcategorytitle_set.all()[0].title.lower()
            category.save()
823707
def write(self, fp):
        """"""
        if self._defaults:
            fp.write("[%s]\n" % DEFAULTSECT)
            for (key, value) in self._defaults.items():
                fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
            fp.write("\n")
        for section in self._sections:
            fp.write("[%s]\n" % section)
            for (key, value) in self._sections[section].items():
                if key == "__name__":
                    continue
                if (value is not None) or (self._optcre == self.OPTCRE):
                    key = " = ".join((key, str(value).replace('\n', '\n\t')))
                fp.write("%s\n" % (key))
            fp.write("\n")
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
        )
430532
def forwards(self, orm):
        ""
        # Note: Don't use "from appname.models import ModelName". 
        # Use orm.ModelName to refer to models in this application,
        # and orm['appname.ModelName'] for models in other applications.
        from account_keeping.models import Invoice
        for invoice in Invoice.objects.all():
            invoice.save()