from typing import Optional
from typing import Dict
from typing import Tuple


def is_job_queued(info_queue: Optional[Dict] = None) -> Tuple[bool, int]:
    """Checks whether a job has been queued or not.

    Args:
        info_queue: queue information from the API response.

    Returns:
        a pair indicating if the job is queued and in which
            position.
    """
    is_queued, position = False, 0
    if info_queue:
        if 'status' in info_queue:
            queue_status = info_queue['status']
            is_queued = queue_status == 'PENDING_IN_QUEUE'
        if 'position' in info_queue:
            position = info_queue['position']
    return is_queued, position