<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_county_estimate(self, table, variable, code, datum):
 """ Creates new estimate from a census series. Data has following signature from API: { 'B00001_001E': '5373', 'NAME': 'Anderson County, Texas', 'county': '001', 'state': '48' } """

        try:
            division = Division.objects.get(
                code="{}{}".format(datum["state"], datum["county"]),
                level=self.COUNTY_LEVEL,
            )
            CensusEstimate.objects.update_or_create(
                division=division,
                variable=variable,
                defaults={"estimate": datum[code] or 0},
            )
        except ObjectDoesNotExist:
            print("ERROR: {}, {}".format(datum["NAME"], datum["state"]))