def METHOD_NAME(
    self, *, readonly: bool, force_master: bool = True
) -> DBConnectionContext:
    assert "readonly" not in self.db_cfg, "readonly is picked by the caller"
    assert "force_master" not in self.db_cfg, "force_master is picked by the caller"
    # pyre-fixme [9]: Technically could be any `Pluggable`, but we use it as
    # a DBConnectionContext
    conn_ctx: DBConnectionContext = DBConnectionContext.from_json(
        {**self.db_cfg, "readonly": readonly, "force_master": force_master}
    )
    return conn_ctx