def maybe_remove_scheme(func):
    'Remove scheme from args and kwargs in case underlying fs does not support it.'

    @wraps(func)
    def wrapper(self, path, *args, **kwargs):
        if (not self.supports_scheme):
            path = remove_scheme(path, raise_=False)
            args = [remove_scheme(a, raise_=False) for a in args]
            kwargs = {k: (remove_scheme(v, raise_=False) if isinstance(v, (Path, str)) else v) for (k, v) in kwargs.items()}
        return func(self, path, *args, **kwargs)
    return wrapper
Remove scheme from args and kwargs in case underlying fs does not support it.
def maybe_remove_scheme(func):
    

    @wraps(func)
    def wrapper(self, path, *args, **kwargs):
        if (not self.supports_scheme):
            path = remove_scheme(path, raise_=False)
            args = [remove_scheme(a, raise_=False) for a in args]
            kwargs = {k: (remove_scheme(v, raise_=False) if isinstance(v, (Path, str)) else v) for (k, v) in kwargs.items()}
        return func(self, path, *args, **kwargs)
    return wrapper