'Adds the given ``key_value_pairs`` and ``items`` to the ``dictionary``.
Giving items as ``key_value_pairs`` means giving keys and values
as separate arguments:
| Set To Dictionary | ${D1} | key | value | second | ${2} |
| ${D1} = {\'a\': 1, \'key\': \'value\', \'second\': 2}
Starting from Robot Framework 2.8.1, items can also be given as kwargs
using ``key=value`` syntax:
| Set To Dictionary | ${D1} | key=value | second=${2} |
The latter syntax is typically more convenient to use, but it has
a limitation that keys must be strings.
If given keys already exist in the dictionary, their values are updated.'

def set_to_dictionary(self, dictionary, *key_value_pairs, **items):

    if ((len(key_value_pairs) % 2) != 0):
        raise ValueError('Adding    data    to    a    dictionary    failed.    There    should    be    even    number    of    key-value-pairs.')
    for i in range(0, len(key_value_pairs), 2):
        dictionary[key_value_pairs[i]] = key_value_pairs[(i + 1)]
    dictionary.update(items)
    return dictionary
