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

Code before:
            )
        else:
            self.label = self.label_constructor(str(text), font_size=font_size)

        self.brace.put_at_tip(self.label)
        self.add(self.brace, self.label)

    def creation_anim(
        self,
        label_anim: type[Animation] = FadeIn,
        brace_anim: type[Animation] = GrowFromCenter,
    ) -> AnimationGroup:
        return AnimationGroup(brace_anim(self.brace), label_anim(self.label))

    # TODO: This method is only called from the method change_brace_label, which is
    # not called from any location in the current codebase.
    # TODO: The Mobject could be more specific.
    def shift_brace(self, obj: Mobject, **kwargs: Any) -> Self:
        if isinstance(obj, list):
            obj = self.get_group_class()(*obj)
        self.brace = Brace(obj, self.brace_direction, **kwargs)
        self.brace.put_at_tip(self.label)
        return self

    # TODO: This method is only called from the method change_brace_label, which is
    # not called from any location in the current codebase.
    def change_label(self, *text: str, **kwargs: Any) -> Self:
        self.label = self.label_constructor(*text, **kwargs)

        self.brace.put_at_tip(self.label)
        return self

    # TODO: This method is not called from anywhere in the codebase.
    def change_brace_label(self, obj: Mobject, *text: str, **kwargs: Any) -> Self:
        self.shift_brace(obj)
        self.change_label(*text, **kwargs)
        return self


class BraceText(BraceLabel):
    def __init__(
        self, obj: Mobject, text: str, label_constructor: type[Tex] = Tex, **kwargs: Any
    ):
        super().__init__(obj, text, label_constructor=label_constructor, **kwargs)


class BraceBetweenPoints(Brace):
    """Similar to Brace, but instead of taking a mobject it uses 2
    points to place the brace.

    A fitting direction for the brace is

Review comment (suggestion):
Although it's not called anywhere, it seems like an useful method to be exposed to the end user. In that case, the real problem would be that it's not documented at all. This could be a good follow-up PR.
```suggestion
```

Code after:
            self.label = self.label_constructor(str(text), font_size=font_size)

        self.brace.put_at_tip(self.label)
        self.add(self.brace, self.label)

    def creation_anim(
        self,
        label_anim: type[Animation] = FadeIn,
        brace_anim: type[Animation] = GrowFromCenter,
    ) -> AnimationGroup:
        return AnimationGroup(brace_anim(self.brace), label_anim(self.label))

    def shift_brace(self, obj: Mobject, **kwargs: Any) -> Self:
        if isinstance(obj, list):
            obj = self.get_group_class()(*obj)
        self.brace = Brace(obj, self.brace_direction, **kwargs)
        self.brace.put_at_tip(self.label)
        return self

    def change_label(self, *text: str, **kwargs: Any) -> Self:
        self.label = self.label_constructor(*text, **kwargs)  # type: ignore[arg-type]
        self.brace.put_at_tip(self.label)
        return self

    def change_brace_label(self, obj: Mobject, *text: str, **kwargs: Any) -> Self:
        self.shift_brace(obj)
        self.change_label(*text, **kwargs)
        return self


class BraceText(BraceLabel):
    def __init__(
        self,
        obj: Mobject,
        text: str,
        label_constructor: type[SingleStringMathTex | Text] = Text,
        **kwargs: Any,
    ):
        super().__init__(obj, text, label_constructor=label_constructor, **kwargs)


class BraceBetweenPoints(Brace):
    """Similar to Brace, but instead of taking a mobject it uses 2
    points to place the brace.

    A fitting direction for the brace is
    computed, but it still can be manually overridden.
    If the points go from left to right, the brace is drawn from below.
    Swapping the points places the brace on the opposite side.

    Parameters