<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_display_name(self, room=None):
 """Get this user's display name. Args: room (Room):
 Optional. When specified, return the display name of the user in this room. Returns: The display name. Defaults to the user ID if not set. """

        if room:
            try:
                return room.members_displaynames[self.user_id]
            except KeyError:
                return self.user_id
        if not self.displayname:
            self.displayname = self.api.get_display_name(self.user_id)
        return self.displayname or self.user_id