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.
docstr: Divides an iterable of segments in to portions.
  
  Args:
      cuts (Iterable[int]): Cell positions where to divide.
  
  Yields:
      [Iterable[List[Segment]]]: An iterable of Segments in List.
docstr_tok: ["Divides","an","iterable","of","segments","in","to","portions",".","Args",":","cuts","(","Iterable","[","int","]",")",":","Cell","positions","where","to","divide",".","Yields",":","[","Iterable","[","List","[","Segment","]","]","]",":","An","iterable","of","Segments","in","List","."]
code: def divide(
      cls, segments: Iterable["Segment"], cuts: Iterable[int]
  ) -> Iterable[List["Segment"]]:
      """Divides an iterable of segments in to portions.
  
      Args:
          cuts (Iterable[int]): Cell positions where to divide.
  
      Yields:
          [Iterable[List[Segment]]]: An iterable of Segments in List.
      """
      split_segments: List["Segment"] = []
      add_segment = split_segments.append
  
      iter_cuts = iter(cuts)
  
      while True:
          cut = next(iter_cuts, -1)
          if cut == -1:
              return []
          if cut != 0:
              break
          yield []
      pos = 0
  
      segments_clear = split_segments.clear
      segments_copy = split_segments.copy
  
      _cell_len = cached_cell_len
      for segment in segments:
          text, _style, control = segment
          while text:
              end_pos = pos if control else pos + _cell_len(text)
              if end_pos < cut:
                  add_segment(segment)
                  pos = end_pos
                  break
  
              if end_pos == cut:
                  add_segment(segment)
                  yield segments_copy()
                  segments_clear()
                  pos = end_pos
  
                  cut = next(iter_cuts, -1)
                  if cut == -1:
                      if split_segments:
                          yield segments_copy()
                      return
  
                  break
  
              else:
                  before, segment = segment.split_cells(cut - pos)
                  text, _style, control = segment
                  add_segment(before)
                  yield segments_copy()
                  segments_clear()
                  pos = cut
  
              cut = next(iter_cuts, -1)
              if cut == -1:
                  if split_segments:
                      yield segments_copy()
                  return
  
      yield segments_copy()
  
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 23 for calling the Segment obj's underlying member method code with example usage: obj.divide(cls, segments, cuts) and returns: list