def add_upsert(self, action, meta_action, doc_source, update_spec):
<EOL>if update_spec:<EOL><INDENT>self.bulk_index(action, meta_action)<EOL>self.add_doc_to_update(action, update_spec, len(self.action_buffer) - <NUM_LIT:2>)<EOL><DEDENT>else:<EOL><INDENT>if doc_source:<EOL><INDENT>self.add_to_sources(action, doc_source)<EOL><DEDENT>self.bulk_index(action, meta_action)<EOL><DEDENT>
Function which stores sources for "insert" actions
and decide if for "update" action has to add docs to
get source buffer