def fake_urllib2_urlopen(url, data=None):
if not isinstance(url, str):<EOL><INDENT>url = url.get_full_url()<EOL><DEDENT>api = urlparse.urlparse(url)<EOL>url = urlparse.urlparse(urlparse.parse_qs(api.query)['<STR_LIT:url>'][<NUM_LIT:0>])<EOL>resource = os.path.join('<STR_LIT>', '<STR_LIT>', url.netloc,<EOL>api.path.strip('<STR_LIT:/>') + '<STR_LIT>')<EOL>return open(resource, '<STR_LIT:rb>')<EOL>
A stub `urllib2.urlopen()` implementation.