Repository: Avaiga/taipy
File: taipy/core/taipy.py (Python)

Code before:
    return False


@_warn_no_core_service("The submitted entity will not be executed until the Core service is running.")
def submit(
    entity: Union[Scenario, Sequence, Task],
    force: bool = False,
    wait: bool = False,
    timeout: Optional[Union[float, int]] = None,
    **properties,
) -> Submission:
    """Submit a scenario, sequence or task entity for execution.

    This function submits the given entity for execution and returns the created job(s).

    If the entity is a sequence or a scenario, all the tasks of the entity are
    submitted for execution.

    Parameters:
        entity (Union[Scenario^, Sequence^, Task^]): The scenario, sequence or task to submit.
        force (bool): If True, the execution is forced even if for skippable tasks.
        wait (bool): Wait for the orchestrated jobs created from the submission to be finished
            in asynchronous mode.
        timeout (Union[float, int]): The optional maximum number of seconds to wait
            for the jobs to be finished before returning.
            If not provided and wait is True, the function waits indefinitely.
        **properties (dict[str, any]): A key-worded variable length list of user additional arguments
            that will be stored within the `Submission^`. It can be accessed via `Submission.properties^`.

    Returns:
        The created `Submission^` containing the information about the submission.
    """
    if isinstance(entity, Scenario):
        return _ScenarioManagerFactory._build_manager()._submit(
            entity, force=force, wait=wait, timeout=timeout, **properties
        )
    if isinstance(entity, Sequence):
        return _SequenceManagerFactory._build_manager()._submit(
            entity, force=force, wait=wait, timeout=timeout, **properties
        )
    if isinstance(entity, Task):
        return _TaskManagerFactory._build_manager()._submit(
            entity, force=force, wait=wait, timeout=timeout, **properties
        )
    return None


@overload
def exists(entity_id: TaskId) -> bool:
    ...


Review comment (suggestion):
```suggestion
            If not provided and *wait* is True, the function waits indefinitely.
```

Code after:
    return False


@_warn_no_core_service("The submitted entity will not be executed until the Core service is running.")
def submit(
    entity: Union[Scenario, Sequence, Task],
    force: bool = False,
    wait: bool = False,
    timeout: Optional[Union[float, int]] = None,
    **properties,
) -> Submission:
    """Submit a scenario, sequence or task entity for execution.

    This function submits the given entity for execution and returns the created job(s).

    If the entity is a sequence or a scenario, all the tasks of the entity are
    submitted for execution.

    Parameters:
        entity (Union[Scenario^, Sequence^, Task^]): The scenario, sequence or task to submit.
        force (bool): If True, the execution is forced even if for skippable tasks.
        wait (bool): Wait for the orchestrated jobs created from the submission to be finished
            in asynchronous mode.
        timeout (Union[float, int]): The optional maximum number of seconds to wait
            for the jobs to be finished before returning.<br/>
            If not provided and *wait* is True, the function waits indefinitely.
        **properties (dict[str, any]): A key-worded variable length list of user additional arguments
            that will be stored within the `Submission^`. It can be accessed via `Submission.properties^`.

    Returns:
        The created `Submission^` containing the information about the submission.
    """
    if isinstance(entity, Scenario):
        return _ScenarioManagerFactory._build_manager()._submit(
            entity, force=force, wait=wait, timeout=timeout, **properties
        )
    if isinstance(entity, Sequence):
        return _SequenceManagerFactory._build_manager()._submit(
            entity, force=force, wait=wait, timeout=timeout, **properties
        )
    if isinstance(entity, Task):
        return _TaskManagerFactory._build_manager()._submit(
            entity, force=force, wait=wait, timeout=timeout, **properties
        )
    return None


@overload
def exists(entity_id: TaskId) -> bool:
    ...