@verbose
def expand_tweetids_demo():
 ids_f = StringIO('        588665495492124672\n        588665495487909888\n        588665495508766721\n        588665495513006080\n        588665495517200384\n        588665495487811584\n        588665495525588992\n        588665495487844352\n        588665495492014081\n        588665495512948737')
 oauth = credsfromfile()
 client = Query(**oauth)
 hydrated = client.expand_tweetids(ids_f)
 for tweet in hydrated:
  id_str = tweet['id_str']
  print('id: {}'.format(id_str))
  text = tweet['text']
  if text.startswith('@null'):
   text = '[Tweet not available]'
  print((text + '\n'))

@ verbose def expand_tweetids_demo ( ) : ids_f = StringIO ( '        588665495492124672\n        588665495487909888\n        588665495508766721\n        588665495513006080\n        588665495517200384\n        588665495487811584\n        588665495525588992\n        588665495487844352\n        588665495492014081\n        588665495512948737' ) oauth = credsfromfile ( ) client = Query ( ** oauth ) hydrated = client . expand_tweetids ( ids_f ) for tweet in hydrated : id_str = tweet [ 'id_str' ] print ( 'id: {}' . format ( id_str ) ) text = tweet [ 'text' ] if text . startswith ( '@null' ) : text = '[Tweet not available]' print ( ( text + '\n' ) )
given a file object containing a list of tweet ids .