code: def resolve_types(
      cls,
      globalns=None,
      localns=None,
      attribs=None,
      include_extras=True,
  ):
      """
      Resolve any strings and forward annotations in type annotations.
  
      This is only required if you need concrete types in `Attribute`'s *type*
      field. In other words, you don't need to resolve your types if you only
      use them for static type checking.
  
      With no arguments, names will be looked up in the module in which the class
      was created. If this is not what you want, e.g. if the name only exists
      inside a method, you may pass *globalns* or *localns* to specify other
      dictionaries in which to look up these names. See the docs of
      `typing.get_type_hints` for more details.
  
      :param type cls: Class to resolve.
      :param Optional[dict] globalns: Dictionary containing global variables.
      :param Optional[dict] localns: Dictionary containing local variables.
      :param Optional[list] attribs: List of attribs for the given class.
          This is necessary when calling from inside a ``field_transformer``
          since *cls* is not an *attrs* class yet.
      :param bool include_extras: Resolve more accurately, if possible.
          Pass ``include_extras`` to ``typing.get_hints``, if supported by the
          typing module. On supported Python versions (3.9+), this resolves the
          types more accurately.
  
      :raise TypeError: If *cls* is not a class.
      :raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
          class and you didn't pass any attribs.
      :raise NameError: If types cannot be resolved because of missing variables.
  
      :returns: *cls* so you can use this function also as a class decorator.
          Please note that you have to apply it **after** `attrs.define`. That
          means the decorator has to come in the line **before** `attrs.define`.
  
      ..  versionadded:: 20.1.0
      ..  versionadded:: 21.1.0 *attribs*
      ..  versionadded:: 23.1.0 *include_extras*
  
      """
      # Since calling get_type_hints is expensive we cache whether we've
      # done it already.
      if getattr(cls, "__attrs_types_resolved__", None) != cls:
          import typing
  
          kwargs = {"globalns": globalns, "localns": localns}
  
          if PY_3_9_PLUS:
              kwargs["include_extras"] = include_extras
  
          hints = typing.get_type_hints(cls, **kwargs)
          for field in fields(cls) if attribs is None else attribs:
              if field.name in hints:
                  # Since fields have been frozen we must work around it.
                  _obj_setattr(field, "type", hints[field.name])
          # We store the class we resolved so that subclasses know they haven't
          # been resolved.
          cls.__attrs_types_resolved__ = cls
  
      # Return the class so you can use it as a decorator too.
      return cls
  
file_path: catboost/contrib/python/attrs/py3/attr/_funcs.py
imports: import copy
  from ._compat import PY_3_9_PLUS, get_generic_base
  from ._make import NOTHING, _obj_setattr, fields
  from .exceptions import AttrsAttributeNotFoundError
label_desc: Use image node_id 7 for calling a global function with example usage: resolve_types(cls, globalns, localns, attribs, include_extras) and returns: cls