Generate the likely value of this census column, based on available information.

@param Individual $individual
@param Individual $head

@return string
503640
public function generate(Individual $individual, Individual $head): string
    {
        switch ($individual->sex()) {
            case 'M':
                return $this->male;
            case 'F':
                return $this->female;
            default:
                return '';
        }
    }
1144659
public function generate(Individual $individual, Individual $head): string
    {
        $birth_date = $individual->getBirthDate();

        if ($birth_date->minimumJulianDay() === $birth_date->maximumJulianDay()) {
            return $birth_date->minimumDate()->format('%j. %F %Y');
        }

        return '';
    }
789765
def _initial_individual(self):
        """"""
        ind = creator.Individual(
            [random.uniform(-1, 1)
             for _ in range(len(self.value_means))])
        return ind
660139
public function updateCensusAssistant(ServerRequestInterface $request, Individual $individual, string $fact_id, string $newged, bool $keep_chan): string
    {
        $ca_title       = $request->get('ca_title', '');
        $ca_place       = $request->get('ca_place', '');
        $ca_citation    = $request->get('ca_citation', '');
        $ca_individuals = (array) $request->get('ca_individuals');
        $ca_notes       = $request->get('ca_notes', '');
        $ca_census      = $request->get('ca_census', '');

        if ($ca_census !== '' && !empty($ca_individuals)) {
            $census = new $ca_census();

            $note_text   = $this->createNoteText($census, $ca_title, $ca_place, $ca_citation, $ca_individuals, $ca_notes);
            $note_gedcom = '0 @@ NOTE ' . str_replace("\n", "\n1 CONT ", $note_text);
            $note        = $individual->tree()->createRecord($note_gedcom);

            $newged .= "\n2 NOTE @" . $note->xref() . '@';

            // Add the census fact to the rest of the household
            foreach (array_keys($ca_individuals) as $xref) {
                if ($xref !== $individual->xref()) {
                    Individual::getInstance($xref, $individual->tree())
                        ->updateFact($fact_id, $newged, !$keep_chan);
                }
            }
        }

        return $newged;
    }
447361
private function summaryData(Individual $individual, Fact $fact): array
    {
        $record = $fact->record();
        $name   = '';
        $url    = '';
        $tag    = $fact->label();

        if ($record instanceof Family) {
            // Marriage
            $spouse = $record->spouse($individual);
            if ($spouse instanceof Individual) {
                $url  = $spouse->url();
                $name = $spouse->fullName();
            }
        } elseif ($record !== $individual) {
            // Birth of a child
            $url  = $record->url();
            $name = $record->fullName();
            $tag  = GedcomTag::getLabel('_BIRT_CHIL', $record);
        }

        return [
            'tag'    => $tag,
            'url'    => $url,
            'name'   => $name,
            'value'  => $fact->value(),
            'date'   => $fact->date()->display(true),
            'place'  => $fact->place(),
            'addtag' => false,
        ];
    }
880517
public function father(Individual $individual): ?Individual
    {
        $family = $individual->primaryChildFamily();

        if ($family) {
            return $family->husband();
        }

        return null;
    }
804693
public function getSosaNumbers(Individual $indi) {
        if(!$this->is_setup) return array();
        return Database::prepare(
                'SELECT majs_sosa, majs_gen FROM `##maj_sosa`'.
                ' WHERE majs_i_id=:indi_id AND majs_gedcom_id=:tree_id AND majs_user_id=:user_id'
            )->execute(array(
                'indi_id' => $indi->getXref(), 
                'tree_id' => $this->tree->getTreeId(), 
                'user_id' => $this->user->getUserId()
            ))->fetchAssoc();
    }
626912
private function getMedia(Individual $individual): array
    {
        if ($this->media_list === null) {
            // Use facts from this individual and all their spouses
            $facts = $individual->facts();
            foreach ($individual->spouseFamilies() as $family) {
                foreach ($family->facts() as $fact) {
                    $facts->push($fact);
                }
            }
            // Use all media from each fact
            $this->media_list = [];
            foreach ($facts as $fact) {
                // Don't show pending edits, as the user just sees duplicates
                if (!$fact->isPendingDeletion()) {
                    preg_match_all('/(?:^1|\n\d) OBJE @(' . Gedcom::REGEX_XREF . ')@/', $fact->gedcom(), $matches);
                    foreach ($matches[1] as $match) {
                        $media = Media::getInstance($match, $individual->tree());
                        if ($media && $media->canShow()) {
                            $this->media_list[] = $media;
                        }
                    }
                }
            }
            // If a media object is linked twice, only show it once
            $this->media_list = array_unique($this->media_list);
            // Sort these using _WT_OBJE_SORT
            $wt_obje_sort = [];
            foreach ($individual->facts(['_WT_OBJE_SORT']) as $fact) {
                $wt_obje_sort[] = trim($fact->value(), '@');
            }
            usort($this->media_list, static function (Media $x, Media $y) use ($wt_obje_sort): int {
                return array_search($x->xref(), $wt_obje_sort, true) - array_search($y->xref(), $wt_obje_sort, true);
            });
        }

        return $this->media_list;
    }
