<commit_before><?php

namespace Dotdigitalgroup\Email\Block\Adminhtml\Contact;


class Grid extends \Magento\Backend\Block\Widget\Grid\Extended
{

    /**
     * @var \Magento\Framework\Module\Manager
     */
    protected $moduleManager;

    protected $_gridFactory;
    protected $_storeFactory;
    protected $_importerFactory;


    /**
     * Grid constructor.
     *
     * @param \Dotdigitalgroup\Email\Model\Resource\Contact\CollectionFactory       $collectionFactory
     * @param \Dotdigitalgroup\Email\Model\Adminhtml\Source\Contact\ImportedFactory $importerFactory
     * @param \Magento\Backend\Block\Template\Context                               $context
     * @param \Magento\Backend\Helper\Data                                          $backendHelper
     * @param \Magento\Store\Model\System\StoreFactory                              $storeFactory
     * @param \Dotdigitalgroup\Email\Model\ContactFactory                           $gridFactory
     * @param \Magento\Framework\Module\Manager                                     $moduleManager
     * @param array                                                                 $data
     */
    public function __construct(
        \Dotdigitalgroup\Email\Model\Resource\Contact\CollectionFactory $collectionFactory,
        \Dotdigitalgroup\Email\Model\Adminhtml\Source\Contact\ImportedFactory $importerFactory,
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Backend\Helper\Data $backendHelper,
        \Magento\Store\Model\System\StoreFactory $storeFactory,
        \Dotdigitalgroup\Email\Model\ContactFactory $gridFactory,
        \Magento\Framework\Module\Manager $moduleManager,
        array $data = []
    ) {
        $this->_collectionFactory = $collectionFactory;
        $this->_contactFactory    = $gridFactory;
        $this->_importerFactory   = $importerFactory;
        $this->moduleManager      = $moduleManager;
        $this->_storeFactory      = $storeFactory;
        parent::__construct($context, $backendHelper, $data);
    }

    /**
     * @return void
     */
    protected function _construct()
    {
        parent::_construct();
        $this->setId('contact');
        $this->setDefaultSort('email_contact_id');
        $this->setDefaultDir('DESC');
    }

    /**
     * @return $this
     */
    protected function _prepareCollection()
    {
        $this->setCollection($this->_collectionFactory->create());

        return parent::_prepareCollection();
    }

    /**
     *
     * @return $this
     * @throws \Exception
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    protected function _prepareColumns()
    {
        $this->addColumn(
            'email_contact_id',
            [
                'header'           => __('Contact ID'),
                'type'             => 'number',
                'index'            => 'email_contact_id',
                'header_css_class' => 'col-id',
                'column_css_class' => 'col-id'
            ]
        )->addColumn(
            'email',
            [
                'header' => __('Email'),
                'type'   => 'text',
                'index'  => 'email',
                'class'  => 'xxx'
            ]
        )->addColumn(
            'customer_id',
            [
                'header' => __('Customer ID'),
                'type'   => 'number',
                'index'  => 'customer_id'
            ]
        )->addColumn(
            'is_guest',
            [
                'header'  => __('Is Guest'),
                'type'    => 'options',
                'index'   => 'is_guest',
                'options' => ['0' => 'Guest', '1' => 'Not Guest']
            ]
        )->addColumn(
            'is_subscriber',
            [
                'header'  => __('Is Subscriber'),
                'index'   => 'is_subscriber',
                'type'    => 'options',
                'options' => ['0' => 'Not Subscriber', '1' => 'Subscriber'],
                'escape'  => true
            ]
        )->addColumn('subscriber_status', [<commit_msg>Not Guest = Guest #42<commit_after><?php

namespace Dotdigitalgroup\Email\Block\Adminhtml\Contact;


class Grid extends \Magento\Backend\Block\Widget\Grid\Extended
{

    /**
     * @var \Magento\Framework\Module\Manager
     */
    protected $moduleManager;

    protected $_gridFactory;
    protected $_storeFactory;
    protected $_importerFactory;


    /**
     * Grid constructor.
     *
     * @param \Dotdigitalgroup\Email\Model\Resource\Contact\CollectionFactory       $collectionFactory
     * @param \Dotdigitalgroup\Email\Model\Adminhtml\Source\Contact\ImportedFactory $importerFactory
     * @param \Magento\Backend\Block\Template\Context                               $context
     * @param \Magento\Backend\Helper\Data                                          $backendHelper
     * @param \Magento\Store\Model\System\StoreFactory                              $storeFactory
     * @param \Dotdigitalgroup\Email\Model\ContactFactory                           $gridFactory
     * @param \Magento\Framework\Module\Manager                                     $moduleManager
     * @param array                                                                 $data
     */
    public function __construct(
        \Dotdigitalgroup\Email\Model\Resource\Contact\CollectionFactory $collectionFactory,
        \Dotdigitalgroup\Email\Model\Adminhtml\Source\Contact\ImportedFactory $importerFactory,
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Backend\Helper\Data $backendHelper,
        \Magento\Store\Model\System\StoreFactory $storeFactory,
        \Dotdigitalgroup\Email\Model\ContactFactory $gridFactory,
        \Magento\Framework\Module\Manager $moduleManager,
        array $data = []
    ) {
        $this->_collectionFactory = $collectionFactory;
        $this->_contactFactory    = $gridFactory;
        $this->_importerFactory   = $importerFactory;
        $this->moduleManager      = $moduleManager;
        $this->_storeFactory      = $storeFactory;
        parent::__construct($context, $backendHelper, $data);
    }

    /**
     * @return void
     */
    protected function _construct()
    {
        parent::_construct();
        $this->setId('contact');
        $this->setDefaultSort('email_contact_id');
        $this->setDefaultDir('DESC');
    }

    /**
     * @return $this
     */
    protected function _prepareCollection()
    {
        $this->setCollection($this->_collectionFactory->create());

        return parent::_prepareCollection();
    }

    /**
     *
     * @return $this
     * @throws \Exception
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    protected function _prepareColumns()
    {
        $this->addColumn(
            'email_contact_id',
            [
                'header'           => __('Contact ID'),
                'type'             => 'number',
                'index'            => 'email_contact_id',
                'header_css_class' => 'col-id',
                'column_css_class' => 'col-id'
            ]
        )->addColumn(
            'email',
            [
                'header' => __('Email'),
                'type'   => 'text',
                'index'  => 'email',
                'class'  => 'xxx'
            ]
        )->addColumn(
            'customer_id',
            [
                'header' => __('Customer ID'),
                'type'   => 'number',
                'index'  => 'customer_id'
            ]
        )->addColumn(
            'is_guest',
            [
                'header'  => __('Is Guest'),
                'type'    => 'options',
                'index'   => 'is_guest',
                'options' => ['1' => 'Guest', '' => 'Not Guest']
            ]
        )->addColumn(
            'is_subscriber',
            [
                'header'  => __('Is Subscriber'),
                'index'   => 'is_subscriber',
                'type'    => 'options',
                'options' => ['0' => 'Not Subscriber', '1' => 'Subscriber'],
                'escape'  => true
            ]
        )->addColumn('subscriber_status', [
{'fraction_non_alphanumeric': 0.12795107033639144, 'fraction_numerical': 0.0011009174311926607, 'mean_word_length': 1.570260924237661, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7297570', 'n_tokens_mistral': 2181, 'n_tokens_neox': 2118, 'n_words': 334}