code: def _as_label(self, index_or_label):
          
          if isinstance(index_or_label, str):
              return index_or_label
          if isinstance(index_or_label, numbers.Integral):
              return self.labels[index_or_label]
          else:
              raise ValueError(str(index_or_label) + ' is not a label or index')
docs: Convert index to label.