Repository: ManimCommunity/manim
File: manim/mobject/mobject.py (Python)

Code before:
    def arrange_in_grid(
        self,
        rows: Optional[int] = None,
        cols: Optional[int] = None,
        buff: Union[float, Tuple[float, float]] = MED_SMALL_BUFF,
        cell_alignment: np.ndarray = ORIGIN,
        row_alignments: Optional[str] = None,  # "ucd"
        col_alignments: Optional[str] = None,  # "lcr"
        row_heights: Optional[Iterable[Optional[float]]] = None,
        col_widths: Optional[Iterable[Optional[float]]] = None,
        flow_order: str = "rd",
        **kwargs,
    ) -> "Mobject":
        """Arrange submobjects in a grid.

        Parameters
        ----------
        rows
            The number of rows in the grid.
        cols
            The number of columns in the grid.
        buff
            The gap between grid cells. To specify a different buffer in horizontal and
            vertical direction, a tuple of two values can be given. The first value
            containing defines the buffer in horizontal, the second the buffer in vertical
            direction.
        cell_alignment
            The way each submobject is aligned in its grid cell.
        row_alignments
            The way each row of submobjects (from top to bottom) is aligned vertically.
            If defined the given string must only contain the following characters: "u"
            (up), "c" (centered) and "d" (down).
        col_alignments
            The way each column of submobjects (from left to righht) is aligned horizontally.
            If defined the given string must only contain the following characters: "l"
            (left), "c" (centered) and "r" (right).
        row_heights
            Specific heights for certain rows (from top to bottom). The given list can contain
            `None`. In that case the corresponding row will fit its height automatically based
            on the highest element in that row.
        col_widths
            Specific widths for certain columns (from left to right). The given list can contain
            `None`. In that case the corresponding column will fit its width automatically based
            on the widest element in that column.
        flow_order
            The order in which the grid gets filled with the submobjects. Can be one of the
            following values: "rd", "dr", "ld", "dl", "ru", "ur", "lu", "ul". For example,
            "dr" (down right) means: Fill the table column by column downwards, filling the
            columns rigthwards. "u" and "l" stand for upwards and leftwards.

        .. note:: If either :code:`rows` or :code:`cols` is not defined, it is set to the length of either

Review comment (suggestion):
This comment is a little verbose imo. Here's a suggestion to improve clarity.

```suggestion
        buff
            The gap between grid cells. To specify a different buffer in the horizontal and
            vertical directions, a tuple of two values can be given - `(row, col)`. 
```

Code after:
            self.center()
        return self

    def arrange_in_grid(
        self,
        rows: Optional[int] = None,
        cols: Optional[int] = None,
        buff: Union[float, Tuple[float, float]] = MED_SMALL_BUFF,
        cell_alignment: np.ndarray = ORIGIN,
        row_alignments: Optional[str] = None,  # "ucd"
        col_alignments: Optional[str] = None,  # "lcr"
        row_heights: Optional[Iterable[Optional[float]]] = None,
        col_widths: Optional[Iterable[Optional[float]]] = None,
        flow_order: str = "rd",
        **kwargs,
    ) -> "Mobject":
        """Arrange submobjects in a grid.

        Parameters
        ----------
        rows
            The number of rows in the grid.
        cols
            The number of columns in the grid.
        buff
            The gap between grid cells. To specify a different buffer in the horizontal and
            vertical directions, a tuple of two values can be given - ``(row, col)``.
        cell_alignment
            The way each submobject is aligned in its grid cell.
        row_alignments
            The vertical alignment for each row (top to bottom). Accepts the following characters: ``"u"`` -
            up, ``"c"`` - center, ``"d"`` - down.
        col_alignments
            The horizontal alignment for each column (left to right). Accepts the following characters ``"l"`` - left,
            ``"c"`` - center, ``"r"`` - right.
        row_heights
            Defines a list of heights for certain rows (top to bottom). If the list contains
            ``None``, the corresponding row will fit its height automatically based
            on the highest element in that row.
        col_widths
            Defines a list of widths for certain columns (left to right). If the list contains ``None``, the
            corresponding column will fit its width automatically based on the widest element in that column.
        flow_order
            The order in which submobjects fill the grid. Can be one of the following values:
            "rd", "dr", "ld", "dl", "ru", "ur", "lu", "ul". ("rd" -> fill rightwards then downwards)

        Returns
        -------
        Mobject
            The mobject.