def _get_blank_label(dataset):
 category_index = dataset.label_name_to_index['category']
 category_to_name = dataset.label_to_value_funcs[category_index]
 blank_label = 5
 try:
  blank_name = category_to_name(blank_label)
 except ValueError:
  return None
 assert (blank_name == 'blank')
 blank_rowmask = (dataset.y[:, category_index] == blank_label)
 blank_labels = dataset.y[blank_rowmask, :]
 if (not blank_rowmask.any()):
  return None
 if (not numpy.all((blank_labels[0, :] == blank_labels[1:, :]))):
  raise ValueError("Expected all labels of category 'blank' to have the same value, but they differed.")
 return blank_labels[0, :].copy()

def _get_blank_label ( dataset ) : category_index = dataset . label_name_to_index [ 'category' ] category_to_name = dataset . label_to_value_funcs [ category_index ] blank_label = 5 try : blank_name = category_to_name ( blank_label ) except ValueError : return None assert ( blank_name == 'blank' ) blank_rowmask = ( dataset . y [ : , category_index ] == blank_label ) blank_labels = dataset . y [ blank_rowmask , : ] if ( not blank_rowmask . any ( ) ) : return None if ( not numpy . all ( ( blank_labels [ 0 , : ] == blank_labels [ 1 : , : ] ) ) ) : raise ValueError ( "Expected all labels of category 'blank' to have the same value, but they differed." ) return blank_labels [ 0 , : ] . copy ( )
returns the label vector associated with blank images .