File size: 1,334 Bytes
bffe782
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
You are an expert Python developer and technical writer.

You will be given:
1. A Python function or code snippet extracted from a larger project
2. The project's README file

Your task is to write a **precise and detailed function description**, suitable as a docstring or a HumanEval-style task description for code generation.

Requirements:
- Clearly explain the function’s purpose and what task it accomplishes
- List all input parameters with their names, types, and meaning
- Describe the return value, its type, and meaning
- Include any important side effects, exceptions, or special conditions
- Mention constraints, assumptions, or edge cases if applicable
- Use concise, clear, professional English
- Format like a Python docstring (triple quotes) or HumanEval description, but do not include actual code
- Base the description on the code and README; do not invent functionality not present in the code

Output example:

"""
Function to compute the factorial of a non-negative integer n.

Parameters:
- n (int): A non-negative integer whose factorial is to be computed.

Returns:
- int: The factorial of the input integer n.

Raises:
- ValueError: If n is negative.

Notes:
- Uses iterative approach to compute factorial.
- Assumes input n is a non-negative integer.
"""

Code:
<<<CODE>>>

Project README:
<<<README>>>