class_docstr: Class to convert between character offsets in a text string, and pairs (line, column) of 1-based
  line and 0-based column numbers, as used by tokens and AST nodes.
  
  This class expects unicode for input and stores positions in unicode. But it supports
  translating to and from utf8 offsets, which are used by ast parsing.
docstr: Given a 1-based line number and 0-based utf8 column, returns a 0-based unicode column.
docstr_tok: ["Given","a","1-based","line","number","and","0-based","utf8","column",",","returns","a","0-based","unicode","column","."]
code: def from_utf8_col(self, line, utf8_column):
      # type: (int, int) -> int
      """
      Given a 1-based line number and 0-based utf8 column, returns a 0-based unicode column.
      """
      offsets = self._utf8_offset_cache.get(line)
      if offsets is None:
          end_offset = (
              self._line_offsets[line]
              if line < len(self._line_offsets)
              else self._text_len
          )
          line_text = self._text[
              self._line_offsets[line - 1] : end_offset
          ]
  
          offsets = [
              i
              for i, c in enumerate(line_text)
              for byte in c.encode("utf8")
          ]
          offsets.append(len(line_text))
          self._utf8_offset_cache[line] = offsets
  
      return offsets[max(0, min(len(offsets) - 1, utf8_column))]
  
file_path: catboost/contrib/python/asttokens/asttokens/line_numbers.py
imports: import bisect
  import re
  from typing import Dict, List, Tuple
label_desc: Use image node_id 2 for calling the LineNumbers obj's underlying member method code with example usage: obj.from_utf8_col(line, utf8_column) and returns: offsets