parameters: (atoms, exec_fn = read_stdout)
return_statement: return [a for a in atoms if portage_detect_single(a, exec_fn)]
docstring: Given a list of atoms, return a list of which are already installed.
  
      :param exec_fn: function to execute Popen and read stdout (for testing)
docstring_summary: Given a list of atoms, return a list of which are already installed.
docstring_tokens: Given a list of atoms return a list of which are already installed .
function: def portage_detect(atoms, exec_fn = read_stdout):
      """
      Given a list of atoms, return a list of which are already installed.
  
      :param exec_fn: function to execute Popen and read stdout (for testing)
      """
  
      # This is for testing, to make sure they're always checked in the same order
      # TODO: make testing better to not need this
      if isinstance(atoms, list):
          atoms.sort()
      
      return [a for a in atoms if portage_detect_single(a, exec_fn)]
function_tokens: def portage_detect ( atoms , exec_fn = read_stdout ) : # This is for testing, to make sure they're always checked in the same order # TODO: make testing better to not need this if isinstance ( atoms , list ) : atoms . sort ( ) return [ a for a in atoms if portage_detect_single ( a , exec_fn ) ]