<commit_before><?php

include 'vendor/autoload.php';

// Locate the TiVo.
$process   = new Symfony\Component\Process\Process('');
$location  = new JimLind\TiVo\Location($process);
$ipAddress = $location->find();

// Download a list of XML elements.
$ip         = '192.168.0.1';
$mak        = '7678999999';
$guzzle     = new GuzzleHttp\Client();
$nowPlaying = new JimLind\TiVo\NowPlaying($ip, $mak, $guzzle);
$xmlList    = $nowPlaying->download();
$xmlSlice   = array_slice($xmlList, 0, 2);

// Build a list of show models.
$origin   = new JimLind\TiVo\Model\Show();
$factory  = new JimLind\TiVo\Factory\ShowFactory($origin);
$showList = $factory->createFromXmlList($xmlSlice);

// Download the video file.
$show       = array_pop($showList);
$downloader = new JimLind\TiVo\Download($mak, $guzzle);
$downloader->store($show->getURL(), '/tmp/video.tivo');

// Download a portion of the video file.
$downloader->storePreview($show->getURL(), '/tmp/preview.tivo');

// Decode the video file.
$decoder = new JimLind\TiVo\Decode($mak, $process);
$decoder->decode('/tmp/preview.tivo', '/tmp/preview.mpeg');<commit_msg>Update example for ShowListFactory<commit_after><?php

include 'vendor/autoload.php';

// Locate the TiVo.
$process   = new Symfony\Component\Process\Process('');
$location  = new JimLind\TiVo\Location($process);
$ipAddress = $location->find();

// Download a list of XML elements.
$ip         = '192.168.0.1';
$mak        = '7678999999';
$guzzle     = new GuzzleHttp\Client();
$nowPlaying = new JimLind\TiVo\NowPlaying($ip, $mak, $guzzle);
$xmlList    = $nowPlaying->download();
$xmlSlice   = array_slice($xmlList, 0, 2);

// Build a list of show models.
$factory  = new JimLind\TiVo\Factory\ShowListFactory();
$showList = $factory->createShowListFromXmlList($xmlSlice);

// Download the video file.
$show       = array_pop($showList);
$downloader = new JimLind\TiVo\Download($mak, $guzzle);
$downloader->store($show->getURL(), '/tmp/video.tivo');

// Download a portion of the video file.
$downloader->storePreview($show->getURL(), '/tmp/preview.tivo');

// Decode the video file.
$decoder = new JimLind\TiVo\Decode($mak, $process);
$decoder->decode('/tmp/preview.tivo', '/tmp/preview.mpeg');
{'fraction_non_alphanumeric': 0.18095238095238095, 'fraction_numerical': 0.018140589569160998, 'mean_word_length': 4.393643031784841, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6218045', 'n_tokens_mistral': 811, 'n_tokens_neox': 740, 'n_words': 165}