def _get_lut_id(lut, label, use_lut):
 if (not use_lut):
  return 1
 assert isinstance(label, string_types)
 mask = (lut['name'] == label.encode('utf-8'))
 assert (mask.sum() == 1)
 return lut['id'][mask]

def _get_lut_id ( lut , label , use_lut ) : if ( not use_lut ) : return 1 assert isinstance ( label , string_types ) mask = ( lut [ 'name' ] == label . encode ( 'utf-8' ) ) assert ( mask . sum ( ) == 1 ) return lut [ 'id' ] [ mask ]
convert a label to a lut id number .