code: def hmset_dict(self, key, *args, **kwargs):
          
          if not args and not kwargs:
              raise TypeError("args or kwargs must be specified")
          pairs = ()
          if len(args) > 1:
              raise TypeError("single positional argument allowed")
          elif len(args) == 1:
              if not isinstance(args[0], dict):
                  raise TypeError("args[0] must be dict")
              elif not args[0] and not kwargs:
                  raise ValueError("args[0] is empty dict")
              pairs = chain.from_iterable(args[0].items())
          kwargs_pairs = chain.from_iterable(kwargs.items())
          return wait_ok(self.execute(
              b'HMSET', key, *chain(pairs, kwargs_pairs)))
docs: Set multiple hash fields to multiple values.
  
          dict can be passed as first positional argument:
  
          >>> await redis.hmset_dict(
          ...     'key', {'field1': 'value1', 'field2': 'value2'})
  
          or keyword arguments can be used:
  
          >>> await redis.hmset_dict(
          ...     'key', field1='value1', field2='value2')
  
          or dict argument can be mixed with kwargs:
  
          >>> await redis.hmset_dict(
          ...     'key', {'field1': 'value1'}, field2='value2')
  
          .. note:: ``dict`` and ``kwargs`` not get mixed into single dictionary,
             if both specified and both have same key(s) -- ``kwargs`` will win:
  
             >>> await redis.hmset_dict('key', {'foo': 'bar'}, foo='baz')
             >>> await redis.hget('key', 'foo', encoding='utf-8')
             'baz'