<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_hostname(cls, hostname):
 """Retrieve virtual machine id associated to a hostname."""

        result = cls.list({'hostname': str(hostname)})
        if result:
            return result[0]['id']