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_language_parsing
def test_language_parsing():app = TestApp(simpleapp)res = app.get('/')assert "The languages are: ['en-us']" in resres = app.get('/', headers={'Accept-Language':'da, en-gb;q=0.8, en;q=0.7'})assert "languages are: ['da', 'en-gb', 'en', 'en-us']" in resres = app.get('/', headers={'Accept-Language':'en-gb;q=0.8, da, en;q=0...
1
8
0
62
2
31
40
31
['res', 'app']
None
{"Assign": 4}
4
10
4
["TestApp", "app.get", "app.get", "app.get"]
0
[]
The function (test_language_parsing) defined within the public class called public.The function start at line 31 and ends at 40. 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 4.0 functions, and It has 4.0 functi...
pasteorg_paste
public
public
0
0
test_mime_parsing
def test_mime_parsing():app = TestApp(simpleapp)res = app.get('/', headers={'Accept':'text/html'})assert "accepttypes is: ['text/html']" in resres = app.get('/', headers={'Accept':'application/xml'})assert "accepttypes is: ['application/xml']" in resres = app.get('/', headers={'Accept':'application/xml,*/*'})assert "ac...
1
8
0
70
2
42
51
42
['res', 'app']
None
{"Assign": 4}
4
10
4
["TestApp", "app.get", "app.get", "app.get"]
0
[]
The function (test_mime_parsing) defined within the public class called public.The function start at line 42 and ends at 51. 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 4.0 functions, and It has 4.0 functions ...
pasteorg_paste
public
public
0
0
test_bad_cookie
def test_bad_cookie():env = {}env['HTTP_COOKIE'] = '070-it-:><?0'assert get_cookie_dict(env) == {}env['HTTP_COOKIE'] = 'foo=bar'assert get_cookie_dict(env) == {'foo': 'bar'}env['HTTP_COOKIE'] = '...'assert get_cookie_dict(env) == {}env['HTTP_COOKIE'] = '=foo'assert get_cookie_dict(env) == {}env['HTTP_COOKIE'] = '?='ass...
1
12
0
81
1
53
64
53
['env']
None
{"Assign": 6}
5
12
5
["get_cookie_dict", "get_cookie_dict", "get_cookie_dict", "get_cookie_dict", "get_cookie_dict"]
0
[]
The function (test_bad_cookie) defined within the public class called public.The function start at line 53 and ends at 64. 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 5.0 functions, and It has 5.0 functions c...
pasteorg_paste
public
public
0
0
test_parse_querystring
def test_parse_querystring():e = {'QUERY_STRING': 'a=1&b=2&c=3&b=4'}d = parse_querystring(e)assert d == [('a', '1'), ('b', '2'), ('c', '3'), ('b', '4')]assert e['paste.parsed_querystring'] == ((d, e['QUERY_STRING']))e = {'QUERY_STRING': 'a&b&c=&d=1'}d = parse_querystring(e)assert d == [('a', ''), ('b', ''), ('c', ''), ...
1
9
0
102
2
6
14
6
['d', 'e']
None
{"Assign": 4}
2
9
2
["parse_querystring", "parse_querystring"]
0
[]
The function (test_parse_querystring) defined within the public class called public.The function start at line 6 and ends at 14. 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 2.0 functions, and It has 2.0 functi...
pasteorg_paste
public
public
0
0
make_post
def make_post(body):e = {'CONTENT_TYPE': 'application/x-www-form-urlencoded','CONTENT_LENGTH': str(len(body)),'REQUEST_METHOD': 'POST','wsgi.input': io.BytesIO(body),}return e
1
8
1
38
1
16
23
16
body
['e']
Returns
{"Assign": 1, "Return": 1}
3
8
3
["str", "len", "io.BytesIO"]
10
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700218_mesosphere_dcos_jenkins_service.testing.jenkins_remote_access_py.add_slave_info", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700218_mesosphere_dcos_jenkins_service.testing.jenkins_remote_access_py.change...
The function (make_post) defined within the public class called public.The function start at line 16 and ends at 23. It contains 8 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 3.0 functions, It has 3.0 functions called in...
pasteorg_paste
public
public
0
0
test_parse_formvars_nodup
def test_parse_formvars_nodup():"""GH85: Test that parse_formvars can be called twice."""e = {'QUERY_STRING': 'a=1&b=2&c=3&b=4', 'wsgi.input': ""}d1 = parse_formvars(e)assert d1.getall("a") == ["1"]d2 = parse_formvars(e)assert d2.getall("a") == ["1"]
1
6
0
50
3
25
31
25
['d1', 'd2', 'e']
None
{"Assign": 3, "Expr": 1}
4
7
4
["parse_formvars", "d1.getall", "parse_formvars", "d2.getall"]
0
[]
The function (test_parse_formvars_nodup) defined within the public class called public.The function start at line 25 and ends at 31. 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 4.0 functions, and It has 4.0 fu...
pasteorg_paste
public
public
0
0
test_parsevars
def test_parsevars():e = make_post(b'a=1&b=2&c=3&b=4')#cur_input = e['wsgi.input']d = parse_formvars(e)assert isinstance(d, MultiDict)assert d == MultiDict([('a', '1'), ('b', '2'), ('c', '3'), ('b', '4')])assert e['paste.parsed_formvars'] == ((d, e['wsgi.input']))
1
7
0
71
2
33
40
33
['d', 'e']
None
{"Assign": 2}
4
8
4
["make_post", "parse_formvars", "isinstance", "MultiDict"]
0
[]
The function (test_parsevars) defined within the public class called public.The function start at line 33 and ends at 40. 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 4.0 functions, and It has 4.0 functions cal...
pasteorg_paste
public
public
0
0
test_replace_header
def test_replace_header():h = [('content-type', 'text/plain'), ('x-blah', 'foobar')]replace_header(h, 'content-length', '10')assert h[-1] == ('content-length', '10')replace_header(h, 'Content-Type', 'text/html')assert ('content-type', 'text/html') in hassert ('content-type', 'text/plain') not in h
1
8
0
64
1
3
10
3
['h']
None
{"Assign": 1, "Expr": 2}
2
8
2
["replace_header", "replace_header"]
0
[]
The function (test_replace_header) defined within the public class called public.The function start at line 3 and ends at 10. 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 2.0 functions, and It has 2.0 functions...
pasteorg_paste
public
public
0
0
wsgi_app
def wsgi_app(environ, start_response):pi = environ.get('PATH_INFO', '')if pi in ('/get1', '/get2'):if pi == '/get1':sess = environ['paste.session.factory']()start_response('200 OK', [('content-type', 'text/plain')])if pi == '/get2':sess = environ['paste.session.factory']()if 'info' in sess:body = str(sess['info'])body ...
8
23
2
167
3
6
28
6
environ,start_response
['body', 'sess', 'pi']
Returns
{"Assign": 9, "Expr": 2, "If": 7, "Return": 3}
5
23
5
["environ.get", "start_response", "str", "body.encode", "start_response"]
0
[]
The function (wsgi_app) defined within the public class called public.The function start at line 6 and ends at 28. It contains 23 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [6.0], and this function return a value. It declares 5.0 functions, and It has 5.0 functions cal...
pasteorg_paste
public
public
0
0
test_app1
def test_app1():app = TestApp(wsgi_app)res = app.get('/get1')assert res.body == b'no-info'res = app.get('/get2')assert res.body ==b'no-info'info[:] = ['test']res = app.get('/put1')res = app.get('/get1')assert res.body == b'test'res = app.get('/get2')assert res.body == b'test'
1
12
0
86
2
32
43
32
['res', 'app']
None
{"Assign": 7}
6
12
6
["TestApp", "app.get", "app.get", "app.get", "app.get", "app.get"]
0
[]
The function (test_app1) defined within the public class called public.The function start at line 32 and ends at 43. 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 6.0 functions, and It has 6.0 functions called ...
pasteorg_paste
public
public
0
0
test_app2
def test_app2():app = TestApp(wsgi_app)info[:] = ['fluff']res = app.get('/put2')res = app.get('/get1')assert res.body == b'fluff'res = app.get('/get2')assert res.body == b'fluff'
1
8
0
56
2
45
52
45
['res', 'app']
None
{"Assign": 5}
4
8
4
["TestApp", "app.get", "app.get", "app.get"]
0
[]
The function (test_app2) defined within the public class called public.The function start at line 45 and ends at 52. 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 4.0 functions, and It has 4.0 functions called i...
pasteorg_paste
public
public
0
0
make_app.app
def app(environ, start_response):headers = [('Content-type', 'text/html')]start_response('200 OK', headers)body = response_text % environbody = body.encode('ascii')return [body]
1
6
2
39
0
5
10
5
null
[]
None
null
0
0
0
null
0
null
The function (make_app.app) defined within the public class called public.The function start at line 5 and ends at 10. It contains 6 lines of code and it has a cyclomatic complexity of 1. 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(response_text):def app(environ, start_response):headers = [('Content-type', 'text/html')]start_response('200 OK', headers)body = response_text % environbody = body.encode('ascii')return [body]return app
1
3
1
9
2
4
11
4
response_text
['headers', 'body']
Returns
{"Assign": 3, "Expr": 1, "Return": 2}
2
8
2
["start_response", "body.encode"]
23
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707931_jonashaag_klaus.klaus.cli_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707931_jonashaag_klaus.klaus.contrib.wsgi_autoreloading_py.make_autoreloading_app", "_.content.gdrive.MyDrive.Phd_Thesis.Dat...
The function (make_app) defined within the public class called public.The function start at line 4 and ends at 11. 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 2.0 functions, It has 2.0 functions called insi...
pasteorg_paste
public
public
0
0
test_map
def test_map():mapper = URLMap({})app = TestApp(mapper)text = '%s script_name="%%(SCRIPT_NAME)s" path_info="%%(PATH_INFO)s"'mapper[''] = make_app(text % 'root')mapper['/foo'] = make_app(text % 'foo-only')mapper['/foo/bar'] = make_app(text % 'foo:bar')mapper['/f'] = make_app(text % 'f-only')res = app.get('/')res.mustcon...
1
31
0
214
4
13
43
13
['app', 'text', 'mapper', 'res']
None
{"Assign": 13, "Expr": 17}
29
31
29
["URLMap", "TestApp", "make_app", "make_app", "make_app", "make_app", "app.get", "res.mustcontain", "res.mustcontain", "res.mustcontain", "app.get", "res.mustcontain", "res.mustcontain", "res.mustcontain", "app.get", "res.mustcontain", "res.mustcontain", "res.mustcontain", "app.get", "res.mustcontain", "res.mustcontain...
0
[]
The function (test_map) defined within the public class called public.The function start at line 13 and ends at 43. It contains 31 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 29.0 functions, and It has 29.0 functions called...
pasteorg_paste
public
public
0
0
test_404
def test_404():mapper = URLMap({})app = TestApp(mapper, extra_environ={'HTTP_ACCEPT': 'text/html'})res = app.get("/-->%0D<script>alert('xss')</script>", status=404)assert b'--><script' not in res.bodyres = app.get("/--%01><script>", status=404)assert b'--\x01><script>' not in res.body
1
7
0
65
3
45
51
45
['app', 'res', 'mapper']
None
{"Assign": 4}
4
7
4
["URLMap", "TestApp", "app.get", "app.get"]
0
[]
The function (test_404) defined within the public class called public.The function start at line 45 and ends at 51. 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 4.0 functions, and It has 4.0 functions called in...
pasteorg_paste
public
public
0
0
relative_path
def relative_path(name):here = os.path.join(os.path.dirname(os.path.abspath(__file__)),'urlparser_data')f = os.path.join('urlparser_data', '..', 'urlparser_data', name)return os.path.join(here, f)
1
5
1
58
2
11
15
11
name
['f', 'here']
Returns
{"Assign": 2, "Return": 1}
5
5
5
["os.path.join", "os.path.dirname", "os.path.abspath", "os.path.join", "os.path.join"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_urlparser_py.test_relative_path_in_static_parser", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_urlparser_py.test_xss"]
The function (relative_path) 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 this function return a value. It declares 5.0 functions, It has 5.0 functions calle...
pasteorg_paste
public
public
0
0
path
def path(name):return os.path.join(os.path.dirname(os.path.abspath(__file__)),'urlparser_data', name)
1
3
1
32
0
17
19
17
name
[]
Returns
{"Return": 1}
3
3
3
["os.path.join", "os.path.dirname", "os.path.abspath"]
139
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3703461_scoutapp_scout_apm_python.tests.integration.django_app_py.urlpatterns", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3719314_idlesign_django_sitetree.src.sitetree.admin_py.TreeAdmin.get_urls", "_.content.gd...
The function (path) defined within the public class called public.The function start at line 17 and ends at 19. 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 3.0 functions, It has 3.0 functions called inside ...
pasteorg_paste
public
public
0
0
make_app
def make_app(name):app = URLParser({}, path(name), name, index_names=['index', 'Main'])testapp = TestApp(app)return testapp
1
4
1
35
2
21
24
21
name
['testapp', 'app']
Returns
{"Assign": 2, "Return": 1}
3
4
3
["URLParser", "path", "TestApp"]
23
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707931_jonashaag_klaus.klaus.cli_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707931_jonashaag_klaus.klaus.contrib.wsgi_autoreloading_py.make_autoreloading_app", "_.content.gdrive.MyDrive.Phd_Thesis.Dat...
The function (make_app) defined within the public class called public.The function start at line 21 and ends at 24. 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 3.0 functions, It has 3.0 functions called ins...
pasteorg_paste
public
public
0
0
test_find_file
def test_find_file():app = make_app('find_file')res = app.get('/')assert 'index1' in resassert res.header('content-type') == 'text/plain'res = app.get('/index')assert 'index1' in resassert res.header('content-type') == 'text/plain'res = app.get('/index.txt')assert 'index1' in resassert res.header('content-type') == 'te...
1
32
0
250
2
26
58
26
['res', 'app']
None
{"Assign": 15}
23
33
23
["make_app", "app.get", "res.header", "app.get", "res.header", "app.get", "res.header", "app.get", "res.header", "app.get", "res.header", "app.get", "res.header", "app.get", "res.header", "app.get", "res.header", "app.get", "app.get", "app.get", "app.get", "app.get", "app.get"]
0
[]
The function (test_find_file) defined within the public class called public.The function start at line 26 and ends at 58. It contains 32 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 23.0 functions, and It has 23.0 functions ...
pasteorg_paste
public
public
0
0
test_deep
def test_deep():app = make_app('deep')res = app.get('/')assert 'index2' in resres = app.get('/sub')assert res.status == 301print(res)assert res.header('location') == 'http://localhost/sub/'assert 'http://localhost/sub/' in resres = app.get('/sub/')assert 'index3' in res
1
11
0
65
2
60
70
60
['res', 'app']
None
{"Assign": 4, "Expr": 1}
6
11
6
["make_app", "app.get", "app.get", "print", "res.header", "app.get"]
0
[]
The function (test_deep) defined within the public class called public.The function start at line 60 and ends at 70. 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 called ...
pasteorg_paste
public
public
0
0
test_python
def test_python():app = make_app('python')res = app.get('/simpleapp')assert 'test1' in resassert res.header('test-header') == 'TEST!'assert res.header('content-type') == 'text/html'res = app.get('/stream')assert 'test2' in resres = app.get('/sub/simpleapp')assert 'subsimple' in res
1
10
0
64
2
72
81
72
['res', 'app']
None
{"Assign": 4}
6
10
6
["make_app", "app.get", "res.header", "res.header", "app.get", "app.get"]
0
[]
The function (test_python) defined within the public class called public.The function start at line 72 and ends at 81. 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 6.0 functions, and It has 6.0 functions calle...
pasteorg_paste
public
public
0
0
test_hook
def test_hook():app = make_app('hook')res = app.get('/bob/app')assert 'user: bob' in resres = app.get('/tim/')assert 'index: tim' in res
1
6
0
34
2
83
88
83
['res', 'app']
None
{"Assign": 3}
3
6
3
["make_app", "app.get", "app.get"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3567358_coursera_dataduct.dataduct.utils.tests.test_hook_py.TestHooks.test_after_hook_simple", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3567358_coursera_dataduct.dataduct.utils.tests.test_hook_py.TestHooks.test...
The function (test_hook) defined within the public class called public.The function start at line 83 and ends at 88. 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, It has 3.0 functions called inside...
pasteorg_paste
public
public
0
0
test_not_found_hook
def test_not_found_hook():app = make_app('not_found')res = app.get('/simple/notfound')assert res.status == 200assert 'not found' in resres = app.get('/simple/found')assert 'is found' in resres = app.get('/recur/__notfound', status=404)# @@: It's unfortunate that the original path doesn't actually show upassert '/recur/...
1
17
0
104
2
90
107
90
['res', 'app']
None
{"Assign": 7}
7
18
7
["make_app", "app.get", "app.get", "app.get", "app.get", "app.get", "app.get"]
0
[]
The function (test_not_found_hook) defined within the public class called public.The function start at line 90 and ends at 107. 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 7.0 functions, and It has 7.0 functi...
pasteorg_paste
public
public
0
0
test_relative_path_in_static_parser
def test_relative_path_in_static_parser():x = relative_path('find_file')app = StaticURLParser(relative_path('find_file'))assert '..' not in app.root_directory
1
4
0
26
2
109
112
109
['x', 'app']
None
{"Assign": 2}
3
4
3
["relative_path", "StaticURLParser", "relative_path"]
0
[]
The function (test_relative_path_in_static_parser) defined within the public class called public.The function start at line 109 and ends at 112. 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 3.0 functions, and I...
pasteorg_paste
public
public
0
0
test_xss
def test_xss():app = TestApp(StaticURLParser(relative_path('find_file')),extra_environ={'HTTP_ACCEPT': 'text/html'})res = app.get("/-->%0D<script>alert('xss')</script>", status=404)assert b'--><script>' not in res.body
1
5
0
44
2
114
118
114
['res', 'app']
None
{"Assign": 2}
4
5
4
["TestApp", "StaticURLParser", "relative_path", "app.get"]
0
[]
The function (test_xss) defined within the public class called public.The function start at line 114 and ends at 118. 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 called ...
pasteorg_paste
public
public
0
0
test_static_parser
def test_static_parser():app = StaticURLParser(path('find_file'))testapp = TestApp(app)res = testapp.get('', status=301)res = testapp.get('/', status=404)res = testapp.get('/index.txt')assert res.body.strip() == b'index1'res = testapp.get('/index.txt/foo', status=404)res = testapp.get('/test 3.html')assert res.body.str...
1
21
0
210
3
120
141
120
['testapp', 'res', 'app']
None
{"Assign": 15}
21
22
21
["StaticURLParser", "path", "TestApp", "testapp.get", "testapp.get", "testapp.get", "res.body.strip", "testapp.get", "testapp.get", "res.body.strip", "testapp.get", "res.body.strip", "testapp.get", "res.body.strip", "testapp.get", "res.body.strip", "testapp.get", "testapp.get", "testapp.get", "testapp.get", "testapp.ge...
0
[]
The function (test_static_parser) defined within the public class called public.The function start at line 120 and ends at 141. It contains 21 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 21.0 functions, and It has 21.0 func...
pasteorg_paste
public
public
0
0
test_egg_parser
def test_egg_parser():app = PkgResourcesParser('Paste', 'paste')testapp = TestApp(app)res = testapp.get('', status=301)res = testapp.get('/', status=404)res = testapp.get('/flup_session', status=404)res = testapp.get('/util/classinit.py')assert 'ClassInitMeta' in resres = testapp.get('/util/classinit', status=404)res =...
6
32
0
281
10
143
183
143
['level', 'res', 'search_path', 'app', 'unreachable_test_file', 'testapp', 'pkg_root_path', 'unreachable_path', 'full_path', 'unreachable_path_quoted']
None
{"Assign": 21, "AugAssign": 1, "For": 1, "If": 1, "While": 1}
20
41
20
["PkgResourcesParser", "TestApp", "testapp.get", "testapp.get", "testapp.get", "testapp.get", "testapp.get", "testapp.get", "testapp.get", "get_distribution", "os.path.normpath", "os.listdir", "os.path.join", "os.path.isfile", "os.access", "os.path.dirname", "testapp.get", "testapp.get", "testapp.get", "testapp.get"]
0
[]
The function (test_egg_parser) defined within the public class called public.The function start at line 143 and ends at 183. It contains 32 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value. It declares 20.0 functions, and It has 20.0 functio...
pasteorg_paste
public
public
0
0
app_iterable_func_bytes
def app_iterable_func_bytes():yield b'a'yield b'b'yield b'c'
1
4
0
13
0
6
9
6
[]
None
{"Expr": 3}
0
4
0
[]
0
[]
The function (app_iterable_func_bytes) defined within the public class called public.The function start at line 6 and ends at 9. 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
app_iterable_func_unicode
def app_iterable_func_unicode():yield b'a'.decode('ascii')yield b'b'.decode('ascii')yield b'c'.decode('ascii')
1
4
0
28
0
12
15
12
[]
None
{"Expr": 3}
3
4
3
["decode", "decode", "decode"]
0
[]
The function (app_iterable_func_unicode) defined within the public class called public.The function start at line 12 and ends at 15. 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 3.0 functions, and It has 3.0 fu...
pasteorg_paste
public
public
0
0
close_func
def close_func():global close_func_calledclose_func_called = True
1
3
0
9
1
18
20
18
['close_func_called']
None
{"Assign": 1}
0
3
0
[]
0
[]
The function (close_func) defined within the public class called public.The function start at line 18 and ends at 20. 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_add_close
def test_add_close(app_iterable_func, expected):global close_func_calledclose_func_called = Falselst = []app_iterable = app_iterable_func()obj = add_close(app_iterable, close_func)for x in obj:lst.append(x)obj.close()assert lst == expectedassert close_func_calledassert obj._closed
2
12
2
55
4
27
41
27
app_iterable_func,expected
['obj', 'app_iterable', 'close_func_called', 'lst']
None
{"Assign": 4, "Expr": 2, "For": 1}
5
15
5
["app_iterable_func", "add_close", "lst.append", "obj.close", "pytest.mark.parametrize"]
0
[]
The function (test_add_close) defined within the public class called public.The function start at line 27 and ends at 41. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [27.0] and does not return any value. It declares 5.0 functions, and It has 5.0 functions...
pasteorg_paste
AssertApp
public
0
0
__init__
def __init__(self, assertfunc):self.assertfunc = assertfunc
1
2
2
12
0
10
11
10
self,assertfunc
[]
None
{"Assign": 1}
0
2
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 AssertApp.The function start at line 10 and ends at 11. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [10.0] and does not return any value. It has 6814.0 functions calling this function which are ...
pasteorg_paste
AssertApp
public
0
0
__call__
def __call__(self, environ, start_response):start_response('200 OK', [('Content-type','text/plain')])self.assertfunc(environ)return [b'Passed']
1
4
3
32
0
13
16
13
self,environ,start_response
[]
Returns
{"Expr": 2, "Return": 1}
2
4
2
["start_response", "self.assertfunc"]
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 AssertApp.The function start at line 13 and ends at 16. It contains 4 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 declares 2.0 functions, It has 2.0 functions call...
pasteorg_paste
public
public
0
0
valid_name.assert_valid_name
def assert_valid_name(environ):if encoding is not no_encoding:WSGIRequest.defaults._push_object(dict(content_type='text/html', charset=encoding))try:request = WSGIRequest(environ)if post:params = request.POSTelse:params = request.GETassert params['name'] == nameassert request.params['name'] == namefinally:if encoding i...
5
15
1
82
0
20
34
20
null
[]
None
null
0
0
0
null
0
null
The function (valid_name.assert_valid_name) defined within the public class called public.The function start at line 20 and ends at 34. It contains 15 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
valid_name
def valid_name(name, encoding=no_encoding, post=False):def assert_valid_name(environ):if encoding is not no_encoding:WSGIRequest.defaults._push_object(dict(content_type='text/html', charset=encoding))try:request = WSGIRequest(environ)if post:params = request.POSTelse:params = request.GETassert params['name'] == nameass...
1
3
3
17
2
19
35
19
name,encoding,post
['params', 'request']
Returns
{"Assign": 3, "Expr": 2, "If": 3, "Return": 1, "Try": 1}
4
17
4
["WSGIRequest.defaults._push_object", "dict", "WSGIRequest", "WSGIRequest.defaults._pop_object"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_wsgiwrappers_py.test_wsgirequest_charset"]
The function (valid_name) defined within the public class called public.The function start at line 19 and ends at 35. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [19.0], and this function return a value. It declares 4.0 functions, It has 4.0 functions calle...
pasteorg_paste
public
public
0
0
test_wsgirequest_charset
def test_wsgirequest_charset():# Jose, 'José'app = TestApp(AssertApp(assertfunc=valid_name(u'José', encoding='UTF-8')))res = app.get('/?name=Jos%C3%A9')# Tanaka, '田中'app = TestApp(AssertApp(assertfunc=valid_name(u'田中', encoding='UTF-8')))res = app.get('/?name=%E7%94%B0%E4%B8%AD')# Nippon (Japan), '日本'app = TestApp(Asse...
1
19
0
242
3
37
69
37
['res', 'app', 'content_type']
None
{"Assign": 13}
29
33
29
["TestApp", "AssertApp", "valid_name", "app.get", "TestApp", "AssertApp", "valid_name", "app.get", "TestApp", "AssertApp", "valid_name", "app.post", "dict", "TestApp", "AssertApp", "valid_name", "app.post", "dict", "TestApp", "AssertApp", "valid_name", "app.post", "dict", "TestApp", "AssertApp", "valid_name", "app.post...
0
[]
The function (test_wsgirequest_charset) defined within the public class called public.The function start at line 37 and ends at 69. 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 29.0 functions, and It has 29.0 ...
pasteorg_paste
public
public
0
0
test_wsgirequest_charset_fileupload.handle_fileupload
def handle_fileupload(environ, start_response):start_response('200 OK', [('Content-type','text/plain')])request = WSGIRequest(environ)assert len(request.POST) == 1assert isinstance(request.POST.keys()[0], str)fs = request.POST['thefile']assert isinstance(fs, FieldStorage)assert isinstance(fs.filename, str)assert fs.fil...
1
21
2
170
0
72
95
72
null
[]
None
null
0
0
0
null
0
null
The function (test_wsgirequest_charset_fileupload.handle_fileupload) defined within the public class called public.The function start at line 72 and ends at 95. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [72.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_wsgirequest_charset_fileupload
def test_wsgirequest_charset_fileupload():def handle_fileupload(environ, start_response):start_response('200 OK', [('Content-type','text/plain')])request = WSGIRequest(environ)assert len(request.POST) == 1assert isinstance(request.POST.keys()[0], str)fs = request.POST['thefile']assert isinstance(fs, FieldStorage)assert...
1
4
0
39
4
71
98
71
['fs', 'res', 'app', 'request']
Returns
{"Assign": 7, "Expr": 1, "Return": 1}
15
28
15
["start_response", "WSGIRequest", "len", "isinstance", "request.POST.keys", "isinstance", "isinstance", "len", "isinstance", "request.POST.keys", "isinstance", "isinstance", "TestApp", "app.post", "encode"]
0
[]
The function (test_wsgirequest_charset_fileupload) defined within the public class called public.The function start at line 71 and ends at 98. 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 15.0 functions, and...
pasteorg_paste
public
public
0
0
test_wsgiresponse_charset
def test_wsgiresponse_charset():response = WSGIResponse(mimetype='text/html; charset=UTF-8')assert response.content_type == 'text/html'assert response.charset == 'UTF-8'response.write(u'test')response.write(u'test2')response.write('test3')status, headers, content = response.wsgi_response()for data in content:assert isi...
8
42
0
273
1
100
146
100
['response']
None
{"Assign": 8, "Expr": 14, "For": 4, "Try": 3}
29
47
29
["WSGIResponse", "response.write", "response.write", "response.write", "response.wsgi_response", "isinstance", "WSGIResponse.defaults._push_object", "dict", "WSGIResponse", "response.write", "response.write", "response.write", "response.wsgi_response", "isinstance", "WSGIResponse.defaults._pop_object", "WSGIResponse.de...
0
[]
The function (test_wsgiresponse_charset) defined within the public class called public.The function start at line 100 and ends at 146. It contains 42 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value. It declares 29.0 functions, and It has 29...
pasteorg_paste
public
public
0
0
test_call_wsgiresponse.sp
def sp(status, response_headers):assert status == '200 OK'assert sorted(response_headers) == [('cache-control', 'no-cache'),('content-type', 'application/octet-stream'),]
1
6
2
31
0
150
155
150
null
[]
None
null
0
0
0
null
0
null
The function (test_call_wsgiresponse.sp) defined within the public class called public.The function start at line 150 and ends at 155. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [150.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_call_wsgiresponse
def test_call_wsgiresponse():resp = WSGIResponse(b'some content', 'application/octet-stream')def sp(status, response_headers):assert status == '200 OK'assert sorted(response_headers) == [('cache-control', 'no-cache'),('content-type', 'application/octet-stream'),]assert resp({}, sp) == [b'some content']f = io.BytesIO(b'...
1
10
0
92
2
148
162
148
['resp', 'f']
None
{"Assign": 5}
10
15
10
["WSGIResponse", "sorted", "resp", "io.BytesIO", "WSGIResponse", "list", "resp", "io.BytesIO", "WSGIResponse", "resp"]
0
[]
The function (test_call_wsgiresponse) defined within the public class called public.The function start at line 148 and ends at 162. 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 has 10.0 ...
pasteorg_paste
public
public
0
0
build.setter
def setter(environ, start_response):save = environ['paste.auth.cookie'].appendfor (k,v) in setenv.items():save(k)environ[k] = vreturn application(environ, start_response)
2
6
2
45
0
10
15
10
null
[]
None
null
0
0
0
null
0
null
The function (build.setter) defined within the public class called public.The function start at line 10 and ends at 15. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [10.0] and does not return any value..
pasteorg_paste
public
public
0
0
build
def build(application,setenv, *args, **kwargs):def setter(environ, start_response):save = environ['paste.auth.cookie'].appendfor (k,v) in setenv.items():save(k)environ[k] = vreturn application(environ, start_response)return cookie.middleware(setter,*args,**kwargs)
1
3
4
28
1
9
16
9
application,setenv,*args,**kwargs
['save']
Returns
{"Assign": 2, "Expr": 1, "For": 1, "Return": 2}
4
8
4
["setenv.items", "save", "application", "cookie.middleware"]
406
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3569119_lmjohns3_theanets.theanets.activations_py.build", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3588611_cfelton_rhea.examples.boards.atlys.atlys_blinky_host_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dat...
The function (build) defined within the public class called public.The function start at line 9 and ends at 16. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [9.0], and this function return a value. It declares 4.0 functions, It has 4.0 functions called insid...
pasteorg_paste
public
public
0
0
test_noop
def test_noop():app = build(dump_environ,{})(status,headers,content,errors) = \raw_interactive(app)assert not header_value(headers,'Set-Cookie')
1
5
0
36
1
18
22
18
['app']
None
{"Assign": 2}
3
5
3
["build", "raw_interactive", "header_value"]
0
[]
The function (test_noop) defined within the public class called public.The function start at line 18 and ends at 22. 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 3.0 functions, and It has 3.0 functions called i...
pasteorg_paste
public
public
0
0
test_basic
def test_basic(key='key', val='bingles'):app = build(dump_environ,{key:val})(status,headers,content,errors) = \raw_interactive(app)value = header_value(headers,'Set-Cookie')assert "Path=/;" in valueassert "expires=" not in valuecookie = value.split(";")[0](status,headers,content,errors) = \raw_interactive(app,{'HTTP_CO...
1
13
2
117
4
24
36
24
key,val
['value', 'app', 'cookie', 'expected']
None
{"Assign": 7}
7
13
7
["build", "raw_interactive", "header_value", "value.split", "raw_interactive", "val.replace", "expected.encode"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_auth.test_auth_cookie_py.test_roundtrip"]
The function (test_basic) defined within the public class called public.The function start at line 24 and ends at 36. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [24.0] and does not return any value. It declares 7.0 functions, It has 7.0 functions called i...
pasteorg_paste
public
public
0
0
test_roundtrip
def test_roundtrip():roundtrip = str('').join(map(chr, range(256)))test_basic(roundtrip,roundtrip)
1
3
0
29
1
38
40
38
['roundtrip']
None
{"Assign": 1, "Expr": 1}
5
3
5
["join", "str", "map", "range", "test_basic"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69736792_webassembly_component_model.design.mvp.canonical_abi.run_tests_py.test_roundtrips"]
The function (test_roundtrip) defined within the public class called public.The function start at line 38 and ends at 40. 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 5.0 functions, It has 5.0 functions called i...
pasteorg_paste
public
public
0
0
application
def application(environ, start_response):content = REMOTE_USER(environ)start_response("200 OK",(('Content-Type', 'text/plain'), ('Content-Length', len(content))))content = content.encode('utf8')return [content]
1
6
2
46
1
11
17
11
environ,start_response
['content']
Returns
{"Assign": 2, "Expr": 1, "Return": 1}
4
7
4
["REMOTE_USER", "start_response", "len", "content.encode"]
30
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3718286_gawel_pyquery.tests.apps_py.secure_application", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3964585_django_channels.channels.routing_py.ChannelNameRouter.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Da...
The function (application) defined within the public class called public.The function start at line 11 and ends at 17. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [11.0], and this function return a value. It declares 4.0 functions, It has 4.0 functions call...
pasteorg_paste
public
public
0
0
backwords
def backwords(environ, realm, username):""" dummy password hash, where user password is just reverse """password = list(username)password.reverse()password = "".join(password)return digest_password(realm, username, password)
1
5
3
38
1
21
26
21
environ,realm,username
['password']
Returns
{"Assign": 2, "Expr": 2, "Return": 1}
4
6
4
["list", "password.reverse", "join", "digest_password"]
0
[]
The function (backwords) defined within the public class called public.The function start at line 21 and ends at 26. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [21.0], and this function return a value. It declares 4.0 functions, and It has 4.0 functions c...
pasteorg_paste
public
public
0
0
check
def check(username, password, path="/"):""" perform two-stage authentication to verify login """(status,headers,content,errors) = \raw_interactive(application,path, accept='text/html')assert status.startswith("401")challenge = WWW_AUTHENTICATE(headers)response = AUTHORIZATION(username=username, password=password, chall...
4
16
3
121
2
31
47
31
username,password,path
['challenge', 'response']
Returns
{"Assign": 4, "Expr": 1, "If": 2, "Return": 2}
7
17
7
["raw_interactive", "status.startswith", "WWW_AUTHENTICATE", "AUTHORIZATION", "raw_interactive", "status.startswith", "status.startswith"]
259
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3513788_docker_archive_docker_registry.depends.docker_registry_core.docker_registry.core.driver_py.filter_args", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3546011_hashdist_hashdist.hashdist.spec.tests.test_utils...
The function (check) defined within the public class called public.The function start at line 31 and ends at 47. It contains 16 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [31.0], and this function return a value. It declares 7.0 functions, It has 7.0 functions called in...
pasteorg_paste
public
public
0
0
test_digest
def test_digest():assert b'bing' == check("bing","gnib")assert check("bing","bad") is None
1
3
0
23
0
49
51
49
[]
None
{}
2
3
2
["check", "check"]
0
[]
The function (test_digest) defined within the public class called public.The function start at line 49 and ends at 51. 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 called...
pasteorg_paste
public
public
0
0
authfetch
def authfetch(username,password,path="/",realm=realm):server.accept(2)import socketsocket.setdefaulttimeout(5)uri = ("http://%s:%s" % server.server_address) + pathauth = HTTPDigestAuthHandler()auth.add_password(realm,uri,username,password)opener = build_opener(auth)result = opener.open(uri)return result.read()
1
10
4
77
0
66
75
66
null
[]
None
null
0
0
0
null
0
null
The function (authfetch) defined within the public class called public.The function start at line 66 and ends at 75. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [66.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_success
def test_success():assert "bing" == authfetch('bing','gnib')
1
2
0
13
0
77
78
77
null
[]
None
null
0
0
0
null
0
null
The function (test_success) defined within the public class called public.The function start at line 77 and ends at 78. 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_failure
def test_failure():# urllib tries 5 more times before it gives upserver.accept(5)try:authfetch('bing','wrong')assert False, "this should raise an exception"except HTTPError as e:assert e.code == 401
2
7
0
33
0
80
87
80
null
[]
None
null
0
0
0
null
0
null
The function (test_failure) defined within the public class called public.The function start at line 80 and ends at 87. It contains 7 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_shutdown
def test_shutdown():server.stop()
1
2
0
9
0
89
90
89
null
[]
None
null
0
0
0
null
0
null
The function (test_shutdown) defined within the public class called public.The function start at line 89 and ends at 90. 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_auth_ticket_digest_and_cookie_value
def test_auth_ticket_digest_and_cookie_value():test_parameters = [(('shared_secret','username','0.0.0.0',# remote address),{'tokens': ['admin'],'time': 1579782607},b'731274bec45f6983c1f33bac8e8baf43',b'731274bec45f6983c1f33bac8e8baf435e2991cfusername!admin!',),(('shared_secret','username','0.0.0.0',),{'tokens': ['admin...
2
34
0
111
2
7
41
7
['test_parameters', 'token']
None
{"Assign": 2, "For": 1}
3
35
3
["AuthTicket", "token.digest", "token.cookie_value"]
0
[]
The function (test_auth_ticket_digest_and_cookie_value) defined within the public class called public.The function start at line 7 and ends at 41. It contains 34 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...
pasteorg_paste
public
public
0
0
test_auth_ticket_cookie
def test_auth_ticket_cookie():test_parameters = [(('shared_secret','username','0.0.0.0',# remote address),{'tokens': ['admin'],'time': 1579782607},{'name': 'auth_tkt','path': '/','secure': '','cookie_value': b'731274bec45f6983c1f33bac8e8baf435e2991cfusername!admin!'}),(('shared_secret','username','0.0.0.0',# remote add...
2
65
0
228
4
44
111
44
['test_parameters', 'expected_cookie', 'token', 'expected_cookie_value']
None
{"Assign": 7, "For": 1}
4
68
4
["AuthTicket", "SimpleCookie", "base64.b64encode", "token.cookie"]
0
[]
The function (test_auth_ticket_cookie) defined within the public class called public.The function start at line 44 and ends at 111. It contains 65 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 4.0 functions, and It has 4.0 fu...
pasteorg_paste
public
public
0
0
do_request
def do_request(app, expect_status=500):app = lint.middleware(app)app = ErrorMiddleware(app, {}, debug=True)app = clear_middleware(app)testapp = TestApp(app)res = testapp.get('', status=expect_status,expect_errors=True)return res
1
8
2
60
3
10
17
10
app,expect_status
['testapp', 'res', 'app']
Returns
{"Assign": 5, "Return": 1}
5
8
5
["lint.middleware", "ErrorMiddleware", "clear_middleware", "TestApp", "testapp.get"]
10
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.80560341_prozorroukr_openprocurement_api.docs.tests.base.test_py.DumpsWebTestApp.do_request", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_cgitb_catcher_py.test_after_start", "_.c...
The function (do_request) defined within the public class called public.The function start at line 10 and ends at 17. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [10.0], and this function return a value. It declares 5.0 functions, It has 5.0 functions calle...
pasteorg_paste
public
public
0
0
clear_middleware.clear_middleware.clear_throw_errors.replacement
def replacement(status, headers, exc_info=None):if headers_sent:return start_response(status, headers, exc_info)headers_sent.append(True)return start_response(status, headers)
2
5
3
36
0
28
32
28
null
[]
None
null
0
0
0
null
0
null
The function (clear_middleware.clear_middleware.clear_throw_errors.replacement) defined within the public class called public.The function start at line 28 and ends at 32. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [28.0] and does not return any value..
pasteorg_paste
public
public
0
0
clear_middleware.clear_throw_errors
def clear_throw_errors(environ, start_response):headers_sent = []def replacement(status, headers, exc_info=None):if headers_sent:return start_response(status, headers, exc_info)headers_sent.append(True)return start_response(status, headers)if 'paste.throw_errors' in environ:del environ['paste.throw_errors']return app(e...
2
6
2
30
0
26
35
26
null
[]
None
null
0
0
0
null
0
null
The function (clear_middleware.clear_throw_errors) defined within the public class called public.The function start at line 26 and ends at 35. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [26.0] and does not return any value..
pasteorg_paste
public
public
0
0
clear_middleware
def clear_middleware(app):"""The fixture sets paste.throw_errors, which suppresses exactly whatwe want to test in this case. This wrapper also strips exc_infoon the *first* call to start_response (but not the second, orsubsequent calls."""def clear_throw_errors(environ, start_response):headers_sent = []def replacement(...
1
3
1
10
1
19
36
19
app
['headers_sent']
Returns
{"Assign": 1, "Expr": 2, "If": 2, "Return": 4}
4
18
4
["start_response", "headers_sent.append", "start_response", "app"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_cgitb_catcher_py.do_request", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_exceptions.test_error_middleware_py.do_request"]
The function (clear_middleware) defined within the public class called public.The function start at line 19 and ends at 36. 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 4.0 functions, It has 4.0 functions ca...
pasteorg_paste
public
public
0
0
bad_app
def bad_app():"No argument list!"return None
1
3
0
7
0
43
45
43
[]
Returns
{"Expr": 1, "Return": 1}
0
3
0
[]
0
[]
The function (bad_app) defined within the public class called public.The function start at line 43 and ends at 45. 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..
pasteorg_paste
public
public
0
0
unicode_bad_app
def unicode_bad_app(environ, start_response):raise ValueError(u"\u1000")
1
2
2
13
0
47
48
47
environ,start_response
[]
None
{}
1
2
1
["ValueError"]
0
[]
The function (unicode_bad_app) defined within the public class called public.The function start at line 47 and ends at 48. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [47.0] and does not return any value. It declare 1.0 function, and It has 1.0 function ca...
pasteorg_paste
public
public
0
0
start_response_app
def start_response_app(environ, start_response):"raise error before start_response"raise ValueError("hi")
1
3
2
13
0
50
52
50
environ,start_response
[]
None
{"Expr": 1}
1
3
1
["ValueError"]
0
[]
The function (start_response_app) defined within the public class called public.The function start at line 50 and ends at 52. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [50.0] and does not return any value. It declare 1.0 function, and It has 1.0 function...
pasteorg_paste
public
public
0
0
after_start_response_app
def after_start_response_app(environ, start_response):start_response("200 OK", [('Content-type', 'text/plain')])raise ValueError('error2')
1
3
2
24
0
54
56
54
environ,start_response
[]
None
{"Expr": 1}
2
3
2
["start_response", "ValueError"]
0
[]
The function (after_start_response_app) defined within the public class called public.The function start at line 54 and ends at 56. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [54.0] and does not return any value. It declares 2.0 functions, and It has 2.0 ...
pasteorg_paste
public
public
0
0
iter_app
def iter_app(environ, start_response):start_response("200 OK", [('Content-type', 'text/plain')])return yielder([b'this', b' is ', b' a', None])
1
3
2
35
0
58
60
58
environ,start_response
[]
Returns
{"Expr": 1, "Return": 1}
2
3
2
["start_response", "yielder"]
0
[]
The function (iter_app) defined within the public class called public.The function start at line 58 and ends at 60. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [58.0], and this function return a value. It declares 2.0 functions, and It has 2.0 functions ca...
pasteorg_paste
public
public
0
0
yielder
def yielder(args):for arg in args:if arg is None:raise ValueError("None raises error")yield arg
3
5
1
22
0
62
66
62
args
[]
None
{"Expr": 1, "For": 1, "If": 1}
1
5
1
["ValueError"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_cgitb_catcher_py.iter_app", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_exceptions.test_error_middleware_py.iter_app"]
The function (yielder) defined within the public class called public.The function start at line 62 and ends at 66. It contains 5 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 declare 1.0 function, It has 1.0 function called inside whic...
pasteorg_paste
public
public
0
0
test_makes_exception
def test_makes_exception():res = do_request(bad_app)assert '<html' in resres = strip_html(str(res))assert 'bad_app() takes 0 positional arguments but 2 were given' in resassert 'iterator = application(environ, start_response_wrapper)' in resassert 'paste.lint' in resassert 'paste.exceptions.errormiddleware' in res
1
8
0
39
1
72
79
72
['res']
None
{"Assign": 2}
3
8
3
["do_request", "strip_html", "str"]
0
[]
The function (test_makes_exception) defined within the public class called public.The function start at line 72 and ends at 79. 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 3.0 functions, and It has 3.0 functio...
pasteorg_paste
public
public
0
0
test_unicode_exception
def test_unicode_exception():res = do_request(unicode_bad_app)
1
2
0
10
1
81
82
81
['res']
None
{"Assign": 1}
1
2
1
["do_request"]
0
[]
The function (test_unicode_exception) defined within the public class called public.The function start at line 81 and ends at 82. 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 declare 1.0 function, and It has 1.0 functio...
pasteorg_paste
public
public
0
0
test_start_res
def test_start_res():res = do_request(start_response_app)res = strip_html(str(res))assert 'ValueError: hi' in resassert 'test_error_middleware' in resassert ':52 in start_response_app' in res
1
6
0
31
1
85
90
85
['res']
None
{"Assign": 2}
3
6
3
["do_request", "strip_html", "str"]
0
[]
The function (test_start_res) defined within the public class called public.The function start at line 85 and ends at 90. 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 cal...
pasteorg_paste
public
public
0
0
test_after_start
def test_after_start():res = do_request(after_start_response_app, 200)res = strip_html(str(res))#print resassert 'ValueError: error2' in res
1
4
0
25
1
92
96
92
['res']
None
{"Assign": 2}
3
5
3
["do_request", "strip_html", "str"]
0
[]
The function (test_after_start) defined within the public class called public.The function start at line 92 and ends at 96. 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 3.0 functions, and It has 3.0 functions c...
pasteorg_paste
public
public
0
0
test_iter_app
def test_iter_app():res = do_request(lint.middleware(iter_app), 200)#print resassert 'None raises error' in resassert 'yielder' in res
1
4
0
25
1
98
102
98
['res']
None
{"Assign": 1}
2
5
2
["do_request", "lint.middleware"]
0
[]
The function (test_iter_app) defined within the public class called public.The function start at line 98 and ends at 102. 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 cal...
pasteorg_paste
Mock
public
0
0
__init__
def __init__(self, **kw):for name, value in kw.items():setattr(self, name, value)
2
3
2
27
0
8
10
8
self,**kw
[]
None
{"Expr": 1, "For": 1}
2
3
2
["kw.items", "setattr"]
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 Mock.The function start at line 8 and ends at 10. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [8.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called inside w...
pasteorg_paste
Supplement
public
0
1
getInfo
def getInfo(self):return self.info
1
2
1
9
0
18
19
18
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (getInfo) defined within the public class called Supplement, that inherit another class.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 this function return a value..
pasteorg_paste
Supplement
public
0
1
__call__
def __call__(self, *args):self.args = argsreturn self
1
3
2
15
0
21
23
21
self,*args
[]
Returns
{"Assign": 1, "Return": 1}
0
3
0
[]
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 Supplement, that inherit another class.The function start at line 21 and ends at 23. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [21.0], and this function return a value. It has 43.0 functions c...
pasteorg_paste
Supplement
public
0
1
getInfo
def getInfo(self):raise ValueError("This supplemental info is buggy")
1
2
1
10
0
27
28
27
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (getInfo) defined within the public class called Supplement, that inherit another class.The function start at line 27 and ends at 28. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value..
pasteorg_paste
public
public
0
0
call_error
def call_error(sup):1 + 2__traceback_supplement__ = (sup, ())assert 0, "I am an error"
1
4
1
20
1
30
33
30
sup
['__traceback_supplement__']
None
{"Assign": 1, "Expr": 1}
0
4
0
[]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_exceptions.test_formatter_py.raise_error"]
The function (call_error) defined within the public class called public.The function start at line 30 and ends at 33. 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 has 1.0 function calling this function which is ["_.conte...
pasteorg_paste
public
public
0
0
raise_error
def raise_error(sup='default'):if sup == 'default':sup = Supplement()for i in range(10):__traceback_info__ = iif i == 5:call_error(sup=sup)
4
7
1
39
2
35
41
35
sup
['sup', '__traceback_info__']
None
{"Assign": 2, "Expr": 1, "For": 1, "If": 2}
3
7
3
["Supplement", "range", "call_error"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3915596_conan_io_conan_package_tools.cpt.packager_py.ConanMultiPackager._upload_enabled", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_exceptions.test_formatter_py.test_content", ...
The function (raise_error) defined within the public class called public.The function start at line 35 and ends at 41. It contains 7 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 3.0 functions, It has 3.0 functions called insi...
pasteorg_paste
public
public
0
0
hide
def hide(t, inner, *args, **kw):__traceback_hide__ = treturn inner(*args, **kw)
1
3
4
25
1
43
45
43
t,inner,*args,**kw
['__traceback_hide__']
Returns
{"Assign": 1, "Return": 1}
1
3
1
["inner"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3914659_opengisch_qfieldsync.qfieldsync.gui.checker_feedback_table_py.CheckerFeedbackTable.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.73263884_aequilibrae_qaequilibrae.qaequilibrae.qaequilibrae_py.Aequ...
The function (hide) defined within the public class called public.The function start at line 43 and ends at 45. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [43.0], and this function return a value. It declare 1.0 function, It has 1.0 function called inside ...
pasteorg_paste
public
public
0
0
pass_through
def pass_through(info, inner, *args, **kw):"""To add another frame to the call; detectable because__tracback_info__ is set to `info`"""__traceback_info__ = inforeturn inner(*args, **kw)
1
3
4
26
1
47
53
47
info,inner,*args,**kw
['__traceback_info__']
Returns
{"Assign": 1, "Expr": 1, "Return": 1}
1
7
1
["inner"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_exceptions.test_formatter_py.test_hide_after", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_exceptions.test_formatter_py.test_hide_before", "_.c...
The function (pass_through) defined within the public class called public.The function start at line 47 and ends at 53. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [47.0], and this function return a value. It declare 1.0 function, It has 1.0 function called...
pasteorg_paste
public
public
0
0
format
def format(type='html', **ops):data = collector.collect_exception(*sys.exc_info())report = getattr(formatter, 'format_' + type)(data, **ops)return report
1
4
2
41
2
55
58
55
type,**ops
['report', 'data']
Returns
{"Assign": 2, "Return": 1}
3
4
3
["collector.collect_exception", "sys.exc_info", "getattr"]
10,310
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Meson._configure_option", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.10922465_openbmc_openbmc_build_scripts.scripts.unit_test_py.Meson._maybe_valgrind",...
The function (format) defined within the public class called public.The function start at line 55 and ends at 58. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [55.0], and this function return a value. It declares 3.0 functions, It has 3.0 functions called in...
pasteorg_paste
public
public
0
0
test_excersize
def test_excersize():for f in formats:try:raise_error()except Exception:format(f)
3
6
0
21
0
62
67
62
[]
None
{"Expr": 2, "For": 1, "Try": 1}
2
6
2
["raise_error", "format"]
0
[]
The function (test_excersize) defined within the public class called public.The function start at line 62 and ends at 67. It contains 6 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 2.0 functions, and It has 2.0 functions cal...
pasteorg_paste
public
public
0
0
test_content
def test_content():for f in formats:try:raise_error()except Exception:result = format(f)print(result)assert 'test_object' in resultassert 'http://whatever.com' in resultassert 'This is some supplemental information' in resultassert 'raise_error' in resultassert 'call_error' in resultassert '5' in resultassert 'test_con...
3
16
0
59
1
69
84
69
['result']
None
{"Assign": 1, "Expr": 2, "For": 1, "Try": 1}
3
16
3
["raise_error", "format", "print"]
0
[]
The function (test_content) defined within the public class called public.The function start at line 69 and ends at 84. It contains 16 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 3.0 functions, and It has 3.0 functions call...
pasteorg_paste
public
public
0
0
test_trim
def test_trim():current = os.path.abspath(os.getcwd())for f in formats:try:raise_error()except Exception:result = format(f, trim_source_paths=[(current, '.')])assert current not in resultassert ('%stest_formatter.py' % os.sep) in result, ValueError(repr(result))else:assert 0
3
11
0
74
2
86
96
86
['current', 'result']
None
{"Assign": 2, "Expr": 1, "For": 1, "Try": 1}
6
11
6
["os.path.abspath", "os.getcwd", "raise_error", "format", "ValueError", "repr"]
0
[]
The function (test_trim) defined within the public class called public.The function start at line 86 and ends at 96. It contains 11 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 6.0 functions, and It has 6.0 functions called ...
pasteorg_paste
public
public
0
0
test_hide
def test_hide():for f in formats:try:hide(True, raise_error)except Exception:result = format(f)print(result)assert 'in hide_inner' not in resultassert 'inner(*args, **kw)' not in resultelse:assert 0
3
11
0
44
1
98
108
98
['result']
None
{"Assign": 1, "Expr": 2, "For": 1, "Try": 1}
3
11
3
["hide", "format", "print"]
0
[]
The function (test_hide) defined within the public class called public.The function start at line 98 and ends at 108. It contains 11 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 3.0 functions, and It has 3.0 functions called...
pasteorg_paste
public
public
0
0
print_diff
def print_diff(s1, s2):differ = difflib.Differ()result = list(differ.compare(s1.splitlines(), s2.splitlines()))print('\n'.join(result))
1
4
2
44
2
110
113
110
s1,s2
['result', 'differ']
None
{"Assign": 2, "Expr": 1}
7
4
7
["difflib.Differ", "list", "differ.compare", "s1.splitlines", "s2.splitlines", "print", "join"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700218_mesosphere_dcos_jenkins_service.tools.update_config_json_py.process", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_exceptions.test_formatter_py.test_hide_supppressed"]
The function (print_diff) defined within the public class called public.The function start at line 110 and ends at 113. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [110.0] and does not return any value. It declares 7.0 functions, It has 7.0 functions called...
pasteorg_paste
public
public
0
0
test_hide_supppressed
def test_hide_supppressed():"""When an error occurs and __traceback_stop__ is true for theerroneous frame, then that setting should be ignored."""for f in ['html']: #formats:results = []for hide_value in (False, 'after'):try:pass_through('a',hide,hide_value,pass_through,'b',raise_error)except Exception:results.append(f...
5
19
0
82
1
115
137
115
['results']
None
{"Assign": 1, "Expr": 4, "For": 2, "If": 1, "Try": 1}
4
23
4
["pass_through", "results.append", "format", "print_diff"]
0
[]
The function (test_hide_supppressed) defined within the public class called public.The function start at line 115 and ends at 137. It contains 19 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 4.0 functions, and It has 4.0 fun...
pasteorg_paste
public
public
0
0
test_hide_after
def test_hide_after():for f in formats:try:pass_through('AABB',hide, 'after',pass_through, 'CCDD',# A little whitespace to keep this line out of the# content part of the reporthide, 'reset',raise_error)except Exception:result = format(f)assert 'AABB' in resultassert 'CCDD' not in resultassert 'raise_error' in resultels...
3
16
0
55
1
139
158
139
['result']
None
{"Assign": 1, "Expr": 1, "For": 1, "Try": 1}
2
20
2
["pass_through", "format"]
0
[]
The function (test_hide_after) defined within the public class called public.The function start at line 139 and ends at 158. It contains 16 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 2.0 functions, and It has 2.0 functions...
pasteorg_paste
public
public
0
0
test_hide_before
def test_hide_before():for f in formats:try:pass_through('AABB',hide, 'before',raise_error)except Exception:result = format(f)print(result)assert 'AABB' not in resultassert 'raise_error' in resultelse:assert 0
3
14
0
47
1
160
173
160
['result']
None
{"Assign": 1, "Expr": 2, "For": 1, "Try": 1}
3
14
3
["pass_through", "format", "print"]
0
[]
The function (test_hide_before) defined within the public class called public.The function start at line 160 and ends at 173. It contains 14 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 3.0 functions, and It has 3.0 function...
pasteorg_paste
public
public
0
0
test_make_wrappable
def test_make_wrappable():assert '<wbr>' in formatter.make_wrappable('x'*1000)# I'm just going to test that this doesn't excede the stack limit:formatter.make_wrappable(';'*2000)assert (formatter.make_wrappable('this that the other')== 'this that the other')assert (formatter.make_wrappable('this that ' + ('x'*50) + ';'...
1
7
0
77
0
175
182
175
[]
None
{"Expr": 1}
4
8
4
["formatter.make_wrappable", "formatter.make_wrappable", "formatter.make_wrappable", "formatter.make_wrappable"]
0
[]
The function (test_make_wrappable) defined within the public class called public.The function start at line 175 and ends at 182. 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 4.0 functions, and It has 4.0 functi...
pasteorg_paste
public
public
0
0
test_HTTPMove
def test_HTTPMove():""" make sure that location is a mandatory attribute of Redirects """pytest.raises(AssertionError, HTTPFound)pytest.raises(AssertionError, HTTPTemporaryRedirect, headers=[('l0cation','/bing')])assert isinstance(HTTPMovedPermanently("This is a message",headers=[('Location','/bing')]) ,HTTPRedirection...
1
10
0
79
0
32
42
32
[]
None
{"Expr": 3}
8
11
8
["pytest.raises", "pytest.raises", "isinstance", "HTTPMovedPermanently", "isinstance", "HTTPUseProxy", "isinstance", "HTTPFound"]
0
[]
The function (test_HTTPMove) defined within the public class called public.The function start at line 32 and ends at 42. 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 8.0 functions, and It has 8.0 functions cal...
pasteorg_paste
public
public
0
0
test_badapp.badapp
def badapp(environ, start_response):start_response("200 OK",[])raise HTTPBadRequest("Do not do this at home.")
1
3
2
19
0
46
48
46
null
[]
None
null
0
0
0
null
0
null
The function (test_badapp.badapp) defined within the public class called public.The function start at line 46 and ends at 48. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [46.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_badapp
def test_badapp():""" verify that the middleware handles previously-started responses """def badapp(environ, start_response):start_response("200 OK",[])raise HTTPBadRequest("Do not do this at home.")newapp = HTTPExceptionHandler(badapp)assert b'Bad Request' in b''.join(newapp({'HTTP_ACCEPT': 'text/html'}, (lambda a, b,...
1
5
0
44
1
44
51
44
['newapp']
None
{"Assign": 1, "Expr": 2}
5
8
5
["start_response", "HTTPBadRequest", "HTTPExceptionHandler", "join", "newapp"]
0
[]
The function (test_badapp) defined within the public class called public.The function start at line 44 and ends at 51. 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 called...
pasteorg_paste
public
public
0
0
test_unicode.badapp
def badapp(environ, start_response):start_response("200 OK",[])raise HTTPBadRequest(tstr)
1
3
2
19
0
56
58
56
null
[]
None
null
0
0
0
null
0
null
The function (test_unicode.badapp) defined within the public class called public.The function start at line 56 and ends at 58. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [56.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_unicode
def test_unicode():""" verify unicode output """tstr = u"\0xCAFE"def badapp(environ, start_response):start_response("200 OK",[])raise HTTPBadRequest(tstr)newapp = HTTPExceptionHandler(badapp)assert tstr.encode("utf-8") in b''.join(newapp({'HTTP_ACCEPT': 'text/html'}, (lambda a, b, c=None: None)))assert tstr.encode("utf...
1
10
0
87
2
53
65
53
['tstr', 'newapp']
None
{"Assign": 2, "Expr": 2}
9
13
9
["start_response", "HTTPBadRequest", "HTTPExceptionHandler", "tstr.encode", "join", "newapp", "tstr.encode", "join", "newapp"]
0
[]
The function (test_unicode) defined within the public class called public.The function start at line 53 and ends at 65. 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 9.0 functions, and It has 9.0 functions call...
pasteorg_paste
public
public
0
0
test_template
def test_template():""" verify that html() and plain() output methods work """e = HTTPInternalServerError()e.template = 'A %(ping)s and <b>%(pong)s</b> message.'assert str(e).startswith("500 Internal Server Error")assert e.plain({'ping': 'fun', 'pong': 'happy'}) == ('500 Internal Server Error\r\n''A fun and happy messa...
1
9
0
63
1
67
76
67
['e']
None
{"Assign": 2, "Expr": 1}
5
10
5
["HTTPInternalServerError", "startswith", "str", "e.plain", "e.html"]
0
[]
The function (test_template) defined within the public class called public.The function start at line 67 and ends at 76. 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 5.0 functions, and It has 5.0 functions call...
pasteorg_paste
public
public
0
0
test_redapp.saveit
def saveit(status, headers, exc_info = None):saved.append((status,headers))
1
2
3
21
0
81
82
81
null
[]
None
null
0
0
0
null
0
null
The function (test_redapp.saveit) defined within the public class called public.The function start at line 81 and ends at 82. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [81.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_redapp.redapp
def redapp(environ, start_response):raise HTTPFound("/bing/foo")
1
2
2
12
0
83
84
83
null
[]
None
null
0
0
0
null
0
null
The function (test_redapp.redapp) defined within the public class called public.The function start at line 83 and ends at 84. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [83.0] and does not return any value..
pasteorg_paste
public
public
0
0
test_redapp
def test_redapp():""" check that redirect returns the correct, expected results """saved = []def saveit(status, headers, exc_info = None):saved.append((status,headers))def redapp(environ, start_response):raise HTTPFound("/bing/foo")app = HTTPExceptionHandler(redapp)result = list(app({'HTTP_ACCEPT': 'text/html'},saveit)...
1
13
0
127
3
78
93
78
['result', 'saved', 'app']
None
{"Assign": 4, "Expr": 2}
11
16
11
["saved.append", "HTTPFound", "HTTPExceptionHandler", "list", "app", "header_value", "header_value", "list", "app", "header_value", "header_value"]
0
[]
The function (test_redapp) defined within the public class called public.The function start at line 78 and ends at 93. 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 11.0 functions, and It has 11.0 functions cal...
pasteorg_paste
public
public
0
0
test_misc
def test_misc():assert get_exception(301) == HTTPMovedPermanentlyredirect = HTTPFound("/some/path")assert isinstance(redirect,HTTPException)assert isinstance(redirect,HTTPRedirection)assert not isinstance(redirect,HTTPError)notfound = HTTPNotFound()assert isinstance(notfound,HTTPException)assert isinstance(notfound,HTT...
1
16
0
107
3
95
110
95
['notfound', 'notimpl', 'redirect']
None
{"Assign": 3}
15
16
15
["get_exception", "HTTPFound", "isinstance", "isinstance", "isinstance", "HTTPNotFound", "isinstance", "isinstance", "isinstance", "isinstance", "HTTPNotImplemented", "isinstance", "isinstance", "isinstance", "isinstance"]
0
[]
The function (test_misc) defined within the public class called public.The function start at line 95 and ends at 110. It contains 16 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 15.0 functions, and It has 15.0 functions call...
pasteorg_paste
public
public
0
0
setup_file
def setup_file(fn, content=None):dir = os.path.join(os.path.dirname(__file__), 'reporter_output')fn = os.path.join(dir, fn)if os.path.exists(dir):if os.path.exists(fn):os.unlink(fn)else:os.mkdir(dir)if content is not None:f = open(fn, 'wb')f.write(content)f.close()return fn
4
13
2
101
3
6
18
6
fn,content
['fn', 'dir', 'f']
Returns
{"Assign": 3, "Expr": 4, "If": 3, "Return": 1}
10
13
10
["os.path.join", "os.path.dirname", "os.path.join", "os.path.exists", "os.path.exists", "os.unlink", "os.mkdir", "open", "f.write", "f.close"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.tests.test_exceptions.test_reporter_py.test_logger"]
The function (setup_file) defined within the public class called public.The function start at line 6 and ends at 18. It contains 13 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 10.0 functions, It has 10.0 functions call...