def unique_labels(*ys):
 if (not ys):
  raise ValueError('No argument has been passed.')
 ys_types = set((type_of_target(x) for x in ys))
 if (ys_types == set(['binary', 'multiclass'])):
  ys_types = set(['multiclass'])
 if (len(ys_types) > 1):
  raise ValueError(('Mix type of y not allowed, got types %s' % ys_types))
 label_type = ys_types.pop()
 if ((label_type == 'multilabel-indicator') and (len(set((check_array(y, ['csr', 'csc', 'coo']).shape[1] for y in ys))) > 1)):
  raise ValueError('Multi-label binary indicator input with different numbers of labels')
 _unique_labels = _FN_UNIQUE_LABELS.get(label_type, None)
 if (not _unique_labels):
  raise ValueError(('Unknown label type: %s' % repr(ys)))
 ys_labels = set(chain.from_iterable((_unique_labels(y) for y in ys)))
 if (len(set((isinstance(label, string_types) for label in ys_labels))) > 1):
  raise ValueError('Mix of label input types (string and number)')
 return np.array(sorted(ys_labels))

def unique_labels ( * ys ) : if ( not ys ) : raise ValueError ( 'No argument has been passed.' ) ys_types = set ( ( type_of_target ( x ) for x in ys ) ) if ( ys_types == set ( [ 'binary' , 'multiclass' ] ) ) : ys_types = set ( [ 'multiclass' ] ) if ( len ( ys_types ) > 1 ) : raise ValueError ( ( 'Mix type of y not allowed, got types %s' % ys_types ) ) label_type = ys_types . pop ( ) if ( ( label_type == 'multilabel-indicator' ) and ( len ( set ( ( check_array ( y , [ 'csr' , 'csc' , 'coo' ] ) . shape [ 1 ] for y in ys ) ) ) > 1 ) ) : raise ValueError ( 'Multi-label binary indicator input with different numbers of labels' ) _unique_labels = _FN_UNIQUE_LABELS . get ( label_type , None ) if ( not _unique_labels ) : raise ValueError ( ( 'Unknown label type: %s' % repr ( ys ) ) ) ys_labels = set ( chain . from_iterable ( ( _unique_labels ( y ) for y in ys ) ) ) if ( len ( set ( ( isinstance ( label , string_types ) for label in ys_labels ) ) ) > 1 ) : raise ValueError ( 'Mix of label input types (string and number)' ) return np . array ( sorted ( ys_labels ) )
extract an ordered integer array of unique labels this implementation ignores any occurrence of nans .