<commit_before><?php

/**
 * Special sprintf function for window/unix-compatible quote replacements
 *
 * "%xs" will be replaced by "%s" wrapped in platform-specific quotes and
 * passed through sprintf.
 *
 * @return mixed
 */
function xsprintf()
{
    $args = func_get_args();
    $format = array_shift($args);

    $quote = defined('PHP_WINDOWS_VERSION_MAJOR') ? '"' : '\'';

    $format = str_replace('%xs', $quote . '%s' . $quote, $format);

    array_unshift($args, $format);

    return call_user_func_array('sprintf', $args);
}
<commit_msg>refactor xsprintf to use vsprintf<commit_after><?php

/**
 * Special sprintf function for window/unix-compatible quote replacements
 *
 * "%xs" will be replaced by "%s" wrapped in platform-specific quotes and
 * passed through sprintf.
 *
 * @return mixed
 */
function xsprintf()
{
    $args = func_get_args();
    $format = array_shift($args);

    $quote = defined('PHP_WINDOWS_VERSION_MAJOR') ? '"' : '\'';

    $format = str_replace('%xs', $quote . '%s' . $quote, $format);

    return vsprintf($format, $args);
}

{'fraction_non_alphanumeric': 0.16041275797373358, 'fraction_numerical': 0.0, 'mean_word_length': 3.985981308411215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '663046', 'n_tokens_mistral': 346, 'n_tokens_neox': 346, 'n_words': 88}