def get_idx_from_sent(status, word_idx_map, charged_words, max_l=51, max_s=200, k=300, filter_h=5):
    """
    Transforms sentence into a list of indices. Pad with zeroes.
    """
    x = []
    pad = filter_h - 1
    length = len(status)


    pass_one=True
    while len(x)==0:
        for i in range(length):
            words = status[i].split()
            if pass_one:
                words_set = set(words)
                if len(charged_words.intersection(words_set))==0:
                    continue
            else:
                if np.random.randint(0,2)==0:
                    continue
            y=[]
            for i in xrange(pad):
                y.append(0)
            for word in words:
                if word in word_idx_map:
                    y.append(word_idx_map[word])

            while len(y) < max_l+2*pad:
                y.append(0)
            x.append(y)
        pass_one=False

    if len(x) < max_s:
        x.extend([[0]*(max_l+2*pad)]*(max_s-len(x)))



    return x

    Transforms sentence into a list of indices. Pad with zeroes.
    
conv_net_train.py