<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_canonical_host(self):
 """ Return the canonical host as for the Host HTTP header specification. """

        host = self.host.lower()
        if self.port is not None:
            host = "%s:%s" % (host, self.port)
        return host