code: def dict_to_cognito(attributes, attr_map=None):
      
      if attr_map is None:
          attr_map = {}
      for k,v in attr_map.items():
          if v in attributes.keys():
              attributes[k] = attributes.pop(v)
  
      return [{'Name': key, 'Value': value} for key, value in attributes.items()]
docs: :param attributes: Dictionary of User Pool attribute names/values
      :return: list of User Pool attribute formatted dicts: {'Name': <attr_name>, 'Value': <attr_value>}