def fetch_streams_with_retry(plugin, interval, count):
try:<EOL><INDENT>streams = fetch_streams(plugin)<EOL><DEDENT>except PluginError as err:<EOL><INDENT>log.error(u"<STR_LIT>", err)<EOL>streams = None<EOL><DEDENT>if not streams:<EOL><INDENT>log.info("<STR_LIT>"<EOL>"<STR_LIT>", interval)<EOL><DEDENT>attempts = <NUM_LIT:0><EOL>while not streams:<EOL><INDENT>sleep(interval)<EOL>try:<EOL><INDENT>streams = fetch_streams(plugin)<EOL><DEDENT>except FatalPluginError as err:<EOL><INDENT>raise<EOL><DEDENT>except PluginError as err:<EOL><INDENT>log.error(u"<STR_LIT>", err)<EOL><DEDENT>if count > <NUM_LIT:0>:<EOL><INDENT>attempts += <NUM_LIT:1><EOL>if attempts >= count:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>return streams<EOL>
Attempts to fetch streams repeatedly
       until some are returned or limit hit.