@staticmethod
    def formatter_onaccept(form):

        s3db = current.s3db
        section_id = form.vars.section_id
        stable = s3db.survey_section
        section_name = stable[section_id].name
        if section_name == "Background Information":
            col1 = []
            # Add the default layout
            ttable = s3db.survey_template
            template = ttable[form.vars.template_id]
            if template.competion_qstn != "":
                col1.append("STD-WHO")
            if template.date_qstn != "":
                col1.append("STD-DATE")
            if template.time_qstn != "":
                col1.append("STD-TIME")
            if "location_detail" in template:
                col2 = ["STD-P-Code"]
                location_list = json2py(template.location_detail)
                for loc in location_list:
                    col2.append("STD-%s" % loc)
                col = [col1, col2]
                rule = [{"columns":col}]
                rule_list = json2py(form.vars.rules)
                rule_list[:0] = rule
                rules = json.dumps(rule_list)
                db = current.db
                ftable = db.survey_formatter
                db(ftable.id == form.vars.id).update(rules = rules)

    # -------------------------------------------------------------------------
Format a single Python file and return the formatted code.
dataset/ETHPy150Open sahana/eden/modules/s3db/survey.py/S3SurveyFormatterModel.formatter_onaccept--crossover with--dataset/ETHPy150Open google/yapf/yapf/yapflib/yapf_api.py/FormatFile