def list_devices(sess, filter='/job:worker'):
    """List all device names for a session, filtering by the
    filter string, by default '/job:worker'"""
    return [d.name for d in sess.list_devices()
     if filter in d.name]