I remember GitHub had something like what Mike M suggested for their search. I just noticed that it's changed, and what they do now is make the selection a part of their autocomplete-like menu:
[![enter image description here][1]][1]

I imagine the default selection at the top is what they believe to be the most common, which makes sense to search in the current repo by default. An advantage I note in this is that it let's you switch without hassle. If I wanted to search "rails" in "All GitHub" (which makes more sense), all I need to do is press <kbd>↓</kbd> before hitting <kbd>Enter</kbd>. This means that switching the filter is just a single additional keypress.

Comparing this with other solutions:

 - <b>dropdown input at the left</b> means I have to <kbd>Shift</kbd>+<kbd>Tab</kbd> and hit <kbd>↓</kbd> either once or twice (I get the feeling that some dropdowns don't change the selection on the first hit and only open the menu with the selection unchanged, which gives me uncertainty about dropdowns in general).
 - <b>2 buttons at the right with the default on the left</b> means I have to hit <kbd>Tab</kbd> twice.
 - <b>2 buttons at the right with the default on the right</b> means I only have to hit <kbd>Tab</kbd> once to switch, but it might not be intuitive that the default is not what's closest to the input.
 - <b>radio input</b> is like dropdown but at least I can be sure that hitting the arrow key will cause a change in selection.

All these other solutions also suffer in that they have more visual noise, when the input is not in use. An advantage they do all have, however, is that they don't require javascript (if we're talking websites here), which is nice both for the developer and users.

  [1]: https://i.sstatic.net/noLWx.png