parameters: (cmd, directory)
return_statement: return p.returncode
docstring: Runs a command in a directory and returns its return value.
  
      Captures the standard error stream.
docstring_summary: Runs a command in a directory and returns its return value.
docstring_tokens: Runs a command in a directory and returns its return value .
function: def command_retval(cmd, directory):
      """Runs a command in a directory and returns its return value.
  
      Captures the standard error stream.
      """
      p = subprocess.Popen(cmd,
                           cwd=directory,
                           stdout=subprocess.PIPE)
      p.communicate()
      return p.returncode
function_tokens: def command_retval ( cmd , directory ) : p = subprocess . Popen ( cmd , cwd = directory , stdout = subprocess . PIPE ) p . communicate ( ) return p . returncode