Complete code with Tabnine in VS Code
Install the Tabnine extension, try inline suggestions, and check the result on a small function.
What you will create
Complete a small Python function using Tabnine's inline suggestions, then decide whether the proposed code meets a precise contract. The goal is not to accept as many lines as possible: it is to distinguish plausible code from code that fits your actual requirement.
Before you start
Use VS Code with Tabnine already installed and activated in an authorized environment, plus an available Python interpreter. If installation is needed, use the official distribution and review requested permissions. Create a test folder without client code, secrets or personal data. This exercise needs no additional dependencies, network service or changes to a real project.
Step-by-step
- Create a test Python file. Define the expected behavior before accepting suggestions: trim surrounding whitespace from strings, remove strings that become empty and retain the first occurrence of each value without changing order.
- Add a comment explaining this contract and start
def unique_labels(values):. Tabnine may offer gray inline code. A suggestion is not guaranteed after every keystroke. - Read it before accepting with Tab if that shortcut is active in your setup. Do not keep lines you do not understand. Clarify the comment or function name if the suggestion targets a different behavior.
- Add the four assertions from the example after the function. Check that the file contains only this function and these tests, then run it with your Python interpreter.
- If an assertion fails, compare the actual result with the contract. Correct the logic and rerun all four cases, not only the failing one.
Example to adapt
Contract for this original exercise: inputs contain strings only; case matters, so “A” and “a” are different. Preserve first-appearance order after trimming. Do not modify the input list. Handling numbers or null values is outside this exercise.
assert unique_labels([" red ", "blue", "red", ""]) == ["red", "blue"]
assert unique_labels([]) == []
assert unique_labels(["A", "a", " A "]) == ["A", "a"]
assert unique_labels([" ", "\t"]) == []Add a non-mutation check: keep a copy of the input list before calling the function and compare the input with that copy afterwards. The assertions above are expectations to verify, not observed Tabnine output.
Two pitfalls are easy to spot: converting directly to a set does not guarantee the required order; lowercasing every value would merge “A” and “a” against the chosen rule. Short code is not necessarily the right code.
Check your result
- All four assertions pass with the exact expected values.
- The original input list remains unchanged.
- No unnecessary imports, file access or network requests have been added.
- You can explain each step of the function.
- You understand the scope: four passing cases do not prove universal correctness.
Common problems
No suggestion: check extension activation and connection before changing the project. Tab does something else: inspect inline-suggestion keyboard shortcuts. The code solves a different problem: narrow the exercise to the written contract. The file will not run: distinguish interpreter or indentation issues from a logically failing assertion. Do not run unfamiliar commands as a workaround.
Next steps
Review the Tabnine page on QAILT. Once comfortable, add one requirement and its corresponding test at a time. Keep inline completion distinct from an agent authorized to change multiple files.

