code: def for_dict(cls, m):
          # type: (Dict[Hashable, Promise[S]]) -> Promise[Dict[Hashable, S]]
          
          dict_type = type(m)  # type: Type[Dict]
  
          if not m:
              return cls.resolve(dict_type())
  
          def handle_success(resolved_values):
              # type: (List[S]) -> Dict[Hashable, S]
              return dict_type(zip(m.keys(), resolved_values))
  
          return cls.all(m.values()).then(handle_success)
docs: A special function that takes a dictionary of promises
          and turns them into a promise for a dictionary of values.
          In other words, this turns an dictionary of promises for values
          into a promise for a dictionary of values.