parameters: (cmd, cwd=None)
return_statement: return out.decode("utf-8").rstrip()
docstring: Run a command and return its output as a string.
docstring_summary: Run a command and return its output as a string.
docstring_tokens: Run a command and return its output as a string .
function: def get_cmd_output(cmd, cwd=None):
      """Run a command and return its output as a string."""
      if cwd is not None:
          out = subprocess.check_output(cmd, cwd=cwd)
      else:
          out = subprocess.check_output(cmd)
      return out.decode("utf-8").rstrip()
function_tokens: def get_cmd_output ( cmd , cwd = None ) : if cwd is not None : out = subprocess . check_output ( cmd , cwd = cwd ) else : out = subprocess . check_output ( cmd ) return out . decode ( "utf-8" ) . rstrip ( )