async def METHOD_NAME(self, task_id=None, params=None, headers=None):
    """
    Cancels a task, if it can be cancelled through an API.
    .. warning::
        This API is **experimental** so may include breaking changes
        or be removed in a future version
    :arg task_id: Cancel the task with specified task id
        (node_id:task_number)
    :arg actions: A comma-separated list of actions that should be
        cancelled. Leave empty to cancel all.
    :arg nodes: A comma-separated list of node IDs or names to limit
        the returned information; use `_local` to return information from the
        node you're connecting to, leave empty to get information from all nodes
    :arg parent_task_id: Cancel tasks with specified parent task id
        (node_id:task_number). Set to -1 to cancel all.
    :arg wait_for_completion: Should the request block until the
        cancellation of the task and its descendant tasks is completed. Defaults
        to false
    """
    return await self.transport.perform_request(
        "POST",
        _make_path("_tasks", task_id, "_cancel"),
        params=params,
        headers=headers,
    )