<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def modLocationPort(self, location):
 """ Ensures that the location port is a the given port value Used in `handleHeader` """

        components = urlparse.urlparse(location)
        reverse_proxy_port = self.father.getHost().port
        reverse_proxy_host = self.father.getHost().host
        # returns an ordered dict of urlparse.ParseResult components
        _components = components._asdict()
        _components['netloc'] = '%s:%d' % (
            reverse_proxy_host, reverse_proxy_port
        )
        return urlparse.urlunparse(_components.values())