def get_langids(dev):
 from usb.control import get_descriptor
 buf = get_descriptor(dev, 254, DESC_TYPE_STRING, 0)
 if ((len(buf) < 4) or (buf[0] < 4) or ((buf[0] & 1) != 0)):
  return ()
 return tuple(map((lambda x, y: (x + (y << 8))), buf[2:buf[0]:2], buf[3:buf[0]:2]))

def get_langids ( dev ) : from usb . control import get_descriptor buf = get_descriptor ( dev , 254 , DESC_TYPE_STRING , 0 ) if ( ( len ( buf ) < 4 ) or ( buf [ 0 ] < 4 ) or ( ( buf [ 0 ] & 1 ) != 0 ) ) : return ( ) return tuple ( map ( ( lambda x , y : ( x + ( y << 8 ) ) ) , buf [ 2 : buf [ 0 ] : 2 ] , buf [ 3 : buf [ 0 ] : 2 ] ) )
retrieve the list of supported language ids from the device .