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

@param Individual $individual
@param Individual $head

@return string
345324
public function generate(Individual $individual, Individual $head): string
    {
        $mother = $this->mother($individual);

        if ($mother && $this->lastPartOfPlace($mother->getBirthPlace()->gedcomName()) !== $this->place()) {
            return 'Y';
        }

        return '';
    }
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;
    }
969202
public function generate(Individual $individual, Individual $head): string
    {
        $family = $this->spouseFamily($individual);
        $sex    = $individual->sex();

        if ($family === null || $family->facts(['MARR'])->isEmpty()) {
            if ($this->isChild($individual)) {
                return $this->conditionChild($sex);
            }

            return $this->conditionSingle($sex);
        }

        if ($family->facts(['DIV'])->isNotEmpty()) {
            return $this->conditionDivorced($sex);
        }

        $spouse = $family->spouse($individual);
        if ($spouse instanceof Individual && $this->isDead($spouse)) {
            return $this->conditionWidowed($sex);
        }

        return $this->conditionMarried($sex);
    }
266446
public function generate(Individual $individual, Individual $head): string
    {
        $birth_jd  = $individual->getBirthDate()->julianDay();
        $census_jd = $this->date()->julianDay();
        if ($birth_jd <= $census_jd && $birth_jd >= $census_jd - 365) {
            // Use the GEDCOM month, as we need this in English - for the US census
            return ucfirst(strtolower($individual->getBirthDate()->minimumDate()->format('%O')));
        }

        return '';
    }
267883
public function generate(Individual $individual, Individual $head): string
    {
        $father = $this->father($individual);

        if ($father && $this->lastPartOfPlace($father->getBirthPlace()->gedcomName()) !== $this->place()) {
            return 'Y';
        }

        return '';
    }
299170
protected function getLineageRootIndividual(Individual $indi) {
		$is_first=false;
		$dindi = new \MyArtJaub\Webtrees\Individual($indi);
		$indi_surname=$dindi->getUnprotectedPrimarySurname();
		$resIndi = $indi;
		while(!$is_first){
			//Get the individual parents family
			$fam=$resIndi->getPrimaryChildFamily();
			if($fam){
				$husb=$fam->getHusband();
				$wife=$fam->getWife();
				//If the father exists, take him
				if($husb){
					$dhusb = new \MyArtJaub\Webtrees\Individual($husb);
					$dhusb->isNewAddition() ? $is_first = true : $resIndi=$husb;
				}
				//If only a mother exists
				else if($wife){
					$dwife = new \MyArtJaub\Webtrees\Individual($wife);
					$wife_surname=$dwife->getUnprotectedPrimarySurname();
					//Check if the child is a natural child of the mother (based on the surname - Warning : surname must be identical)
					if(!$dwife->isNewAddition() && I18N::strcasecmp($wife_surname, $indi_surname) == 0){
						$resIndi=$wife;
					}
					else{
						$is_first=true;
					}
				}
				else{
					$is_first=true;
				}
			}
			else{
				$is_first=true;
			}
		}
		if(isset($this->used_indis[$resIndi->getXref()])){
			return null;
		}
		else{
			return $resIndi;
		}
	}
94120
def individual(self, ind_id=None):
        
        for ind_obj in self.individual_objs:
            if ind_obj.ind_id == ind_id:
                return ind_obj
        return None
789765
def _initial_individual(self):
        """"""
        ind = creator.Individual(
            [random.uniform(-1, 1)
             for _ in range(len(self.value_means))])
        return ind
638736
private function isChild(Individual $individual): bool
    {
        $age = Date::getAgeYears($individual->getEstimatedBirthDate(), $this->date());

        return $age < $this->age_adult;
    }
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>';
    }
419361
public function generate(Individual $individual, Individual $head): string
    {
        foreach ($individual->spouseFamilies() as $family) {
            foreach ($family->facts(['MARR']) as $fact) {
                $marriage_jd = $fact->date()->julianDay();
                $census_jd   = $this->date()->julianDay();
                if ($marriage_jd <= $census_jd && $marriage_jd >= $census_jd - 365) {
                    // Use the GEDCOM month, as we need this in English - for the US census
                    return ucfirst(strtolower($fact->date()->minimumDate()->format('%O')));
                }
            }
        }

        return '';
    }
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);
    }
941508
public function individualBoxMenuFamilyLinks(Individual $individual): array
    {
        $menus = [];

        foreach ($individual->spouseFamilies() as $family) {
            $menus[] = new Menu('<strong>' . I18N::translate('Family with spouse') . '</strong>', $family->url());
            $spouse  = $family->spouse($individual);
            if ($spouse && $spouse->canShowName()) {
                $menus[] = new Menu($spouse->fullName(), $spouse->url());
            }
            foreach ($family->children() as $child) {
                if ($child->canShowName()) {
                    $menus[] = new Menu($child->fullName(), $child->url());
                }
            }
        }

        return $menus;
    }
503640
public function generate(Individual $individual, Individual $head): string
    {
        switch ($individual->sex()) {
            case 'M':
                return $this->male;
            case 'F':
                return $this->female;
            default:
                return '';
        }
    }
988820
public function spouse(Individual $person, $access_level = null): ?Individual
    {
        if ($person === $this->wife) {
            return $this->husband($access_level);
        }

        return $this->wife($access_level);
    }
317370
public function getCurrentSpouse(): ?Individual
    {
        $family = $this->spouseFamilies()->last();

        if ($family instanceof Family) {
            return $family->spouse($this);
        }

        return null;
    }
82866
public function generate(Individual $individual, Individual $head): string
    {
        return $this->lastPartOfPlace(parent::generate($individual, $head));
    }