def is_path_creatable(pathname: str) -> bool:
    """Checks whether the given path is creatable.

    Returns
    -------
    `True` if the current user has sufficient permissions to create the passed
    pathname; `False` otherwise.
    """
    # Parent directory of the passed path. If empty, we substitute the current
    # working directory (CWD) instead.
    dirname = os.path.dirname(pathname) or os.getcwd()
    return os.access(dirname, os.W_OK)
def is_path_creatable ( pathname : str ) -> bool : dirname = os . path . dirname ( pathname ) or os . getcwd ( ) return os . access ( dirname , os . W_OK )
Checks whether the given path is creatable.

    Returns
    -------
    `True` if the current user has sufficient permissions to create the passed
    pathname; `False` otherwise.