project_name
string
class_name
string
class_modifiers
string
class_implements
int64
class_extends
int64
function_name
string
function_body
string
cyclomatic_complexity
int64
NLOC
int64
num_parameter
int64
num_token
int64
num_variable
int64
start_line
int64
end_line
int64
function_index
int64
function_params
string
function_variable
string
function_return_type
string
function_body_line_type
string
function_num_functions
int64
function_num_lines
int64
outgoing_function_count
int64
outgoing_function_names
string
incoming_function_count
int64
incoming_function_names
string
lexical_representation
string
pasteorg_paste
public
public
0
0
test_cache
def test_cache():def build(*args,**kwargs):app = DataApp(b"SomeContent")app.cache_control(*args,**kwargs)return TestApp(app).get("/")res = build()assert 'public' == res.header('cache-control')assert not res.header('expires',None)res = build(private=True)assert 'private' == res.header('cache-control')assert mktime_tz(pa...
2
20
0
220
3
27
49
27
['res', 'app', 'expires']
Returns
{"Assign": 8, "Expr": 1, "Return": 1}
35
23
35
["DataApp", "app.cache_control", "get", "TestApp", "build", "res.header", "res.header", "build", "res.header", "mktime_tz", "parsedate_tz", "res.header", "time.time", "build", "res.header", "mktime_tz", "parsedate_tz", "res.header", "time.time", "build", "res.header", "mktime_tz", "parsedate_tz", "res.header", "time.ti...
0
[]
The function (test_cache) defined within the public class called public.The function start at line 27 and ends at 49. It contains 20 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 35.0 functions, and It has 35.0 functions ...
pasteorg_paste
public
public
0
0
test_disposition.build
def build(*args,**kwargs):app = DataApp(b"SomeContent")app.content_disposition(*args,**kwargs)return TestApp(app).get("/")
1
4
2
36
0
52
55
52
null
[]
None
null
0
0
0
null
0
null
The function (test_disposition.build) defined within the public class called public.The function start at line 52 and ends at 55. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [52.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_disposition
def test_disposition():def build(*args,**kwargs):app = DataApp(b"SomeContent")app.content_disposition(*args,**kwargs)return TestApp(app).get("/")res = build()assert 'attachment' == res.header('content-disposition')assert 'application/octet-stream' == res.header('content-type')res = build(filename="bing.txt")assert 'att...
2
22
0
137
2
51
75
51
['res', 'app']
Returns
{"Assign": 6, "Expr": 1, "Return": 1, "Try": 1}
17
25
17
["DataApp", "app.content_disposition", "get", "TestApp", "build", "res.header", "res.header", "build", "res.header", "res.header", "build", "res.header", "res.header", "build", "res.header", "res.header", "build"]
0
[]
The function (test_disposition) defined within the public class called public.The function start at line 51 and ends at 75. It contains 22 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 17.0 functions, and It has 17.0 func...
pasteorg_paste
public
public
0
0
test_modified
def test_modified():harness = TestApp(DataApp(b'mycontent'))res = harness.get("/")assert "<Response 200 OK 'mycontent'>" == repr(res)last_modified = res.header('last-modified')res = harness.get("/",headers={'if-modified-since': last_modified})assert "<Response 304 Not Modified ''>" == repr(res)res = harness.get("/",hea...
3
17
0
152
3
77
93
77
['harness', 'res', 'last_modified']
None
{"Assign": 7}
11
17
11
["TestApp", "DataApp", "harness.get", "repr", "res.header", "harness.get", "repr", "harness.get", "repr", "harness.get", "harness.get"]
0
[]
The function (test_modified) defined within the public class called public.The function start at line 77 and ends at 93. It contains 17 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 11.0 functions, and It has 11.0 functions c...
pasteorg_paste
public
public
0
0
test_file
def test_file():tempfile = "test_fileapp.%s.txt" % (random.random())content = LETTERS * 20content = content.encode('utf8')with open(tempfile, "wb") as fp:fp.write(content)try:app = fileapp.FileApp(tempfile)res = TestApp(app).get("/")assert len(content) == int(res.header('content-length'))assert 'text/plain' == res.head...
3
35
0
305
7
95
129
95
['res', 'file', 'content', 'app', 'tempfile', 'lastmod', 'newsize']
None
{"Assign": 11, "Expr": 8, "Try": 1, "With": 1}
35
35
35
["random.random", "content.encode", "open", "fp.write", "fileapp.FileApp", "get", "TestApp", "len", "int", "res.header", "res.header", "res.header", "print", "open", "file.write", "file.close", "get", "TestApp", "len", "int", "res.header", "res.header", "open", "file.write", "file.write", "file.close", "get", "TestApp"...
0
[]
The function (test_file) defined within the public class called public.The function start at line 95 and ends at 129. It contains 35 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 35.0 functions, and It has 35.0 functions call...
pasteorg_paste
public
public
0
0
test_dir
def test_dir():tmpdir = tempfile.mkdtemp()try:tmpfile = os.path.join(tmpdir, 'file')tmpsubdir = os.path.join(tmpdir, 'dir')fp = open(tmpfile, 'w')fp.write('abcd')fp.close()os.mkdir(tmpsubdir)try:app = fileapp.DirectoryApp(tmpdir)for path in ['/', '', '//', '/..', '/.', '/../..']:assert TestApp(app).get(path, status=403...
5
21
0
185
5
131
151
131
['tmpfile', 'tmpsubdir', 'fp', 'app', 'tmpdir']
None
{"Assign": 5, "Expr": 6, "For": 2, "Try": 2}
19
21
19
["tempfile.mkdtemp", "os.path.join", "os.path.join", "open", "fp.write", "fp.close", "os.mkdir", "fileapp.DirectoryApp", "get", "TestApp", "ValueError", "get", "TestApp", "ValueError", "get", "TestApp", "os.remove", "os.rmdir", "os.rmdir"]
0
[]
The function (test_dir) defined within the public class called public.The function start at line 131 and ends at 151. It contains 21 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 19.0 functions, and It has 19.0 functions call...
pasteorg_paste
public
public
0
0
_excercize_range
def _excercize_range(build,content):# full content request, but using ranges'res = build("bytes=0-%d" % (len(content)-1))assert res.header('accept-ranges') == 'bytes'assert res.body == contentassert res.header('content-length') == str(len(content))res = build("bytes=-%d" % (len(content)-1))assert res.body == contentass...
1
20
2
215
1
153
174
153
build,content
['res']
None
{"Assign": 6}
22
22
22
["build", "len", "res.header", "res.header", "str", "len", "build", "len", "res.header", "str", "len", "build", "res.header", "str", "len", "build", "res.header", "build", "len", "res.header", "build", "res.header"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_fileapp_py.test_file_range", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_fileapp_py.test_range"]
The function (_excercize_range) defined within the public class called public.The function start at line 153 and ends at 174. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [153.0] and does not return any value. It declares 22.0 functions, It has 22.0 functio...
pasteorg_paste
public
public
0
0
test_range.build
def build(range, status=206):app = DataApp(content)return TestApp(app).get("/",headers={'Range': range}, status=status)
1
3
2
37
0
179
181
179
null
[]
None
null
0
0
0
null
0
null
The function (test_range.build) defined within the public class called public.The function start at line 179 and ends at 181. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [179.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_range
def test_range():content = LETTERS * 5content = content.encode('utf8')def build(range, status=206):app = DataApp(content)return TestApp(app).get("/",headers={'Range': range}, status=status)_excercize_range(build,content)build('bytes=0-%d' % (len(content)+1), 416)
1
6
0
40
2
176
183
176
['content', 'app']
Returns
{"Assign": 3, "Expr": 2, "Return": 1}
7
8
7
["content.encode", "DataApp", "get", "TestApp", "_excercize_range", "build", "len"]
0
[]
The function (test_range) defined within the public class called public.The function start at line 176 and ends at 183. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 7.0 functions, and It has 7.0 functions c...
pasteorg_paste
public
public
0
0
test_file_range.build
def build(range, status=206):app = fileapp.FileApp(tempfile)return TestApp(app).get("/",headers={'Range': range},status=status)
1
4
2
39
0
193
196
193
null
[]
None
null
0
0
0
null
0
null
The function (test_file_range.build) defined within the public class called public.The function start at line 193 and ends at 196. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [193.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_file_range
def test_file_range():tempfile = "test_fileapp.%s.txt" % (random.random())content = LETTERS * (1+(fileapp.CACHE_SIZE // len(LETTERS)))content = content.encode('utf8')assert len(content) > fileapp.CACHE_SIZEwith open(tempfile, "wb") as fp:fp.write(content)try:def build(range, status=206):app = fileapp.FileApp(tempfile)r...
3
15
0
108
3
185
202
185
['content', 'app', 'tempfile']
Returns
{"Assign": 5, "Expr": 4, "For": 1, "Return": 1, "Try": 1, "With": 1}
14
18
14
["random.random", "len", "content.encode", "len", "open", "fp.write", "fileapp.FileApp", "get", "TestApp", "_excercize_range", "len", "len", "_excercize_range", "os.unlink"]
0
[]
The function (test_file_range) defined within the public class called public.The function start at line 185 and ends at 202. It contains 15 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 14.0 functions, and It has 14.0 fun...
pasteorg_paste
public
public
0
0
test_file_cache
def test_file_cache():filename = os.path.join(os.path.dirname(__file__),'urlparser_data', 'secured.txt')app = TestApp(fileapp.FileApp(filename))res = app.get('/')etag = res.header('ETag')last_mod = res.header('Last-Modified')res = app.get('/', headers={'If-Modified-Since': last_mod},status=304)res = app.get('/', header...
1
19
0
182
5
204
222
204
['res', 'app', 'last_mod', 'filename', 'etag']
None
{"Assign": 11}
13
19
13
["os.path.join", "os.path.dirname", "TestApp", "fileapp.FileApp", "app.get", "res.header", "res.header", "app.get", "app.get", "app.get", "app.get", "app.get", "app.get"]
0
[]
The function (test_file_cache) defined within the public class called public.The function start at line 204 and ends at 222. It contains 19 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 13.0 functions, and It has 13.0 functio...
pasteorg_paste
public
public
0
0
test_methods
def test_methods():filename = os.path.join(os.path.dirname(__file__),'urlparser_data', 'secured.txt')app = TestApp(fileapp.FileApp(filename))get_res = app.get('')res = app.get('', extra_environ={'REQUEST_METHOD': 'HEAD'})assert res.headers == get_res.headersassert not res.bodyapp.post('', status=405) # Method Not Allow...
1
9
0
83
4
224
232
224
['get_res', 'res', 'filename', 'app']
None
{"Assign": 4, "Expr": 1}
7
9
7
["os.path.join", "os.path.dirname", "TestApp", "fileapp.FileApp", "app.get", "app.get", "app.post"]
0
[]
The function (test_methods) defined within the public class called public.The function start at line 224 and ends at 232. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, and It has 7.0 functions cal...
pasteorg_paste
public
public
0
0
test_fixture.items
def items(self):return [('a', '10'), ('a', '20')]
1
2
1
19
0
18
19
18
null
[]
None
null
0
0
0
null
0
null
The function (test_fixture.items) defined within the public class called public.The function start at line 18 and ends at 19. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
test_fixture
def test_fixture():app = TestApp(SimpleApplication())res = app.get('/', params={'a': ['1', '2']})assert (res.request.environ['QUERY_STRING'] =='a=1&a=2')res = app.put('/')assert (res.request.environ['REQUEST_METHOD'] =='PUT')res = app.delete('/')assert (res.request.environ['REQUEST_METHOD'] =='DELETE')class FakeDict:de...
1
22
0
175
3
6
30
6
['res', 'hc', 'app']
Returns
{"Assign": 10, "Return": 1}
9
25
9
["TestApp", "SimpleApplication", "app.get", "app.put", "app.delete", "app.post", "FakeDict", "app.get", "split"]
0
[]
The function (test_fixture) defined within the public class called public.The function start at line 6 and ends at 30. It contains 22 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 9.0 functions, and It has 9.0 functions c...
pasteorg_paste
public
public
0
0
test_fixture_form
def test_fixture_form():app = TestApp(SlowConsumer())res = app.get('/')form = res.forms[0]assert 'file' in form.fieldsassert form.action == ''
1
6
0
40
3
33
38
33
['form', 'res', 'app']
None
{"Assign": 3}
3
6
3
["TestApp", "SlowConsumer", "app.get"]
0
[]
The function (test_fixture_form) defined within the public class called public.The function start at line 33 and ends at 38. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions ...
pasteorg_paste
public
public
0
0
test_fixture_form_end.response
def response(environ, start_response):body = b"<html><body><form>sm\xc3\xb6rebr\xc3\xb6</form></body></html>"start_response("200 OK", [('Content-Type', 'text/html'),('Content-Length', str(len(body)))])return [body]
1
5
2
39
0
42
46
42
null
[]
None
null
0
0
0
null
0
null
The function (test_fixture_form_end.response) defined within the public class called public.The function start at line 42 and ends at 46. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [42.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_fixture_form_end
def test_fixture_form_end():def response(environ, start_response):body = b"<html><body><form>sm\xc3\xb6rebr\xc3\xb6</form></body></html>"start_response("200 OK", [('Content-Type', 'text/html'),('Content-Length', str(len(body)))])return [body]TestApp(response).get('/')
1
3
0
15
1
41
47
41
['body']
Returns
{"Assign": 1, "Expr": 2, "Return": 1}
5
7
5
["start_response", "str", "len", "get", "TestApp"]
0
[]
The function (test_fixture_form_end) defined within the public class called public.The function start at line 41 and ends at 47. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 5.0 functions, and It has 5.0 fu...
pasteorg_paste
public
public
0
0
test_params_and_upload_files.__call__
def __call__(self, environ, start_response):start_response("204 No content", [])self.request = WSGIRequest(environ)return [b'']
1
4
3
29
0
51
54
51
null
[]
None
null
0
0
0
null
0
null
The function (test_params_and_upload_files.__call__) defined within the public class called public.The function start at line 51 and ends at 54. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [51.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_params_and_upload_files
def test_params_and_upload_files():class PostApp:def __call__(self, environ, start_response):start_response("204 No content", [])self.request = WSGIRequest(environ)return [b'']post_app = PostApp()app = TestApp(post_app)app.post('/',params={'param1': 'a', 'param2': 'b'},upload_files=[('file1', 'myfile.txt', b'data1'),('...
1
21
0
129
3
49
72
49
['params', 'app', 'post_app']
Returns
{"Assign": 4, "Expr": 2, "Return": 1}
6
24
6
["start_response", "WSGIRequest", "PostApp", "TestApp", "app.post", "len"]
0
[]
The function (test_params_and_upload_files) defined within the public class called public.The function start at line 49 and ends at 72. It contains 21 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 6.0 functions, and It ha...
pasteorg_paste
public
public
0
0
test_unicode_path
def test_unicode_path():app = TestApp(SimpleApplication())app.get(u"/?")app.post(u"/?")app.put(u"/?")app.delete(u"/?")
1
6
0
40
1
74
79
74
['app']
None
{"Assign": 1, "Expr": 4}
6
6
6
["TestApp", "SimpleApplication", "app.get", "app.post", "app.put", "app.delete"]
0
[]
The function (test_unicode_path) defined within the public class called public.The function start at line 74 and ends at 79. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 functions ...
pasteorg_paste
public
public
0
0
_make_app.application
def application(environ, start_response):start_response('200 OK', [('content-type', 'text/plain')])lines = [str(environ.get('REMOTE_USER')),':',str(environ.get('REMOTE_USER_TOKENS')),]lines = [line.encode('utf8') for line in lines]return lines
2
9
2
61
0
5
13
5
null
[]
None
null
0
0
0
null
0
null
The function (_make_app.application) defined within the public class called public.The function start at line 5 and ends at 13. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [5.0] and does not return any value..
pasteorg_paste
public
public
0
0
_make_app
def _make_app():def application(environ, start_response):start_response('200 OK', [('content-type', 'text/plain')])lines = [str(environ.get('REMOTE_USER')),':',str(environ.get('REMOTE_USER_TOKENS')),]lines = [line.encode('utf8') for line in lines]return linesip_map = {'127.0.0.1': (None, 'system'),'192.168.0.0/16': (No...
1
11
0
60
3
4
22
4
['ip_map', 'lines', 'app']
Returns
{"Assign": 5, "Expr": 1, "Return": 2}
8
19
8
["start_response", "str", "environ.get", "str", "environ.get", "line.encode", "grantip.GrantIPMiddleware", "TestApp"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_grantip_py.test_req"]
The function (_make_app) defined within the public class called public.The function start at line 4 and ends at 22. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 8.0 functions, It has 8.0 functions called in...
pasteorg_paste
public
public
0
0
test_req.doit
def doit(remote_addr):res = app.get('/', extra_environ={'REMOTE_ADDR': remote_addr})return res.body
1
3
1
25
0
26
28
26
null
[]
None
null
0
0
0
null
0
null
The function (test_req.doit) defined within the public class called public.The function start at line 26 and ends at 28. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
test_req
def test_req():app = _make_app()def doit(remote_addr):res = app.get('/', extra_environ={'REMOTE_ADDR': remote_addr})return res.bodyassert doit('127.0.0.1') == b'None:system'assert doit('192.168.15.12') == b'None:worker'assert doit('192.168.0.4') == b'None:worker'result = doit('192.168.0.5')assert result.startswith(b'bo...
2
11
0
77
3
24
36
24
['result', 'res', 'app']
Returns
{"Assign": 3, "Return": 1}
9
13
9
["_make_app", "app.get", "doit", "doit", "doit", "doit", "result.startswith", "result.count", "doit"]
0
[]
The function (test_req) defined within the public class called public.The function start at line 24 and ends at 36. It contains 11 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 9.0 functions, and It has 9.0 functions call...
pasteorg_paste
public
public
0
0
simple_app
def simple_app(environ, start_response):start_response('200 OK', [('content-type', 'text/plain'),('content-length', '0')])return [b'this is a test'] if environ['REQUEST_METHOD'] != 'HEAD' else []
2
5
2
40
0
6
10
6
environ,start_response
[]
Returns
{"Expr": 1, "Return": 1}
1
5
1
["start_response"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_errordocument_py.auth_docs_app", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_errordocument_py.error_docs_app", "_.content.gdrive.MyDrive.Phd_Th...
The function (simple_app) defined within the public class called public.The function start at line 6 and ends at 10. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [6.0], and this function return a value. It declare 1.0 function, It has 1.0 function called ins...
pasteorg_paste
public
public
0
0
test_gzip
def test_gzip():res = app.get('/', extra_environ=dict(HTTP_ACCEPT_ENCODING='gzip'))assert int(res.header('content-length')) == len(res.body)assert res.body != b'this is a test'actual = gzip.GzipFile(fileobj=io.BytesIO(res.body)).read()assert actual == b'this is a test'
1
7
0
71
2
15
21
15
['res', 'actual']
None
{"Assign": 2}
8
7
8
["app.get", "dict", "int", "res.header", "len", "read", "gzip.GzipFile", "io.BytesIO"]
0
[]
The function (test_gzip) defined within the public class called public.The function start at line 15 and ends at 21. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0 functions called i...
pasteorg_paste
public
public
0
0
test_gzip_head
def test_gzip_head():res = app.head('/', extra_environ=dict(HTTP_ACCEPT_ENCODING='gzip'))assert int(res.header('content-length')) == 0assert res.body == b''
1
5
0
40
1
23
27
23
['res']
None
{"Assign": 1}
4
5
4
["app.head", "dict", "int", "res.header"]
0
[]
The function (test_gzip_head) defined within the public class called public.The function start at line 23 and ends at 27. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functions cal...
pasteorg_paste
public
public
0
0
_test_generic
def _test_generic(collection):assert 'bing' == VIA(collection)REFERER.update(collection,'internal:/some/path')assert 'internal:/some/path' == REFERER(collection)CACHE_CONTROL.update(collection,max_age=1234)CONTENT_DISPOSITION.update(collection,filename="bingles.txt")PRAGMA.update(collection,"test","multi",'valued="item...
1
12
1
87
0
28
39
28
collection
[]
None
{"Expr": 5}
10
12
10
["VIA", "REFERER.update", "REFERER", "CACHE_CONTROL.update", "CONTENT_DISPOSITION.update", "PRAGMA.update", "CACHE_CONTROL", "CONTENT_DISPOSITION", "PRAGMA", "VIA.delete"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_httpheaders_py.test_environ", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_httpheaders_py.test_response_headers"]
The function (_test_generic) defined within the public class called public.The function start at line 28 and ends at 39. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 10.0 functions, It has 10.0 functions called...
pasteorg_paste
public
public
0
0
test_environ
def test_environ():collection = {'HTTP_VIA':'bing', 'wsgi.version': '1.0' }_test_generic(collection)assert collection == {'wsgi.version': '1.0','HTTP_PRAGMA': 'test, multi, valued="items"','HTTP_REFERER': 'internal:/some/path','HTTP_CONTENT_DISPOSITION': 'attachment; filename="bingles.txt"','HTTP_CACHE_CONTROL': 'publi...
1
9
0
43
1
42
50
42
['collection']
None
{"Assign": 1, "Expr": 1}
1
9
1
["_test_generic"]
0
[]
The function (test_environ) defined within the public class called public.The function start at line 42 and ends at 50. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called i...
pasteorg_paste
public
public
0
0
test_environ_cgi
def test_environ_cgi():environ = {'CONTENT_TYPE': 'text/plain', 'wsgi.version': '1.0', 'HTTP_CONTENT_TYPE': 'ignored/invalid', 'CONTENT_LENGTH': '200'}assert 'text/plain' == CONTENT_TYPE(environ)assert '200' == CONTENT_LENGTH(environ)CONTENT_TYPE.update(environ,'new/type')assert 'new/type' == CONTENT_TYPE(environ)CONTE...
1
11
0
72
1
52
62
52
['environ']
None
{"Assign": 1, "Expr": 2}
6
11
6
["CONTENT_TYPE", "CONTENT_LENGTH", "CONTENT_TYPE.update", "CONTENT_TYPE", "CONTENT_TYPE.delete", "CONTENT_TYPE"]
0
[]
The function (test_environ_cgi) defined within the public class called public.The function start at line 52 and ends at 62. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 functions ...
pasteorg_paste
public
public
0
0
test_response_headers
def test_response_headers():collection = [('via', 'bing')]_test_generic(collection)normalize_headers(collection)assert collection == [('Cache-Control', 'public, max-age=1234'),('Pragma', 'test, multi, valued="items"'),('Referer', 'internal:/some/path'),('Content-Disposition', 'attachment; filename="bingles.txt"')]
1
10
0
49
1
64
73
64
['collection']
None
{"Assign": 1, "Expr": 2}
2
10
2
["_test_generic", "normalize_headers"]
0
[]
The function (test_response_headers) defined within the public class called public.The function start at line 64 and ends at 73. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 funct...
pasteorg_paste
public
public
0
0
test_cache_control
def test_cache_control():assert 'public' == CACHE_CONTROL()assert 'public' == CACHE_CONTROL(public=True)assert 'private' == CACHE_CONTROL(private=True)assert 'no-cache' == CACHE_CONTROL(no_cache=True)assert 'private, no-store' == CACHE_CONTROL(private=True, no_store=True)assert 'public, max-age=60' == CACHE_CONTROL(max...
1
17
0
138
1
75
91
75
['headers']
None
{"Assign": 2, "Expr": 1}
14
17
14
["CACHE_CONTROL", "CACHE_CONTROL", "CACHE_CONTROL", "CACHE_CONTROL", "CACHE_CONTROL", "CACHE_CONTROL", "CACHE_CONTROL", "CACHE_CONTROL", "CACHE_CONTROL.apply", "CACHE_CONTROL", "EXPIRES.parse", "time.time", "EXPIRES.parse", "time.time"]
0
[]
The function (test_cache_control) defined within the public class called public.The function start at line 75 and ends at 91. It contains 17 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 14.0 functions, and It has 14.0 functi...
pasteorg_paste
public
public
0
0
test_content_disposition
def test_content_disposition():assert 'attachment' == CONTENT_DISPOSITION()assert 'attachment' == CONTENT_DISPOSITION(attachment=True)assert 'inline' == CONTENT_DISPOSITION(inline=True)assert 'inline; filename="test.txt"' == \CONTENT_DISPOSITION(inline=True, filename="test.txt")assert 'attachment; filename="test.txt"' ...
1
22
0
149
1
93
114
93
['headers']
None
{"Assign": 2, "Expr": 4}
13
22
13
["CONTENT_DISPOSITION", "CONTENT_DISPOSITION", "CONTENT_DISPOSITION", "CONTENT_DISPOSITION", "CONTENT_DISPOSITION", "CONTENT_DISPOSITION.apply", "CONTENT_TYPE", "CONTENT_DISPOSITION.apply", "CONTENT_TYPE", "CONTENT_DISPOSITION.apply", "CONTENT_TYPE", "CONTENT_DISPOSITION.apply", "CONTENT_TYPE"]
0
[]
The function (test_content_disposition) defined within the public class called public.The function start at line 93 and ends at 114. It contains 22 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 13.0 functions, and It has 13.0...
pasteorg_paste
public
public
0
0
test_range
def test_range():assert ('bytes',[(0,300)]) == RANGE.parse("bytes=0-300")assert ('bytes',[(0,300)]) == RANGE.parse("bytes =-300")assert ('bytes',[(0,None)]) == RANGE.parse("bytes=-")assert ('bytes',[(0,None)]) == RANGE.parse("bytes=0 - ")assert ('bytes',[(300,None)]) == RANGE.parse(" BYTES=300-")assert ('bytes',[(4,5),...
1
13
0
226
0
116
128
116
[]
None
{}
12
13
12
["RANGE.parse", "RANGE.parse", "RANGE.parse", "RANGE.parse", "RANGE.parse", "RANGE.parse", "RANGE.parse", "RANGE.parse", "RANGE.parse", "RANGE.parse", "RANGE.parse", "RANGE.parse"]
0
[]
The function (test_range) defined within the public class called public.The function start at line 116 and ends at 128. It contains 13 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 12.0 functions, and It has 12.0 functions ca...
pasteorg_paste
public
public
0
0
test_copy
def test_copy():environ = {'HTTP_VIA':'bing', 'wsgi.version': '1.0' }response_headers = []VIA.update(response_headers,environ)assert response_headers == [('Via', 'bing')]
1
5
0
37
2
130
134
130
['response_headers', 'environ']
None
{"Assign": 2, "Expr": 1}
1
5
1
["VIA.update"]
0
[]
The function (test_copy) defined within the public class called public.The function start at line 130 and ends at 134. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called in...
pasteorg_paste
public
public
0
0
test_sorting
def test_sorting():# verify the HTTP_HEADERS are set with their canonical formsample = [WWW_AUTHENTICATE, VIA, ACCEPT, DATE,ACCEPT_CHARSET, AGE, ALLOW, CACHE_CONTROL,CONTENT_ENCODING, ETAG, CONTENT_TYPE, FROM,EXPIRES, RANGE, UPGRADE, VARY, ALLOW]sample.sort()sample = [str(x) for x in sample]assert sample == [ # general...
2
13
0
96
1
136
153
136
['sample']
None
{"Assign": 2, "Expr": 1}
2
18
2
["sample.sort", "str"]
0
[]
The function (test_sorting) defined within the public class called public.The function start at line 136 and ends at 153. It contains 13 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions ca...
pasteorg_paste
public
public
0
0
test_normalize
def test_normalize():response_headers = [ ('www-authenticate','Response AuthMessage'), ('unknown-header','Unknown Sorted Last'), ('Via','General Bingles'), ('aLLoW','Entity Allow Something'), ('ETAG','Response 34234'), ('expires','Entity An-Expiration-Date'), ('date','General A-Date')]normalize_headers(response_headers...
1
18
0
103
1
155
172
155
['response_headers']
None
{"Assign": 1, "Expr": 1}
1
18
1
["normalize_headers"]
0
[]
The function (test_normalize) defined within the public class called public.The function start at line 155 and ends at 172. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function cal...
pasteorg_paste
public
public
0
0
test_if_modified_since
def test_if_modified_since():from paste.httpexceptions import HTTPBadRequestdate = 'Thu, 34 Jul 3119 29:34:18 GMT'try:x = IF_MODIFIED_SINCE.parse({'HTTP_IF_MODIFIED_SINCE': date, 'wsgi.version': (1, 0)})except HTTPBadRequest:passelse:assert 0
2
10
0
43
2
174
183
174
['x', 'date']
None
{"Assign": 2, "Try": 1}
1
10
1
["IF_MODIFIED_SINCE.parse"]
0
[]
The function (test_if_modified_since) defined within the public class called public.The function start at line 174 and ends at 183. It contains 10 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 func...
pasteorg_paste
MockSocket
public
0
0
makefile
def makefile(self, mode, bufsize):return io.StringIO()
1
2
3
15
0
13
14
13
self,mode,bufsize
[]
Returns
{"Return": 1}
1
2
1
["io.StringIO"]
0
[]
The function (makefile) defined within the public class called MockSocket.The function start at line 13 and ends at 14. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [13.0], and this function return a value. It declare 1.0 function, and It has 1.0 function c...
pasteorg_paste
public
public
0
0
test_environ
def test_environ():mock_socket = MockSocket()mock_client_address = '1.2.3.4'mock_server = MockServer()wsgi_handler = WSGIHandler(mock_socket, mock_client_address, mock_server)wsgi_handler.command = 'GET'wsgi_handler.path = '/path'wsgi_handler.request_version = 'HTTP/1.0'wsgi_handler.headers = email.message_from_string(...
1
11
0
66
4
17
30
17
['mock_server', 'wsgi_handler', 'mock_socket', 'mock_client_address']
None
{"Assign": 8, "Expr": 1}
5
14
5
["MockSocket", "MockServer", "WSGIHandler", "email.message_from_string", "wsgi_handler.wsgi_setup"]
0
[]
The function (test_environ) defined within the public class called public.The function start at line 17 and ends at 30. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 functions call...
pasteorg_paste
public
public
0
0
test_environ_with_multiple_values
def test_environ_with_multiple_values():mock_socket = MockSocket()mock_client_address = '1.2.3.4'mock_server = MockServer()wsgi_handler = WSGIHandler(mock_socket, mock_client_address, mock_server)wsgi_handler.command = 'GET'wsgi_handler.path = '/path'wsgi_handler.request_version = 'HTTP/1.0'wsgi_handler.headers = email...
1
11
0
66
4
33
46
33
['mock_server', 'wsgi_handler', 'mock_socket', 'mock_client_address']
None
{"Assign": 8, "Expr": 1}
5
14
5
["MockSocket", "MockServer", "WSGIHandler", "email.message_from_string", "wsgi_handler.wsgi_setup"]
0
[]
The function (test_environ_with_multiple_values) defined within the public class called public.The function start at line 33 and ends at 46. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It h...
pasteorg_paste
public
public
0
0
test_limited_length_file
def test_limited_length_file():backing = io.BytesIO(b'0123456789')f = LimitedLengthFile(backing, 9)assert f.tell() == 0assert f.read() == b'012345678'assert f.tell() == 9assert f.read() == b''
1
7
0
55
2
49
55
49
['backing', 'f']
None
{"Assign": 2}
6
7
6
["io.BytesIO", "LimitedLengthFile", "f.tell", "f.read", "f.tell", "f.read"]
0
[]
The function (test_limited_length_file) defined within the public class called public.The function start at line 49 and ends at 55. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 fun...
pasteorg_paste
public
public
0
0
test_limited_length_file_tell_on_socket
def test_limited_length_file_tell_on_socket():backing_read, backing_write = socket.socketpair()f = LimitedLengthFile(backing_read.makefile('rb'), 10)backing_write.send(b'0123456789')backing_write.close()assert f.tell() == 0assert f.read(1) == b'0'assert f.tell() == 1assert f.read() == b'123456789'assert f.tell() == 10b...
1
11
0
86
1
57
67
57
['f']
None
{"Assign": 2, "Expr": 3}
11
11
11
["socket.socketpair", "LimitedLengthFile", "backing_read.makefile", "backing_write.send", "backing_write.close", "f.tell", "f.read", "f.tell", "f.read", "f.tell", "backing_read.close"]
0
[]
The function (test_limited_length_file_tell_on_socket) defined within the public class called public.The function start at line 57 and ends at 67. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 11.0 functions, an...
pasteorg_paste
public
public
0
0
test_address_family_v4
def test_address_family_v4():#ipv4app = Nonehost = '127.0.0.1'port = '9090'svr = serve(app, host=host, port=port, start_loop=False, use_threadpool=False)af = svr.address_familyaddr = svr.server_addressp = svr.server_portsvr.server_close()assert (af == socket.AF_INET)assert (addr[0] == '127.0.0.1')assert (str(p) == port...
1
12
0
81
7
70
86
70
['af', 'port', 'app', 'host', 'svr', 'addr', 'p']
None
{"Assign": 7, "Expr": 1}
3
17
3
["serve", "svr.server_close", "str"]
0
[]
The function (test_address_family_v4) defined within the public class called public.The function start at line 70 and ends at 86. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 func...
pasteorg_paste
public
public
0
0
test_address_family_v4_host_and_port
def test_address_family_v4_host_and_port():#ipv4app = Nonehost = '127.0.0.1:9091'svr = serve(app, host=host, start_loop=False, use_threadpool=False)af = svr.address_familyaddr = svr.server_addressp = svr.server_portsvr.server_close()assert (af == socket.AF_INET)assert (addr[0] == '127.0.0.1')assert (str(p) == '9091')
1
11
0
74
6
89
104
89
['af', 'app', 'host', 'svr', 'addr', 'p']
None
{"Assign": 6, "Expr": 1}
3
16
3
["serve", "svr.server_close", "str"]
0
[]
The function (test_address_family_v4_host_and_port) defined within the public class called public.The function start at line 89 and ends at 104. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and ...
pasteorg_paste
public
public
0
0
test_address_family_v6
def test_address_family_v6():#ipv6app = Nonehost = '[::1]'port = '9090'try:svr = serve(app, host=host, port=port, start_loop=False, use_threadpool=False)af = svr.address_familyaddr = svr.server_addressp = svr.server_portsvr.server_close()assert (af == socket.AF_INET6)assert (addr[0] == '::1')assert (str(p) == port)exce...
2
15
0
96
7
106
126
106
['af', 'port', 'app', 'host', 'svr', 'addr', 'p']
None
{"Assign": 7, "Expr": 1, "Try": 1}
3
21
3
["serve", "svr.server_close", "str"]
0
[]
The function (test_address_family_v6) defined within the public class called public.The function start at line 106 and ends at 126. It contains 15 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 fu...
pasteorg_paste
public
public
0
0
test_simple
def test_simple():for func in eval_import, simple_import:assert func('sys') is sysassert func('sys.version') is sys.versionassert func('os.path.join') is os.path.join
2
5
0
38
0
5
9
5
[]
None
{"For": 1}
3
5
3
["func", "func", "func"]
0
[]
The function (test_simple) defined within the public class called public.The function start at line 5 and ends at 9. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions called i...
pasteorg_paste
public
public
0
0
test_complex
def test_complex():assert eval_import('sys:version') is sys.versionassert eval_import('os:getcwd()') == os.getcwd()assert (eval_import('sys:version.split()[0]') ==sys.version.split()[0])
1
5
0
42
0
11
15
11
[]
None
{}
5
5
5
["eval_import", "eval_import", "os.getcwd", "eval_import", "sys.version.split"]
0
[]
The function (test_complex) defined within the public class called public.The function start at line 11 and ends at 15. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 functions calle...
pasteorg_paste
public
public
0
0
test_dict
def test_dict():d = MultiDict({'a': 1})assert d.items() == [('a', 1)]d['b'] = 2d['c'] = 3assert d.items() == [('a', 1), ('b', 2), ('c', 3)]d['b'] = 4assert d.items() == [('a', 1), ('c', 3), ('b', 4)]d.add('b', 5)pytest.raises(KeyError, d.getone, "b")assert d.getall('b') == [4, 5]assert d.items() == [('a', 1), ('c', 3),...
1
33
0
417
3
12
53
12
['dcopy', 'item', 'd']
None
{"Assign": 8, "Expr": 2}
20
42
20
["MultiDict", "d.items", "d.items", "d.items", "d.add", "pytest.raises", "d.getall", "d.items", "d.items", "d.pop", "d.getone", "d.popitem", "d.items", "d.setdefault", "d.items", "d.setdefault", "d.mixed", "d.dict_of_lists", "d.copy", "d.items"]
0
[]
The function (test_dict) defined within the public class called public.The function start at line 12 and ends at 53. It contains 33 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 20.0 functions, and It has 20.0 functions calle...
pasteorg_paste
public
public
0
0
test_unicode_dict
def test_unicode_dict():_test_unicode_dict()_test_unicode_dict(decode_param_names=True)
1
3
0
13
0
55
57
55
[]
None
{"Expr": 2}
2
3
2
["_test_unicode_dict", "_test_unicode_dict"]
0
[]
The function (test_unicode_dict) defined within the public class called public.The function start at line 55 and ends at 57. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions ...
pasteorg_paste
public
public
0
0
_test_unicode_dict.assert_unicode
def assert_unicode(obj):assert isinstance(obj, str)
1
2
1
12
0
72
73
72
null
[]
None
null
0
0
0
null
0
null
The function (_test_unicode_dict.assert_unicode) defined within the public class called public.The function start at line 72 and ends at 73. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
_test_unicode_dict.assert_key_str
def assert_key_str(obj):assert isinstance(obj, key_str)
1
2
1
12
0
75
76
75
null
[]
None
null
0
0
0
null
0
null
The function (_test_unicode_dict.assert_key_str) defined within the public class called public.The function start at line 75 and ends at 76. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
_test_unicode_dict.assert_unicode_item
def assert_unicode_item(obj):key, value = objassert isinstance(key, key_str)assert isinstance(value, str)
1
4
1
24
0
78
81
78
null
[]
None
null
0
0
0
null
0
null
The function (_test_unicode_dict.assert_unicode_item) defined within the public class called public.The function start at line 78 and ends at 81. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
_test_unicode_dict
def _test_unicode_dict(decode_param_names=False):d = UnicodeMultiDict(MultiDict({b'a': 'a test'}))d.encoding = 'utf-8'd.errors = 'ignore'if decode_param_names:key_str = strk = lambda key: keyd.decode_keys = Trueelse:key_str = bytesk = lambda key: key.encode()def assert_unicode(obj):assert isinstance(obj, str)def assert...
3
86
1
1,008
8
59
164
59
decode_param_names
['ufs', 'key_str', 'fs', 'item', 'k', 'items', 'dcopy', 'd']
None
{"Assign": 26, "Expr": 14, "If": 1}
118
106
118
["UnicodeMultiDict", "MultiDict", "key.encode", "isinstance", "isinstance", "isinstance", "isinstance", "d.items", "k", "map", "d.keys", "map", "d.values", "d.items", "k", "k", "k", "list", "map", "d.items", "k", "d.items", "k", "k", "k", "d.items", "list", "map", "d.items", "d.add", "k", "pytest.raises", "k", "d.getal...
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_multidict_py.test_unicode_dict"]
The function (_test_unicode_dict) defined within the public class called public.The function start at line 59 and ends at 164. It contains 86 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 118.0 functions, It has 118.0 function...
pasteorg_paste
public
public
0
0
simple_app
def simple_app(environ, start_response):start_response('200 OK', [('content-type', 'text/html')])return ['all ok']
1
3
2
23
0
9
11
9
null
[]
None
null
0
0
0
null
0
null
The function (simple_app) defined within the public class called public.The function start at line 9 and ends at 11. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [9.0] and does not return any value..
pasteorg_paste
public
public
0
0
long_func
def long_func():for i in range(1000):passreturn 'test'
2
4
0
15
0
13
16
13
null
[]
None
null
0
0
0
null
0
null
The function (long_func) defined within the public class called public.The function start at line 13 and ends at 16. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
test_profile
def test_profile():app = TestApp(ProfileMiddleware(simple_app, {}))res = app.get('/')# The original app:res.mustcontain('all ok')# The profile information:res.mustcontain('<pre')
1
5
0
36
0
18
24
18
null
[]
None
null
0
0
0
null
0
null
The function (test_profile) defined within the public class called public.The function start at line 18 and ends at 24. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
test_decorator
def test_decorator():value = profile_decorator()(long_func)()assert value == 'test'
1
3
0
18
0
26
28
26
null
[]
None
null
0
0
0
null
0
null
The function (test_decorator) defined within the public class called public.The function start at line 26 and ends at 28. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
test_proxy_to_website
def test_proxy_to_website():# Not the most robust test...# need to test things like POSTing to pages, and getting from pages# that don't set content-length.app = proxy.Proxy('http://httpbin.org')app = TestApp(app)res = app.get('/')# httpbin is a react app now, so hard to readassert '<title>httpbin.org</title>' in res
1
5
0
30
2
9
17
9
['res', 'app']
None
{"Assign": 3}
4
9
4
["proxy.Proxy", "TestApp", "app.get", "pytest.mark.skip"]
0
[]
The function (test_proxy_to_website) defined within the public class called public.The function start at line 9 and ends at 17. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functio...
pasteorg_paste
public
public
0
0
error_docs_app
def error_docs_app(environ, start_response):if environ['PATH_INFO'] == '/not_found':start_response("404 Not found", [('Content-type', 'text/plain')])return [b'Not found']elif environ['PATH_INFO'] == '/error':start_response("200 OK", [('Content-type', 'text/plain')])return [b'Page not found']elif environ['PATH_INFO'] ==...
4
11
2
79
0
6
16
6
environ,start_response
[]
Returns
{"Expr": 2, "If": 3, "Return": 3}
4
11
4
["start_response", "start_response", "ForwardRequestException", "simple_app"]
0
[]
The function (error_docs_app) defined within the public class called public.The function start at line 6 and ends at 16. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [6.0], and this function return a value. It declares 4.0 functions, and It has 4.0 functio...
pasteorg_paste
Middleware
public
0
0
__init__
def __init__(self, app, url='/error'):self.app = appself.url = url
1
3
3
21
0
19
21
19
self,app,url
[]
None
{"Assign": 2}
0
3
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called Middleware.The function start at line 19 and ends at 21. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [19.0] and does not return any value. It has 6814.0 functions calling this function which are...
pasteorg_paste
Middleware
public
0
0
__call__
def __call__(self, environ, start_response):raise ForwardRequestException(self.url)
1
2
3
16
0
22
23
22
self,environ,start_response
[]
None
{}
1
2
1
["ForwardRequestException"]
43
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.validators_py.PermissionValidator.__call__", "_.content...
The function (__call__) defined within the public class called Middleware.The function start at line 22 and ends at 23. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [22.0] and does not return any value. It declare 1.0 function, It has 1.0 function called ins...
pasteorg_paste
public
public
0
0
forward
def forward(app):app = TestApp(RecursiveMiddleware(app))res = app.get('')assert res.header('content-type') == 'text/plain'assert res.full_status == '200 OK'assert 'requested page returned' in resres = app.get('/error')assert res.header('content-type') == 'text/plain'assert res.full_status == '200 OK'assert 'Page not fo...
3
21
1
129
2
25
45
25
app
['res', 'app']
None
{"Assign": 5, "If": 1, "Try": 1}
12
21
12
["TestApp", "RecursiveMiddleware", "app.get", "res.header", "app.get", "res.header", "app.get", "res.header", "app.get", "startswith", "str", "AssertionError"]
24
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3568546_onnxbot_onnx_fb_universe.test.model_defs.densenet_py._DenseLayer.forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content...
The function (forward) defined within the public class called public.The function start at line 25 and ends at 45. It contains 21 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 12.0 functions, It has 12.0 functions called insid...
pasteorg_paste
public
public
0
0
test_ForwardRequest_url.__call__
def __call__(self, environ, start_response):if environ['PATH_INFO'] != '/not_found':return self.app(environ, start_response)raise ForwardRequestException(self.url)
2
4
3
33
0
49
52
49
null
[]
None
null
0
0
0
null
0
null
The function (test_ForwardRequest_url.__call__) defined within the public class called public.The function start at line 49 and ends at 52. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [49.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_ForwardRequest_url
def test_ForwardRequest_url():class TestForwardRequestMiddleware(Middleware):def __call__(self, environ, start_response):if environ['PATH_INFO'] != '/not_found':return self.app(environ, start_response)raise ForwardRequestException(self.url)forward(TestForwardRequestMiddleware(error_docs_app))
1
4
0
19
0
47
53
47
[]
Returns
{"Expr": 1, "If": 1, "Return": 1}
4
7
4
["self.app", "ForwardRequestException", "forward", "TestForwardRequestMiddleware"]
0
[]
The function (test_ForwardRequest_url) defined within the public class called public.The function start at line 47 and ends at 53. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 4.0 functions, and It has 4.0 ...
pasteorg_paste
public
public
0
0
test_ForwardRequest_environ.__call__
def __call__(self, environ, start_response):if environ['PATH_INFO'] != '/not_found':return self.app(environ, start_response)environ['PATH_INFO'] = self.urlraise ForwardRequestException(environ=environ)
2
5
3
41
0
57
61
57
null
[]
None
null
0
0
0
null
0
null
The function (test_ForwardRequest_environ.__call__) defined within the public class called public.The function start at line 57 and ends at 61. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [57.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_ForwardRequest_environ
def test_ForwardRequest_environ():class TestForwardRequestMiddleware(Middleware):def __call__(self, environ, start_response):if environ['PATH_INFO'] != '/not_found':return self.app(environ, start_response)environ['PATH_INFO'] = self.urlraise ForwardRequestException(environ=environ)forward(TestForwardRequestMiddleware(e...
1
4
0
19
0
55
62
55
[]
Returns
{"Assign": 1, "Expr": 1, "If": 1, "Return": 1}
4
8
4
["self.app", "ForwardRequestException", "forward", "TestForwardRequestMiddleware"]
0
[]
The function (test_ForwardRequest_environ) defined within the public class called public.The function start at line 55 and ends at 62. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 4.0 functions, and It has ...
pasteorg_paste
public
public
0
0
test_ForwardRequest_factory.test_ForwardRequest_factory.__call__.factory
def factory(app):return StatusKeeper(app, status='404 Not Found', url='/error', headers=[])
1
2
1
23
0
73
74
73
null
[]
None
null
0
0
0
null
0
null
The function (test_ForwardRequest_factory.test_ForwardRequest_factory.__call__.factory) defined within the public class called public.The function start at line 73 and ends at 74. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value...
pasteorg_paste
public
public
0
0
test_ForwardRequest_factory.__call__
def __call__(self, environ, start_response):if environ['PATH_INFO'] != '/not_found':return self.app(environ, start_response)environ['PATH_INFO'] = self.urldef factory(app):return StatusKeeper(app, status='404 Not Found', url='/error', headers=[])raise ForwardRequestException(factory=factory)
2
6
3
43
0
69
75
69
null
[]
None
null
0
0
0
null
0
null
The function (test_ForwardRequest_factory.__call__) defined within the public class called public.The function start at line 69 and ends at 75. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [69.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_ForwardRequest_factory
def test_ForwardRequest_factory():from paste.errordocument import StatusKeeperclass TestForwardRequestMiddleware(Middleware):def __call__(self, environ, start_response):if environ['PATH_INFO'] != '/not_found':return self.app(environ, start_response)environ['PATH_INFO'] = self.urldef factory(app):return StatusKeeper(app...
3
25
0
152
2
64
97
64
['res', 'app']
Returns
{"Assign": 7, "If": 2, "Return": 2, "Try": 1}
16
34
16
["self.app", "StatusKeeper", "ForwardRequestException", "TestForwardRequestMiddleware", "TestApp", "RecursiveMiddleware", "app.get", "res.header", "app.get", "res.header", "app.get", "res.header", "app.get", "startswith", "str", "AssertionError"]
0
[]
The function (test_ForwardRequest_factory) defined within the public class called public.The function start at line 64 and ends at 97. It contains 25 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 16.0 functions, and It ha...
pasteorg_paste
public
public
0
0
test_ForwardRequestException.__call__
def __call__(self, environ, start_response):if environ['PATH_INFO'] != '/not_found':return self.app(environ, start_response)raise ForwardRequestException(path_info=self.url)
2
4
3
35
0
102
105
102
null
[]
None
null
0
0
0
null
0
null
The function (test_ForwardRequestException.__call__) defined within the public class called public.The function start at line 102 and ends at 105. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [102.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_ForwardRequestException
def test_ForwardRequestException():class TestForwardRequestExceptionMiddleware(Middleware):def __call__(self, environ, start_response):if environ['PATH_INFO'] != '/not_found':return self.app(environ, start_response)raise ForwardRequestException(path_info=self.url)with pytest.warns(DeprecationWarning):forward(TestForwar...
1
5
0
27
0
100
108
100
[]
Returns
{"Expr": 1, "If": 1, "Return": 1, "With": 1}
5
9
5
["self.app", "ForwardRequestException", "pytest.warns", "forward", "TestForwardRequestExceptionMiddleware"]
0
[]
The function (test_ForwardRequestException) defined within the public class called public.The function start at line 100 and ends at 108. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 5.0 functions, and It h...
pasteorg_paste
public
public
0
0
simpleapp
def simpleapp(environ, start_response):status = '200 OK'response_headers = [('Content-type','text/plain')]start_response(status, response_headers)return [b'Hello world!\n']
1
5
2
30
2
19
23
19
environ,start_response
['response_headers', 'status']
Returns
{"Assign": 2, "Expr": 1, "Return": 1}
1
5
1
["start_response"]
0
[]
The function (simpleapp) defined within the public class called public.The function start at line 19 and ends at 23. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [19.0], and this function return a value. It declare 1.0 function, and It has 1.0 function call...
pasteorg_paste
public
public
0
0
simpleapp_withregistry
def simpleapp_withregistry(environ, start_response):status = '200 OK'response_headers = [('Content-type','text/plain')]start_response(status, response_headers)body = 'Hello world!Value is %s\n' % regobj.keys()body = body.encode('utf8')return [body]
1
7
2
46
3
25
31
25
environ,start_response
['body', 'response_headers', 'status']
Returns
{"Assign": 4, "Expr": 1, "Return": 1}
3
7
3
["start_response", "regobj.keys", "body.encode"]
0
[]
The function (simpleapp_withregistry) defined within the public class called public.The function start at line 25 and ends at 31. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [25.0], and this function return a value. It declares 3.0 functions, and It has 3....
pasteorg_paste
public
public
0
0
simpleapp_withregistry_default
def simpleapp_withregistry_default(environ, start_response):status = '200 OK'response_headers = [('Content-type','text/plain')]start_response(status, response_headers)body = 'Hello world!Value is %s\n' % secondobjbody = body.encode('utf8')return [body]
1
7
2
42
3
33
39
33
environ,start_response
['body', 'response_headers', 'status']
Returns
{"Assign": 4, "Expr": 1, "Return": 1}
2
7
2
["start_response", "body.encode"]
0
[]
The function (simpleapp_withregistry_default) defined within the public class called public.The function start at line 33 and ends at 39. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [33.0], and this function return a value. It declares 2.0 functions, and I...
pasteorg_paste
RegistryUsingApp
public
0
0
__init__
def __init__(self, var, value, raise_exc=False):self.var = varself.value = valueself.raise_exc = raise_exc
1
4
4
28
0
43
46
43
self,var,value,raise_exc
[]
None
{"Assign": 3}
0
4
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called RegistryUsingApp.The function start at line 43 and ends at 46. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [43.0] and does not return any value. It has 6814.0 functions calling this function whi...
pasteorg_paste
RegistryUsingApp
public
0
0
__call__
def __call__(self, environ, start_response):if 'paste.registry' in environ:environ['paste.registry'].register(self.var, self.value)if self.raise_exc:raise self.raise_excstatus = '200 OK'response_headers = [('Content-type','text/plain')]start_response(status, response_headers)body = 'Hello world!\nThe variable is %s' % ...
3
11
3
76
0
48
58
48
self,environ,start_response
[]
Returns
{"Assign": 4, "Expr": 2, "If": 2, "Return": 1}
4
11
4
["register", "start_response", "str", "body.encode"]
43
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.validators_py.PermissionValidator.__call__", "_.content...
The function (__call__) defined within the public class called RegistryUsingApp.The function start at line 48 and ends at 58. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [48.0], and this function return a value. It declares 4.0 functions, It has 4.0 functi...
pasteorg_paste
RegistryUsingApp
public
0
0
__init__
def __init__(self, var, value):self.var = varself.value = value
1
3
3
19
0
61
63
61
self,var,value,raise_exc
[]
None
{"Assign": 3}
0
4
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called RegistryUsingApp.The function start at line 61 and ends at 63. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [61.0] and does not return any value. It has 6814.0 functions calling this function whi...
pasteorg_paste
RegistryUsingApp
public
0
0
__call__
def __call__(self, environ, start_response):if 'paste.registry' in environ:environ['paste.registry'].register(self.var, self.value)status = '200 OK'response_headers = [('Content-type','text/plain')]start_response(status, response_headers)body = 'Hello world!\nThe variable is %s' % str(regobj)body = body.encode('utf8')r...
2
9
3
70
0
65
73
65
self,environ,start_response
[]
Returns
{"Assign": 4, "Expr": 2, "If": 2, "Return": 1}
4
11
4
["register", "start_response", "str", "body.encode"]
43
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.validators_py.PermissionValidator.__call__", "_.content...
The function (__call__) defined within the public class called RegistryUsingApp.The function start at line 65 and ends at 73. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [65.0], and this function return a value. It declares 4.0 functions, It has 4.0 functio...
pasteorg_paste
RegistryUsingApp
public
0
0
__init__
def __init__(self, app, var, value, depth):self.app = appself.var = varself.value = valueself.depth = depth
1
5
5
33
0
76
80
76
self,var,value,raise_exc
[]
None
{"Assign": 3}
0
4
0
[]
6,814
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Autotools.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.CMake.__init__", "_.content....
The function (__init__) defined within the public class called RegistryUsingApp.The function start at line 76 and ends at 80. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [76.0] and does not return any value. It has 6814.0 functions calling this function whi...
pasteorg_paste
RegistryUsingApp
public
0
0
__call__
def __call__(self, environ, start_response):if 'paste.registry' in environ:environ['paste.registry'].register(self.var, self.value)line = ('\nInserted by middleware!\nInsertValue at depth %s is %s'% (self.depth, str(regobj)))line = line.encode('utf8')app_response = [line]app_iter = Noneapp_iter = self.app(environ, star...
5
23
3
157
0
82
104
82
self,environ,start_response
[]
Returns
{"Assign": 4, "Expr": 2, "If": 2, "Return": 1}
4
11
4
["register", "start_response", "str", "body.encode"]
43
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.validators_py.PermissionValidator.__call__", "_.content...
The function (__call__) defined within the public class called RegistryUsingApp.The function start at line 82 and ends at 104. It contains 23 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [82.0], and this function return a value. It declares 4.0 functions, It has 4.0 funct...
pasteorg_paste
public
public
0
0
test_simple
def test_simple():app = TestApp(simpleapp)response = app.get('/')assert 'Hello world' in response
1
4
0
22
2
107
110
107
['app', 'response']
None
{"Assign": 2}
2
4
2
["TestApp", "app.get"]
0
[]
The function (test_simple) defined within the public class called public.The function start at line 107 and ends at 110. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions call...
pasteorg_paste
public
public
0
0
test_solo_registry
def test_solo_registry():obj = {'hi':'people'}wsgiapp = RegistryUsingApp(regobj, obj)wsgiapp = RegistryManager(wsgiapp)app = TestApp(wsgiapp)res = app.get('/')assert 'Hello world' in resassert 'The variable is' in resassert "{'hi': 'people'}" in res
1
9
0
51
4
112
120
112
['obj', 'app', 'res', 'wsgiapp']
None
{"Assign": 5}
4
9
4
["RegistryUsingApp", "RegistryManager", "TestApp", "app.get"]
0
[]
The function (test_solo_registry) defined within the public class called public.The function start at line 112 and ends at 120. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functio...
pasteorg_paste
public
public
0
0
test_registry_no_object_error
def test_registry_no_object_error():app = TestApp(simpleapp_withregistry)pytest.raises(TypeError, app.get, '/')
1
3
0
22
1
122
124
122
['app']
None
{"Assign": 1, "Expr": 1}
2
3
2
["TestApp", "pytest.raises"]
0
[]
The function (test_registry_no_object_error) defined within the public class called public.The function start at line 122 and ends at 124. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has ...
pasteorg_paste
public
public
0
0
test_with_default_object
def test_with_default_object():app = TestApp(simpleapp_withregistry_default)res = app.get('/')print(res)assert 'Hello world' in resassert "Value is {'hi': 'people'}" in res
1
6
0
30
2
126
131
126
['res', 'app']
None
{"Assign": 2, "Expr": 1}
3
6
3
["TestApp", "app.get", "print"]
0
[]
The function (test_with_default_object) defined within the public class called public.The function start at line 126 and ends at 131. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 f...
pasteorg_paste
public
public
0
0
test_double_registry
def test_double_registry():obj = {'hi':'people'}secondobj = {'bye':'friends'}wsgiapp = RegistryUsingApp(regobj, obj)wsgiapp = RegistryManager(wsgiapp)wsgiapp = RegistryMiddleMan(wsgiapp, regobj, secondobj, 0)wsgiapp = RegistryManager(wsgiapp)app = TestApp(wsgiapp)res = app.get('/')assert 'Hello world' in resassert 'The...
1
14
0
84
5
133
146
133
['res', 'obj', 'app', 'secondobj', 'wsgiapp']
None
{"Assign": 8}
6
14
6
["RegistryUsingApp", "RegistryManager", "RegistryMiddleMan", "RegistryManager", "TestApp", "app.get"]
0
[]
The function (test_double_registry) defined within the public class called public.The function start at line 133 and ends at 146. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 func...
pasteorg_paste
public
public
0
0
test_really_deep_registry
def test_really_deep_registry():keylist = ['fred', 'wilma', 'barney', 'homer', 'marge', 'bart', 'lisa','maggie']valuelist = range(0, len(keylist))obj = {'hi':'people'}wsgiapp = RegistryUsingApp(regobj, obj)wsgiapp = RegistryManager(wsgiapp)for depth in valuelist:newobj = {keylist[depth]: depth}wsgiapp = RegistryMiddleM...
4
22
0
156
7
148
169
148
['res', 'obj', 'keylist', 'app', 'valuelist', 'wsgiapp', 'newobj']
None
{"Assign": 10, "For": 3}
8
22
8
["range", "len", "RegistryUsingApp", "RegistryManager", "RegistryMiddleMan", "RegistryManager", "TestApp", "app.get"]
0
[]
The function (test_really_deep_registry) defined within the public class called public.The function start at line 148 and ends at 169. It contains 22 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0...
pasteorg_paste
public
public
0
0
test_iterating_response
def test_iterating_response():obj = {'hi':'people'}secondobj = {'bye':'friends'}wsgiapp = RegistryUsingIteratorApp(regobj, obj)wsgiapp = RegistryManager(wsgiapp)wsgiapp = RegistryMiddleMan(wsgiapp, regobj, secondobj, 0)wsgiapp = RegistryManager(wsgiapp)app = TestApp(wsgiapp)res = app.get('/')assert 'Hello world' in res...
1
14
0
84
5
171
184
171
['res', 'obj', 'app', 'secondobj', 'wsgiapp']
None
{"Assign": 8}
6
14
6
["RegistryUsingIteratorApp", "RegistryManager", "RegistryMiddleMan", "RegistryManager", "TestApp", "app.get"]
0
[]
The function (test_iterating_response) defined within the public class called public.The function start at line 171 and ends at 184. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 f...
pasteorg_paste
public
public
0
0
_test_restorer
def _test_restorer(stack, data):# We need to test the request's specific Registry. Initialize it here so we# can use it later (RegistryManager will re-use one preexisting in the# environ)registry = Registry()extra_environ={'paste.throw_errors': False, 'paste.registry': registry}request_id = restorer.get_request_id(extr...
11
37
2
232
8
186
240
186
stack,data
['res', 'request_id', 'extra_environ', 'app', 'replace', 'new', 'only_key', 'registry']
None
{"Assign": 9, "Expr": 8, "For": 2, "If": 1, "Try": 3}
16
55
16
["Registry", "restorer.get_request_id", "TestApp", "app.get", "list", "proxied_obj.keys", "restorer.restoration_begin", "list", "proxied_obj.items", "registry.prepare", "registry.register", "registry.cleanup", "registry.replace", "registry.cleanup", "stacked._current_obj", "restorer.restoration_end"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_registry_py.test_restorer_basic", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_registry_py.test_restorer_basic_manager_outside", "_.content.gdri...
The function (_test_restorer) defined within the public class called public.The function start at line 186 and ends at 240. It contains 37 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [186.0] and does not return any value. It declares 16.0 functions, It has 16.0 function...
pasteorg_paste
public
public
0
0
_restorer_data
def _restorer_data():S = StackedObjectProxyd = [[S(name='first'), dict(top='of the registry stack'), False], [S(name='second'), dict(middle='of the stack'), False], [S(name='third'), dict(bottom='of the STACK.'), False]]return d
1
6
0
66
2
242
247
242
['S', 'd']
Returns
{"Assign": 2, "Return": 1}
6
6
6
["S", "dict", "S", "dict", "S", "dict"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_registry_py.test_restorer_basic", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_registry_py.test_restorer_basic_manager_outside", "_.content.gdri...
The function (_restorer_data) defined within the public class called public.The function start at line 242 and ends at 247. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 6.0 functions, It has 6.0 functions ca...
pasteorg_paste
public
public
0
0
_set_cleanup_test
def _set_cleanup_test(data):"""Instruct _test_restorer to check registry cleanup at this level of the stack"""data[2] = True
1
2
1
12
0
249
252
249
data
[]
None
{"Assign": 1, "Expr": 1}
0
4
0
[]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_registry_py.test_restorer_basic", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_registry_py.test_restorer_basic_manager_outside", "_.content.gdri...
The function (_set_cleanup_test) defined within the public class called public.The function start at line 249 and ends at 252. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 5.0 functions calling this function which ar...
pasteorg_paste
public
public
0
0
test_restorer_basic
def test_restorer_basic():data = _restorer_data()[0]wsgiapp = RegistryUsingApp(data[0], data[1], raise_exc=Exception())wsgiapp = RegistryManager(wsgiapp)_set_cleanup_test(data)wsgiapp = EvalException(wsgiapp)_test_restorer(wsgiapp, [data])
1
7
0
56
2
254
260
254
['wsgiapp', 'data']
None
{"Assign": 4, "Expr": 2}
7
7
7
["_restorer_data", "RegistryUsingApp", "Exception", "RegistryManager", "_set_cleanup_test", "EvalException", "_test_restorer"]
0
[]
The function (test_restorer_basic) defined within the public class called public.The function start at line 254 and ends at 260. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, and It has 7.0 functi...
pasteorg_paste
public
public
0
0
test_restorer_basic_manager_outside
def test_restorer_basic_manager_outside():data = _restorer_data()[0]wsgiapp = RegistryUsingApp(data[0], data[1], raise_exc=Exception())wsgiapp = EvalException(wsgiapp)wsgiapp = RegistryManager(wsgiapp)_set_cleanup_test(data)_test_restorer(wsgiapp, [data])
1
7
0
56
2
262
268
262
['wsgiapp', 'data']
None
{"Assign": 4, "Expr": 2}
7
7
7
["_restorer_data", "RegistryUsingApp", "Exception", "EvalException", "RegistryManager", "_set_cleanup_test", "_test_restorer"]
0
[]
The function (test_restorer_basic_manager_outside) defined within the public class called public.The function start at line 262 and ends at 268. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, and I...
pasteorg_paste
public
public
0
0
test_restorer_middleman_nested_evalexception
def test_restorer_middleman_nested_evalexception():data = _restorer_data()[:2]wsgiapp = RegistryUsingApp(data[0][0], data[0][1], raise_exc=Exception())wsgiapp = EvalException(wsgiapp)wsgiapp = RegistryMiddleMan(wsgiapp, data[1][0], data[1][1], 0)wsgiapp = RegistryManager(wsgiapp)_set_cleanup_test(data[1])_test_restorer...
1
8
0
88
2
270
277
270
['wsgiapp', 'data']
None
{"Assign": 5, "Expr": 2}
8
8
8
["_restorer_data", "RegistryUsingApp", "Exception", "EvalException", "RegistryMiddleMan", "RegistryManager", "_set_cleanup_test", "_test_restorer"]
0
[]
The function (test_restorer_middleman_nested_evalexception) defined within the public class called public.The function start at line 270 and ends at 277. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 8.0 function...
pasteorg_paste
public
public
0
0
test_restorer_nested_middleman
def test_restorer_nested_middleman():data = _restorer_data()[:2]wsgiapp = RegistryUsingApp(data[0][0], data[0][1], raise_exc=Exception())wsgiapp = RegistryManager(wsgiapp)_set_cleanup_test(data[0])wsgiapp = RegistryMiddleMan(wsgiapp, data[1][0], data[1][1], 0)wsgiapp = EvalException(wsgiapp)wsgiapp = RegistryManager(ws...
1
10
0
101
2
279
288
279
['wsgiapp', 'data']
None
{"Assign": 6, "Expr": 3}
10
10
10
["_restorer_data", "RegistryUsingApp", "Exception", "RegistryManager", "_set_cleanup_test", "RegistryMiddleMan", "EvalException", "RegistryManager", "_set_cleanup_test", "_test_restorer"]
0
[]
The function (test_restorer_nested_middleman) defined within the public class called public.The function start at line 279 and ends at 288. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 10.0 functions, and It h...
pasteorg_paste
public
public
0
0
test_restorer_middlemen_nested_evalexception
def test_restorer_middlemen_nested_evalexception():data = _restorer_data()wsgiapp = RegistryUsingApp(data[0][0], data[0][1], raise_exc=Exception())wsgiapp = RegistryManager(wsgiapp)_set_cleanup_test(data[0])wsgiapp = EvalException(wsgiapp)wsgiapp = RegistryMiddleMan(wsgiapp, data[1][0], data[1][1], 0)wsgiapp = Registry...
1
13
0
134
2
290
302
290
['wsgiapp', 'data']
None
{"Assign": 8, "Expr": 4}
13
13
13
["_restorer_data", "RegistryUsingApp", "Exception", "RegistryManager", "_set_cleanup_test", "EvalException", "RegistryMiddleMan", "RegistryManager", "_set_cleanup_test", "RegistryMiddleMan", "RegistryManager", "_set_cleanup_test", "_test_restorer"]
0
[]
The function (test_restorer_middlemen_nested_evalexception) defined within the public class called public.The function start at line 290 and ends at 302. It contains 13 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 13.0 functi...
pasteorg_paste
public
public
0
0
test_restorer_disabled
def test_restorer_disabled():# Ensure restoration_begin/end work safely when there's no Registrywsgiapp = TestApp(simpleapp)wsgiapp.get('/')try:restorer.restoration_begin(1)finally:restorer.restoration_end()# A second call should do nothingrestorer.restoration_end()
2
8
0
36
1
304
313
304
['wsgiapp']
None
{"Assign": 1, "Expr": 4, "Try": 1}
5
10
5
["TestApp", "wsgiapp.get", "restorer.restoration_begin", "restorer.restoration_end", "restorer.restoration_end"]
0
[]
The function (test_restorer_disabled) defined within the public class called public.The function start at line 304 and ends at 313. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 fun...
pasteorg_paste
public
public
0
0
simpleapp
def simpleapp(environ, start_response):status = '200 OK'response_headers = [('Content-type','text/plain')]start_response(status, response_headers)request = WSGIRequest(environ)body = ['Hello world!\n', 'The get is %s' % str(request.GET),' and Val is %s\n' % request.GET.get('name'),'The languages are: %s\n' % request.la...
2
12
2
91
4
8
19
8
environ,start_response
['body', 'response_headers', 'status', 'request']
Returns
{"Assign": 5, "Expr": 1, "Return": 1}
6
12
6
["start_response", "WSGIRequest", "str", "request.GET.get", "request.match_accept", "line.encode"]
0
[]
The function (simpleapp) defined within the public class called public.The function start at line 8 and ends at 19. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [8.0], and this function return a value. It declares 6.0 functions, and It has 6.0 functions ca...
pasteorg_paste
public
public
0
0
test_gets
def test_gets():app = TestApp(simpleapp)res = app.get('/')assert 'Hello' in resassert "get is MultiDict([])" in resres = app.get('/?name=george')res.mustcontain("get is MultiDict([('name', 'george')])")res.mustcontain("Val is george")
1
8
0
46
2
21
29
21
['res', 'app']
None
{"Assign": 3, "Expr": 2}
5
9
5
["TestApp", "app.get", "app.get", "res.mustcontain", "res.mustcontain"]
0
[]
The function (test_gets) defined within the public class called public.The function start at line 21 and ends at 29. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 functions called i...