<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _replace_services_in_kwargs(self, kwargs):
 """ Replace service references in keyed arguments dictionary """

        _check_type('kwargs', kwargs, dict)

        new_kwargs = {}
        for (name, value) in iteritems(kwargs):
            if isinstance(value, list):
                new_kwargs[name] = self._replace_services_in_args(value)
            elif isinstance(value, dict):
                new_kwargs[name] = self._replace_services_in_kwargs(value)
            elif isinstance(value, string_types):
                new_kwargs[name] = self._replace_service(value)
            else:
                new_kwargs[name] = value
        return new_kwargs