INNER CODE UNIT · Python

get_population

cmu-sei/GHOSTS · experimental/grms/grms/main.py:349

async def get_population(country: str, period: str = "current"):
    key = _pop_key(country, period)
    if key not in populations:
        if period != "current":
            raise HTTPException(404, "Population profile not found")
        for k, v in populations.items():
            if k.startswith(f"{country}:"):
                return v
        raise HTTPException(404, "Population profile not found")
    return populations[key]


# --- Prediction ---


class PredictLeaderRequest(BaseModel):
    leader_id: UUID
    event: GeopoliticalEvent

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…