def preprocessing_helper(tokens, embeddings, e, combine_with):
    index = 0
    avg_embeddings = []
    index = tokens.index(e)
    (first, last) = (False, False)
    if ((index - 1) == (- 1)):
        first = True
    if ((index + 1) == len(tokens)):
        last = True
    embed1 = embeddings[index]
    embed2 = []
    embed2_index = 0
    if (combine_with == 'after'):
        if last:
            return (tokens, embeddings)
        embed2_index = (index + 1)
        embed2 = embeddings[embed2_index]
    else:
        if first:
            return (tokens, embeddings)
        embed2_index = (index - 1)
        embed2 = embeddings[embed2_index]
    averaged_embeddings = average_two_embeddings_vectors(embed1, embed2)
    return update_tok_and_embed(tokens, embeddings, index, embed2_index, averaged_embeddings)
def preprocessing_helper(tokens, embeddings, e, combine_with):
    index = 0
    avg_embeddings = []
    index = tokens.index(e)
    (first, last) = (False, False)
    if ((index - 1) == (- 1)):
        first = True
    if ((index + 1) == len(tokens)):
        last = True
    embed1 = embeddings[index]
    embed2 = []
    embed2_index = 0
    if (combine_with == 'after'):
        if last:
            return (tokens, embeddings)
        embed2_index = (index + 1)
        embed2 = embeddings[embed2_index]
    else:
        if first:
            return (tokens, embeddings)
        embed2_index = (index - 1)
        embed2 = embeddings[embed2_index]
    averaged_embeddings = average_two_embeddings_vectors(embed1, embed2)
    return update_tok_and_embed(tokens, embeddings, index, embed2_index, averaged_embeddings)