<commit_before># -*- coding: UTF-8 -*-
'''
Splay function calls across targeted minions
'''
import time
from salt.exceptions import CommandExecutionError

_DEFAULT_SPLAYTIME = 600
_DEFAULT_SIZE = 8192


def _get_hash(hashable, size):
    '''
    Jenkins One-At-A-Time Hash Function
    More Info: http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-time
    '''
    # Using bitmask to emulate rollover behavior of C unsigned 32 bit int
    bitmask = 0xffffffff
    h = 0

    for i in bytearray(hashable):
        h = (h + i) & bitmask
        h = (h + (h << 10)) & bitmask
        h = (h ^ (h >> 6)) & bitmask

    h = (h + (h << 3)) & bitmask
    h = (h ^ (h >> 11)) & bitmask
    h = (h + (h << 15)) & bitmask

    return (h & (size - 1)) & bitmask

<commit_msg>Python 3 compat fix for modules/splay.py<commit_after># -*- coding: UTF-8 -*-
'''
Splay function calls across targeted minions
'''

# Import Python Libs
from __future__ import absolute_import
import time

# Import Salt Libs
from salt.exceptions import CommandExecutionError

_DEFAULT_SPLAYTIME = 600
_DEFAULT_SIZE = 8192


def _get_hash(hashable, size):
    '''
    Jenkins One-At-A-Time Hash Function
    More Info: http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-time
    '''
    # Using bitmask to emulate rollover behavior of C unsigned 32 bit int
    bitmask = 0xffffffff
    h = 0

    for i in bytearray(hashable):
        h = (h + i) & bitmask
        h = (h + (h << 10)) & bitmask
        h = (h ^ (h >> 6)) & bitmask

    h = (h + (h << 3)) & bitmask
    h = (h ^ (h >> 11)) & bitmask
    h = (h + (h << 15)) & bitmask

    return (h & (size - 1)) & bitmask


{'fraction_non_alphanumeric': 0.13422007255139057, 'fraction_numerical': 0.02599758162031439, 'mean_word_length': 2.61353711790393, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '2059403', 'n_tokens_mistral': 620, 'n_tokens_neox': 562, 'n_words': 181}