class Callback:
    __slots__ = ["hooks"]

    def __init__(self, **hooks):
        self.hooks = hooks

    def call(self, hook, *args, **kwargs):
        callback = self.hooks.get(hook)
        if callback is not None:
            return callback(*args, **kwargs)

    def call_func(self, hook, func, *args, **kwargs):
        callback = self.hooks.get(hook)
        if callback is not None:
            return callback(func(*args, **kwargs))


class NoOpCallback(Callback):
    def call(self, hook, *args, **kwargs):
        return None


_DEFAULT_CALLBACK = NoOpCallback()


def callback(
    *,
    set_size=None,
    relative_update=None,
    absolute_update=None,
    properties=None,
    **hooks,
):
    """Create a new callback for filesystem APIs.

    Parameters
    ----------
    set_size: Callable[[Optional[int]], None] (optional)
        When transferring something quantifiable (e.g bytes in a file, or
        number of files), this hook will be called with the total number of
        items. Might set something to None, in that case it should be ignored.

    relative_update: Callable[[int], None] (optional)
        Update the total transferred items relative to the previous position.
        If the current cursor is at N, and a relative_update(Q) happens then
        the current cursor should now point at the N+Q.

    absolute_update: Callable[[int], None] (optional)
        Update the total transferred items to an absolute position. If
        the current cursor is at N, and a absolute_update(Q) happens then
        the current cursor should now point at the Q. If another one happens
        it will override the current value.

    properties: Dict[str, Any] (optional)
        A mapping of config option (callback related) to their values.

    hooks: Callable[..., Any]
        Optional hooks that are not generally available.
    """

    return Callback(
        set_size=set_size,
        relative_update=relative_update,
        absolute_update=absolute_update,
        **hooks,
    )


def as_callback(maybe_callback):
    """Return the no-op callback if the maybe_callback parameter is None

    Parameters
    ----------
    maybe_callback: fsspec.callback.Callback or None

    Returns
    -------
    fsspec.callback.Callback
    """
    if maybe_callback is None:
        return _DEFAULT_CALLBACK
    else:
        return maybe_callback

@@ -132,32 +132,559 @@
 rgs, **kwargs):%0A
+        %22%22%22Make a callback to a hook named %60%60hook%60%60. If it can't%0A        find the hook, then this function will return None. Otherwise%0A        the return value of the hook will be used.%0A%0A        Parameters%0A        ----------%0A        hook: str%0A            The name of the hook%0A        *args: Any%0A            All the positional arguments that will be passed%0A            to the %60%60hook%60%60, if found.%0A        **kwargs: Any%0A            All the keyword arguments that will be passed%0A            tot the %60%60hook%60%60, if found.%0A        %22%22%22%0A
         callback
@@ -1060,16 +1060,85 @@
 n None%0A%0A
+    def call_func(self, hook, *args, **kwargs):%0A        return None%0A%0A
 %0A_DEFAUL

add some more docs to the call