code: def _rapply(d, func, *args, **kwargs):
      
      if isinstance(d, (tuple, list)):
          return [_rapply(each, func, *args, **kwargs) for each in d]
      if isinstance(d, dict):
          return {
              key: _rapply(value, func, *args, **kwargs) for key, value in iteritems(d)
          }
      else:
          return func(d, *args, **kwargs)
docs: Apply a function to all values in a dictionary or list of dictionaries, recursively.