@staticmethod
def varname_dtindex(tok):
    """
        >>> p = AbinitInputParser()
        >>> assert p.varname_dtindex("acell1") == ("acell", 1)
        >>> assert p.varname_dtindex("fa1k2") == ("fa1k", 2)
        """
    l = []
    for i, c in enumerate(tok[::-1]):
        if c.isalpha():
            break
        l.append(c)
    else:
        raise ValueError('Cannot find dataset index in: %s' % tok)
    assert i > 0
    l.reverse()
    dtidx = int(''.join(l))
    varname = tok[:len(tok) - i]
    return varname, dtidx
