def emit(self, tup, stream=Stream.DEFAULT_STREAM_ID,<EOL>anchors=None, direct_task=None, need_task_ids=False):
<EOL>self.pplan_helper.check_output_schema(stream, tup)<EOL>custom_target_task_ids = self.pplan_helper.choose_tasks_for_custom_grouping(stream, tup)<EOL>self.pplan_helper.context.invoke_hook_emit(tup, stream, None)<EOL>data_tuple = tuple_pb2.HeronDataTuple()<EOL>data_tuple.key = <NUM_LIT:0><EOL>if direct_task is not None:<EOL><INDENT>if not isinstance(direct_task, int):<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>% str(type(direct_task)))<EOL><DEDENT>data_tuple.dest_task_ids.append(direct_task)<EOL><DEDENT>elif custom_target_task_ids is not None:<EOL><INDENT>for task_id in custom_target_task_ids:<EOL><INDENT>data_tuple.dest_task_ids.append(task_id)<EOL><DEDENT><DEDENT>if anchors is not None:<EOL><INDENT>merged_roots = set()<EOL>for tup in [t for t in anchors if isinstance(t, HeronTuple) and t.roots is not None]:<EOL><INDENT>merged_roots.update(tup.roots)<EOL><DEDENT>for rt in merged_roots:<EOL><INDENT>to_add = data_tuple.roots.add()<EOL>to_add.CopyFrom(rt)<EOL><DEDENT><DEDENT>tuple_size_in_bytes = <NUM_LIT:0><EOL>start_time = time.time()<EOL>for obj in tup:<EOL><INDENT>serialized = self.serializer.serialize(obj)<EOL>data_tuple.values.append(serialized)<EOL>tuple_size_in_bytes += len(serialized)<EOL><DEDENT>serialize_latency_ns = (time.time() - start_time) * system_constants.SEC_TO_NS<EOL>self.bolt_metrics.serialize_data_tuple(stream, serialize_latency_ns)<EOL>super(BoltInstance, self).admit_data_tuple(stream_id=stream, data_tuple=data_tuple,<EOL>tuple_size_in_bytes=tuple_size_in_bytes)<EOL>self.bolt_metrics.update_emit_count(stream)<EOL>if need_task_ids:<EOL><INDENT>sent_task_ids = custom_target_task_ids or []<EOL>if direct_task is not None:<EOL><INDENT>sent_task_ids.append(direct_task)<EOL><DEDENT>return sent_task_ids<EOL><DEDENT>
Emits a new tuple from this Bolt

        It is compatible with StreamParse API.

        :type tup: list or tuple
        :param tup: the new output Tuple to send from this bolt,
                    should only contain only serializable data.
        :type stream: str
        :param stream: the ID of the stream to emit this Tuple to.
                       Leave empty to emit to the default stream.
        :type anchors: list
        :param anchors: a list of HeronTuples to which the emitted Tuples should be anchored.
        :type direct_task: int
        :param direct_task: the task to send the Tupel to if performing a direct emit.
        :type need_task_ids: bool
        :param need_task_ids: indicate whether or not you would like the task IDs the Tuple was emitted.