import posixpath


def strip(path: str) -> str:
    """Removes leading and trailing slashes from a path.

    Jupyter claims to do this already, but these are lies.

    https://jupyter-notebook.readthedocs.io/en/stable/extending/contents.html#apipaths

    >>> strip("/path/to/it")
    'path/to/it'
    >>> strip("////so many////")
    'so many'
    >>> strip("nothing")
    'nothing'
    """
    return path.strip(posixpath.sep)