<commit_before><?php

function smarty_block_form($params, $content, Smarty_Internal_Template $template, $open) {
    /** @var CM_Frontend_Render $render */
    $render = $template->smarty->getTemplateVars('render');
    $frontend = $render->getGlobalResponse();
    if ($open) {
        $form = CM_Form_Abstract::factory($params['name'], $params);
        $viewResponse = new CM_Frontend_ViewResponse($form);
        $form->prepare($render->getEnvironment(), $viewResponse);

        $frontend->treeExpand($viewResponse);
        return '';
    } else {
        $viewResponse = $frontend->getClosestViewResponse('CM_Form_Abstract');
        if (null === $viewResponse) {
            throw new CM_Exception_Invalid('Cannot find `CM_Form_Abstract` within frontend tree.');
        }
        /** @var CM_Form_Abstract $form */
        $form = $viewResponse->getView();

        $cssClasses = $viewResponse->getCssClasses();
        $cssClasses[] = $form->getName();
        $html = '<form id="' . $viewResponse->getAutoId() . '" class="' .
            implode(' ', $cssClasses) . ' clearfix" method="post" action="" onsubmit="return false;" novalidate >';
        if ($form->getAvoidPasswordManager()) {
            $html .= '<input style="display:none" type="text" name="fakeusernameremembered">';
            $html .= '<input style="display:none" type="password" name="fakepasswordremembered">';
        }

        $html .= $content;

        foreach ($form->getFields() as $field) {
            if ($field instanceof CM_FormField_Hidden) {
                $renderAdapter = new CM_RenderAdapter_FormField($render, $field);
                $html .= $renderAdapter->fetch(CM_Params::factory());
            }
        }
        foreach ($form->getActions() as $actionName => $action) {
            $viewResponse->getJs()->append("this.registerAction('{$actionName}', {$action->js_presentation()});");
        }
        $html .= '</form>';

        $frontend->treeCollapse();
        return $html;<commit_msg>remove unnecessary "clearfix" css class<commit_after><?php

function smarty_block_form($params, $content, Smarty_Internal_Template $template, $open) {
    /** @var CM_Frontend_Render $render */
    $render = $template->smarty->getTemplateVars('render');
    $frontend = $render->getGlobalResponse();
    if ($open) {
        $form = CM_Form_Abstract::factory($params['name'], $params);
        $viewResponse = new CM_Frontend_ViewResponse($form);
        $form->prepare($render->getEnvironment(), $viewResponse);

        $frontend->treeExpand($viewResponse);
        return '';
    } else {
        $viewResponse = $frontend->getClosestViewResponse('CM_Form_Abstract');
        if (null === $viewResponse) {
            throw new CM_Exception_Invalid('Cannot find `CM_Form_Abstract` within frontend tree.');
        }
        /** @var CM_Form_Abstract $form */
        $form = $viewResponse->getView();

        $cssClasses = $viewResponse->getCssClasses();
        $cssClasses[] = $form->getName();
        $html = '<form id="' . $viewResponse->getAutoId() . '" class="' .
            implode(' ', $cssClasses) . '" method="post" action="" onsubmit="return false;" novalidate >';
        if ($form->getAvoidPasswordManager()) {
            $html .= '<input style="display:none" type="text" name="fakeusernameremembered">';
            $html .= '<input style="display:none" type="password" name="fakepasswordremembered">';
        }

        $html .= $content;

        foreach ($form->getFields() as $field) {
            if ($field instanceof CM_FormField_Hidden) {
                $renderAdapter = new CM_RenderAdapter_FormField($render, $field);
                $html .= $renderAdapter->fetch(CM_Params::factory());
            }
        }
        foreach ($form->getActions() as $actionName => $action) {
            $viewResponse->getJs()->append("this.registerAction('{$actionName}', {$action->js_presentation()});");
        }
        $html .= '</form>';

        $frontend->treeCollapse();
        return $html;
{'fraction_non_alphanumeric': 0.16795031055900622, 'fraction_numerical': 0.0, 'mean_word_length': 2.9625984251968505, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '117164', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1111, 'n_words': 206}