code: def inline(script):
      """
      :type script: api.Script
      """
      new_lines = split_lines(python_bytes_to_unicode(script.source))
  
      dct = {}
  
      definitions = script.goto_assignments()
      assert len(definitions) == 1
      stmt = definitions[0]._definition
      usages = script.usages()
      inlines = [
          r
          for r in usages
          if not stmt.start_pos <= (r.line, r.column) <= stmt.end_pos
      ]
      inlines = sorted(
          inlines,
          key=lambda x: (x.module_path, x.line, x.column),
          reverse=True,
      )
      expression_list = stmt.expression_list()
      # don't allow multi-line refactorings for now.
      assert stmt.start_pos[0] == stmt.end_pos[0]
      index = stmt.start_pos[0] - 1
  
      line = new_lines[index]
      replace_str = line[
          expression_list[0].start_pos[1] : stmt.end_pos[1] + 1
      ]
      replace_str = replace_str.strip()
      # tuples need parentheses
      if expression_list and isinstance(expression_list[0], pr.Array):
          arr = expression_list[0]
          if replace_str[0] not in ["(", "[", "{"] and len(arr) > 1:
              replace_str = "(%s)" % replace_str
  
      # if it's the only assignment, remove the statement
      if len(stmt.get_defined_names()) == 1:
          line = line[: stmt.start_pos[1]] + line[stmt.end_pos[1] :]
  
      dct = _rename(inlines, replace_str)
      # remove the empty line
      new_lines = dct[script.path][2]
      if line.strip():
          new_lines[index] = line
      else:
          new_lines.pop(index)
  
      return Refactoring(dct)
  
file_path: catboost/contrib/python/jedi/py3/jedi/refactoring.py
imports: import difflib
  from parso import python_bytes_to_unicode, split_lines
  from jedi.evaluate import helpers
label_desc: Use image node_id 4 for calling a global function with example usage: inline(script) and returns: Refactoring