<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_host_from_service_info(service_info):
 """ Get hostname or IP from service_info. """

    host = None
    port = None
    if (service_info and service_info.port and
            (service_info.server or service_info.address)):
        if service_info.address:
            host = socket.inet_ntoa(service_info.address)
        else:
            host = service_info.server.lower()
        port = service_info.port
    return (host, port)