def METHOD_NAME(postcode):
    postcode = postcode.without_space
    # list of addresses
    if postcode == "AA11AA":
        return StubGeocoder(
            Point(0.22247314453125, 53.149405955929744, srid=4326), "X01000001"
        )
    # council with no data
    if postcode == "BB11BB":
        return StubGeocoder(
            Point(-3.54583740234375, 52.019712234868464, srid=4326), "X01000002"
        )
    # polling station 1
    if postcode == "CC11CC":
        return StubGeocoder(
            Point(-2.1533203125, 52.858517622387716, srid=4326), "X01000001"
        )
    # no council
    if postcode == "DD11DD":
        return StubGeocoder(Point(-4.6142578125, 57.45913526799062, srid=4326), None)
    if postcode == "FOOBAR":
        raise PostcodeError("oh noes!!")
    return None