<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_gen(chain, urls):
 """Device object generator."""

    itr = iter(urls)
    last = next(itr)
    for url in itr:
        yield Device(chain, make_hop_info_from_url(last), driver_name='jumphost', is_target=False)
        last = url
    yield Device(chain, make_hop_info_from_url(last), driver_name='generic', is_target=True)