def METHOD_NAME(
    self, node_id: Optional[int], limit: Optional[int]
) -> List[TaskIns]:
    """Get TaskIns optionally filtered by node_id.
    Usually, the Fleet API calls this for Nodes planning to work on one or more
    TaskIns.
    Constraints
    -----------
    If `node_id` is not `None`, retrieve all TaskIns where
        1. the `task_ins.task.consumer.node_id` equals `node_id` AND
        2. the `task_ins.task.consumer.anonymous` equals `False` AND
        3. the `task_ins.task.delivered_at` equals `""`.
    If `node_id` is `None`, retrieve all TaskIns where the
    `task_ins.task.consumer.node_id` equals `0` and
    `task_ins.task.consumer.anonymous` is set to `True`.
    If `delivered_at` MUST BE set (not `""`) otherwise the TaskIns MUST not be in
    the result.
    If `limit` is not `None`, return, at most, `limit` number of `task_ins`. If
    `limit` is set, it has to be greater zero.
    """