def _as_published_topic(self):
oop = self.get_operator_output_port()<EOL>if not hasattr(oop, '<STR_LIT>'):<EOL><INDENT>return<EOL><DEDENT>export = oop.export<EOL>if export['<STR_LIT:type>'] != '<STR_LIT>':<EOL><INDENT>return<EOL><DEDENT>seen_export_type = False<EOL>topic = None<EOL>for p in export['<STR_LIT>']:<EOL><INDENT>if p['<STR_LIT:type>'] != '<STR_LIT>':<EOL><INDENT>continue<EOL><DEDENT>if p['<STR_LIT:name>'] == '<STR_LIT>':<EOL><INDENT>if p['<STR_LIT>'] == ['<STR_LIT>']:<EOL><INDENT>seen_export_type = True<EOL><DEDENT>else:<EOL><INDENT>return<EOL><DEDENT><DEDENT>if p['<STR_LIT:name>'] == '<STR_LIT>':<EOL><INDENT>topic = p['<STR_LIT>'][<NUM_LIT:0>]<EOL><DEDENT><DEDENT>if seen_export_type and topic is not None:<EOL><INDENT>schema = None<EOL>if hasattr(oop, '<STR_LIT>'):<EOL><INDENT>ta_url = oop.tupleAttributes<EOL>ta_resp = self.rest_client.make_request(ta_url)<EOL>schema = streamsx.topology.schema.StreamSchema(ta_resp['<STR_LIT>'])<EOL><DEDENT>return PublishedTopic(topic[<NUM_LIT:1>:-<NUM_LIT:1>], schema)<EOL><DEDENT>return<EOL>
This stream as a PublishedTopic if it is published otherwise None