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

Code before:
    def get_points_defining_boundary(self):
        # Probably returns all anchors, but this is weird regarding  the name of the method.
        return np.array(list(it.chain(*[sm.get_anchors() for sm in self.get_family()])))

    def get_arc_length(self, sample_points_per_curve: Optional[float] = None) -> float:
        """Return the approximated length of the whole curve.

        Parameters
        ----------
        sample_points_per_curve
            Number of sample points per curve used to approximate the length. More points result in a better approximation.

        Returns
        -------
        float
            The length of the curve
        """
        kwargs = {}
        if sample_points_per_curve is not None:
            kwargs["sample_points"] = sample_points_per_curve
        return np.sum(
            [
                length
                for curve, length in self.get_curve_functions_with_lengths(**kwargs)
            ]
        )

    # Alignment
    def align_points(self, vmobject):
        # This probably makes the current vmobject and the given one have the same number of points,
        # by adding extra points to the last sub-path. This method is never used in the whole library.
        self.align_rgbas(vmobject)
        if self.get_num_points() == vmobject.get_num_points():
            return

        for mob in self, vmobject:
            # If there are no points, add one to
            # wherever the "center" is
            if mob.has_no_points():
                mob.start_new_path(mob.get_center())
            # If there's only one point, turn it into
            # a null curve
            if mob.has_new_path_started():
                mob.add_line_to(mob.get_last_point())

        # Figure out what the subpaths are, and align
        subpaths1 = self.get_subpaths()
        subpaths2 = vmobject.get_subpaths()
        n_subpaths = max(len(subpaths1), len(subpaths2))
        # Start building new ones
        new_path1 = np.zeros((0, self.dim))

Review comment (refactor):
```suggestion
        return np.sum(length for _, length in self.get_curve_functions_with_lengths(sample_points=sample_points_per_curve))
```
Might be too long for black's tastes but that's the structure I think this should follow. The use of `_, length` explicates that we don't care about the first element. And then `get_nth_curve_function_with_length` should have `sample_points` default to `None` and then something like
```py
if sample_points is None:
    sample_points = 10
```

Code after:
            list(
                it.chain(
                    *zip(
                        self.get_start_anchors(),
                        self.get_end_anchors(),
                    )
                )
            )
        )

    def get_points_defining_boundary(self):
        # Probably returns all anchors, but this is weird regarding  the name of the method.
        return np.array(list(it.chain(*[sm.get_anchors() for sm in self.get_family()])))

    def get_arc_length(self, sample_points_per_curve: Optional[int] = None) -> float:
        """Return the approximated length of the whole curve.

        Parameters
        ----------
        sample_points_per_curve
            Number of sample points per curve used to approximate the length. More points result in a better approximation.

        Returns
        -------
        float
            The length of the :class:`VMobject`.
        """

        return np.sum(
            length
            for _, length in self.get_curve_functions_with_lengths(
                sample_points=sample_points_per_curve
            )
        )

    # Alignment
    def align_points(self, vmobject):
        # This probably makes the current vmobject and the given one have the same number of points,
        # by adding extra points to the last sub-path. This method is never used in the whole library.
        self.align_rgbas(vmobject)
        if self.get_num_points() == vmobject.get_num_points():
            return

        for mob in self, vmobject:
            # If there are no points, add one to
            # wherever the "center" is
            if mob.has_no_points():
                mob.start_new_path(mob.get_center())
            # If there's only one point, turn it into
            # a null curve
            if mob.has_new_path_started():