def flat_map(self, func=None, name=None):
if func is None:<EOL><INDENT>func = streamsx.topology.runtime._identity<EOL>if name is None:<EOL><INDENT>name = '<STR_LIT>'<EOL><DEDENT><DEDENT>sl = _SourceLocation(_source_info(), '<STR_LIT>')<EOL>_name = self.topology.graph._requested_name(name, action='<STR_LIT>', func=func)<EOL>stateful = self._determine_statefulness(func)<EOL>op = self.topology.graph.addOperator(self.topology.opnamespace+"<STR_LIT>", func, name=_name, sl=sl, stateful=stateful)<EOL>op.addInputPort(outputPort=self.oport)<EOL>streamsx.topology.schema.StreamSchema._fnop_style(self.oport.schema, op, '<STR_LIT>')<EOL>oport = op.addOutputPort(name=_name)<EOL>return Stream(self.topology, oport)._make_placeable()._layout('<STR_LIT>', name=_name, orig_name=name)<EOL>
Maps and flatterns each tuple from this stream into 0 or more tuples.


For each tuple on this stream ``func(tuple)`` is called.
If the result is not `None` then the the result is iterated over
with each value from the iterator that is not `None` will be submitted
to the return stream.

If the result is `None` or an empty iterable then no tuples are submitted to
the returned stream.

Args:
    func: A callable that takes a single parameter for the tuple.
        If not supplied then a function equivalent to ``lambda tuple_ : tuple_`` is used.
        This is suitable when each tuple on this stream is an iterable to be flattened.

    name(str): Name of the flattened stream, defaults to a generated name.

If invoking ``func`` for a tuple on the stream raises an exception
then its processing element will terminate. By default the processing
element will automatically restart though tuples may be lost.

If ``func`` is a callable object then it may suppress exceptions
by return a true value from its ``__exit__`` method. When an
exception is suppressed no tuples are submitted to the flattened
and mapped stream corresponding to the input tuple
that caused the exception.

Returns:
    Stream: A Stream containing flattened and mapped tuples.
Raises:
    TypeError: if `func` does not return an iterator nor None

.. versionchanged:: 1.11 `func` is optional.