code: def setup_interpreter(distributions, interpreter=None):
    
    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
docs: 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`