class_docstr: Adds integration with ya, helps in finding dependencies
class_docstr_tok: ["Adds","integration","with","ya",",","helps","in","finding","dependencies"]
code: def _detect_source_root(self):
      root = None
      try:
          import library.python.find_root
  
          # try to determine source root from cwd
          cwd = os.getcwd()
          root = library.python.find_root.detect_root(cwd)
  
          if not root:
              # try to determine root pretending we are in the test work dir made from --keep-temps run
              env_subdir = os.path.join("environment", "arcadia")
              root = library.python.find_root.detect_root(
                  cwd,
                  detector=lambda p: os.path.exists(
                      os.path.join(p, env_subdir)
                  ),
              )
      except ImportError:
          logging.warning("Unable to import library.python.find_root")
  
      return root
  
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 17 for calling the Ya obj's underlying member method code with example usage: obj._detect_source_root() and returns: root