Write your forwards methods here.
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()
1130095
def _forward_iterator(self):
        ""
        path = [(self, 0, Bits())]
        while path:
            node, idx, prefix = path.pop()
            if idx==0 and node.value is not None and not node.prune_value:
                yield (self._unpickle_key(prefix), self._unpickle_value(node.value))
            if idx<len(node.children):
                path.append((node, idx+1, prefix))
                link = node.children[idx]
                if not link.pruned:
                    path.append((link.node, 0, prefix + link.prefix))
444994
public static function forward($methods, $object)
    {
        foreach ((array) $methods as $method) {
            static::extend($method, static::buildForward($method, $object));
        }
    }
902937
def forwards(self, orm):
        ""
        if not db.dry_run:
            for pl in orm['core.Placement'].objects.all():
                pl.listing_set.update(publishable=pl.publishable)
                publishable = pl.publishable
                publishable.publish_from = pl.publish_from
                publishable.static = pl.static
                publishable.publish_to = pl.publish_to
                publishable.save(force_update=True)
760326
private function write()
    {
        ftruncate($this->handle, 0);
        rewind($this->handle);

        fwrite($this->handle, serialize($this->data));
    }
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()
102225
def forwards(self, orm):
        ""
        for category in orm['document_library.DocumentCategory'].objects.all():
            category.is_published = True
            category.save()
155926
def forwards(self, orm):
        ""

        projects = orm['samples.Project'].objects.exclude(name=DEFAULT_PROJECT_NAME)
        for project in projects:
            cohort = orm['samples.Cohort'](name=project.label, autocreated=True)
            cohort.project = project
            cohort.save()
            cohort_bulk_add(orm, cohort, orm['samples.Sample'].objects.filter(project=project).distinct())

        batches = orm['samples.Batch'].objects.select_related('project')
        for batch in batches:
            cohort = orm['samples.Cohort'](name=batch.label, autocreated=True)
            cohort.project = batch.project
            cohort.save()
            cohort_bulk_add(orm, cohort, orm['samples.Sample'].objects.filter(batch=batch).distinct())

        # Populate the default cohort with all samples
        default_cohort = orm['samples.Cohort'].objects.get(name=DEFAULT_COHORT_NAME)
        cohort_bulk_add(orm, default_cohort, orm['samples.Sample'].objects.all())
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()
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()
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()
943391
public function advance(): void
	{
		$this->progress++;

		if($this->progress === $this->items || ($this->progress % $this->redrawRate) === 0)
		{
			$this->draw();
		}
	}
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()
602460
def forwards(self, orm):
        ""
        PERM_CONF = {
            "publish_content": "Can publish content",
            "publish_own_content": "Can publish own content",
            "change_content": "Can change content",
            "promote_content": "Can promote content"
        }
        GROUP_CONF = dict(
            contributor=(),
            author=("publish_own_content",),
            editor=(
                "publish_content",
                "change_content",
                "promote_content",
            ),
            admin=(
                "publish_content",
                "change_content",
                "promote_content",
            )
        )
        content_ct, _ = orm["contenttypes.ContentType"].objects.get_or_create(
            model="content", app_label="content"
        )
        for group_name, group_perms in GROUP_CONF.items():
            group, _ = orm["auth.Group"].objects.get_or_create(
                name=group_name
            )
            for perm_name in group_perms:
                perm, _ = orm["auth.Permission"].objects.get_or_create(
                    content_type=content_ct,
                    codename=perm_name,
                    defaults={
                        "name": PERM_CONF[perm_name]
                    }
                )
                group.permissions.add(perm)
133229
def forward_message(self, *args, **kwargs):
        """"""
        return forward_message(*args, **self._merge_overrides(**kwargs)).run()
1293509
def forwards(apps, schema_editor):
    
    Work = apps.get_model('spectator_events', 'Work')

    for work in Work.objects.all():
        if not work.slug:
            work.slug = generate_slug(work.pk)
            work.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);
        }
    }