code: def _line_and_col_to_offset(lines, line, col):
      
  
      offset = 0
      for index, contents in enumerate(lines, 1):
          if index == line:
              return offset + col
  
          offset += len(contents)
  
      raise ValueError("Offset {}:{} not found".format(line, col))
docs: Figure out the offset into a file for a particular line and col.
  
      This can return offsets that don't actually exist in the file. If you
      specify a line that exists and a col that is past the end of that line, this
      will return a "fake" offset. This is to account for the fact that a
      WorkItem's end_pos is one-past the end of a mutation, and hence potentially
      one-past the end of a file.
  
      Args:
          lines: A sequence of the lines in a file.
          line: A one-based index indicating the line in the file.
          col: A zero-based index indicating the column on `line`.
  
      Raises: ValueError: If the specified line found in the file.