Time and Space Complexity of functions present in the random module

Hi Everyone,

I’m struggling to find a valid source to know the time complexity and space complexity of functions in Random Module. Please let me know the time and space complexity of the following functions, and its valid sources to know more details.
Assume input list has N items


random.choices(input_list, k = k1) # where k1 = no of items have to be returned
random.choices(input_list, k = k1, weights = <weights/probability of items in input_list>)

random.sample(input_list,k) # where k = no of items have to be returned

Thank you,

Homework question?

The source is at GitHub.com/python/cpython, look under Lib/random.py.

Thank you, Guido for your response!

The source link helped me to delve into random module. The question is not related to my homework. I asked this question for my learning purpose, and saw a lot of debates on the time complexities [O(N) vs O(1) ] on different blogs for radom.choices() function. So, I posted this question here to get clarification and get a valid source.