

from itertools import compress, repeat
from math import ceil, sqrt




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	list[int]:



    """simple docstring"""






    if num <= 2:
        return []
    if num == 3:
        return [2]

    # Odd sieve for numbers in range [3, num - 1]
    UpperCamelCase_      =	bytearray(B"\x01" ) * ((num >> 1) - 1)

    for i in range(3 ,	int(sqrt(SCREAMING_SNAKE_CASE_ ) ) + 1 ,	2 ):
        if sieve[(i >> 1) - 1]:
            UpperCamelCase_      =	i**2
            UpperCamelCase_      =	repeat(
                0 ,	ceil((num - i_squared) / (i << 1) ) )

    return [2] + list(compress(range(3 ,	SCREAMING_SNAKE_CASE_ ,	2 ) ,	SCREAMING_SNAKE_CASE_ ) )


if __name__ == "__main__":
 import doctest

 doctest.testmod()



def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	float:



    """simple docstring"""






    return -num if num < 0 else num




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	int:



    """simple docstring"""






    if len(SCREAMING_SNAKE_CASE_ ) == 0:
        raise ValueError("abs_min() arg is an empty sequence" )
    UpperCamelCase_      =	x[0]
    for i in x:
        if abs_val(SCREAMING_SNAKE_CASE_ ) < abs_val(SCREAMING_SNAKE_CASE_ ):
            UpperCamelCase_      =	i
    return j




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	int:



    """simple docstring"""






    if len(SCREAMING_SNAKE_CASE_ ) == 0:
        raise ValueError("abs_max() arg is an empty sequence" )
    UpperCamelCase_      =	x[0]
    for i in x:
        if abs(SCREAMING_SNAKE_CASE_ ) > abs(SCREAMING_SNAKE_CASE_ ):
            UpperCamelCase_      =	i
    return j




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	int:



    """simple docstring"""






    if len(SCREAMING_SNAKE_CASE_ ) == 0:
        raise ValueError("abs_max_sort() arg is an empty sequence" )
    return sorted(SCREAMING_SNAKE_CASE_ ,	key=SCREAMING_SNAKE_CASE_ )[-1]




def  lowerCAmelCase(			)->	Any:



    """simple docstring"""






    assert abs_val(0 ) == 0
    assert abs_val(3_4 ) == 3_4
    assert abs_val(-1_0_0_0_0_0_0_0_0_0_0_0 ) == 1_0_0_0_0_0_0_0_0_0_0_0

    UpperCamelCase_      =	[-3, -1, 2, -1_1]
    assert abs_max(SCREAMING_SNAKE_CASE_ ) == -1_1
    assert abs_max_sort(SCREAMING_SNAKE_CASE_ ) == -1_1
    assert abs_min(SCREAMING_SNAKE_CASE_ ) == -1


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 test_abs_val()
 print(abs_val(-34))  # --> 34
