code: def _check_basis_label_type(cls, label_or_index):
          
          if not isinstance(label_or_index, cls._basis_label_types):
              raise TypeError(
                  "label_or_index must be an instance of one of %s; not %s" % (
                      ", ".join([t.__name__ for t in cls._basis_label_types]),
                      label_or_index.__class__.__name__))
docs: Every object (BasisKet, LocalSigma) that contains a label or index
          for an eigenstate of some LocalSpace should call this routine to check
          the type of that label or index (or, use
          :meth:`_unpack_basis_label_or_index`