<commit_before><?php

namespace Dotdigitalgroup\Email\Helper;

use Dotdigitalgroup\Email\Helper\Config as EmailConfig;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{

    const MODULE_NAME = 'Dotdigitalgroup_Email';
    
    /**
     * @var object
     */
    protected $_context;
    /**
     * @var \Magento\Config\Model\ResourceModel\Config
     */
    protected $_resourceConfig;
    /**
     * @var \Magento\Store\Model\StoreManagerInterface
     */
    protected $_storeManager;
    /**
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $_objectManager;
    /**
     * @var object
     */
    protected $_backendConfig;
    /**
     * @var \Dotdigitalgroup\Email\Model\ContactFactory
     */
    protected $_contactFactory;
    /**
     * @var \Magento\Framework\App\ProductMetadata
     */
    protected $_productMetadata;

    /**
     * @var \Magento\Framework\App\ResourceConnection
     */
    protected $_adapter;

    /**
     * @var \Magento\Store\Model\Store
     */
    protected $_store;


    /**
     * @var \Zend\Log\Logger
     */
    protected $_connectorLogger;

    /**
     * @var
     */
    protected $logFileName = 'connector.log';

    /**
     * @var \Magento\Framework\Module\ModuleListInterface
     */
    protected $_moduleInterface;


    /**
     * @var \Magento\Customer\Model\CustomerFactory
     */
    protected $customerFactory;

    /**
     * @var \Magento\Cron\Model\ScheduleFactory
     */
    protected $_schelduleFactory;

    /**
     * Data constructor.
     *
     * @param \Magento\Framework\App\ProductMetadata      $productMetadata
     * @param \Dotdigitalgroup\Email\Model\ContactFactory $contactFactory
     * @param \Magento\Config\Model\ResourceModel\Config  $resourceConfig
     * @param \Magento\Framework\App\ResourceConnection   $adapter
     * @param \Magento\Framework\App\Helper\Context       $context
     * @param \Magento\Framework\ObjectManagerInterface   $objectManager
     * @param \Magento\Store\Model\StoreManagerInterface  $storeManager
     * @param \Magento\Customer\Model\CustomerFactory     $customerFactory
     * @param \Magento\Backend\Model\Auth\Session         $sessionModel
     * @param \Magento\Store\Model\Store                  $store
     */
    public function __construct(
        \Magento\Framework\App\ProductMetadata $productMetadata,
        \Dotdigitalgroup\Email\Model\ContactFactory $contactFactory,
        \Magento\Config\Model\ResourceModel\Config $resourceConfig,
        \Magento\Framework\App\ResourceConnection $adapter,
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Customer\Model\CustomerFactory $customerFactory,
        \Magento\Framework\Module\ModuleListInterface $moduleListInterface,
        \Magento\Cron\Model\ScheduleFactory $schedule,
        \Magento\Store\Model\Store $store
    ) {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/' . $this->logFileName);
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $this->_connectorLogger = $logger;
        $this->_adapter = $adapter;
        $this->_schelduleFactory = $schedule;
        $this->_productMetadata = $productMetadata;
        $this->_contactFactory = $contactFactory;
        $this->_resourceConfig = $resourceConfig;
        $this->_storeManager = $storeManager;
        $this->_objectManager = $objectManager;
        $this->customerFactory = $customerFactory;
        $this->_moduleInterface = $moduleListInterface;
        $this->_store = $store;

        parent::__construct($context);
    }

    /**
     * Get api creadentials enabled.
     *
     * @param int $website
     *
     * @return bool
     */
    public function isEnabled($website = 0)
    {
        $website = $this->_storeManager->getWebsite($website);
        $enabled = $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_API_ENABLED,<commit_msg>Return false if api is not enabled #100<commit_after><?php

namespace Dotdigitalgroup\Email\Helper;

use Dotdigitalgroup\Email\Helper\Config as EmailConfig;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{

    const MODULE_NAME = 'Dotdigitalgroup_Email';
    
    /**
     * @var object
     */
    protected $_context;
    /**
     * @var \Magento\Config\Model\ResourceModel\Config
     */
    protected $_resourceConfig;
    /**
     * @var \Magento\Store\Model\StoreManagerInterface
     */
    protected $_storeManager;
    /**
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $_objectManager;
    /**
     * @var object
     */
    protected $_backendConfig;
    /**
     * @var \Dotdigitalgroup\Email\Model\ContactFactory
     */
    protected $_contactFactory;
    /**
     * @var \Magento\Framework\App\ProductMetadata
     */
    protected $_productMetadata;

    /**
     * @var \Magento\Framework\App\ResourceConnection
     */
    protected $_adapter;

    /**
     * @var \Magento\Store\Model\Store
     */
    protected $_store;


    /**
     * @var \Zend\Log\Logger
     */
    protected $_connectorLogger;

    /**
     * @var
     */
    protected $logFileName = 'connector.log';

    /**
     * @var \Magento\Framework\Module\ModuleListInterface
     */
    protected $_moduleInterface;


    /**
     * @var \Magento\Customer\Model\CustomerFactory
     */
    protected $customerFactory;

    /**
     * @var \Magento\Cron\Model\ScheduleFactory
     */
    protected $_schelduleFactory;

    /**
     * Data constructor.
     *
     * @param \Magento\Framework\App\ProductMetadata      $productMetadata
     * @param \Dotdigitalgroup\Email\Model\ContactFactory $contactFactory
     * @param \Magento\Config\Model\ResourceModel\Config  $resourceConfig
     * @param \Magento\Framework\App\ResourceConnection   $adapter
     * @param \Magento\Framework\App\Helper\Context       $context
     * @param \Magento\Framework\ObjectManagerInterface   $objectManager
     * @param \Magento\Store\Model\StoreManagerInterface  $storeManager
     * @param \Magento\Customer\Model\CustomerFactory     $customerFactory
     * @param \Magento\Backend\Model\Auth\Session         $sessionModel
     * @param \Magento\Store\Model\Store                  $store
     */
    public function __construct(
        \Magento\Framework\App\ProductMetadata $productMetadata,
        \Dotdigitalgroup\Email\Model\ContactFactory $contactFactory,
        \Magento\Config\Model\ResourceModel\Config $resourceConfig,
        \Magento\Framework\App\ResourceConnection $adapter,
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Customer\Model\CustomerFactory $customerFactory,
        \Magento\Framework\Module\ModuleListInterface $moduleListInterface,
        \Magento\Cron\Model\ScheduleFactory $schedule,
        \Magento\Store\Model\Store $store
    ) {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/' . $this->logFileName);
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $this->_connectorLogger = $logger;
        $this->_adapter = $adapter;
        $this->_schelduleFactory = $schedule;
        $this->_productMetadata = $productMetadata;
        $this->_contactFactory = $contactFactory;
        $this->_resourceConfig = $resourceConfig;
        $this->_storeManager = $storeManager;
        $this->_objectManager = $objectManager;
        $this->customerFactory = $customerFactory;
        $this->_moduleInterface = $moduleListInterface;
        $this->_store = $store;

        parent::__construct($context);
    }

    /**
     * Get api creadentials enabled.
     *
     * @param int $website
     *
     * @return bool
     */
    public function isEnabled($website = 0)
    {
        $website = $this->_storeManager->getWebsite($website);
        $enabled = $this->scopeConfig->isSetFlag(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_API_ENABLED,
{'fraction_non_alphanumeric': 0.12072948328267477, 'fraction_numerical': 0.0006079027355623101, 'mean_word_length': 2.551813471502591, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '5851139', 'n_tokens_mistral': 2333, 'n_tokens_neox': 2340, 'n_words': 360}