@staticmethod
def _basename(string):
    """
        Remove trailing numbers from a string.
        """
    if not isinstance(string, str):
        raise ValueError(
            '_basename received a non-string input! Got the following: {}'.
            format(string))
    if string == '':
        return string
    if not string[-1].isdigit():
        return string
    else:
        counter = 0
        for ss in string[::-1]:
            if ss.isdigit():
                counter += 1
            else:
                break
        return string[:-counter]
