<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def device_id_from_name(device_name, nodes):
 """ Get the device ID when given a device name :param str device_name: device name :param list nodes: list of nodes from :py:meth:`generate_nodes` :return: device ID :rtype: int """

        device_id = None
        for node in nodes:
            if device_name == node['properties']['name']:
                device_id = node['id']
                break
        return device_id