code: def back_tick(cmd, ret_err=False, as_str=True, raise_err=None):
      
      if raise_err is None:
          raise_err = False if ret_err else True
      cmd_is_seq = isinstance(cmd, (list, tuple))
      proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=not cmd_is_seq)
      out, err = proc.communicate()
      retcode = proc.returncode
      cmd_str = ' '.join(cmd) if cmd_is_seq else cmd
      if retcode is None:
          proc.terminate()
          raise RuntimeError(cmd_str + ' process did not terminate')
      if raise_err and retcode != 0:
          raise RuntimeError('{0} returned code {1} with error {2}'.format(
                             cmd_str, retcode, err.decode('latin-1')))
      out = out.strip()
      if as_str:
          out = out.decode('latin-1')
      if not ret_err:
          return out
      err = err.strip()
      if as_str:
          err = err.decode('latin-1')
      return out, err
docs: Run command `cmd`, return stdout, or stdout, stderr if `ret_err`
  
      Roughly equivalent to ``check_output`` in Python 2.7
  
      Parameters
      ----------
      cmd : sequence
          command to execute
      ret_err : bool, optional
          If True, return stderr in addition to stdout.  If False, just return
          stdout
      as_str : bool, optional
          Whether to decode outputs to unicode string on exit.
      raise_err : None or bool, optional
          If True, raise RuntimeError for non-zero return code. If None, set to
          True when `ret_err` is False, False if `ret_err` is True
  
      Returns
      -------
      out : str or tuple
          If `ret_err` is False, return stripped string containing stdout from
          `cmd`.  If `ret_err` is True, return tuple of (stdout, stderr) where
          ``stdout`` is the stripped stdout, and ``stderr`` is the stripped
          stderr.
  
      Raises
      ------
      Raises RuntimeError if command returns non-zero exit code and `raise_err`
      is True