def contact():

    # CRUD pre-process
    def prep(r):
        person_id = get_vars.get("person", None)
        if person_id:
            # Coming from s3.contacts.js [s3db.pr_Contacts()]
            # Lookup the controller
            controller = get_vars.get("controller", "pr")
            # Lookup the access
            access = get_vars.get("access", None)
            if access is None:
                method = "contacts"
            elif access == "1":
                method = "private_contacts"
            elif access == "2":
                method = "public_contacts"
            s3db.configure("pr_contact",
                           create_next = URL(c=controller,
                                             f="person",
                                             args=[person_id, method]),
                           update_next = URL(c=controller,
                                             f="person",
                                             args=[person_id, method])
                           )
            if r.method == "create":
                table = s3db.pr_person
                pe_id = db(table.id == person_id).select(table.pe_id,
                                                         limitby=(0, 1)
                                                         ).first().pe_id
                table = s3db.pr_contact
                table.pe_id.default = pe_id
                # Public or Private?
                if access:
                    table.access.default = access
        else:
            field = s3db.pr_contact.pe_id
            if r.method in ("create", "create.popup"):
                # Coming from Profile page
                pe_id = get_vars.get("~.pe_id", None)
                if pe_id:
                    field.default = pe_id
                else:
                    field.label = T("Entity")
                    field.readable = field.writable = True
            else:
                # @ToDo: Document which workflow uses this?
                field.label = T("Entity")
                field.readable = field.writable = True
                from s3 import S3TextFilter, S3OptionsFilter
                filter_widgets = [S3TextFilter(["value",
                                                "comments",
                                                ],
                                               label = T("Search"),
                                               comment = T("You can search by value or comments."),
                                               ),
                                  S3OptionsFilter("contact_method"),
                                  ]
                s3db.configure("pr_contact",
                               filter_widgets = filter_widgets,
                               )

        return True
    s3.prep = prep

    output = s3_rest_controller()
    return output

# -----------------------------------------------------------------------------
Remove any unnecessary local security group info or unused ipsets.
dataset/ETHPy150Open sahana/eden/controllers/pr.py/contact--crossover with--dataset/ETHPy150Open openstack/neutron/neutron/agent/linux/iptables_firewall.py/IptablesFirewallDriver._remove_unused_security_group_info