def _as_label(self, index_or_label):
if isinstance(index_or_label, str):<EOL><INDENT>return index_or_label<EOL><DEDENT>if isinstance(index_or_label, numbers.Integral):<EOL><INDENT>return self.labels[index_or_label]<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(str(index_or_label) + '<STR_LIT>')<EOL><DEDENT>
Convert index to label.