GITHUB-COPILOT practice question 7 of 15
What is the process behind identifying public code matches when using a public code filter enabled in GitHub Copilot?
Full set: 65 questionsWhen the public code filter is enabled in GitHub Copilot, it checks generated code suggestions against a comprehensive index of public code hosted on GitHub. This process involves comparing the suggestion and its surrounding context (approximately 150 characters) against this index. If a direct or near-match is found, the suggestion is suppressed and not presented to the user. This mechanism acts as a filter to help users avoid unintentionally incorporating code that matches public repositories.
B. Comparing suggestions against public code using machine learning. This is imprecise. The process is a direct comparison against an index of public code, not necessarily another machine learning model for the comparison itself.
C. Analyzing the context and structure of the code being written. This describes how Copilot generates suggestions in the first place, not the specific, separate process of filtering them against public code.
D. Reviewing the user's browsing history to identify public repositories. This is incorrect. GitHub Copilot does not access a user's browsing history; this would be a major privacy violation.
1. GitHub Docs. (2024). "Configuring GitHub Copilot settings on GitHub.com." In GitHub Docs. Retrieved from https://docs.github.com/en/copilot/configuring-github-copilot/configuring-github-copilot-settings-on-githubcom#allowing-or-blocking-suggestions-matching-public-code.
Reference Details: The section "Allowing or blocking suggestions matching public code" explicitly states, "GitHub Copilot includes a filter to help you block suggestions that match public code on GitHub. ... When the filter is enabled, GitHub Copilot checks code suggestions with their surrounding code of about 150 characters against public code on GitHub. If there is a match or near match, the suggestion will not be shown to you." This directly supports the concept of a filter (Option A).
2. GitHub. (2023). "GitHub Copilot Trust Center." Retrieved from https://github.com/features/copilot/trust-center.
Reference Details: Under the "Filtering" section, it is explained: "We have a filter that detects and suppresses suggestions that contain code that matches public code on GitHub." This confirms the process is a filter designed for detection and suppression.
Keep practicing
Take the free GITHUB-COPILOT practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GITHUB-COPILOT practice questions
- Question 1What is the best way to share feedback about GitHub Copilot Chat when using it on GitHub …
- Question 2What types of prompts or code snippets might be flagged by the GitHub Copilot toxicity fi…
- Question 3What is the correct way to exclude specific files from being used by GitHub Copilot Busin…
- Question 4How do you generate code suggestions with GitHub Copilot in the CLI?
- Question 5Which principle emphasizes that AI systems should be understandable and provide clear inf…
- Question 6What should developers consider when relying on GitHub Copilot for generating code that i…
