class_docstr: Adds integration with ya, helps in finding dependencies
class_docstr_tok: ["Adds","integration","with","ya",",","helps","in","finding","dependencies"]
code: def get_binary(self, *path):
      assert (
          self._build_root
      ), "Build root was not set neither determined, use --build-root to set it explicitly"
      path = list(path)
      if os.name == "nt":
          if not path[-1].endswith(".exe"):
              path[-1] += ".exe"
  
      target_dirs = [self.build_root]
      # Search for binaries within PATH dirs to be able to get path to the binaries specified by basename for exectests
      if "PATH" in os.environ:
          target_dirs += os.environ["PATH"].split(":")
  
      for target_dir in target_dirs:
          binary_path = os.path.join(target_dir, *path)
          if os.path.exists(binary_path):
              yatest_logger.debug("Binary was found by %s", binary_path)
              return binary_path
  
      error_message = "Cannot find binary '{binary}': make sure it was added in the DEPENDS section".format(
          binary=path
      )
      yatest_logger.debug(error_message)
      if self._mode == RunMode.Run:
          raise TestMisconfigurationException(error_message)
  
imports: import os
  import sys
  import logging
  import json
  import six
  from .tools import to_str
  from .external import ExternalDataInfo
label_desc: Use image node_id 11 for calling the Ya obj's underlying member method code with example usage: obj.get_binary() and returns: binary_path