<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _init_nodes(self, config):
 """ Gathers dependency sets onto _nodes """

        if not isinstance(config, dict):
            raise TypeError('"config" must be a dictionary')

        for (name, conf) in six.iteritems(config):
            args = [] if 'args' not in conf else conf['args']
            kwargs = {} if 'kwargs' not in conf else conf['kwargs']

            dependencies = set()
            arg_deps = self._get_dependencies_from_args(args)
            kwarg_deps = self._get_dependencies_from_kwargs(kwargs)

            dependencies.update(arg_deps)
            dependencies.update(kwarg_deps)

            self._nodes[name] = dependencies