<commit_before><?php

namespace JimLind\TiVo;

use Exception;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Uri;
use JimLind\TiVo\Characteristic\XmlTrait;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use SimpleXMLElement;

/**
 * Service for downloading a list of shows from a TiVo
 */
class XmlDownloader
{
    use XmlTrait;

    /**
     * @var Uri
     */
    protected $uri;

    /**
     * @var string
     */
    protected $mak;

    /**
     * @var ClientInterface
     */
    protected $guzzle;

    /**
     * @var LoggerInterface
     */
    protected $logger;

    /**
     * @param string          $ip     Your TiVo's IP Address
     * @param string          $mak    Your TiVo's Media Access Key
     * @param ClientInterface $guzzle A Guzzle Client
     */
    public function __construct($ip, $mak, ClientInterface $guzzle)
    {
        $originalUri = new Uri();
        $this->uri  = $originalUri
            ->withScheme('https')
            ->withHost($ip)
            ->withPath('TiVoConnect');

        $this->mak    = $mak;
        $this->guzzle = $guzzle;

        // Default to the NullLogger
        $this->setLogger(new NullLogger());
    }

    /**
     * @param LoggerInterface $logger
     */<commit_msg>Use hip new style<commit_after><?php

namespace JimLind\TiVo;

use Exception;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Uri;
use JimLind\TiVo\Characteristic\XmlTrait;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use SimpleXMLElement;

/**
 * Service for downloading a list of shows from a TiVo
 */
class XmlDownloader
{
    use XmlTrait;

    /**
     * @var Uri
     */
    protected $uri;

    /**
     * @var string
     */
    protected $mak;

    /**
     * @var ClientInterface
     */
    protected $guzzle;

    /**
     * @var LoggerInterface
     */
    protected $logger;

    /**
     * @param string          $ip     Your TiVo's IP Address
     * @param string          $mak    Your TiVo's Media Access Key
     * @param ClientInterface $guzzle A Guzzle Client
     */
    public function __construct($ip, $mak, ClientInterface $guzzle)
    {
        $this->uri = (new Uri)
            ->withScheme('https')
            ->withHost($ip)
            ->withPath('TiVoConnect');

        $this->mak    = $mak;
        $this->guzzle = $guzzle;

        // Default to the NullLogger
        $this->setLogger(new NullLogger());
    }

    /**
     * @param LoggerInterface $logger
     */
{'fraction_non_alphanumeric': 0.11816192560175055, 'fraction_numerical': 0.002188183807439825, 'mean_word_length': 2.234669811320755, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '504380', 'n_tokens_mistral': 909, 'n_tokens_neox': 838, 'n_words': 207}