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

Code before:
        frame or not.

        Parameters
        ----------
        mobject : Mobject
            The mobject for which the checking needs to be done.

        Returns
        -------
        bool
            True if in frame, False otherwise.
        """
        fc = self.frame_center
        fh = self.frame_height
        fw = self.frame_width
        return not reduce(
            op.or_,
            [
                mobject.get_right()[0] < fc[0] - fw,
                mobject.get_bottom()[1] > fc[1] + fh,
                mobject.get_left()[0] > fc[0] + fw,
                mobject.get_top()[1] < fc[1] - fh,
            ],
        )

    def capture_mobject(self, mobject, **kwargs):
        """Capture mobjects by printing them on :attr:`pixel_array`.

        This is a single-mobject version of :meth:`capture_mobjects`.

        Parameters
        ----------
        mobject : :class:`~.Mobject`
            Mobject to capture.

        kwargs : Any
            Keyword arguments to be passed to :meth:`get_mobjects_to_display`.

        """
        return self.capture_mobjects([mobject], **kwargs)

    def capture_mobjects(self, mobjects, **kwargs):
        """Capture mobjects by printing them on :attr:`pixel_array`.

        This is the essential function that converts the contents of a Scene
        into an array, which is then converted to an image or video.

        Parameters
        ----------
        mobjects : :class:`~.Mobject`
            Mobjects to capture.

Review comment (suggestion):
Type hints should be added here instead of in the docstring.

```suggestion
    def capture_mobject(self, mobject : Mobject, **kwargs : Any):
```

Please add `Any` to the `typing` import on line 12 of this file.

Code after:
        frame or not.

        Parameters
        ----------
        mobject : Mobject
            The mobject for which the checking needs to be done.

        Returns
        -------
        bool
            True if in frame, False otherwise.
        """
        fc = self.frame_center
        fh = self.frame_height
        fw = self.frame_width
        return not reduce(
            op.or_,
            [
                mobject.get_right()[0] < fc[0] - fw,
                mobject.get_bottom()[1] > fc[1] + fh,
                mobject.get_left()[0] > fc[0] + fw,
                mobject.get_top()[1] < fc[1] - fh,
            ],
        )

    def capture_mobject(self, mobject: Mobject, **kwargs: Any):
        """Capture mobjects by storing it in :attr:`pixel_array`.

        This is a single-mobject version of :meth:`capture_mobjects`.

        Parameters
        ----------
        mobject
            Mobject to capture.

        kwargs
            Keyword arguments to be passed to :meth:`get_mobjects_to_display`.

        """
        return self.capture_mobjects([mobject], **kwargs)

    def capture_mobjects(self, mobjects, **kwargs):
        """Capture mobjects by printing them on :attr:`pixel_array`.

        This is the essential function that converts the contents of a Scene
        into an array, which is then converted to an image or video.

        Parameters
        ----------
        mobjects : :class:`~.Mobject`
            Mobjects to capture.