<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_dict(self, key: str, my_dict: dict, hierarchical: bool = False):
 """Store the specified dictionary at the specified key."""

        for _key, _value in my_dict.items():
            if isinstance(_value, dict):
                if not hierarchical:
                    self._db.hmset(key, {_key: json.dumps(_value)})
                else:
                    self.save_dict(key + ':' + _key, _value, hierarchical)
            elif isinstance(_value, list):
                if not hierarchical:
                    self._db.hmset(key, {_key: str(_value)})
                else:
                    print('saving list at ', key + ':' + _key)
                    self._db.lpush(key + ':' + _key, *_value[::-1])
            elif isinstance(_value, bool):
                self._db.hmset(key, {_key: str(_value)})
            else:
                self._db.hmset(key, {_key: _value})