python/ray/_private/ray_option_utils.py
def _counting_option(name: str, infinite: bool = True, default_value: Any = None):
    """This is used for positive and discrete options.

    Args:
        name: The name of the option keyword.
        infinite: If True, user could use -1 to represent infinity.
        default_value: The default value for this option.
    """
    if infinite:
        return Option(
            (int, type(None)),
            lambda x: x is None or x >= -1,
            f"The keyword '{name}' only accepts None, 0, -1 or a positive integer, "
            "where -1 represents infinity.",
            default_value=default_value,
        )
    return Option(
        (int, type(None)),
        lambda x: x is None or x >= 0,
        f"The keyword '{name}' only accepts None, 0 or a positive integer.",
        default_value=default_value,
    )
This is used for positive and discrete options.

    Args:
        name: The name of the option keyword.
        infinite: If True, user could use -1 to represent infinity.
        default_value: The default value for this option.
    
This is used for positive and discrete options.
This is used for positive and discrete options .
def _counting_option(name: str, infinite: bool = True, default_value: Any = None):
    if infinite:
        return Option(
            (int, type(None)),
            lambda x: x is None or x >= -1,
            f"The keyword '{name}' only accepts None, 0, -1 or a positive integer, "
            "where -1 represents infinity.",
            default_value=default_value,
        )
    return Option(
        (int, type(None)),
        lambda x: x is None or x >= 0,
        f"The keyword '{name}' only accepts None, 0 or a positive integer.",
        default_value=default_value,
    )
def _counting_option ( name : str , infinite : bool = True , default_value : Any = None ) : if infinite : return Option ( ( int , type ( None ) ) , lambda x : x is None or x >= - 1 , f"The keyword '{name}' only accepts None, 0, -1 or a positive integer, " "where -1 represents infinity." , default_value = default_value , ) return Option ( ( int , type ( None ) ) , lambda x : x is None or x >= 0 , f"The keyword '{name}' only accepts None, 0 or a positive integer." , default_value = default_value , )
This is used for positive and discrete options.
This is used for positive and discrete options .
"""This is used for positive and discrete options.

    Args:
        name: The name of the option keyword.
        infinite: If True, user could use -1 to represent infinity.
        default_value: The default value for this option.
    """
name
str
The name of the option keyword.
The name of the option keyword .
infinite
bool
If True, user could use -1 to represent infinity.
If True user could use - 1 to represent infinity .
default_value
Any
The default value for this option.
The default value for this option .