<commit_before><?php
$Smarty->register_object('UIBROWSER', $uiBrowser);
$Smarty->register_object('BROWSE', $uiBrowser->BROWSE);
$Smarty->register_object('HUBBROWSE', $uiBrowser->HUBBROWSE);
$Smarty->register_object('SEARCH', $uiBrowser->SEARCH);
$Smarty->register_object('HUBSEARCH', $uiBrowser->HUBSEARCH);
$Smarty->register_object('TRANSFERS', $uiBrowser->TRANSFERS);
$Smarty->assign_by_ref('PL', $uiBrowser->PLAYLIST);
$Smarty->assign_by_ref('SCHEDULER', $uiBrowser->SCHEDULER);
$Smarty->assign_by_ref('SCRATCHPAD', $uiBrowser->SCRATCHPAD);
$Smarty->assign_by_ref('SUBJECTS', $uiBrowser->SUBJECTS);
$Smarty->assign_by_ref('EXCHANGE', $uiBrowser->EXCHANGE);
$Smarty->assign_by_ref('JSCOM', $jscom);

$Smarty->register_function('str_repeat', 'S_str_repeat');
$Smarty->register_function('tra', 'S_tra');
$Smarty->register_function('getHour', 'S_getHour');
$Smarty->register_function('getMinute', 'S_getMinute');
$Smarty->register_function('getSecond', 'S_getSecond');
$Smarty->register_function('niceTime', 'S_niceTime');

// --- Smarty Extensions ---
/**
 * Repeat given string.
 *
 * @param array $param
 * 		must have the key values "str" and "count"
 * @return string
 * 		repeated string
 */
function S_str_repeat($param)
{
    extract($param);
    return str_repeat($str, intval($count));
} // fn S_str_repeat


/**
 * Translate given string.
 *
 * @param array $in
 * 		array of strings to be outputted translated
 * @return string
 */
function S_tra($in)
{
	echo call_user_func_array('tra', $in);
} // fn S_tra


/**
 * @param array $param
 *      An array with key values named "time" and "pause".
 * @return string
 */
function S_getHour($param)
{
    // input format is HH:MM:SS.dddddd
    extract($param);
    if (empty($time) || !is_string($time)) {
        return 0;
    }
    list($h, $m, $s) = explode(':', $time);
    $h = intval($h);
    $m = intval($m);
    $s = intval($s);
    $curr = mktime($h, $m ,$s);
    if (isset($pause) && $pause) {
        $curr = strtotime(UI_SCHEDULER_PAUSE_PL2PL, $curr);
    }
    return strftime("%H", $curr);
} // fn S_getHour


/**
 * @param array $param
 *      An array with key values named "time" and "pause".
 * @return string
 */
function S_getMinute($param)
{
    // input format is HH:MM:SS.dddddd
    extract($param);
    if (empty($time) || !is_string($time)) {
        return 0;
    }
    list ($h, $m, $s) = explode(':', $time);
    $h = intval($h);
    $m = intval($m);
    $s = intval($s);
    $curr = mktime($h, $m ,$s);
    if (isset($pause) && $pause) {
        $curr = strtotime(UI_SCHEDULER_PAUSE_PL2PL, $curr);
    }
    return strftime("%M", $curr);
} // fn S_getMinute


/**
 * @param array $param
 *      An array with key values named "time" and "pause".
 * @return string
 */
function S_getSecond($param)
{
    // input format is HH:MM:SS.dddddd
    extract($param);
    if (empty($time) || !is_string($time)) {
        return 0;
    }
    list ($h, $m, $s) = explode (':', $time);
    $h = intval($h);
    $m = intval($m);
    $s = intval($s);
    $curr = mktime($h, $m ,$s);
    if (isset($pause) && $pause) {
        $curr = strtotime(UI_SCHEDULER_PAUSE_PL2PL, $curr);
    }
    return strftime("%S", $curr);
} // fn S_getSecond


/**
 * @param array $param
 *      Array with a key value "in".
 * @return string
 */
