Enclosing function.

def my_func(version):  # noqa: D202
    """Enclosing function."""

    class MyClass(object):
        """Enclosed class."""

        if version == 2:
            import docs.support.python2_module as pm
        else:
            import docs.support.python3_module as pm

        def __init__(self, value):
            self._value = value

        def _get_value(self):
            return self._value

        value = property(_get_value, pm._set_value, None, "Value property")