class_docstr: Base class for repository detection 
class_docstr_tok: ["Base","class","for","repository","detection"]
docstr: Run a command and return its output 
docstr_tok: ["Run","a","command","and","return","its","output"]
code: def _get_command_output(
      self, path, name, command, commands=None, strip=True
  ):
      """Run a command and return its output"""
      try:
          return get_command_output(command, path, strip=strip)
  
      except (CalledProcessError, UnicodeDecodeError) as ex:
          if not name.endswith(self._fallback):
              fallback_command = attr.asdict(
                  commands or self._get_commands()
              ).get(name + self._fallback)
              if fallback_command:
                  try:
                      return get_command_output(
                          fallback_command, path, strip=strip
                      )
                  except (CalledProcessError, UnicodeDecodeError):
                      pass
          self._get_logger().warning(
              "Can't get {} information for {} repo in {}".format(
                  name, self.type_name, path
              )
          )
          # full details only in debug
          self._get_logger().debug(
              "Can't get {} information for {} repo in {}: {}".format(
                  name, self.type_name, path, str(ex)
              )
          )
          return ""
  
imports: import abc
  import os
  from subprocess import call, CalledProcessError
  import attr
  import six
  from pathlib2 import Path
  from ....config.defs import VCS_REPO_TYPE, VCS_DIFF, VCS_STATUS, VCS_ROOT, VCS_BRANCH, VCS_COMMIT_ID, VCS_REPOSITORY_URL
  from ....debugging import get_logger
  from .util import get_command_output
label_desc: Use image node_id 4 for calling the Detector obj's underlying member method code with example usage: obj._get_command_output(path, name, command, commands, strip) and returns: get_command_output, str, get_command_output