class_docstr: A piece of text with associated style. Segments are produced by the Console render process and
  are ultimately converted in to strings to be written to the terminal.
  
  Args:
      text (str): A piece of text.
      style (:class:`~rich.style.Style`, optional): An optional style to apply to the text.
      control (Tuple[ControlCode], optional): Optional sequence of control codes.
  
  Attributes:
      cell_length (int): The cell length of this Segment.
code: def _split_cells(
      cls, segment: "Segment", cut: int
  ) -> Tuple["Segment", "Segment"]:
      text, style, control = segment
      _Segment = Segment
  
      cell_length = segment.cell_length
      if cut >= cell_length:
          return segment, _Segment("", style, control)
  
      cell_size = get_character_cell_size
  
      pos = int((cut / cell_length) * (len(text) - 1))
  
      before = text[:pos]
      cell_pos = cell_len(before)
      if cell_pos == cut:
          return (
              _Segment(before, style, control),
              _Segment(text[pos:], style, control),
          )
      while pos < len(text):
          char = text[pos]
          pos += 1
          cell_pos += cell_size(char)
          before = text[:pos]
          if cell_pos == cut:
              return (
                  _Segment(before, style, control),
                  _Segment(text[pos:], style, control),
              )
          if cell_pos > cut:
              return (
                  _Segment(before[: pos - 1] + " ", style, control),
                  _Segment(" " + text[pos:], style, control),
              )
  
      raise AssertionError("Will never reach here")
  
imports: from enum import IntEnum
  from functools import lru_cache
  from itertools import filterfalse
  from logging import getLogger
  from operator import attrgetter
  from typing import TYPE_CHECKING, Dict, Iterable, List, NamedTuple, Optional, Sequence, Tuple, Type, Union
  from .cells import _is_single_cell_widths, cached_cell_len, cell_len, get_character_cell_size, set_cell_size
  from .repr import Result, rich_repr
  from .style import Style
label_desc: Use image node_id 5 for calling the Segment obj's underlying member method code with example usage: obj._split_cells(cls, segment, cut) and returns: segment,  _Segment, _Segment,  _Segment, _Segment,  _Segment, _Segment,  _Segment