class_docstr: Create a dataset sibling on a UNIX-like Shell (local or SSH)-accessible machine
  
  Given a local dataset, and a path or SSH login information this command
  creates a remote dataset repository and configures it as a dataset sibling
  to be used as a publication target (see `publish` command).
  
  Various properties of the remote sibling can be configured (e.g. name
  location on the server, read and write access URLs, and access
  permissions.
  
  Optionally, a basic web-viewer for DataLad datasets can be installed
  at the remote location.
  
  This command supports recursive processing of dataset hierarchies, creating
  a remote sibling for each dataset in the hierarchy. By default, remote
  siblings are created in hierarchical structure that reflects the
  organization on the local file system. However, a simple templating
  mechanism is provided to produce a flat list of datasets (see
  --target-dir).
docstr: Given a dataset, and name of the remote, run command via ssh
  
  Parameters
  ----------
  cmd: str
    Will be .format()'ed given the `path` to the dataset on remote
  
  Returns
  -------
  out
  
  Raises
  ------
  CommandError
docstr_tok: ["Given","a","dataset",",","and","name","of","the","remote",",","run","command","via","ssh","Parameters","--","--","--","--","--","cmd",":","str","Will","be",".format","(",")","'ed","given","the","`","path","`","to","the","dataset","on","remote","Returns","--","--","--","-","out","Raises","--","--","--","CommandError"]
code: def _run_on_ds_ssh_remote(ds, name, ssh, cmd):
      """Given a dataset, and name of the remote, run command via ssh
  
      Parameters
      ----------
      cmd: str
        Will be .format()'ed given the `path` to the dataset on remote
  
      Returns
      -------
      out
  
      Raises
      ------
      CommandError
      """
      remote_url = CreateSibling._get_remote_url(ds, name)
      remote_ri = RI(remote_url)
      out, err = ssh(cmd.format(path=sh_quote(remote_ri.path)))
      if err:
          lgr.warning("Got stderr while calling ssh: %s", err)
      return out
  
imports: import logging
  import os
  from os.path import curdir
  import shlex
  from os.path import join
  from os.path import normpath, relpath
  from looseversion import LooseVersion
  from datalad import ssh_manager
  from datalad.cmd import CommandError, StdOutErrCapture, WitlessRunner
  from datalad.consts import TIMESTAMP_FMT, WEB_META_LOG
  from datalad.core.local.diff import diff_dataset
  from datalad.distribution.dataset import Dataset, EnsureDataset, datasetmethod, require_dataset, resolve_path
  from datalad.distribution.siblings import Siblings, _DelayedSuper
  from datalad.interface.base import Interface, build_doc, eval_results
  from datalad.interface.common_opts import annex_group_opt, annex_groupwanted_opt, annex_wanted_opt, as_common_datasrc, inherit_opt, publish_by_default, publish_depends, recursion_flag, recursion_limit
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.constraints import EnsureBool, EnsureChoice, EnsureNone, EnsureStr
  from datalad.support.exceptions import CapturedException, InsufficientArgumentsError, MissingExternalDependency
  from datalad.support.external_versions import external_versions
  from datalad.support.network import RI, PathRI, is_ssh
  from datalad.support.param import Parameter
  from datalad.ui import ui
  from datalad.utils import _path_, ensure_list, make_tempfile, on_windows
  from datalad.utils import quote_cmdlinearg
  from datalad.utils import slash_join
label_desc: Use image node_id 2 for calling the CreateSibling obj's underlying member method code with example usage: obj._run_on_ds_ssh_remote(ds, name, ssh, cmd) and returns: out