'Removes the platform label from the overall labels'

def _cleanup_labels(self, labels, platform=None):

    if platform:
        return [label for label in labels if (label != platform)]
    else:
        try:
            return [label for label in labels if (not label['platform'])]
        except TypeError:
            return labels
