def chop_dirname(self, dirname, path):

        if dirname:
            return path[len(dirname)+1:]
        else:
            return path
This is a more generalized form -> basically if
dataset/ETHPy150Open memsql/memsql-loader/memsql_loader/vendor/glob2/impl.py/Globber.chop_dirname