<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_metadata(self, e):
 """ This function sets the metadata that is common between pub and priv """

        metadata = Metadata(source=self.actor_urn).__dict__
        metadata['source_connector'] = 'irc'
        metadata['source_channel'] = e.target
        metadata['source_user'] = e.source
        metadata['source_username'] = e.source.split('!')[0]
        metadata['user_id'] = metadata['source_user']
        metadata['display_name'] = metadata['source_username']
        return metadata