human
Give me a the Python code you requested given the following:
Complete the below
def group():

    ''''REST controller to register families and other groups'
    '''
assistant
#Here is the Python code you requested.
    evr_group_types = settings.get_evr_group_types()
    def prep(r):
        resource = r.resource
        if (not r.component):
            FS = s3base.S3FieldSelector
            query = ((FS('system') == False) & FS('group_type').belongs(evr_group_types.keys()))
            resource.add_filter(query)
            resource.configure(create_next=URL(f='group', args=['[id]', 'group_membership']), list_fields=['id', 'name', 'description', 'group_type', 'group_membership.person_id', (T('Contact'), 'contact.value')])
            if r.interactive:
                resource.table.group_type.requires = IS_IN_SET(evr_group_types, zero=None)
        component = r.component
        if (component and (component.name == 'group_membership')):
            component.configure(list_fields=['id', 'group_id$name', 'group_id$description', 'group_id$group_type', 'person_id', 'person_id$date_of_birth', 'group_head'], listadd=False)
        return True
    s3.prep = prep
    def postp(r, output):
        if r.interactive:
            component = r.component
            if (not component):
                update_url = URL(args=['[id]', 'group_membership'])
            elif ((component.name == 'group_membership') and (not r.method)):
                buttons = output.get('buttons', {})
                buttons['add_btn'] = A(T('Add    Members'), _href=r.url(component='', method='add_members'), _class='action-btn    add')
                output['buttons'] = buttons
        return output
    s3.postp = postp
    output = s3_rest_controller('pr', 'group', rheader=s3db.evr_rheader)
    return output