<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def overlay_gateway_type(self, **kwargs):
 """Configure Overlay Gateway Type on vdx switches Args: gw_name: Name of Overlay Gateway gw_type: Type of Overlay Gateway(hardware-vtep/ layer2-extension/nsx) get (bool):
 Get config instead of editing config. (True, False) delete (bool):
 True, delete the overlay gateway type. (True, False) callback (function):
 A function executed upon completion of the method. The only parameter passed to `callback` will be the ``ElementTree`` `config`. Returns: Return value of `callback`. Raises: KeyError: if `gw_name`, 'gw_type' is not passed. ValueError: if `gw_name`, 'gw_type' is invalid. Examples: """


        callback = kwargs.pop('callback', self._callback)
        get_config = kwargs.pop('get', False)
        if not get_config:
            gw_name = kwargs.pop('gw_name')
            gw_type = kwargs.pop('gw_type')
            gw_args = dict(name=gw_name, gw_type=gw_type)
            overlay_gw = getattr(self._tunnels, 'overlay_gateway_gw_type')
            config = overlay_gw(**gw_args)

        if get_config:
            overlay_gw = getattr(self._tunnels, 'overlay_gateway_gw_type')
            config = overlay_gw(name='', gw_type='')
            output = callback(config, handler='get_config')
            if output.data.find('.//{*}name') is not None:
                gwtype = output.data.find('.//{*}gw-type').text
                return gwtype
            else:
                return None

        return callback(config)