def METHOD_NAME(self, data):
    state_id = False
    city_id = False
    if data.get("uf") != "":
        state = self.env["res.country.state"].search(
            [
                ("code", "=", data["uf"]),
                ("country_id.code", "=", "BR"),
            ],
            limit=1,
        )
        if state.id:
            state_id = state.id
        if data.get("municipio") != "":
            city = self.env["res.city"].search(
                [
                    ("name", "=ilike", data["municipio"].title()),
                    ("state_id.id", "=", state_id),
                ]
            )
            if len(city) == 1:
                city_id = city.id
    return [state_id, city_id]