<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setup_interpreter(distributions, interpreter=None):
 """Return an interpreter configured with vendored distributions as extras. Any distributions that are present in the vendored set will be added to the interpreter as extras. :param distributions: The names of distributions to setup the interpreter with. :type distributions: list of str :param interpreter: An optional interpreter to configure. If ``None``, the current interpreter is used. :type interpreter: :class:`pex.interpreter.PythonInterpreter` :return: An bare interpreter configured with vendored extras. :rtype: :class:`pex.interpreter.PythonInterpreter` """

  from pex.interpreter import PythonInterpreter

  interpreter = interpreter or PythonInterpreter.get()
  for dist in _vendored_dists(OrderedSet(distributions)):
    interpreter = interpreter.with_extra(dist.key, dist.version, dist.location)
  return interpreter