old_contents: import requests
  import re
  import config
  
  
  def login(username, passwd):
      s = requests.Session()
      r = s.get(config.LOGIN_URL)
  
      r = s.post(config.LOGIN_URL,
                 data={'username': username,
                       'password': passwd,
                       'csrfmiddlewaretoken': s.cookies['sessionid']})
  
      return s.cookies['sessionid']
new_contents: import requests
  import config
  
  
  def login(username, passwd):
      s = requests.Session()
      r = s.get(config.LOGIN_URL)
  
      r = s.post(config.LOGIN_URL,
                 data={'username': username,
                       'password': passwd,
                       'csrfmiddlewaretoken': s.cookies['sessionid']})
  
      return s.cookies['sessionid']
  
subject: add newline, remove `re`