def check_symlink_capability(path, target):
    "helper similar to datalad.tests.utils.has_symlink_capability\n\n    However, for use in a datalad command context, we shouldn't\n    assume to be able to write to tmpfile and also not import a whole lot from\n    datalad's test machinery. Finally, we want to know, whether we can create a\n    symlink at a specific location, not just somewhere. Therefore use\n    arbitrary path to test-build a symlink and delete afterwards. Suitable\n    location can therefore be determined by high lever code.\n\n    Parameters\n    ----------\n    path: Path\n    target: Path\n\n    Returns\n    -------\n    bool\n    "
    try:
        target.touch()
        path.symlink_to(target)
        return True
    except Exception:
        return False
    finally:
        if path.exists():
            path.unlink()
        if target.exists():
            target.unlink()
helper similar to datalad.tests.utils.has_symlink_capability

However, for use in a datalad command context, we shouldn't
assume to be able to write to tmpfile and also not import a whole lot from
datalad's test machinery. Finally, we want to know, whether we can create a
symlink at a specific location, not just somewhere. Therefore use
arbitrary path to test-build a symlink and delete afterwards. Suitable
location can therefore be determined by high lever code.

Parameters
----------
path: Path
target: Path

Returns
-------
bool
def check_symlink_capability(path, target):
    "helper similar to datalad.tests.utils.has_symlink_capability\n\n    However, for use in a datalad command context, we shouldn't\n    assume to be able to write to tmpfile and also not import a whole lot from\n    datalad's test machinery. Finally, we want to know, whether we can create a\n    symlink at a specific location, not just somewhere. Therefore use\n    arbitrary path to test-build a symlink and delete afterwards. Suitable\n    location can therefore be determined by high lever code.\n\n    Parameters\n    ----------\n    path: Path\n    target: Path\n\n    Returns\n    -------\n    bool\n    "
    try:
        target.touch()
        path.symlink_to(target)
        return True
    except Exception:
        return False
    finally:
        if path.exists():
            path.unlink()
        if target.exists():
            target.unlink()