1145515
public static function plural($count, $single, $plural = null)
	{
		if (\is_null($plural)) {
			$plural = $single.'s';
		}
		return $count == 1
			? $single
			: $plural;
	}
671076
private function individualOptions(Individual $individual): array
    {
        $name = strip_tags($individual->fullName());

        if ($individual->sex() === 'F') {
            return [
                'self'              => $name,
                'parents'           => I18N::translate('%s, her parents and siblings', $name),
                'spouses'           => I18N::translate('%s, her spouses and children', $name),
                'ancestors'         => I18N::translate('%s and her ancestors', $name),
                'ancestor_families' => I18N::translate('%s, her ancestors and their families', $name),
                'descendants'       => I18N::translate('%s, her spouses and descendants', $name),
            ];
        }

        return [
            'self'              => $name,
            'parents'           => I18N::translate('%s, his parents and siblings', $name),
            'spouses'           => I18N::translate('%s, his spouses and children', $name),
            'ancestors'         => I18N::translate('%s and his ancestors', $name),
            'ancestor_families' => I18N::translate('%s, his ancestors and their families', $name),
            'descendants'       => I18N::translate('%s, his spouses and descendants', $name),
        ];
    }
654441
protected function nameAtCensusDate(Individual $individual, Date $census_date): array
    {
        $names = $individual->getAllNames();
        $name  = $names[0];

        foreach ($individual->spouseFamilies() as $family) {
            foreach ($family->facts(['MARR']) as $marriage) {
                if ($marriage->date()->isOK() && Date::compare($marriage->date(), $census_date) < 0) {
                    $spouse = $family->spouse($individual);
                    foreach ($names as $individual_name) {
                        foreach ($spouse->getAllNames() as $spouse_name) {
                            if ($individual_name['type'] === '_MARNM' && $individual_name['surn'] === $spouse_name['surn']) {
                                return $individual_name;
                            }
                        }
                    }
                }
            }
        }

        return $name;
    }
358757
public function wife($access_level = null): ?Individual
    {
        $SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS');

        if ($this->wife && ($SHOW_PRIVATE_RELATIONSHIPS || $this->wife->canShowName($access_level))) {
            return $this->wife;
        }

        return null;
    }
132400
protected function chartCompact(Individual $individual, ChartService $chart_service): ResponseInterface
    {
        $ancestors = $chart_service->sosaStradonitzAncestors($individual, 5);

        $html = view('modules/compact-chart/chart', [
            'ancestors' => $ancestors,
            'module'    => $this,
        ]);

        return response($html);
    }
609580
public function historicEventsForIndividual(Individual $individual): Collection
    {
        $min_date = $individual->getEstimatedBirthDate();
        $max_date = $individual->getEstimatedDeathDate();

        return (new Collection($this->historicEventsAll()))
            ->map(static function (string $gedcom) use ($individual): Fact {
                return new Fact($gedcom, $individual, 'histo');
            })
            ->filter(static function (Fact $fact) use ($min_date, $max_date): bool {
                return Date::compare($fact->date(), $min_date) >= 0 && Date::compare($fact->date(), $max_date) <= 0;
            });
    }
917231
public function getSidebarContent(Individual $individual): string
    {
        ob_start();

        foreach ($individual->facts(static::HANDLED_FACTS) as $fact) {
            FunctionsPrintFacts::printFact($fact, $individual);
        }

        $html = ob_get_clean();

        return strip_tags($html, '<a><div><span>');
    }
397602
def individual(self, ind_id):
        """"""
        ind_obj = self.query(Individual).filter_by(ind_id=ind_id).first()
        if ind_obj is None:
            ind_obj = BaseIndividual(ind_id='unknown')
        return ind_obj
181279
public function censusTableRow(CensusInterface $census, Individual $individual, Individual $head): string
    {
        $html = '';
        foreach ($census->columns() as $column) {
            $html .= '<td class="wt-census-assistant-field p-0"><input class="form-control wt-census-assistant-form-control p-0" type="text" value="' . $column->generate($individual, $head) . '" name="ca_individuals[' . $individual->xref() . '][]"></td>';
        }

        return '<tr class="wt-census-assistant-row"><td class="wt-census-assistant-field" hidden>' . $individual->xref() . '</td>' . $html . '<td class="wt-census-assistant-field"><a class="icon-remove" href="#" title="' . I18N::translate('Remove') . '"></a></td></tr>';
    }