def generate_feed_dict(model, data_size, batch_size):
    data_size = min(data_size, len(model.input_data))
    input_data = model.input_data[:data_size]
    input_answer = model.input_answer[:data_size]
    input_question = model.input_question[:data_size]
    input_question_word = (model.input_question_word[:data_size] if (model.input_question_word is not None) else None)
    input_question_subword = (model.input_question_subword[:data_size] if (model.input_question_subword is not None) else None)
    input_question_char = (model.input_question_char[:data_size] if (model.input_question_char is not None) else None)
    input_context = model.input_context[:data_size]
    input_context_word = (model.input_context_word[:data_size] if (model.input_context_word is not None) else None)
    input_context_subword = (model.input_context_subword[:data_size] if (model.input_context_subword is not None) else None)
    input_context_char = (model.input_context_char[:data_size] if (model.input_context_char is not None) else None)
    data_dict = {'data_size': data_size, 'input_data': input_data, 'input_answer': input_answer, 'input_question': input_question, 'input_question_word': input_question_word, 'input_question_subword': input_question_subword, 'input_question_char': input_question_char, 'input_context': input_context, 'input_context_word': input_context_word, 'input_context_subword': input_context_subword, 'input_context_char': input_context_char}
    feed_dict = {model.data_pipeline.data_size_placeholder: data_size, model.data_pipeline.batch_size_placeholder: batch_size}
    if ((model.data_pipeline.input_answer_placeholder is not None) and (input_answer is not None)):
        feed_dict[model.data_pipeline.input_answer_placeholder] = input_answer
    if ((model.data_pipeline.input_question_placeholder is not None) and (input_question is not None)):
        feed_dict[model.data_pipeline.input_question_placeholder] = input_question
    if ((model.data_pipeline.input_question_word_placeholder is not None) and (input_question_word is not None)):
        feed_dict[model.data_pipeline.input_question_word_placeholder] = input_question_word
    if ((model.data_pipeline.input_question_subword_placeholder is not None) and (input_question_subword is not None)):
        feed_dict[model.data_pipeline.input_question_subword_placeholder] = input_question_subword
    if ((model.data_pipeline.input_question_char_placeholder is not None) and (input_question_char is not None)):
        feed_dict[model.data_pipeline.input_question_char_placeholder] = input_question_char
    if ((model.data_pipeline.input_context_placeholder is not None) and (input_context is not None)):
        feed_dict[model.data_pipeline.input_context_placeholder] = input_context
    if ((model.data_pipeline.input_context_word_placeholder is not None) and (input_context_word is not None)):
        feed_dict[model.data_pipeline.input_context_word_placeholder] = input_context_word
    if ((model.data_pipeline.input_context_subword_placeholder is not None) and (input_context_subword is not None)):
        feed_dict[model.data_pipeline.input_context_subword_placeholder] = input_context_subword
    if ((model.data_pipeline.input_context_char_placeholder is not None) and (input_context_char is not None)):
        feed_dict[model.data_pipeline.input_context_char_placeholder] = input_context_char
    return (feed_dict, data_dict)
def generate_feed_dict(model, data_size, batch_size):
    data_size = min(data_size, len(model.input_data))
    input_data = model.input_data[:data_size]
    input_answer = model.input_answer[:data_size]
    input_question = model.input_question[:data_size]
    input_question_word = (model.input_question_word[:data_size] if (model.input_question_word is not None) else None)
    input_question_subword = (model.input_question_subword[:data_size] if (model.input_question_subword is not None) else None)
    input_question_char = (model.input_question_char[:data_size] if (model.input_question_char is not None) else None)
    input_context = model.input_context[:data_size]
    input_context_word = (model.input_context_word[:data_size] if (model.input_context_word is not None) else None)
    input_context_subword = (model.input_context_subword[:data_size] if (model.input_context_subword is not None) else None)
    input_context_char = (model.input_context_char[:data_size] if (model.input_context_char is not None) else None)
    data_dict = {'data_size': data_size, 'input_data': input_data, 'input_answer': input_answer, 'input_question': input_question, 'input_question_word': input_question_word, 'input_question_subword': input_question_subword, 'input_question_char': input_question_char, 'input_context': input_context, 'input_context_word': input_context_word, 'input_context_subword': input_context_subword, 'input_context_char': input_context_char}
    feed_dict = {model.data_pipeline.data_size_placeholder: data_size, model.data_pipeline.batch_size_placeholder: batch_size}
    if ((model.data_pipeline.input_answer_placeholder is not None) and (input_answer is not None)):
        feed_dict[model.data_pipeline.input_answer_placeholder] = input_answer
    if ((model.data_pipeline.input_question_placeholder is not None) and (input_question is not None)):
        feed_dict[model.data_pipeline.input_question_placeholder] = input_question
    if ((model.data_pipeline.input_question_word_placeholder is not None) and (input_question_word is not None)):
        feed_dict[model.data_pipeline.input_question_word_placeholder] = input_question_word
    if ((model.data_pipeline.input_question_subword_placeholder is not None) and (input_question_subword is not None)):
        feed_dict[model.data_pipeline.input_question_subword_placeholder] = input_question_subword
    if ((model.data_pipeline.input_question_char_placeholder is not None) and (input_question_char is not None)):
        feed_dict[model.data_pipeline.input_question_char_placeholder] = input_question_char
    if ((model.data_pipeline.input_context_placeholder is not None) and (input_context is not None)):
        feed_dict[model.data_pipeline.input_context_placeholder] = input_context
    if ((model.data_pipeline.input_context_word_placeholder is not None) and (input_context_word is not None)):
        feed_dict[model.data_pipeline.input_context_word_placeholder] = input_context_word
    if ((model.data_pipeline.input_context_subword_placeholder is not None) and (input_context_subword is not None)):
        feed_dict[model.data_pipeline.input_context_subword_placeholder] = input_context_subword
    if ((model.data_pipeline.input_context_char_placeholder is not None) and (input_context_char is not None)):
        feed_dict[model.data_pipeline.input_context_char_placeholder] = input_context_char
    return (feed_dict, data_dict)