code: def check_sys_path_modifications(module_context):
      """
      Detect sys.path modifications within module.
      """
  
      def get_sys_path_powers(names):
          for name in names:
              power = name.parent.parent
              if power.type in ("power", "atom_expr"):
                  c = power.children
                  if (
                      c[0].type == "name"
                      and c[0].value == "sys"
                      and c[1].type == "trailer"
                  ):
                      n = c[1].children[1]
                      if n.type == "name" and n.value == "path":
                          yield name, power
  
      if module_context.tree_node is None:
          return []
  
      added = []
      try:
          possible_names = module_context.tree_node.get_used_names()[
              "path"
          ]
      except KeyError:
          pass
      else:
          for name, power in get_sys_path_powers(possible_names):
              expr_stmt = power.parent
              if len(power.children) >= 4:
                  added.extend(
                      _paths_from_list_modifications(
                          module_context, *power.children[2:4]
                      )
                  )
              elif (
                  expr_stmt is not None
                  and expr_stmt.type == "expr_stmt"
              ):
                  added.extend(
                      _paths_from_assignment(module_context, expr_stmt)
                  )
      return added
  
file_path: catboost/contrib/python/jedi/py2/jedi/evaluate/sys_path.py
imports: import os
  from jedi._compatibility import unicode, force_unicode, all_suffixes
  from jedi.evaluate.cache import evaluator_method_cache
  from jedi.evaluate.base_context import ContextualizedNode
  from jedi.evaluate.helpers import is_string
  from jedi.common.utils import traverse_parents
  from jedi.parser_utils import get_cached_code_lines
  from jedi import settings
  from jedi import debug
label_desc: Use image node_id 4 for calling a global function with example usage: check_sys_path_modifications(module_context) and returns: added, list