def listen_for_dweets_from(thing_name, timeout=<NUM_LIT>, key=None, session=None):
url = BASE_URL + '<STR_LIT>'.format(thing_name)<EOL>session = session or requests.Session()<EOL>if key is not None:<EOL><INDENT>params = {'<STR_LIT:key>': key}<EOL><DEDENT>else:<EOL><INDENT>params = None<EOL><DEDENT>start = datetime.datetime.utcnow()<EOL>while True:<EOL><INDENT>request = requests.Request("<STR_LIT:GET>", url, params=params).prepare()<EOL>resp = session.send(request, stream=True, timeout=timeout)<EOL>try:<EOL><INDENT>for x in _listen_for_dweets_from_response(resp):<EOL><INDENT>yield x<EOL>_check_stream_timeout(start, timeout)<EOL><DEDENT><DEDENT>except (ChunkedEncodingError, requests.exceptions.ConnectionError, requests.exceptions.ReadTimeout):<EOL><INDENT>pass<EOL><DEDENT>_check_stream_timeout(start, timeout)<EOL><DEDENT>
Create a real-time subscription to dweets