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

Code before:
    import importlib_metadata

__version__ = importlib_metadata.version(__name__)


import sys

# Importing the config module should be the first thing we do, since other
# modules depend on the global config dict for initialization.
from ._config import *

# Workaround to set the renderer passed via CLI args *before* importing
# Manim's classes (as long as the metaclass approach for switching
# between OpenGL and cairo rendering is in place, classes depend
# on the value of config.renderer).
for i, arg in enumerate(sys.argv):
    if arg.startswith("--renderer"):
        if "=" in arg:
            _, parsed_renderer = arg.split("=")
        else:
            parsed_renderer = sys.argv[i + 1]
        config.renderer = parsed_renderer
    if arg == "--use_opengl_renderer":
        config.renderer = "opengl"
    if arg == "--use_webgl_renderer":
        config.renderer = "webgl"


from .animation.animation import *
from .animation.composition import *
from .animation.creation import *
from .animation.fading import *
from .animation.growing import *
from .animation.indication import *
from .animation.movement import *
from .animation.numbers import *
from .animation.rotation import *
from .animation.transform import *
from .animation.transform_matching_parts import *
from .animation.update import *
from .camera.camera import *
from .camera.mapping_camera import *
from .camera.moving_camera import *
from .camera.multi_camera import *
from .camera.three_d_camera import *
from .constants import *
from .container import *
from .mobject.changing import *
from .mobject.coordinate_systems import *
from .mobject.frame import *
from .mobject.functions import *

Review comment (suggestion):
```suggestion
    elif arg == "--use_opengl_renderer":
        config.renderer = "opengl"
    elif arg == "--use_webgl_renderer":
        config.renderer = "webgl"
```

Code after:
    import importlib_metadata

__version__ = importlib_metadata.version(__name__)


import sys

# Importing the config module should be the first thing we do, since other
# modules depend on the global config dict for initialization.
from ._config import *

# Workaround to set the renderer passed via CLI args *before* importing
# Manim's classes (as long as the metaclass approach for switching
# between OpenGL and cairo rendering is in place, classes depend
# on the value of config.renderer).
for i, arg in enumerate(sys.argv):
    if arg.startswith("--renderer"):
        if "=" in arg:
            _, parsed_renderer = arg.split("=")
        else:
            parsed_renderer = sys.argv[i + 1]
        config.renderer = parsed_renderer
    elif arg == "--use_opengl_renderer":
        config.renderer = "opengl"
    elif arg == "--use_webgl_renderer":
        config.renderer = "webgl"


from .animation.animation import *
from .animation.composition import *
from .animation.creation import *
from .animation.fading import *
from .animation.growing import *
from .animation.indication import *
from .animation.movement import *
from .animation.numbers import *
from .animation.rotation import *
from .animation.transform import *
from .animation.transform_matching_parts import *
from .animation.update import *
from .camera.camera import *
from .camera.mapping_camera import *
from .camera.moving_camera import *
from .camera.multi_camera import *
from .camera.three_d_camera import *
from .constants import *
from .container import *
from .mobject.changing import *
from .mobject.coordinate_systems import *
from .mobject.frame import *
from .mobject.functions import *