function S_niceTime($param)
{
    require_once("../../../storageServer/var/Playlist.php");
    
    $sec = round(Playlist::playlistTimeToSeconds($param['in']));
   
    $hours = $sec / 3600;
    $mins = ($sec % 3600) / 60;
    $secs = (($sec % 3600) % 60);
    
    if(intval($hours))
        return sprintf("%02d:%02d:%02d", $hours, $mins, $secs);
    else
        return sprintf("%02d:%02d", $mins, $secs);
    
} // fn S_niceTime
?><commit_msg>Fixed include path for new dir structure.<commit_after><?php
$Smarty->register_object('UIBROWSER', $uiBrowser);
$Smarty->register_object('BROWSE', $uiBrowser->BROWSE);
$Smarty->register_object('HUBBROWSE', $uiBrowser->HUBBROWSE);
$Smarty->register_object('SEARCH', $uiBrowser->SEARCH);
$Smarty->register_object('HUBSEARCH', $uiBrowser->HUBSEARCH);
$Smarty->register_object('TRANSFERS', $uiBrowser->TRANSFERS);
$Smarty->assign_by_ref('PL', $uiBrowser->PLAYLIST);
$Smarty->assign_by_ref('SCHEDULER', $uiBrowser->SCHEDULER);
$Smarty->assign_by_ref('SCRATCHPAD', $uiBrowser->SCRATCHPAD);
$Smarty->assign_by_ref('SUBJECTS', $uiBrowser->SUBJECTS);
$Smarty->assign_by_ref('EXCHANGE', $uiBrowser->EXCHANGE);
$Smarty->assign_by_ref('JSCOM', $jscom);

$Smarty->register_function('str_repeat', 'S_str_repeat');
$Smarty->register_function('tra', 'S_tra');
$Smarty->register_function('getHour', 'S_getHour');
$Smarty->register_function('getMinute', 'S_getMinute');
$Smarty->register_function('getSecond', 'S_getSecond');
$Smarty->register_function('niceTime', 'S_niceTime');

// --- Smarty Extensions ---
/**
 * Repeat given string.
 *
 * @param array $param
 * 		must have the key values "str" and "count"
 * @return string
 * 		repeated string
 */
function S_str_repeat($param)
{
    extract($param);
    return str_repeat($str, intval($count));
} // fn S_str_repeat


/**
 * Translate given string.
 *
 * @param array $in
 * 		array of strings to be outputted translated
 * @return string
 */
function S_tra($in)
{
	echo call_user_func_array('tra', $in);
} // fn S_tra


/**
 * @param array $param
 *      An array with key values named "time" and "pause".
 * @return string
 */
function S_getHour($param)
{
    // input format is HH:MM:SS.dddddd
    extract($param);
    if (empty($time) || !is_string($time)) {
        return 0;
    }
    list($h, $m, $s) = explode(':', $time);
    $h = intval($h);
    $m = intval($m);
    $s = intval($s);
    $curr = mktime($h, $m ,$s);
    if (isset($pause) && $pause) {
        $curr = strtotime(UI_SCHEDULER_PAUSE_PL2PL, $curr);
    }
    return strftime("%H", $curr);
} // fn S_getHour


/**
 * @param array $param
 *      An array with key values named "time" and "pause".
 * @return string
 */
function S_getMinute($param)
{
    // input format is HH:MM:SS.dddddd
    extract($param);
    if (empty($time) || !is_string($time)) {
        return 0;
    }
    list ($h, $m, $s) = explode(':', $time);
    $h = intval($h);
    $m = intval($m);
    $s = intval($s);
    $curr = mktime($h, $m ,$s);
    if (isset($pause) && $pause) {
        $curr = strtotime(UI_SCHEDULER_PAUSE_PL2PL, $curr);
    }
    return strftime("%M", $curr);
} // fn S_getMinute


/**
 * @param array $param
 *      An array with key values named "time" and "pause".
 * @return string
 */
function S_getSecond($param)
{
    // input format is HH:MM:SS.dddddd
    extract($param);
    if (empty($time) || !is_string($time)) {
        return 0;
    }
    list ($h, $m, $s) = explode (':', $time);
    $h = intval($h);
    $m = intval($m);
    $s = intval($s);
    $curr = mktime($h, $m ,$s);
    if (isset($pause) && $pause) {
        $curr = strtotime(UI_SCHEDULER_PAUSE_PL2PL, $curr);
    }
    return strftime("%S", $curr);
} // fn S_getSecond


/**
 * @param array $param
 *      Array with a key value "in".
 * @return string
 */
function S_niceTime($param)
{
    require_once("../backend/Playlist.php");

    $sec = round(Playlist::playlistTimeToSeconds($param['in']));

    $hours = $sec / 3600;
    $mins = ($sec % 3600) / 60;
    $secs = (($sec % 3600) % 60);

    if(intval($hours))
        return sprintf("%02d:%02d:%02d", $hours, $mins, $secs);
    else
        return sprintf("%02d:%02d", $mins, $secs);

} // fn S_niceTime
?>
{'fraction_non_alphanumeric': 0.19687458260985707, 'fraction_numerical': 0.008548150126886603, 'mean_word_length': 3.6625155666251556, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '7201492', 'n_tokens_mistral': 2915, 'n_tokens_neox': 2805, 'n_words': 576}