<commit_before>from __future__ import print_function, unicode_literals, absolute_import, division
import numpy as np

def pad_to_shape(d, dshape, mode = "constant"):
    """
    pad array d to shape dshape
    """
    if d.shape == dshape:
        return d

    diff = np.array(dshape)- np.array(d.shape)
    #first shrink
    slices  = [slice(-x//2,x//2) if x<0 else slice(None,None) for x in diff]<commit_msg>Get rid of FutureWarning<commit_after>from __future__ import print_function, unicode_literals, absolute_import, division
import numpy as np

def pad_to_shape(d, dshape, mode = "constant"):
    """
    pad array d to shape dshape
    """
    if d.shape == dshape:
        return d

    diff = np.array(dshape)- np.array(d.shape)
    #first shrink
    slices  = tuple(slice(-x//2,x//2) if x<0 else slice(None,None) for x in diff)
{'fraction_non_alphanumeric': 0.11694510739856802, 'fraction_numerical': 0.007159904534606206, 'mean_word_length': 3.2806122448979593, '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': '202209', 'n_tokens_mistral': 285, 'n_tokens_neox': 282, 'n_words': 86}