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
remove_header
def remove_header(headers, name):"""Removes the named header from the list of headers.Returns thevalue of that header, or None if no header found.If multipleheaders are found, only the last one is returned."""name = name.lower()i = 0result = Nonewhile i < len(headers):if headers[i][0].lower() == name:result = headers[i...
3
11
2
64
3
122
137
122
headers,name
['result', 'i', 'name']
Returns
{"Assign": 4, "AugAssign": 1, "Expr": 1, "If": 1, "Return": 1, "While": 1}
3
16
3
["name.lower", "len", "lower"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.cowbell.__init___py.MoreCowbell.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.gzipper_py.GzipResponse.gzip_start_response"]
The function (remove_header) defined within the public class called public.The function start at line 122 and ends at 137. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [122.0], and this function return a value. It declares 3.0 functions, It has 3.0 function...
pasteorg_paste
public
public
0
0
replace_header
def replace_header(headers, name, value):"""Updates the headers replacing the first occurance of the given namewith the value provided; asserting that no further occuranceshappen. Note that this is _not_ the same as remove_header and thenappend, as two distinct operations (del followed by an append) arenot atomic in a ...
4
13
3
91
3
139
161
139
headers,name,value
['result', 'i', 'name']
Returns
{"Assign": 5, "AugAssign": 1, "Expr": 2, "If": 2, "Return": 1, "While": 1}
4
23
4
["name.lower", "len", "lower", "headers.append"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.errordocument_py.StatusKeeper.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.httpexceptions_py.HTTPException.prepare_content", "_.content.gdrive....
The function (replace_header) defined within the public class called public.The function start at line 139 and ends at 161. It contains 13 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [139.0], and this function return a value. It declares 4.0 functions, It has 4.0 functio...
pasteorg_paste
public
public
0
0
error_body_response
def error_body_response(error_code, message, __warn=True):"""Returns a standard HTML response page for an HTTP error.**Note:** Deprecated"""if __warn:warnings.warn('wsgilib.error_body_response is deprecated; use the ''wsgi_application method on an HTTPException object ''instead', DeprecationWarning, 2)return '''\<html>...
2
19
3
40
0
168
190
168
error_code,message,__warn
[]
Returns
{"Expr": 2, "If": 1, "Return": 1}
1
23
1
["warnings.warn"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.response_py.error_response"]
The function (error_body_response) defined within the public class called public.The function start at line 168 and ends at 190. It contains 19 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [168.0], and this function return a value. It declare 1.0 function, It has 1.0 func...
pasteorg_paste
public
public
0
0
error_response
def error_response(environ, error_code, message, debug_message=None, __warn=True):"""Returns the status, headers, and body of an error response.Use like:.. code-block:: pythonstatus, headers, body = wsgilib.error_response('301 Moved Permanently', 'Moved to <a href="%s">%s</a>'% (url, url))start_response(status, headers...
4
13
5
95
2
193
220
193
environ,error_code,message,debug_message,__warn
['headers', 'body']
Returns
{"Assign": 2, "AugAssign": 1, "Expr": 2, "If": 2, "Return": 1}
6
28
6
["warnings.warn", "get", "environ.get", "error_body_response", "str", "len"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.response_py.error_response_app"]
The function (error_response) defined within the public class called public.The function start at line 193 and ends at 220. It contains 13 lines of code and it has a cyclomatic complexity of 4. It takes 5 parameters, represented as [193.0], and this function return a value. It declares 6.0 functions, It has 6.0 functio...
pasteorg_paste
public
public
0
0
error_response_app.application
def application(environ, start_response):status, headers, body = error_response(environ, error_code, message,debug_message=debug_message, __warn=False)start_response(status, headers)return [body]
1
6
2
39
0
234
239
234
null
[]
None
null
0
0
0
null
0
null
The function (error_response_app.application) defined within the public class called public.The function start at line 234 and ends at 239. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [234.0] and does not return any value..
pasteorg_paste
public
public
0
0
error_response_app
def error_response_app(error_code, message, debug_message=None, __warn=True):"""An application that emits the given error response.**Note:** Deprecated"""if __warn:warnings.warn('wsgilib.error_response_app is deprecated; use the ''wsgi_application method on an HTTPException object ''instead', DeprecationWarning, 2)def ...
2
9
4
35
0
222
240
222
error_code,message,debug_message,__warn
[]
Returns
{"Assign": 1, "Expr": 3, "If": 1, "Return": 2}
3
19
3
["warnings.warn", "error_response", "start_response"]
0
[]
The function (error_response_app) defined within the public class called public.The function start at line 222 and ends at 240. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [222.0], and this function return a value. It declares 3.0 functions, and It has 3.0...
pasteorg_paste
SessionMiddleware
public
0
0
__init__
def __init__(self, application, global_conf=None, **factory_kw):self.application = applicationself.factory_kw = factory_kw
1
3
4
24
0
47
49
47
self,application,global_conf,**factory_kw
[]
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 SessionMiddleware.The function start at line 47 and ends at 49. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [47.0] and does not return any value. It has 6814.0 functions calling this function wh...
pasteorg_paste
public
public
0
0
__call__.session_start_response
def session_start_response(status, headers, exc_info=None):if not session_factory.created:remember_headers[:] = [status, headers]return start_response(status, headers)headers.append(session_factory.set_cookie_header())return start_response(status, headers, exc_info)
2
6
3
53
0
56
61
56
null
[]
None
null
0
0
0
null
0
null
The function (__call__.session_start_response) defined within the public class called public.The function start at line 56 and ends at 61. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [56.0] and does not return any value..
pasteorg_paste
public
public
0
0
__call__.start
def start():if session_factory.created and remember_headers:# Tricky bastard used the session after start_responsestatus, headers = remember_headersheaders.append(session_factory.set_cookie_header())exc = ValueError("You cannot get the session after content from the ""app_iter has been returned")start_response(status, ...
3
8
0
49
0
64
72
64
null
[]
None
null
0
0
0
null
0
null
The function (__call__.start) defined within the public class called public.The function start at line 64 and ends at 72. It contains 8 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
pasteorg_paste
public
public
0
0
__call__.close
def close():if session_factory.used:session_factory.close()
2
3
0
14
0
73
75
73
null
[]
None
null
0
0
0
null
0
null
The function (__call__.close) defined within the public class called public.The function start at line 73 and ends at 75. It contains 3 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
SessionMiddleware
public
0
0
__call__
def __call__(self, environ, start_response):session_factory = SessionFactory(environ, **self.factory_kw)environ['paste.session.factory'] = session_factoryremember_headers = []def session_start_response(status, headers, exc_info=None):if not session_factory.created:remember_headers[:] = [status, headers]return start_res...
1
9
3
57
0
51
76
51
self,environ,start_response
[]
Returns
{"Assign": 7, "Expr": 4, "If": 3, "Return": 3}
12
26
12
["SessionFactory", "start_response", "headers.append", "session_factory.set_cookie_header", "start_response", "self.application", "headers.append", "session_factory.set_cookie_header", "ValueError", "start_response", "session_factory.close", "wsgilib.add_start_close"]
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 SessionMiddleware.The function start at line 51 and ends at 76. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [51.0], and this function return a value. It declares 12.0 functions, It has 12.0 func...
pasteorg_paste
SessionMiddleware
public
0
0
__init__
def __init__(self, environ, cookie_name='_SID_', session_class=None, session_expiration=60*12, # in minutes **session_class_kw):self.created = Falseself.used = Falseself.environ = environself.cookie_name = cookie_nameself.session = Noneself.session_class = session_class or FileSessionself.session_class_kw = session_cla...
2
12
6
66
0
82
95
82
self,application,global_conf,**factory_kw
[]
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 SessionMiddleware.The function start at line 82 and ends at 95. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [82.0] and does not return any value. It has 6814.0 functions calling this function w...
pasteorg_paste
SessionMiddleware
public
0
0
__call__
def __call__(self):self.used = Trueif self.session is not None:return self.session.data()cookies = request.get_cookies(self.environ)session = Noneif self.cookie_name in cookies:self.sid = cookies[self.cookie_name].valuetry:session = self.session_class(self.sid, create=False, **self.session_class_kw)except KeyError:# In...
5
21
1
137
0
97
118
97
self,environ,start_response
[]
Returns
{"Assign": 7, "Expr": 4, "If": 3, "Return": 3}
12
26
12
["SessionFactory", "start_response", "headers.append", "session_factory.set_cookie_header", "start_response", "self.application", "headers.append", "session_factory.set_cookie_header", "ValueError", "start_response", "session_factory.close", "wsgilib.add_start_close"]
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 SessionMiddleware.The function start at line 97 and ends at 118. It contains 21 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters, and this function return a value. It declares 12.0 functions, It has 12.0 funct...
pasteorg_paste
SessionFactory
public
0
0
has_session
def has_session(self):if self.session is not None:return Truecookies = request.get_cookies(self.environ)if cookies.has_key(self.cookie_name):return Truereturn False
3
7
1
39
0
120
126
120
self
[]
Returns
{"Assign": 1, "If": 2, "Return": 3}
2
7
2
["request.get_cookies", "cookies.has_key"]
0
[]
The function (has_session) defined within the public class called SessionFactory.The function start at line 120 and ends at 126. It contains 7 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 2.0 functions, and It has 2.0 fu...
pasteorg_paste
SessionFactory
public
0
0
make_sid
def make_sid(self):# @@: need better algorithmreturn (''.join(['%02d' % x for x in time.localtime(time.time())[:6]])+ '-' + self.unique_id())
2
3
1
43
0
128
131
128
self
[]
Returns
{"Return": 1}
4
4
4
["join", "time.localtime", "time.time", "self.unique_id"]
0
[]
The function (make_sid) defined within the public class called SessionFactory.The function start at line 128 and ends at 131. It contains 3 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 4.0 functions, and It has 4.0 funct...
pasteorg_paste
SessionFactory
public
0
0
unique_id
def unique_id(self, for_object=None):"""Generates an opaque, identifier string that is practicallyguaranteed to be unique.If an object is passed, then itsid() is incorporated into the generation.Relies on md5 andreturns a 32 character long string."""r = [time.time(), random.random()]if hasattr(os, 'times'):r.append(os....
5
16
2
120
0
133
156
133
self,for_object
[]
Returns
{"Assign": 5, "Expr": 4, "For": 1, "If": 2, "Return": 2, "Try": 1}
15
24
15
["time.time", "random.random", "hasattr", "r.append", "os.times", "r.append", "id", "str", "content.encode", "md5", "md5_hash.hexdigest", "md5_hash.digest", "hexdigest.append", "ord", "join"]
0
[]
The function (unique_id) defined within the public class called SessionFactory.The function start at line 133 and ends at 156. It contains 16 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [133.0], and this function return a value. It declares 15.0 functions, and It has 15...
pasteorg_paste
SessionFactory
public
0
0
set_cookie_header
def set_cookie_header(self):c = SimpleCookie()c[self.cookie_name] = self.sidc[self.cookie_name]['path'] = '/'gmt_expiration_time = time.gmtime(time.time() + (self.expiration * 60))c[self.cookie_name]['expires'] = time.strftime("%a, %d-%b-%Y %H:%M:%S GMT", gmt_expiration_time)name, value = str(c).split(': ', 1)return (n...
1
8
1
90
0
158
167
158
self
[]
Returns
{"Assign": 6, "Return": 1}
6
10
6
["SimpleCookie", "time.gmtime", "time.time", "time.strftime", "split", "str"]
0
[]
The function (set_cookie_header) defined within the public class called SessionFactory.The function start at line 158 and ends at 167. 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 6.0 functions, and It has ...
pasteorg_paste
SessionFactory
public
0
0
close
def close(self):if self.session is not None:self.session.close()
2
3
1
20
0
169
171
169
self
[]
None
{"Expr": 1, "If": 1}
1
3
1
["self.session.close"]
158
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3470342_bitprophet_ssh.tests.test_client_py.SSHClientTest.tearDown", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537219_anthraxx_diffoscope.diffoscope.presenters.formats_py.text", "_.content.gdrive.MyDrive.Phd_Th...
The function (close) defined within the public class called SessionFactory.The function start at line 169 and ends at 171. It contains 3 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, It has 1.0 function called ins...
pasteorg_paste
SessionMiddleware
public
0
0
__init__
def __init__(self, sid, create=False, session_file_path=tempfile.gettempdir(), chmod=None, expiration=2880, # in minutes: 48 hours ):
1
4
4
28
0
180
183
180
self,application,global_conf,**factory_kw
[]
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 SessionMiddleware.The function start at line 180 and ends at 183. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [180.0] and does not return any value. It has 6814.0 functions calling this function...
pasteorg_paste
FileSession
public
0
0
filename
def filename(self):return os.path.join(self.session_file_path, self.sid)
1
2
1
20
0
200
201
200
self
[]
Returns
{"Return": 1}
1
2
1
["os.path.join"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3593274_stevenproctor_planet_erlang.planet.expunge_py.expungeCache", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3593274_stevenproctor_planet_erlang.planet.shell._genshi_py.run", "_.content.gdrive.MyDrive.Phd_Thes...
The function (filename) defined within the public class called FileSession.The function start at line 200 and ends at 201. 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. It declare 1.0 function, It has 1.0 function called...
pasteorg_paste
FileSession
public
0
0
data
def data(self):if self._data is not None:return self._dataif os.path.exists(self.filename()):f = open(self.filename(), 'rb')self._data = cPickle.load(f)f.close()else:self._data = {}return self._data
3
10
1
70
0
203
212
203
self
[]
Returns
{"Assign": 3, "Expr": 1, "If": 2, "Return": 2}
6
10
6
["os.path.exists", "self.filename", "open", "self.filename", "cPickle.load", "f.close"]
49
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537219_anthraxx_diffoscope.tests.comparators.test_debian_py.test_fallback_comparisons", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537219_anthraxx_diffoscope.tests.comparators.test_gettext_py.test_charsets", "_...
The function (data) defined within the public class called FileSession.The function start at line 203 and ends at 212. It contains 10 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 6.0 functions, It has 6.0 functions called...
pasteorg_paste
SessionFactory
public
0
0
close
def close(self):if self._data is not None:filename = self.filename()exists = os.path.exists(filename)if not self._data:if exists:os.unlink(filename)else:f = open(filename, 'wb')cPickle.dump(self._data, f)f.close()if not exists and self.chmod:os.chmod(filename, self.chmod)
6
13
1
88
0
214
226
214
self
[]
None
{"Expr": 1, "If": 1}
1
3
1
["self.session.close"]
158
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3470342_bitprophet_ssh.tests.test_client_py.SSHClientTest.tearDown", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537219_anthraxx_diffoscope.diffoscope.presenters.formats_py.text", "_.content.gdrive.MyDrive.Phd_Th...
The function (close) defined within the public class called SessionFactory.The function start at line 214 and ends at 226. It contains 13 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 declare 1.0 function, It has 1.0 function called in...
pasteorg_paste
FileSession
public
0
0
_clean_up
def _clean_up(self):global cleaning_uptry:exp_time = datetime.timedelta(seconds=self.expiration*60)now = datetime.datetime.now()#Open every session and check that it isn't too oldfor root, dirs, files in os.walk(self.session_file_path):for f in files:self._clean_up_file(f, exp_time=exp_time, now=now)finally:cleaning_up...
4
10
1
72
0
228
239
228
self
[]
None
{"Assign": 3, "Expr": 1, "For": 2, "Try": 1}
4
12
4
["datetime.timedelta", "datetime.datetime.now", "os.walk", "self._clean_up_file"]
0
[]
The function (_clean_up) defined within the public class called FileSession.The function start at line 228 and ends at 239. It contains 10 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 4.0 functions, and It has 4.0 functions ...
pasteorg_paste
FileSession
public
0
0
_clean_up_file
def _clean_up_file(self, f, exp_time, now):t = f.split("-")if len(t) != 2:returnt = t[0]try:sess_time = datetime.datetime(int(t[0:4]),int(t[4:6]),int(t[6:8]),int(t[8:10]),int(t[10:12]),int(t[12:14]))except ValueError:# Probably not a session file at allreturnif sess_time + exp_time < now:os.remove(os.path.join(self.ses...
4
17
4
130
0
241
259
241
self,f,exp_time,now
[]
None
{"Assign": 3, "Expr": 1, "If": 2, "Return": 2, "Try": 1}
11
19
11
["f.split", "len", "datetime.datetime", "int", "int", "int", "int", "int", "int", "os.remove", "os.path.join"]
0
[]
The function (_clean_up_file) defined within the public class called FileSession.The function start at line 241 and ends at 259. It contains 17 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [241.0] and does not return any value. It declares 11.0 functions, and It has 11.0...
pasteorg_paste
FileSession
public
0
0
clean_up
def clean_up(self):global last_cleanup, cleanup_cycle, cleaning_upnow = datetime.datetime.now()if cleaning_up:returnif not last_cleanup or last_cleanup + cleanup_cycle < now:if not cleaning_up:cleaning_up = Truetry:last_cleanup = nowt = threading.Thread(target=self._clean_up)t.start()except Exception:# Normally _clean_...
6
15
1
70
0
261
280
261
self
[]
None
{"Assign": 5, "Expr": 1, "If": 3, "Return": 1, "Try": 1}
3
20
3
["datetime.datetime.now", "threading.Thread", "t.start"]
0
[]
The function (clean_up) defined within the public class called FileSession.The function start at line 261 and ends at 280. It contains 15 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 3.0 functions, and It has 3.0 functions c...
pasteorg_paste
public
public
0
0
make_session_middleware
def make_session_middleware(app, global_conf,session_expiration=NO_DEFAULT,expiration=NO_DEFAULT,cookie_name=NO_DEFAULT,session_file_path=NO_DEFAULT,chmod=NO_DEFAULT):"""Adds a middleware that handles sessions for your applications.The session is a peristent dictionary.To get this dictionaryin your application, use ``e...
6
23
7
144
5
283
335
283
app,global_conf,session_expiration,expiration,cookie_name,session_file_path,chmod
['expiration', 'session_file_path', 'cookie_name', 'chmod', 'session_expiration']
Returns
{"Assign": 7, "Expr": 1, "If": 5, "Return": 1}
8
53
8
["global_conf.get", "int", "global_conf.get", "int", "global_conf.get", "global_conf.get", "global_conf.get", "SessionMiddleware"]
0
[]
The function (make_session_middleware) defined within the public class called public.The function start at line 283 and ends at 335. It contains 23 lines of code and it has a cyclomatic complexity of 6. It takes 7 parameters, represented as [283.0], and this function return a value. It declares 8.0 functions, and It h...
pasteorg_paste
TransactionManagerMiddleware
public
0
0
__init__
def __init__(self, application):self.application = application
1
2
2
12
0
21
22
21
self,application
[]
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 TransactionManagerMiddleware.The function start at line 21 and ends at 22. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [21.0] and does not return any value. It has 6814.0 functions calling this ...
pasteorg_paste
TransactionManagerMiddleware
public
0
0
__call__
def __call__(self, environ, start_response):environ['paste.transaction_manager'] = manager = Manager()# This makes sure nothing else traps unexpected exceptions:environ['paste.throw_errors'] = Truereturn catch_errors(self.application, environ, start_response,error_callback=manager.error,ok_callback=manager.finish)
1
6
3
48
0
24
30
24
self,environ,start_response
[]
Returns
{"Assign": 2, "Return": 1}
2
7
2
["Manager", "catch_errors"]
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 TransactionManagerMiddleware.The function start at line 24 and ends at 30. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [24.0], and this function return a value. It declares 2.0 functions, It has...
pasteorg_paste
TransactionManagerMiddleware
public
0
0
__init__
def __init__(self):self.aborted = Falseself.transactions = []
1
3
1
16
0
34
36
34
self,application
[]
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 TransactionManagerMiddleware.The function start at line 34 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 does not return any value. It has 6814.0 functions calling this fun...
pasteorg_paste
Manager
public
0
0
abort
def abort(self):self.aborted = True
1
2
1
10
0
38
39
38
self
[]
None
{"Assign": 1}
0
2
0
[]
46
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3564431_devstructure_blueprint.blueprint.io.server.__init___py.get_blueprint", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3564431_devstructure_blueprint.blueprint.io.server.__init___py.get_tarball", "_.content.gd...
The function (abort) defined within the public class called Manager.The function start at line 38 and ends at 39. 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 46.0 functions calling this function which are ["_.conten...
pasteorg_paste
Manager
public
0
0
error
def error(self, exc_info):self.aborted = Trueself.finish()
1
3
2
17
0
41
43
41
self,exc_info
[]
None
{"Assign": 1, "Expr": 1}
1
3
1
["self.finish"]
100
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3675202_galaxyproject_galaxy_lib.galaxy.tools.deps.dockerfiles_py.dockerfile_build", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3696043_vim_vdebug_vdebug.python3.vdebug.util_py.ExceptionHandler.handle_dbgp_error"...
The function (error) defined within the public class called Manager.The function start at line 41 and ends at 43. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [41.0] and does not return any value. It declare 1.0 function, It has 1.0 function called inside wh...
pasteorg_paste
Manager
public
0
0
finish
def finish(self):for trans in self.transactions:if self.aborted:trans.rollback()else:trans.commit()
3
6
1
29
0
45
50
45
self
[]
None
{"Expr": 2, "For": 1, "If": 1}
2
6
2
["trans.rollback", "trans.commit"]
7
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537219_anthraxx_diffoscope.diffoscope.main_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537219_anthraxx_diffoscope.diffoscope.main_py.run_diffoscope", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creati...
The function (finish) defined within the public class called Manager.The function start at line 45 and ends at 50. 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, It has 2.0 functions called inside w...
pasteorg_paste
TransactionManagerMiddleware
public
0
0
__init__
def __init__(self, module, *args, **kwargs):#assert getattr(module,'threadsaftey',0) > 0self.module = moduleself.args = argsself.kwargs = kwargs# deal with database string quoting issuesself.quote = lambda s: "'%s'" % s.replace("'","''")if hasattr(self.module,'PgQuoteString'):self.quote = self.module.PgQuoteString
2
7
4
64
0
60
69
60
self,application
[]
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 TransactionManagerMiddleware.The function start at line 60 and ends at 69. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [60.0] and does not return any value. It has 6814.0 functions calling this ...
pasteorg_paste
TransactionManagerMiddleware
public
0
0
__call__
def __call__(self, environ=None):conn = self.module.connect(*self.args, **self.kwargs)conn.__dict__['module'] = self.moduleconn.__dict__['quote'] = self.quotereturn conn
1
5
2
49
0
71
75
71
self,environ,start_response
[]
Returns
{"Assign": 2, "Return": 1}
2
7
2
["Manager", "catch_errors"]
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 TransactionManagerMiddleware.The function start at line 71 and ends at 75. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [71.0], and this function return a value. It declares 2.0 functions, It has...
pasteorg_paste
public
public
0
0
BasicTransactionHandler.BasicTransactionHandler.basic_transaction.finalizer
def finalizer(exc_info=None):if exc_info:if isinstance(exc_info[1], HTTPException):should_commit.append(exc_info[1].code)if should_commit.pop() < 400:conn.commit()else:try:conn.rollback()except Exception:# TODO: check if rollback has already happenedreturnconn.close()
5
12
1
64
0
90
102
90
null
[]
None
null
0
0
0
null
0
null
The function (BasicTransactionHandler.BasicTransactionHandler.basic_transaction.finalizer) defined within the public class called public.The function start at line 90 and ends at 102. It contains 12 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any ...
pasteorg_paste
public
public
0
0
BasicTransactionHandler.BasicTransactionHandler.basic_transaction.basictrans_start_response
def basictrans_start_response(status, headers, exc_info = None):should_commit.append(int(status.split(" ")[0]))return start_response(status, headers, exc_info)
1
3
3
37
0
103
105
103
null
[]
None
null
0
0
0
null
0
null
The function (BasicTransactionHandler.BasicTransactionHandler.basic_transaction.basictrans_start_response) defined within the public class called public.The function start at line 103 and ends at 105. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [103.0] and ...
pasteorg_paste
public
public
0
0
BasicTransactionHandler.basic_transaction
def basic_transaction(environ, start_response):conn = factory(environ)environ['paste.connection'] = connshould_commit = [500]def finalizer(exc_info=None):if exc_info:if isinstance(exc_info[1], HTTPException):should_commit.append(exc_info[1].code)if should_commit.pop() < 400:conn.commit()else:try:conn.rollback()except E...
1
8
2
41
0
86
107
86
null
[]
None
null
0
0
0
null
0
null
The function (BasicTransactionHandler.basic_transaction) defined within the public class called public.The function start at line 86 and ends at 107. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [86.0] and does not return any value..
pasteorg_paste
public
public
0
0
BasicTransactionHandler
def BasicTransactionHandler(application, factory):"""Provides a simple mechanism for starting a transaction based on thefactory; and for either committing or rolling back the transactiondepending on the result.It checks for the response's currentstatus code either through the latest call to start_response; orthrough a ...
1
3
2
12
2
77
108
77
application,factory
['should_commit', 'conn']
Returns
{"Assign": 3, "Expr": 6, "If": 3, "Return": 4, "Try": 1}
12
32
12
["factory", "isinstance", "should_commit.append", "should_commit.pop", "conn.commit", "conn.rollback", "conn.close", "should_commit.append", "int", "status.split", "start_response", "catch_errors"]
0
[]
The function (BasicTransactionHandler) defined within the public class called public.The function start at line 77 and ends at 108. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [77.0], and this function return a value. It declares 12.0 functions, and It has...
pasteorg_paste
TransLogger
public
0
0
__init__
def __init__(self, application, logger=None, format=None, logging_level=logging.INFO, logger_name='wsgi', setup_console_handler=True, set_logger_level=logging.DEBUG, time_format=None):if format is not None:self.format = formatself.time_format = time_format or self.default_time_formatself.application = applicationself.l...
6
26
9
156
0
31
57
31
self,application,logger,format,logging_level,logger_name,setup_console_handler,set_logger_level,time_format
[]
None
{"Assign": 9, "Expr": 4, "If": 4}
7
27
7
["logging.getLogger", "logging.StreamHandler", "console.setLevel", "console.setFormatter", "logging.Formatter", "self.logger.addHandler", "self.logger.setLevel"]
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 TransLogger.The function start at line 31 and ends at 57. It contains 26 lines of code and it has a cyclomatic complexity of 6. It takes 9 parameters, represented as [31.0] and does not return any value. It declares 7.0 functions, It has 7.0 functions calle...
pasteorg_paste
public
public
0
0
__call__.replacement_start_response
def replacement_start_response(status, headers, exc_info=None):# @@: Ideally we would count the bytes going by if no# content-length header was provided; but that does add# some overhead, so at least for now we'll be lazy.bytes = Nonefor name, value in headers:if name.lower() == 'content-length':bytes = valueself.write...
3
7
3
56
0
66
75
66
null
[]
None
null
0
0
0
null
0
null
The function (__call__.replacement_start_response) defined within the public class called public.The function start at line 66 and ends at 75. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [66.0] and does not return any value..
pasteorg_paste
TransLogger
public
0
0
__call__
def __call__(self, environ, start_response):start = time.localtime()req_uri = quote(environ.get('SCRIPT_NAME', '') + environ.get('PATH_INFO', ''))if environ.get('QUERY_STRING'):req_uri += '?'+environ['QUERY_STRING']method = environ['REQUEST_METHOD']def replacement_start_response(status, headers, exc_info=None):# @@: Id...
2
9
3
71
0
59
76
59
self,environ,start_response
[]
Returns
{"Assign": 5, "AugAssign": 1, "Expr": 1, "For": 1, "If": 2, "Return": 2}
9
18
9
["time.localtime", "quote", "environ.get", "environ.get", "environ.get", "name.lower", "self.write_log", "start_response", "self.application"]
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 TransLogger.The function start at line 59 and ends at 76. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [59.0], and this function return a value. It declares 9.0 functions, It has 9.0 functions ca...
pasteorg_paste
TransLogger
public
0
0
write_log
def write_log(self, environ, method, req_uri, start, status, bytes):if bytes is None:bytes = '-'if time.daylight:offset = time.altzone / 60 / 60 * -100else:offset = time.timezone / 60 / 60 * -100if offset >= 0:offset = "+%0.4d" % (offset)elif offset < 0:offset = "%0.4d" % (offset)remote_addr = '-'if environ.get('HTTP_X...
8
30
7
221
0
78
107
78
self,environ,method,req_uri,start,status,bytes
[]
None
{"Assign": 10, "Expr": 1, "If": 6}
9
30
9
["environ.get", "environ.get", "environ.get", "environ.get", "time.strftime", "status.split", "environ.get", "environ.get", "self.logger.log"]
0
[]
The function (write_log) defined within the public class called TransLogger.The function start at line 78 and ends at 107. It contains 30 lines of code and it has a cyclomatic complexity of 8. It takes 7 parameters, represented as [78.0] and does not return any value. It declares 9.0 functions, and It has 9.0 function...
pasteorg_paste
public
public
0
0
make_filter
def make_filter(app, global_conf,logger_name='wsgi',format=None,logging_level=logging.INFO,setup_console_handler=True,set_logger_level=logging.DEBUG):from paste.util.converters import asboolif isinstance(logging_level, (bytes, str)):logging_level = logging._levelNames[logging_level]if isinstance(set_logger_level, (byte...
4
19
7
109
2
109
127
109
app,global_conf,logger_name,format,logging_level,setup_console_handler,set_logger_level
['set_logger_level', 'logging_level']
Returns
{"Assign": 2, "If": 2, "Return": 1}
4
19
4
["isinstance", "isinstance", "TransLogger", "asbool"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3964620_benbusby_whoogle_search.test.test_alts_py.test_no_duplicate_alt_prefix_reddit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3964620_benbusby_whoogle_search.test.test_alts_py.test_single_pass_description_re...
The function (make_filter) defined within the public class called public.The function start at line 109 and ends at 127. It contains 19 lines of code and it has a cyclomatic complexity of 4. It takes 7 parameters, represented as [109.0], and this function return a value. It declares 4.0 functions, It has 4.0 functions ...
pasteorg_paste
public
public
0
0
html_quote
def html_quote(v):if v is None:return ''return html.escape(str(v), 1)
2
4
1
24
0
16
19
16
v
[]
Returns
{"If": 1, "Return": 2}
2
4
2
["html.escape", "str"]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.evalexception.middleware_py.get_debug_info", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.evalexception.middleware_py.make_table", "_.content.gdrive.MyDri...
The function (html_quote) defined within the public class called public.The function start at line 16 and ends at 19. It contains 4 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 2.0 functions, It has 2.0 functions called i...
pasteorg_paste
public
public
0
0
url_quote
def url_quote(v):if v is None:return ''return quote(str(v))
2
4
1
20
0
21
24
21
v
[]
Returns
{"If": 1, "Return": 2}
2
4
2
["quote", "str"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.auth.auth_tkt_py.AuthTicket.cookie_value", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.auth.digest_py.AuthDigestAuthenticator.authenticate"]
The function (url_quote) 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 2. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0 functions called in...
pasteorg_paste
public
public
0
0
js_repr
def js_repr(v):if v is None:return 'null'elif v is False:return 'false'elif v is True:return 'true'elif isinstance(v, list):return '[%s]' % ', '.join(map(js_repr, v))elif isinstance(v, dict):return '{%s}' % ', '.join(['%s: %s' % (js_repr(key), js_repr(value)) for key, value in v])elif isinstance(v, str):return repr(v)e...
10
23
1
138
0
26
48
26
v
[]
Returns
{"If": 8, "Return": 8}
14
23
14
["isinstance", "join", "map", "isinstance", "join", "js_repr", "js_repr", "isinstance", "repr", "isinstance", "repr", "hasattr", "v.__js_repr__", "ValueError"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.url_py.Button._html_attrs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.url_py.URL._html_attrs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Ou...
The function (js_repr) defined within the public class called public.The function start at line 26 and ends at 48. It contains 23 lines of code and it has a cyclomatic complexity of 10. The function does not take any parameters, and this function return a value. It declares 14.0 functions, It has 14.0 functions called ...
pasteorg_paste
URLResource
public
0
0
__init__
def __init__(self, url, vars=None, attrs=None, params=None):self.url = url or '/'self.vars = vars or []self.attrs = attrs or {}self.params = self.default_params.copy()self.original_params = params or {}if params:self.params.update(params)
6
9
5
72
0
58
66
58
self,url,vars,attrs,params
[]
None
{"Assign": 5, "Expr": 1, "If": 1}
2
9
2
["self.default_params.copy", "self.params.update"]
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 URLResource.The function start at line 58 and ends at 66. It contains 9 lines of code and it has a cyclomatic complexity of 6. It takes 5 parameters, represented as [58.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called...
pasteorg_paste
URLResource
public
0
0
from_environ
def from_environ(cls, environ, with_query_string=True, with_path_info=True, script_name=None, path_info=None, querystring=None):url = request.construct_url(environ, with_query_string=False,with_path_info=with_path_info, script_name=script_name,path_info=path_info)if with_query_string:if querystring is None:vars = reque...
3
19
7
100
0
69
87
69
cls,environ,with_query_string,with_path_info,script_name,path_info,querystring
[]
Returns
{"Assign": 5, "If": 2, "Return": 1}
4
19
4
["request.construct_url", "request.parse_querystring", "parse_qsl", "cls"]
0
[]
The function (from_environ) defined within the public class called URLResource.The function start at line 69 and ends at 87. It contains 19 lines of code and it has a cyclomatic complexity of 3. It takes 7 parameters, represented as [69.0], and this function return a value. It declares 4.0 functions, and It has 4.0 fu...
pasteorg_paste
URLResource
public
0
0
__call__
def __call__(self, *args, **kw):res = self._add_positional(args)res = res._add_vars(kw)return res
1
4
3
29
0
91
94
91
self,*args,**kw
[]
Returns
{"Assign": 2, "Return": 1}
2
4
2
["self._add_positional", "res._add_vars"]
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 URLResource.The function start at line 91 and ends at 94. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [91.0], and this function return a value. It declares 2.0 functions, It has 2.0 functions ca...
pasteorg_paste
URLResource
public
0
0
__getitem__
def __getitem__(self, item):if '=' in item:name, value = item.split('=', 1)return self._add_vars({unquote(name): unquote(value)})return self._add_positional((item,))
2
5
2
51
0
96
100
96
self,item
[]
Returns
{"Assign": 1, "If": 1, "Return": 2}
5
5
5
["item.split", "self._add_vars", "unquote", "unquote", "self._add_positional"]
28
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.AbstractForeignList.__getitem__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.ForeignList.__g...
The function (__getitem__) defined within the public class called URLResource.The function start at line 96 and ends at 100. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [96.0], and this function return a value. It declares 5.0 functions, It has 5.0 function...
pasteorg_paste
URLResource
public
0
0
attr
def attr(self, **kw):for key in kw.keys():if key.endswith('_'):kw[key[:-1]] = kw[key]del kw[key]new_attrs = self.attrs.copy()new_attrs.update(kw)return self.__class__(self.url, vars=self.vars,attrs=new_attrs,params=self.original_params)
3
10
2
84
0
102
111
102
self,**kw
[]
Returns
{"Assign": 2, "Expr": 1, "For": 1, "If": 1, "Return": 1}
5
10
5
["kw.keys", "key.endswith", "self.attrs.copy", "new_attrs.update", "self.__class__"]
123
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637699_magicalraccoon_tootstream.src.tootstream.toot_parser_py.TootParser.handle_endtag", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637699_magicalraccoon_tootstream.src.tootstream.toot_py.about", "_.content.gd...
The function (attr) defined within the public class called URLResource.The function start at line 102 and ends at 111. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [102.0], and this function return a value. It declares 5.0 functions, It has 5.0 functions ca...
pasteorg_paste
URLResource
public
0
0
param
def param(self, **kw):new_params = self.original_params.copy()new_params.update(kw)return self.__class__(self.url, vars=self.vars,attrs=self.attrs,params=new_params)
1
6
2
48
0
113
118
113
self,**kw
[]
Returns
{"Assign": 1, "Expr": 1, "Return": 1}
3
6
3
["self.original_params.copy", "new_params.update", "self.__class__"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69484938_astronomer_astronomer_providers.tests.cncf.kubernetes.triggers.test_wait_container_py.TestWaitContainerTrigger.test_running_log_interval"]
The function (param) defined within the public class called URLResource.The function start at line 113 and ends at 118. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [113.0], and this function return a value. It declares 3.0 functions, It has 3.0 functions ca...
pasteorg_paste
URLResource
public
0
0
coerce_vars
def coerce_vars(self, vars):global variabledecodeneed_variable_encode = Falsefor key, value in vars.items():if isinstance(value, dict):need_variable_encode = Trueif key.endswith('_'):vars[key[:-1]] = vars[key]del vars[key]if need_variable_encode:if variabledecode is None:from formencode import variabledecodevars = vari...
6
14
2
83
0
120
133
120
self,vars
[]
Returns
{"Assign": 4, "For": 1, "If": 4, "Return": 1}
4
14
4
["vars.items", "isinstance", "key.endswith", "variabledecode.variable_encode"]
0
[]
The function (coerce_vars) defined within the public class called URLResource.The function start at line 120 and ends at 133. It contains 14 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [120.0], and this function return a value. It declares 4.0 functions, and It has 4.0 ...
pasteorg_paste
URLResource
public
0
0
var
def var(self, **kw):kw = self.coerce_vars(kw)new_vars = self.vars + list(kw.items())return self.__class__(self.url, vars=new_vars,attrs=self.attrs,params=self.original_params)
1
6
2
55
0
136
141
136
self,**kw
[]
Returns
{"Assign": 2, "Return": 1}
4
6
4
["self.coerce_vars", "list", "kw.items", "self.__class__"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.77529374_cjdrake_pyeda.pyeda.boolalg.test.test_boolfunc_py.test_var"]
The function (var) defined within the public class called URLResource.The function start at line 136 and ends at 141. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [136.0], and this function return a value. It declares 4.0 functions, It has 4.0 functions call...
pasteorg_paste
URLResource
public
0
0
setvar
def setvar(self, **kw):"""Like ``.var(...)``, except overwrites keys, where .var simplyextends the keys.Setting a variable to None here willeffectively delete it."""kw = self.coerce_vars(kw)new_vars = []for name, values in self.vars:if name in kw:continuenew_vars.append((name, values))new_vars.extend(kw.items())return ...
3
11
2
81
0
143
158
143
self,**kw
[]
Returns
{"Assign": 2, "Expr": 3, "For": 1, "If": 1, "Return": 1}
5
16
5
["self.coerce_vars", "new_vars.append", "new_vars.extend", "kw.items", "self.__class__"]
0
[]
The function (setvar) defined within the public class called URLResource.The function start at line 143 and ends at 158. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [143.0], and this function return a value. It declares 5.0 functions, and It has 5.0 funct...
pasteorg_paste
URLResource
public
0
0
setvars
def setvars(self, **kw):"""Creates a copy of this URL, but with all the variables set/reset(like .setvar(), except clears past variables at the same time)"""return self.__class__(self.url, vars=kw.items(),attrs=self.attrs,params=self.original_params)
1
4
2
38
0
160
167
160
self,**kw
[]
Returns
{"Expr": 1, "Return": 1}
2
8
2
["self.__class__", "kw.items"]
0
[]
The function (setvars) defined within the public class called URLResource.The function start at line 160 and ends at 167. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [160.0], and this function return a value. It declares 2.0 functions, and It has 2.0 funct...
pasteorg_paste
URLResource
public
0
0
addpath
def addpath(self, *paths):u = selffor path in paths:path = str(path).lstrip('/')new_url = u.urlif not new_url.endswith('/'):new_url += '/'u = u.__class__(new_url+path, vars=u.vars,attrs=u.attrs,params=u.original_params)return u
3
11
2
74
0
169
179
169
self,*paths
[]
Returns
{"Assign": 4, "AugAssign": 1, "For": 1, "If": 1, "Return": 1}
4
11
4
["lstrip", "str", "new_url.endswith", "u.__class__"]
0
[]
The function (addpath) defined within the public class called URLResource.The function start at line 169 and ends at 179. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [169.0], and this function return a value. It declares 4.0 functions, and It has 4.0 func...
pasteorg_paste
URLResource
public
0
0
become
def become(self, OtherClass):return OtherClass(self.url, vars=self.vars,attrs=self.attrs,params=self.original_params)
1
4
2
32
0
183
186
183
self,OtherClass
[]
Returns
{"Return": 1}
1
4
1
["OtherClass"]
0
[]
The function (become) defined within the public class called URLResource.The function start at line 183 and ends at 186. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [183.0], and this function return a value. It declare 1.0 function, and It has 1.0 function...
pasteorg_paste
URLResource
public
0
0
href__get
def href__get(self):s = self.urlif self.vars:s += '?'vars = []for name, val in self.vars:if isinstance(val, (list, tuple)):val = [v for v in val if v is not None]elif val is None:continuevars.append((name, val))s += urlencode(vars, True)return s
7
13
1
83
0
188
200
188
self
[]
Returns
{"Assign": 3, "AugAssign": 2, "Expr": 1, "For": 1, "If": 3, "Return": 1}
3
13
3
["isinstance", "vars.append", "urlencode"]
0
[]
The function (href__get) defined within the public class called URLResource.The function start at line 188 and ends at 200. It contains 13 lines of code and it has a cyclomatic complexity of 7. The function does not take any parameters, and this function return a value. It declares 3.0 functions, and It has 3.0 functi...
pasteorg_paste
URLResource
public
0
0
__repr__
def __repr__(self):base = '<%s %s' % (self.__class__.__name__, self.href or "''")if self.attrs:base += ' attrs(%s)' % (' '.join(['%s="%s"' % (html_quote(n), html_quote(v))for n, v in self.attrs.items()]))if self.original_params:base += ' params(%s)' % (', '.join(['%s=%r' % (n, v) for n, v in self.attrs.items()]))return...
6
12
1
106
0
204
215
204
self
[]
Returns
{"Assign": 1, "AugAssign": 2, "If": 2, "Return": 1}
6
12
6
["join", "html_quote", "html_quote", "self.attrs.items", "join", "self.attrs.items"]
29
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659669_pyopenapi_pyswagger.pyswagger.tests.v1_2.test_app_py.AppTestCase.test_ref", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3696868_turbogears_ming.ming.schema_py.Array.__repr__", "_.content.gdrive.MyDrive.Phd...
The function (__repr__) defined within the public class called URLResource.The function start at line 204 and ends at 215. It contains 12 lines of code and it has a cyclomatic complexity of 6. 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
URLResource
public
0
0
html__get
def html__get(self):if not self.params.get('tag'):raise ValueError("You cannot get the HTML of %r until you set the ""'tag' param'" % self)content = self._get_content()tag = '<%s' % self.params.get('tag')attrs = ' '.join(['%s="%s"' % (html_quote(n), html_quote(v))for n, v in self._html_attrs()])if attrs:tag += ' ' + at...
5
17
1
118
0
217
233
217
self
[]
Returns
{"Assign": 3, "AugAssign": 2, "If": 3, "Return": 2}
10
17
10
["self.params.get", "ValueError", "self._get_content", "self.params.get", "join", "html_quote", "html_quote", "self._html_attrs", "self._html_extra", "self.params.get"]
0
[]
The function (html__get) defined within the public class called URLResource.The function start at line 217 and ends at 233. It contains 17 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters, and this function return a value. It declares 10.0 functions, and It has 10.0 func...
pasteorg_paste
URLResource
public
0
0
_html_attrs
def _html_attrs(self):return self.attrs.items()
1
2
1
13
0
237
238
237
self
[]
Returns
{"Return": 1}
1
2
1
["self.attrs.items"]
0
[]
The function (_html_attrs) defined within the public class called URLResource.The function start at line 237 and ends at 238. 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. It declare 1.0 function, and It has 1.0 functio...
pasteorg_paste
URLResource
public
0
0
_html_extra
def _html_extra(self):return ''
1
2
1
7
0
240
241
240
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (_html_extra) defined within the public class called URLResource.The function start at line 240 and ends at 241. 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
URLResource
public
0
0
_get_content
def _get_content(self):"""Return the content for a tag (for self.html); return Nonefor an empty tag (like ``<img />``)"""raise NotImplementedError
1
2
1
8
0
243
248
243
self
[]
None
{"Expr": 1}
0
6
0
[]
0
[]
The function (_get_content) defined within the public class called URLResource.The function start at line 243 and ends at 248. 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
URLResource
public
0
0
_add_vars
def _add_vars(self, vars):raise NotImplementedError
1
2
2
9
0
250
251
250
self,vars
[]
None
{}
0
2
0
[]
0
[]
The function (_add_vars) defined within the public class called URLResource.The function start at line 250 and ends at 251. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [250.0] and does not return any value..
pasteorg_paste
URLResource
public
0
0
_add_positional
def _add_positional(self, args):raise NotImplementedError
1
2
2
9
0
253
254
253
self,args
[]
None
{}
0
2
0
[]
0
[]
The function (_add_positional) defined within the public class called URLResource.The function start at line 253 and ends at 254. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [253.0] and does not return any value..
pasteorg_paste
URL
public
0
1
__str__
def __str__(self):return self.href
1
2
1
9
0
283
284
283
self
[]
Returns
{"Return": 1}
0
2
0
[]
64
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.models.ipam_py.Vlans.__str__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3609375_dyninc_dyn_python.dyn.tm.session_py.DynectSession.__str__", "_.content.gdrive.MyDrive....
The function (__str__) defined within the public class called URL, that inherit another class.The function start at line 283 and ends at 284. 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. It has 64.0 functions calling th...
pasteorg_paste
URLResource
public
0
0
_get_content
def _get_content(self):if not self.params.get('content'):raise ValueError("You must give a content param to %r generate anchor tags"% self)return self.params['content']
2
6
1
30
0
286
291
286
self
[]
None
{"Expr": 1}
0
6
0
[]
0
[]
The function (_get_content) defined within the public class called URLResource.The function start at line 286 and ends at 291. It contains 6 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
URLResource
public
0
0
_add_vars
def _add_vars(self, vars):url = selffor name in ('confirm', 'content'):if name in vars:url = url.param(**{name: vars.pop(name)})if 'target' in vars:url = url.attr(target=vars.pop('target'))return url.var(**vars)
4
8
2
70
0
293
300
293
self,vars
[]
None
{}
0
2
0
[]
0
[]
The function (_add_vars) defined within the public class called URLResource.The function start at line 293 and ends at 300. It contains 8 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [293.0] and does not return any value..
pasteorg_paste
URLResource
public
0
0
_add_positional
def _add_positional(self, args):return self.addpath(*args)
1
2
2
15
0
302
303
302
self,args
[]
None
{}
0
2
0
[]
0
[]
The function (_add_positional) defined within the public class called URLResource.The function start at line 302 and ends at 303. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [302.0] and does not return any value..
pasteorg_paste
URLResource
public
0
0
_html_attrs
def _html_attrs(self):attrs = list(self.attrs.items())attrs.insert(0, ('href', self.href))if self.params.get('confirm'):attrs.append(('onclick', 'return confirm(%s)'% js_repr(self.params['confirm'])))return attrs
2
7
1
63
0
305
311
305
self
[]
Returns
{"Return": 1}
1
2
1
["self.attrs.items"]
0
[]
The function (_html_attrs) defined within the public class called URLResource.The function start at line 305 and ends at 311. It contains 7 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 declare 1.0 function, and It has 1.0 functio...
pasteorg_paste
URL
public
0
1
onclick_goto__get
def onclick_goto__get(self):return 'location.href=%s; return false' % js_repr(self.href)
1
2
1
14
0
313
314
313
self
[]
Returns
{"Return": 1}
1
2
1
["js_repr"]
0
[]
The function (onclick_goto__get) defined within the public class called URL, that inherit another class.The function start at line 313 and ends at 314. 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. It declare 1.0 functio...
pasteorg_paste
URL
public
0
1
button__get
def button__get(self):return self.become(Button)
1
2
1
12
0
318
319
318
self
[]
Returns
{"Return": 1}
1
2
1
["self.become"]
0
[]
The function (button__get) defined within the public class called URL, that inherit another class.The function start at line 318 and ends at 319. 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. It declare 1.0 function, and...
pasteorg_paste
URL
public
0
1
js_popup__get
def js_popup__get(self):return self.become(JSPopup)
1
2
1
12
0
323
324
323
self
[]
Returns
{"Return": 1}
1
2
1
["self.become"]
0
[]
The function (js_popup__get) defined within the public class called URL, that inherit another class.The function start at line 323 and ends at 324. 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. It declare 1.0 function, a...
pasteorg_paste
URL
public
0
1
__str__
def __str__(self):return self.href
1
2
1
9
0
343
344
283
self
[]
Returns
{"Return": 1}
0
2
0
[]
64
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.models.ipam_py.Vlans.__str__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3609375_dyninc_dyn_python.dyn.tm.session_py.DynectSession.__str__", "_.content.gdrive.MyDrive....
The function (__str__) defined within the public class called URL, that inherit another class.The function start at line 343 and ends at 344. 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. It has 64.0 functions calling th...
pasteorg_paste
URLResource
public
0
0
_get_content
def _get_content(self):return None
1
2
1
7
0
346
347
346
self
[]
None
{"Expr": 1}
0
6
0
[]
0
[]
The function (_get_content) defined within the public class called URLResource.The function start at line 346 and ends at 347. 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
URLResource
public
0
0
_add_vars
def _add_vars(self, vars):return self.attr(**vars)
1
2
2
15
0
349
350
349
self,vars
[]
None
{}
0
2
0
[]
0
[]
The function (_add_vars) defined within the public class called URLResource.The function start at line 349 and ends at 350. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [349.0] and does not return any value..
pasteorg_paste
URLResource
public
0
0
_add_positional
def _add_positional(self, args):return self.addpath(*args)
1
2
2
15
0
352
353
302
self,args
[]
None
{}
0
2
0
[]
0
[]
The function (_add_positional) defined within the public class called URLResource.The function start at line 352 and ends at 353. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [302.0] and does not return any value..
pasteorg_paste
URLResource
public
0
0
_html_attrs
def _html_attrs(self):attrs = list(self.attrs.items())attrs.insert(0, ('src', self.href))return attrs
1
4
1
33
0
355
358
355
self
[]
Returns
{"Return": 1}
1
2
1
["self.attrs.items"]
0
[]
The function (_html_attrs) defined within the public class called URLResource.The function start at line 355 and ends at 358. 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 declare 1.0 function, and It has 1.0 functio...
pasteorg_paste
URL
public
0
1
__str__
def __str__(self):return self.href
1
2
1
9
0
372
373
283
self
[]
Returns
{"Return": 1}
0
2
0
[]
64
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.models.ipam_py.Vlans.__str__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3609375_dyninc_dyn_python.dyn.tm.session_py.DynectSession.__str__", "_.content.gdrive.MyDrive....
The function (__str__) defined within the public class called URL, that inherit another class.The function start at line 372 and ends at 373. 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. It has 64.0 functions calling th...
pasteorg_paste
URLResource
public
0
0
_get_content
def _get_content(self):if self.params.get('content'):return self.params['content']if self.attrs.get('value'):return self.attrs['content']# @@: Error?return None
3
6
1
41
0
375
381
375
self
[]
None
{"Expr": 1}
0
6
0
[]
0
[]
The function (_get_content) defined within the public class called URLResource.The function start at line 375 and ends at 381. 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..
pasteorg_paste
URLResource
public
0
0
_add_vars
def _add_vars(self, vars):button = selfif 'confirm' in vars:button = button.param(confirm=vars.pop('confirm'))if 'content' in vars:button = button.param(content=vars.pop('content'))return button.var(**vars)
3
7
2
58
0
383
389
383
self,vars
[]
None
{}
0
2
0
[]
0
[]
The function (_add_vars) defined within the public class called URLResource.The function start at line 383 and ends at 389. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [383.0] and does not return any value..
pasteorg_paste
URLResource
public
0
0
_add_positional
def _add_positional(self, args):return self.addpath(*args)
1
2
2
15
0
391
392
302
self,args
[]
None
{}
0
2
0
[]
0
[]
The function (_add_positional) defined within the public class called URLResource.The function start at line 391 and ends at 392. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [302.0] and does not return any value..
pasteorg_paste
URLResource
public
0
0
_html_attrs
def _html_attrs(self):attrs = list(self.attrs.items())onclick = 'location.href=%s' % js_repr(self.href)if self.params.get('confirm'):onclick = 'if (confirm(%s)) {%s}' % (js_repr(self.params['confirm']), onclick)onclick += '; return false'attrs.insert(0, ('onclick', onclick))return attrs
2
9
1
71
0
394
402
394
self
[]
Returns
{"Return": 1}
1
2
1
["self.attrs.items"]
0
[]
The function (_html_attrs) defined within the public class called URLResource.The function start at line 394 and ends at 402. It contains 9 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 declare 1.0 function, and It has 1.0 functio...
pasteorg_paste
URLResource
public
0
0
_add_vars
def _add_vars(self, vars):button = selffor var in ('width', 'height', 'stripped', 'content'):if var in vars:button = button.param(**{var: vars.pop(var)})return button.var(**vars)
3
6
2
54
0
416
421
416
self,vars
[]
None
{}
0
2
0
[]
0
[]
The function (_add_vars) defined within the public class called URLResource.The function start at line 416 and ends at 421. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [416.0] and does not return any value..
pasteorg_paste
JSPopup
public
0
1
_window_args
def _window_args(self):p = self.paramsfeatures = []if p.get('stripped'):p['location'] = p['status'] = p['toolbar'] = '0'for param in 'channelmode directories fullscreen location menubar resizable scrollbars status titlebar'.split():if param not in p:continuev = p[param]if v not in ('yes', 'no', '1', '0'):if v:v = '1'el...
9
23
1
165
0
423
445
423
self
[]
Returns
{"Assign": 7, "Expr": 3, "For": 2, "If": 6, "Return": 1}
9
23
9
["p.get", "split", "features.append", "p.get", "features.append", "args.append", "join", "join", "map"]
0
[]
The function (_window_args) defined within the public class called JSPopup, that inherit another class.The function start at line 423 and ends at 445. It contains 23 lines of code and it has a cyclomatic complexity of 9. The function does not take any parameters, and this function return a value. It declares 9.0 functi...
pasteorg_paste
URLResource
public
0
0
_html_attrs
def _html_attrs(self):attrs = list(self.attrs.items())onclick = ('window.open(%s); return false' % self._window_args())attrs.insert(0, ('target', self.params['target']))attrs.insert(0, ('onclick', onclick))attrs.insert(0, ('href', self.href))return attrs
1
8
1
73
0
447
454
447
self
[]
Returns
{"Return": 1}
1
2
1
["self.attrs.items"]
0
[]
The function (_html_attrs) defined within the public class called URLResource.The function start at line 447 and ends at 454. 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 declare 1.0 function, and It has 1.0 functio...
pasteorg_paste
URLResource
public
0
0
_get_content
def _get_content(self):if not self.params.get('content'):raise ValueError("You must give a content param to %r generate anchor tags"% self)return self.params['content']
2
6
1
30
0
456
461
286
self
[]
None
{"Expr": 1}
0
6
0
[]
0
[]
The function (_get_content) defined within the public class called URLResource.The function start at line 456 and ends at 461. It contains 6 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
URLResource
public
0
0
_add_positional
def _add_positional(self, args):return self.addpath(*args)
1
2
2
15
0
463
464
302
self,args
[]
None
{}
0
2
0
[]
0
[]
The function (_add_positional) defined within the public class called URLResource.The function start at line 463 and ends at 464. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [302.0] and does not return any value..
pasteorg_paste
public
public
0
0
urlmap_factory
def urlmap_factory(loader, global_conf, **local_conf):if 'not_found_app' in local_conf:not_found_app = local_conf.pop('not_found_app')else:not_found_app = global_conf.get('not_found_app')if not_found_app:not_found_app = loader.get_app(not_found_app, global_conf=global_conf)urlmap = URLMap(not_found_app=not_found_app)fo...
4
13
3
93
4
16
28
16
loader,global_conf,**local_conf
['app', 'urlmap', 'not_found_app', 'path']
Returns
{"Assign": 7, "For": 1, "If": 2, "Return": 1}
7
13
7
["local_conf.pop", "global_conf.get", "loader.get_app", "URLMap", "local_conf.items", "parse_path_expression", "loader.get_app"]
0
[]
The function (urlmap_factory) defined within the public class called public.The function start at line 16 and ends at 28. It contains 13 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [16.0], and this function return a value. It declares 7.0 functions, and It has 7.0 funct...
pasteorg_paste
public
public
0
0
parse_path_expression
def parse_path_expression(path):"""Parses a path expression like 'domain foobar.com port 20 /' orjust '/foobar' for a path alone.Returns as an address thatURLMap likes."""parts = path.split()domain = port = path = Nonewhile parts:if parts[0] == 'domain':parts.pop(0)if not parts:raise ValueError("'domain' must be follow...
14
35
1
170
5
30
69
30
path
['domain', 'port', 'path', 's', 'parts']
Returns
{"Assign": 7, "AugAssign": 3, "Expr": 3, "If": 12, "Return": 1, "While": 1}
12
40
12
["path.split", "parts.pop", "ValueError", "ValueError", "parts.pop", "parts.pop", "ValueError", "ValueError", "parts.pop", "ValueError", "parts.pop", "ValueError"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95051027_pasteorg_paste.paste.urlmap_py.urlmap_factory"]
The function (parse_path_expression) defined within the public class called public.The function start at line 30 and ends at 69. It contains 35 lines of code and it has a cyclomatic complexity of 14. The function does not take any parameters, and this function return a value. It declares 12.0 functions, It has 12.0 fun...
pasteorg_paste
URLMap
public
0
1
__init__
def __init__(self, not_found_app=None):self.applications = []if not not_found_app:not_found_app = self.not_found_appself.not_found_application = not_found_app
2
5
2
29
0
88
92
88
self,not_found_app
[]
None
{"Assign": 3, "If": 1}
0
5
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 URLMap, that inherit another class.The function start at line 88 and ends at 92. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [88.0] and does not return any value. It has 6814.0 functions calling...
pasteorg_paste
URLMap
public
0
1
__len__
def __len__(self):return len(self.applications)
1
2
1
12
0
94
95
94
self
[]
Returns
{"Return": 1}
1
2
1
["len"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3665918_alvinwan_neural_backed_decision_trees.nbdt.data.imagenet_py._TinyImagenet200Val.__len__"]
The function (__len__) defined within the public class called URLMap, that inherit another class.The function start at line 94 and ends at 95. 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. It declare 1.0 function, It has...
pasteorg_paste
URLMap
public
0
1
__iter__
def __iter__(self):for app_url, app in self.applications:yield app_url
2
3
1
16
0
97
99
97
self
[]
None
{"Expr": 1, "For": 1}
0
3
0
[]
17
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3593274_stevenproctor_planet_erlang.planet.vendor.html5lib.treebuilders.soup_py.AttrList.__iter__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.BaseForei...
The function (__iter__) defined within the public class called URLMap, that inherit another class.The function start at line 97 and ends at 99. It contains 3 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 has 17.0 functions calling this...
pasteorg_paste
URLMap
public
0
1
not_found_app
def not_found_app(self, environ, start_response):mapper = environ.get('paste.urlmap_object')if mapper:matches = [p for p, a in mapper.applications]extra = 'defined apps: %s' % (',\n'.join(map(repr, matches)))else:extra = ''extra += '\nSCRIPT_NAME: %r' % html.escape(environ.get('SCRIPT_NAME'))extra += '\nPATH_INFO: %r' ...
3
15
3
129
0
104
118
104
self,environ,start_response
[]
Returns
{"Assign": 5, "AugAssign": 3, "If": 1, "Return": 1}
12
15
12
["environ.get", "join", "map", "html.escape", "environ.get", "html.escape", "environ.get", "html.escape", "environ.get", "httpexceptions.HTTPNotFound", "html.escape", "app"]
0
[]
The function (not_found_app) defined within the public class called URLMap, that inherit another class.The function start at line 104 and ends at 118. It contains 15 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [104.0], and this function return a value. It declares 12.0 f...
pasteorg_paste
URLMap
public
0
1
normalize_url
def normalize_url(self, url, trim=True):if isinstance(url, (list, tuple)):domain = url[0]url = self.normalize_url(url[1])[1]return domain, urlassert (not url or url.startswith('/')or self.domain_url_re.search(url)), ("URL fragments must start with / or http:// (you gave %r)" % url)match = self.domain_url_re.search(url)...
7
22
3
161
0
120
141
120
self,url,trim
[]
Returns
{"Assign": 10, "If": 4, "Return": 2}
9
22
9
["isinstance", "self.normalize_url", "url.startswith", "self.domain_url_re.search", "self.domain_url_re.search", "match.end", "url.split", "self.norm_url_re.sub", "url.rstrip"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659669_pyopenapi_pyswagger.pyswagger.utils_py.jr_split", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69847433_requests_cache_requests_cache.requests_cache.cache_keys_py.normalize_request", "_.content.gdrive.MyDri...
The function (normalize_url) defined within the public class called URLMap, that inherit another class.The function start at line 120 and ends at 141. It contains 22 lines of code and it has a cyclomatic complexity of 7. It takes 3 parameters, represented as [120.0], and this function return a value. It declares 9.0 fu...
pasteorg_paste
public
public
0
0
sort_apps.key
def key(app_desc):(domain, url), app = app_descif not domain:# Make sure empty domains sort last:return '\xff', -len(url)else:return domain, -len(url)
2
6
1
36
0
147
153
147
null
[]
None
null
0
0
0
null
0
null
The function (sort_apps.key) defined within the public class called public.The function start at line 147 and ends at 153. It contains 6 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
URLMap
public
0
1
sort_apps
def sort_apps(self):"""Make sure applications are sorted with longest URLs first"""def key(app_desc):(domain, url), app = app_descif not domain:# Make sure empty domains sort last:return '\xff', -len(url)else:return domain, -len(url)apps = [(key(desc), desc) for desc in self.applications]apps.sort()self.applications = ...
3
5
1
46
0
143
156
143
self
[]
Returns
{"Assign": 3, "Expr": 2, "If": 1, "Return": 2}
4
14
4
["len", "len", "key", "apps.sort"]
0
[]
The function (sort_apps) defined within the public class called URLMap, that inherit another class.The function start at line 143 and ends at 156. It contains 5 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 4.0 functions, ...
pasteorg_paste
URLMap
public
0
1
__setitem__
def __setitem__(self, url, app):if app is None:try:del self[url]except KeyError:passreturndom_url = self.normalize_url(url)if dom_url in self:del self[dom_url]self.applications.append((dom_url, app))self.sort_apps()
4
12
3
61
0
158
169
158
self,url,app
[]
None
{"Assign": 1, "Expr": 2, "If": 2, "Return": 1, "Try": 1}
3
12
3
["self.normalize_url", "self.applications.append", "self.sort_apps"]
33
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3609375_dyninc_dyn_python.dyn.mm.utils_py.APIDict.__setitem__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.BaseForeignList.__setitem__", "_.content.gdri...
The function (__setitem__) defined within the public class called URLMap, that inherit another class.The function start at line 158 and ends at 169. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [158.0] and does not return any value. It declares 3.0 function...
pasteorg_paste
URLMap
public
0
1
__getitem__
def __getitem__(self, url):dom_url = self.normalize_url(url)for app_url, app in self.applications:if app_url == dom_url:return appraise KeyError("No application with the url %r (domain: %r; existing: %s)"% (url[1], url[0] or '*', self.applications))
4
8
2
54
0
171
178
171
self,url
[]
Returns
{"Assign": 1, "For": 1, "If": 1, "Return": 1}
2
8
2
["self.normalize_url", "KeyError"]
28
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.AbstractForeignList.__getitem__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621460_cos_archives_modular_odm.modularodm.fields.lists_py.ForeignList.__g...
The function (__getitem__) defined within the public class called URLMap, that inherit another class.The function start at line 171 and ends at 178. It contains 8 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [171.0], and this function return a value. It declares 2.0 funct...