human
Complete the below
def area():

    ''''RESTful Controller for Area Model'
    '''

=====
Give me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def prep(r):
        component_name = r.component_name
        if (component_name == 'household'):
            area_location = r.record.location_id
            if area_location:
                gtable = s3db.gis_location
                record = db((gtable.id == area_location)).select(gtable.parent, limitby=(0, 1)).first()
                if record:
                    s3db.po_household.location_id.default = record.parent
        elif (component_name == 'organisation'):
            otable = s3db.org_organisation
            rtable = s3db.po_referral_organisation
            atable = s3db.po_organisation_area
            query = ((rtable.id != None) & ((atable.area_id == None) | (atable.area_id != r.id)))
            left = [rtable.on(((rtable.organisation_id == otable.id) & (rtable.deleted != True))), atable.on(((atable.organisation_id == otable.id) & (atable.deleted != True)))]
            atable.organisation_id.requires = IS_ONE_OF(db(query), 'org_organisation.id', atable.organisation_id.represent, left=left, error_message=T('Agency    is    required'))
        return True
    s3.prep = prep
    return s3_rest_controller(rheader=s3db.po_rheader)