code: def _strip_rst_role(type_str):
      """
      Strip off the part looks like a ReST role in `type_str`.
  
      >>> _strip_rst_role(':class:`ClassName`')  # strip off :class:
      'ClassName'
      >>> _strip_rst_role(':py:obj:`module.Object`')  # works with domain
      'module.Object'
      >>> _strip_rst_role('ClassName')  # do nothing when not ReST role
      'ClassName'
  
      See also:
      http://sphinx-doc.org/domains.html#cross-referencing-python-objects
  
      """
      match = REST_ROLE_PATTERN.match(type_str)
      if match:
          return match.group(1)
      else:
          return type_str
  
file_path: catboost/contrib/python/jedi/py3/jedi/evaluate/docstrings.py
imports: import re
  from textwrap import dedent
  from parso import parse, ParserSyntaxError
  from jedi._compatibility import u
  from jedi.evaluate.utils import indent_block
  from jedi.evaluate.cache import evaluator_method_cache
  from jedi.evaluate.base_context import iterator_to_context_set, ContextSet, NO_CONTEXTS
  from jedi.evaluate.lazy_context import LazyKnownContexts
label_desc: Use image node_id 6 for calling a global function with example usage: _strip_rst_role(type_str) and returns: match, type_str