old_contents: from __future__ import absolute_import, print_function, unicode_literals
  from builtins import dict, str
  from os.path import join, abspath, dirname
  from utils import make_status_message, get_email_pmids
  from indra.machine import gmail_client
  
  stats = {}
  stats['new_abstracts'] = 0
  stats['new_papers'] = 0
  stats['orig_stmts'] = 10
  stats['new_stmts'] = 10
  stats['orig_top'] = 10
  stats['orig_likely'] = 10
  stats['new_top'] = 10
  stats['new_likely'] = 10
  
  def test_gmail_client():
      cred_file = join(dirname(abspath(__file__)), 'ras_test', 'gmail.txt')
      with open(cred_file, 'rt') as fh:
          un, pw = [l.strip() for l in fh.readlines()]
      config = {}
      config['user'] = un
      config['password'] = pw
      pmids = get_email_pmids(config)
  
  def test_gmail_get_message():
      cred_file = join(dirname(abspath(__file__)), 'ras_test', 'gmail.txt')
      with open(cred_file, 'rb') as fh:
          uname, passwd = [l.strip().decode('utf-8') for l in fh.readlines()]
      M = gmail_client.gmail_login(uname, passwd)
      # Get the mailbox ID of the INBOX
      mbox = gmail_client.select_mailbox(M, 'INBOX')
      pmids = gmail_client.get_message_pmids(M, day_limit=10)
  
  def test_noabs_nopaper():
      s = stats.copy()
      status_msg = make_status_message(s)
      assert(status_msg is None)
  
  def test_absonly():
      s = stats.copy()
      s['new_abstracts'] = 7
      s['new_likely'] = 12
      status_msg = make_status_message(s)
      assert(status_msg == 'Today I read 7 abstracts, ' +\
                           'and learned 2 new mechanisms!')
  
  def test_papersonly():
      s = stats.copy()
      s['new_papers'] = 3
      s['new_likely'] = 12
      status_msg = make_status_message(s)
      assert(status_msg == 'Today I read 3 papers, ' +\
                           'and learned 2 new mechanisms!')
  
  def test_abs_and_paper():
      s = stats.copy()
      s['new_papers'] = 1
      s['new_abstracts'] = 1
      s['new_likely'] = 12
      status_msg = make_status_message(s)
      assert(status_msg == 'Today I read 1 paper and 1 abstract, ' +\
                           'and learned 2 new mechanisms!')
  
  def test_abs_and_papers():
      s = stats.copy()
      s['new_papers'] = 2
      s['new_abstracts'] = 2
      s['new_likely'] = 12
      status_msg = make_status_message(s)
      assert(status_msg == 'Today I read 2 papers and 2 abstracts, ' +\
                           'and learned 2 new mechanisms!')
  
new_contents: from __future__ import absolute_import, print_function, unicode_literals
  from builtins import dict, str
  from os.path import join, abspath, dirname
  from indra.tools.machine.utils import make_status_message, get_email_pmids
  from indra.tools.machine import gmail_client
  
  stats = {}
  stats['new_abstracts'] = 0
  stats['new_papers'] = 0
  stats['orig_stmts'] = 10
  stats['new_stmts'] = 10
  stats['orig_top'] = 10
  stats['orig_likely'] = 10
  stats['new_top'] = 10
  stats['new_likely'] = 10
  
  def test_gmail_client():
      cred_file = join(dirname(abspath(__file__)), 'ras_test', 'gmail.txt')
      with open(cred_file, 'rt') as fh:
          un, pw = [l.strip() for l in fh.readlines()]
      config = {}
      config['user'] = un
      config['password'] = pw
      pmids = get_email_pmids(config)
  
  def test_gmail_get_message():
      cred_file = join(dirname(abspath(__file__)), 'ras_test', 'gmail.txt')
      with open(cred_file, 'rb') as fh:
          uname, passwd = [l.strip().decode('utf-8') for l in fh.readlines()]
      M = gmail_client.gmail_login(uname, passwd)
      # Get the mailbox ID of the INBOX
      mbox = gmail_client.select_mailbox(M, 'INBOX')
      pmids = gmail_client.get_message_pmids(M, day_limit=10)
  
  def test_noabs_nopaper():
      s = stats.copy()
      status_msg = make_status_message(s)
      assert(status_msg is None)
  
  def test_absonly():
      s = stats.copy()
      s['new_abstracts'] = 7
      s['new_likely'] = 12
      status_msg = make_status_message(s)
      assert(status_msg == 'Today I read 7 abstracts, ' +\
                           'and learned 2 new mechanisms!')
  
  def test_papersonly():
      s = stats.copy()
      s['new_papers'] = 3
      s['new_likely'] = 12
      status_msg = make_status_message(s)
      assert(status_msg == 'Today I read 3 papers, ' +\
                           'and learned 2 new mechanisms!')
  
  def test_abs_and_paper():
      s = stats.copy()
      s['new_papers'] = 1
      s['new_abstracts'] = 1
      s['new_likely'] = 12
      status_msg = make_status_message(s)
      assert(status_msg == 'Today I read 1 paper and 1 abstract, ' +\
                           'and learned 2 new mechanisms!')
  
  def test_abs_and_papers():
      s = stats.copy()
      s['new_papers'] = 2
      s['new_abstracts'] = 2
      s['new_likely'] = 12
      status_msg = make_status_message(s)
      assert(status_msg == 'Today I read 2 papers and 2 abstracts, ' +\
                           'and learned 2 new mechanisms!')
  
subject: Update references