old_contents: import requests
  from credentials import cc_client_id, cc_token
  
  # Constant Contact API.
  base_url = 'https://api.constantcontact.com/v2/activities/'
  headers = {'Authorization': ('Bearer ' + cc_token)}
  params = {'api_key': cc_client_id}
  endpoints = ['addcontacts']
  
  
  def create_payload(contacts, list_id):
      '''Creates the JSON payloads sent in the request to the Constant Contact API.
  
      Arguments:
          contacts = The list of contacts generated by append_contacts().
          list_id = The ID of the list in Constant Contact that the new contacts
          will be uploaded to.
  
      Returns:
          payload: a JSON formatted dictionary with a list of contacts, the ID of
          the Constant Contact list the contacts will be added to, and the column
          names of the contacts's data.
      '''
      payload = {'import_data': contacts,
                 'lists': [list_id],
                 'column_names': ['Email Address', 'First Name',
                                  'Last Name', 'Home Phone',
                                  'Address Line 1', 'Address Line 2',
                                  'City', 'State',
                                  'Zip/Postal Code', 'Custom Field 1']}
      return payload
  
  
  def add_contacts(payload):
      '''POSTs a JSON payload to the Constant Contact API.
  
      Arguments:
          payload = The payload returned by create_payload().
      '''
      r = requests.post(base_url + endpoints[0], headers=headers, params=params,
                        json=payload)
      activity = r.json()
      return activity
  
  
  def poll_activity(activity):
      '''Returns a detailed status report for an activity in Constant Contact.
  
      Arguments:
          activity = The text of the response to the add_contacts() call.
      '''
      r = requests.get(base_url + activity['id'], headers=headers, params=params)
      text = r.text
      print(text)
  
new_contents: import requests
  from credentials import cc_client_id, cc_token
  
  # Constant Contact API.
  base_url = 'https://api.constantcontact.com/v2/activities/'
  headers = {'Authorization': ('Bearer ' + cc_token)}
  params = {'api_key': cc_client_id}
  endpoints = ['addcontacts']
  
  
  def create_payload(contacts, list_id):
      '''Creates the JSON payloads sent in the request to the Constant Contact API.
  
      Arguments:
          contacts = The list of contacts generated by append_contacts().
          list_id = The ID of the list in Constant Contact that the new contacts
          will be uploaded to.
  
      Returns:
          payload: a JSON formatted dictionary with a list of contacts, the ID of
          the Constant Contact list the contacts will be added to, and the column
          names of the contacts's data.
      '''
      payload = {'import_data': contacts,
                 'lists': [list_id],
                 'column_names': ['Email Address', 'First Name',
                                  'Last Name', 'Home Phone',
                                  'Address Line 1', 'Address Line 2',
                                  'City', 'State',
                                  'Zip/Postal Code', 'Custom Field 1']}
      return payload
  
  
  def add_contacts(payload):
      '''POSTs a JSON payload to the Constant Contact API.
  
      Arguments:
          payload = The payload returned by create_payload().
  
      Returns:
          activity = The response's content in JSON format.
      '''
      r = requests.post(base_url + endpoints[0], headers=headers, params=params,
                        json=payload)
      activity = r.json()
      return activity
  
  
  def poll_activity(activity):
      '''Returns a detailed status report for an activity in Constant Contact.
  
      Arguments:
          activity = The text of the response to the add_contacts() call.
  
      Returns:
          status_report = A detailed status report for the activity in JSON
          format.
      '''
      r = requests.get(base_url + activity['id'], headers=headers, params=params)
      status_report = r.json()
      return status_report
  
subject: Define return values in constantcontact.py's functions