"""
This function calculates the factorial of a given number.

Parameters:
number (int): The number for which the factorial is to be calculated. Must be a non-negative integer.

Returns:
int: The factorial of the given number.

Raises:
ValueError: If the input number is negative.

Example:
>>> factorial(5)
120
"""
