<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_ip(cls, ip):
 """Retrieve ip id associated to an ip."""

        ips = dict([(ip_['ip'], ip_['id'])
                    for ip_ in cls.list({'items_per_page': 500})])
        return ips.get(ip)