parameters: (cmd, directory)
return_statement: return stdout
docstring: Runs a command in a directory and returns its standard output stream.
  
      Captures the standard error stream.
  
      Raises a RuntimeError if the command fails to launch or otherwise fails.
docstring_summary: Runs a command in a directory and returns its standard output stream.
docstring_tokens: Runs a command in a directory and returns its standard output stream .
function: def command_output(cmd, directory):
      """Runs a command in a directory and returns its standard output stream.
  
      Captures the standard error stream.
  
      Raises a RuntimeError if the command fails to launch or otherwise fails.
      """
      p = subprocess.Popen(cmd,
                           cwd=directory,
                           stdout=subprocess.PIPE,
                           stderr=subprocess.PIPE)
      (stdout, _) = p.communicate()
      if p.returncode != 0:
          raise RuntimeError('Failed to run %s in %s' % (cmd, directory))
      return stdout
function_tokens: def command_output ( cmd , directory ) : p = subprocess . Popen ( cmd , cwd = directory , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) ( stdout , _ ) = p . communicate ( ) if p . returncode != 0 : raise RuntimeError ( 'Failed to run %s in %s' % ( cmd , directory ) ) return stdout