<commit_before>import numpy as np

from .network import autoencoder, get_encoder
from .io import read_text, load_model


def encode(data, model, output_file=None, reduced=False):
    size = data.shape[1]

    assert model.input_shape[1] == size, \
           'Input size of data and pretrained model must be same'

    if reduced:
        #FIXME
        encoder = get_encoder(model)
        predictions = encoder.predict(data)
    else:
        predictions = model.predict(data)<commit_msg>Fix argument name in encode module<commit_after>import numpy as np

from .network import mlp, get_encoder
from .io import read_text, load_model


def encode(data, model, output_file=None, reduced=False):
    size = data.shape[1]

    assert model.input_shape[1] == size, \
           'Input size of data and pretrained model must be same'

    if reduced:
        #FIXME
        encoder = get_encoder(model)
        predictions = encoder.predict(data)
    else:
        predictions = model.predict(data)
{'fraction_non_alphanumeric': 0.08459214501510574, 'fraction_numerical': 0.004028197381671702, 'mean_word_length': 3.040650406504065, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1509828', 'n_tokens_mistral': 294, 'n_tokens_neox': 286, 'n_words': 92}