

def public_availability_formatter(v, c, lab, p):
    if lab.publicly_available:
        klass = 'btn-danger'
        msg = gettext('Make not publicly available')
        return Markup(('<form method=\'POST\' action=\'%(url)s\' style="text-align: center">\n                        <input type=\'hidden\' name=\'activate\' value=\'%(activate_value)s\'/>\n                        <input type=\'hidden\' name=\'lab_id\' value=\'%(lab_id)s\'/>\n                        <label> %(texto)s </label>\n                        <input disabled type=\'text\' name=\'public_identifier\' value=\'%(public_identifier)s\' style=\'width: 150px\'/>\n                        <input class=\'btn %(klass)s\' type=\'submit\' value="%(msg)s"></input>\n                    </form>' % dict(url=url_for('.change_public_availability'), activate_value=unicode(lab.publicly_available).lower(), lab_id=p.id, texto=gettext('Public identifier:'), klass=klass, msg=msg, public_identifier=lab.public_identifier)))
    else:
        klass = 'btn-success'
        msg = gettext('Make publicly available')
    return Markup(('<form method=\'POST\' action=\'%(url)s\' style="text-align: center">\n                        <input type=\'hidden\' name=\'activate\' value=\'%(activate_value)s\'/>\n                        <input type=\'hidden\' name=\'lab_id\' value=\'%(lab_id)s\'/>\n                        <label> %(texto)s </label>\n                        <input type=\'text\' name=\'public_identifier\' value=\'%(public_identifier)s\' style=\'width: 150px\'/>\n                        <input class=\'btn %(klass)s\' type=\'submit\' value="%(msg)s"></input>\n                    </form>' % dict(url=url_for('.change_public_availability'), activate_value=unicode(lab.publicly_available).lower(), lab_id=lab.id, texto=gettext('Public identifier:'), klass=klass, msg=msg, public_identifier=lab.public_identifier)))

dataset/ETHPy150Open gateway4labs/labmanager/labmanager/views/admin.py public_availability_formatter/VarMisuse@64/269 `lab`->`p`