def __init__(
        self,
        widget,
        name,
        widget_coord_name,
        switch_coord_name,
        direction_name,
        extra_callable=None,
    ):
        """Store variables and perform setups.

        widget
            Any object with a translate method and a
            rect.
        name
            An unique string representing the name of the
            widget being stored for hiding/showing.
        widget_coord_name
            Point name of the point in the widget rect
            wherein to anchor the switch.
        switch_coord_name
            Point name of the point in the switch rect
            used to anchor the switch.
        direction_name
            String whose value is either 'up', 'down',
            'left' or 'right'. Indicates the direction
            wherein to hide the widget.
        """
        self.widget = widget
        self.name = name
        self.switch_coord_name = switch_coord_name
        self.widget_coord_name = widget_coord_name
        self.extra_callable = extra_callable

        ### check direction_name value

        if direction_name not in ALLOWED_DIRECTION_NAMES:

            raise ValueError(
                "'direction_name' must one of the"
                + " following string values: "
                + str(ALLOWED_DIRECTION_NAMES)
            )

        else:
            self.direction_name = direction_name

        ### reference surface for 'shown' state in the
        ### 'image' attribute and obtain a rect from it

        self.image = SURFACE_MAP["shown"]
        self.rect = self.image.get_rect()

        ### position object relative to widget rect and
        ### also store such positioning method as
        ### a window resize setup

        self.snap_switch_to_widget()

        APP_REFS.window_resize_setups.append(self.snap_switch_to_widget)

        ### create control to help with translations
        self.is_hiding = cycle([True, False])

        ### assign update behaviour
        self.update = empty_function
Store variables and perform setups.

        widget
            Any object with a translate method and a
            rect.
        name
            An unique string representing the name of the
            widget being stored for hiding/showing.
        widget_coord_name
            Point name of the point in the widget rect
            wherein to anchor the switch.
        switch_coord_name
            Point name of the point in the switch rect
            used to anchor the switch.
        direction_name
            String whose value is either 'up', 'down',
            'left' or 'right'. Indicates the direction
            wherein to hide the widget.
        
nodezator/hideswitch.py