Create a Python function based on the natural language request. The request describes desired functionality, input parameters, and expected return value. Implement according to the specifications: handle edge cases, perform validations, follow Python best practices, and include comments explaining the logic.
REQUEST:
<<<paste NL function spec>>>
Write unit tests for a chosen function with a Copilot prompt fileA prompt file from GitHub's Copilot customization library that studies the function or method you have selected and writes focused unit tests. It covers normal behaviour, invalid and boundary inputs, error handling and side effects, asking which function and test framework to use and aiming for 5 to 8 independent tests.Coding agent
Find and Fix Python BugsInspect Python code for bugs, explain each issue, and provide a corrected version.Coding agent
Generate an OpenAPI 3.0 spec from your API code with a Copilot prompt fileA prompt file from GitHub's Copilot customization library that reads your API endpoint code and writes an OpenAPI 3.0.3 specification in YAML. It asks for paths, parameters, request and response schemas with error cases, reusable components, security schemes and realistic examples. To use it, save the file in your repository's .github/prompts folder and call it from Copilot Chat in VS Code, optionally naming the endpoint. Prompt files are a preview feature in VS Code.Coding agent