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
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
__init__
def __init__(self, request, route_info):""":type request: :class:`pyramid.request.Request`:type route_info: :class:`pyramid.urldispatch.Route`"""self.request = requestself.route_info = route_info
1
3
3
20
0
229
235
229
self,request,route_info
[]
None
{"Assign": 2, "Expr": 1}
0
7
0
[]
6,243
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.AlertCollector_py.AlertCollector.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.ClusterAlertCollector_py.ClusterAlertCollec...
The function (__init__) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 229 and ends at 235. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [229.0] and does not return any value. It has 6243.0...
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
headers
def headers(self):return self.request.headers
1
2
1
11
0
238
239
238
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (headers) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 238 and ends at 239. 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..
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
query
def query(self):""":rtype: dict"""# The `mixed` dict will return a list if a parameter has multiple# values or a single primitive in the case of a single value.return self.request.GET.mixed()
1
2
1
16
0
242
248
242
self
[]
Returns
{"Expr": 1, "Return": 1}
1
7
1
["self.request.GET.mixed"]
63
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3544475_chromium_web_page_replay.third_party.dns.resolver_py.query", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3595150_twisted_txaws.txaws.route53.client_py._Route53Client._submit", "_.content.gdrive.MyDrive.Phd...
The function (query) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 242 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 this function return a value. It declare 1.0 f...
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
path
def path(self):return self.route_info.get('match') or {}
2
2
1
17
0
251
252
251
self
[]
Returns
{"Return": 1}
1
2
1
["self.route_info.get"]
12
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3969351_jazzband_django_constance.constance.admin_py.ConstanceAdmin.get_urls", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69279284_espressif_idf_component_manager.idf_component_manager.cli.cache_py.init_cache", "...
The function (path) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 251 and ends at 252. It contains 2 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 fu...
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
form
def form(self):""":rtype: dict"""# Don't read the POST dict unless the body is form encodedif self.request.content_type in self.FORM_TYPES:return self.request.POST.mixed()return {}
2
4
1
30
0
255
262
255
self
[]
Returns
{"Expr": 1, "If": 1, "Return": 2}
1
8
1
["self.request.POST.mixed"]
10
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3703806_nyaruka_smartmin.smartmin.views_py.SmartMultiFormView.get", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3703806_nyaruka_smartmin.smartmin.views_py.SmartMultiFormView.post", "_.content.gdrive.MyDrive.Phd_Th...
The function (form) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 255 and ends at 262. 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 declare 1.0 fu...
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
body
def body(self):return self.json()
1
2
1
11
0
265
266
265
self
[]
Returns
{"Return": 1}
1
2
1
["self.json"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625043_uber_tchannel_python.tests.schemes.test_thrift_py.test_non_void_call_directly", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625043_uber_tchannel_python.tests.schemes.test_thrift_py.test_non_void_with_head...
The function (body) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 265 and ends at 266. 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 fu...
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
files
def files(self):result = {}for k, v in self.request.params.mixed().items():if hasattr(v, 'file'):result[k] = v.filereturn result
3
6
1
46
0
269
274
269
self
[]
Returns
{"Assign": 2, "For": 1, "If": 1, "Return": 1}
3
6
3
["items", "self.request.params.mixed", "hasattr"]
9
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69722503_billyeatcookies_biscuit.src.biscuit.settings.resources_py.Resources.get_res_path", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70596923_getappmap_appmap_python.appmap.labeling.__init___py.presets", "_.con...
The function (files) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 269 and ends at 274. It contains 6 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 3.0 ...
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
json
def json(self, **kwargs):if self.request.is_body_readable:return getattr(self.request, 'json_body', {})else:return None
2
5
2
31
0
276
280
276
self,**kwargs
[]
Returns
{"If": 1, "Return": 2}
1
5
1
["getattr"]
258
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.binance_api_utils_py.get_current_price", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.repo...
The function (json) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 276 and ends at 280. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [276.0], and this function return a value. It declare 1....
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
__init__
def __init__(self, response):""":type response: :class:`pyramid.response.Response`"""self.response = response
1
2
2
13
0
295
299
295
self,request,route_info
[]
None
{"Assign": 2, "Expr": 1}
0
7
0
[]
6,243
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.AlertCollector_py.AlertCollector.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.ClusterAlertCollector_py.ClusterAlertCollec...
The function (__init__) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 295 and ends at 299. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [295.0] and does not return any value. It has 6243.0...
Yelp_pyramid_swagger
PyramidSwaggerResponse
public
0
1
content_type
def content_type(self):return self.response.content_type
1
2
1
11
0
302
303
302
self
[]
Returns
{"Return": 1}
0
2
0
[]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70596923_getappmap_appmap_python._appmap.test.web_framework_py._TestRemoteRecording.test_can_record", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70596923_getappmap_appmap_python._appmap.test.web_framework_py._Tes...
The function (content_type) defined within the public class called PyramidSwaggerResponse, that inherit another class.The function start at line 302 and ends at 303. 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 2...
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
headers
def headers(self):return self.request.headers
1
2
1
11
0
306
307
238
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (headers) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 306 and ends at 307. 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..
Yelp_pyramid_swagger
PyramidSwaggerResponse
public
0
1
raw_bytes
def raw_bytes(self):return self.response.body
1
2
1
11
0
310
311
310
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (raw_bytes) defined within the public class called PyramidSwaggerResponse, that inherit another class.The function start at line 310 and ends at 311. 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..
Yelp_pyramid_swagger
PyramidSwaggerResponse
public
0
1
text
def text(self):# Treating webob.Response carefully: first check if there's a# non-empty body attribute, since if not, we can short circuitif not self.response.body:return None# if there's a response body, try to read it as text, but carefullytry:return self.response.textexcept AttributeError as prev_ex:# pyramid.respon...
3
7
1
36
0
314
328
314
self
[]
Returns
{"If": 1, "Return": 2, "Try": 1}
2
15
2
["Exception", "str"]
50
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537748_rainerf_ricodebug.src.controllers.quickwatch_py.QuickWatch.__addCurrentText", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537748_rainerf_ricodebug.src.controllers.quickwatch_py.QuickWatch.addToDG", "_.con...
The function (text) defined within the public class called PyramidSwaggerResponse, that inherit another class.The function start at line 314 and ends at 328. 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 ...
Yelp_pyramid_swagger
PyramidSwaggerRequest
public
0
1
json
def json(self, **kwargs):return getattr(self.response, 'json_body', {})
1
2
2
20
0
330
331
330
self,**kwargs
[]
Returns
{"If": 1, "Return": 2}
1
5
1
["getattr"]
258
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.binance_api_utils_py.get_current_price", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.repo...
The function (json) defined within the public class called PyramidSwaggerRequest, that inherit another class.The function start at line 330 and ends at 331. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [330.0], and this function return a value. It declare 1....
Yelp_pyramid_swagger
public
public
0
0
handle_request
def handle_request(request, validator_map, **kwargs):"""Validate the request against the swagger spec and return a dict withall parameter values available in the request, casted to the expectedpython type.:param request: a :class:`PyramidSwaggerRequest` to validate:param validator_map: a :class:`pyramid_swagger.load_sc...
3
18
3
138
4
334
369
334
request,validator_map,**kwargs
['validation_pairs', 'request_data', 'param_name', 'values']
Returns
{"Assign": 5, "Expr": 5, "For": 1, "If": 1, "Return": 1}
5
36
5
["cast_params", "validation_pairs.append", "request_data.update", "validation_pairs.append", "validate_request"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_handle_request_returns_request_data"]
The function (handle_request) defined within the public class called public.The function start at line 334 and ends at 369. It contains 18 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [334.0], and this function return a value. It declares 5.0 functions, It has 5.0 functio...
Yelp_pyramid_swagger
public
public
0
0
load_settings
def load_settings(registry):return Settings(swagger12_handler=build_swagger12_handler(registry.settings.get('pyramid_swagger.schema12')),swagger20_handler=build_swagger20_handler(),validate_request=asbool(registry.settings.get('pyramid_swagger.enable_request_validation',True,)),validate_response=asbool(registry.setting...
4
27
1
149
0
372
398
372
registry
[]
Returns
{"Return": 1}
20
27
20
["Settings", "build_swagger12_handler", "registry.settings.get", "build_swagger20_handler", "asbool", "registry.settings.get", "asbool", "registry.settings.get", "asbool", "registry.settings.get", "get_exclude_paths", "set", "aslist", "registry.settings.get", "set", "aslist", "registry.settings.get", "set", "aslist", "...
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.validation_tween_factory", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.config_ini_test_py.test_load_ini_setting...
The function (load_settings) defined within the public class called public.The function start at line 372 and ends at 398. It contains 27 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 20.0 functions, It has 20.0 functions ...
Yelp_pyramid_swagger
public
public
0
0
build_swagger20_handler
def build_swagger20_handler():return SwaggerHandler(op_for_request=get_op_for_request,handle_request=swaggerize_request,handle_response=swaggerize_response,)
1
6
0
20
0
405
410
405
[]
Returns
{"Return": 1}
1
6
1
["SwaggerHandler"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.load_settings"]
The function (build_swagger20_handler) defined within the public class called public.The function start at line 405 and ends at 410. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, It has 1.0 funct...
Yelp_pyramid_swagger
public
public
0
0
build_swagger12_handler
def build_swagger12_handler(schema):"""Builds a swagger12 handler or returns None if no schema is present.:type schema: :class:`pyramid_swagger.model.SwaggerSchema`:rtype: :class:`SwaggerHandler` or None"""if schema:return SwaggerHandler(op_for_request=schema.validators_for_request,handle_request=handle_request,handle_...
2
7
1
27
0
413
424
413
schema
[]
Returns
{"Expr": 1, "If": 1, "Return": 1}
1
12
1
["SwaggerHandler"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.load_settings"]
The function (build_swagger12_handler) defined within the public class called public.The function start at line 413 and ends at 424. 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, It has 1.0 funct...
Yelp_pyramid_swagger
public
public
0
0
get_exclude_paths
def get_exclude_paths(registry):"""Compiles a list of paths that should not be validated against.:rtype: list of compiled validation regexes"""# TODO(#63): remove deprecated `skip_validation` setting in v2.0.regexes = registry.settings.get('pyramid_swagger.skip_validation',registry.settings.get('pyramid_swagger.exclude...
4
11
1
62
1
427
444
427
registry
['regexes']
Returns
{"Assign": 2, "Expr": 1, "If": 1, "Return": 1}
5
18
5
["registry.settings.get", "registry.settings.get", "isinstance", "isinstance", "re.compile"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.load_settings", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_default_exclude_paths", "_.content.gdrive.M...
The function (get_exclude_paths) defined within the public class called public.The function start at line 427 and ends at 444. It contains 11 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 5.0 functions, It has 5.0 function...
Yelp_pyramid_swagger
public
public
0
0
is_swagger_documentation_route
def is_swagger_documentation_route(route_info):if not route_info:return Falseroute = route_info.get('route')if not route:return Falsereturn route.name.startswith('pyramid_swagger.swagger20.api_docs.')
3
7
1
34
1
447
454
447
route_info
['route']
Returns
{"Assign": 1, "If": 2, "Return": 3}
2
8
2
["route_info.get", "route.name.startswith"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.should_exclude_request", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_is_swagger_documentation_route_wit...
The function (is_swagger_documentation_route) defined within the public class called public.The function start at line 447 and ends at 454. 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, It has ...
Yelp_pyramid_swagger
public
public
0
0
should_exclude_request
def should_exclude_request(settings, request, route_info):disable_all_validation = not any((settings.validate_request,settings.validate_response,settings.validate_path))return (disable_all_validationor should_exclude_path(settings.exclude_paths, request.path_info)or should_exclude_route(settings.exclude_routes, route_i...
4
12
3
57
1
457
468
457
settings,request,route_info
['disable_all_validation']
Returns
{"Assign": 1, "Return": 1}
4
12
4
["any", "should_exclude_path", "should_exclude_route", "is_swagger_documentation_route"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.validation_tween_factory"]
The function (should_exclude_request) defined within the public class called public.The function start at line 457 and ends at 468. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [457.0], and this function return a value. It declares 4.0 functions, It has 4.0...
Yelp_pyramid_swagger
public
public
0
0
should_exclude_response_validation
def should_exclude_response_validation(settings, route_info):return should_exclude_route(settings.response_validation_exclude_routes, route_info)
1
2
2
16
0
471
472
471
settings,route_info
[]
Returns
{"Return": 1}
1
2
1
["should_exclude_route"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.validation_tween_factory", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_should_exclude_response_validati...
The function (should_exclude_response_validation) defined within the public class called public.The function start at line 471 and ends at 472. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [471.0], and this function return a value. It declare 1.0 function, I...
Yelp_pyramid_swagger
public
public
0
0
should_exclude_path
def should_exclude_path(exclude_path_regexes, path):# Skip validation for the specified endpointsreturn any(r.match(path) for r in exclude_path_regexes)
2
2
2
21
0
475
477
475
exclude_path_regexes,path
[]
Returns
{"Return": 1}
2
3
2
["any", "r.match"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.should_exclude_request", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_validation_skips_path_properly"]
The function (should_exclude_path) defined within the public class called public.The function start at line 475 and ends at 477. It contains 2 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [475.0], and this function return a value. It declares 2.0 functions, It has 2.0 fun...
Yelp_pyramid_swagger
public
public
0
0
should_exclude_route
def should_exclude_route(excluded_routes, route_info):return route_info.get('route') and route_info['route'].name in excluded_routes
2
2
2
23
0
480
481
480
excluded_routes,route_info
[]
Returns
{"Return": 1}
1
2
1
["route_info.get"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.should_exclude_request", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.should_exclude_response_validation...
The function (should_exclude_route) defined within the public class called public.The function start at line 480 and ends at 481. It contains 2 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [480.0], and this function return a value. It declare 1.0 function, It has 1.0 func...
Yelp_pyramid_swagger
public
public
0
0
validation_error.validation_error.decorator._validate
def _validate(*args, **kwargs):try:return f(*args, **kwargs)except (jsonschema.exceptions.ValidationError,SwaggerMappingError,) as exc:# This will alter our stack trace slightly, but Pyramid knows# how to render it. And the real value is in the message# anyway.e = exc_class(str(exc), child=exc)e._traceback = sys.exc_in...
2
10
2
61
0
487
499
487
null
[]
None
null
0
0
0
null
0
null
The function (validation_error.validation_error.decorator._validate) defined within the public class called public.The function start at line 487 and ends at 499. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [487.0] and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
validation_error.decorator
def decorator(f):@functools.wraps(f)def _validate(*args, **kwargs):try:return f(*args, **kwargs)except (jsonschema.exceptions.ValidationError,SwaggerMappingError,) as exc:# This will alter our stack trace slightly, but Pyramid knows# how to render it. And the real value is in the message# anyway.e = exc_class(str(exc),...
1
4
1
16
0
485
501
485
null
[]
None
null
0
0
0
null
0
null
The function (validation_error.decorator) defined within the public class called public.The function start at line 485 and ends at 501. 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..
Yelp_pyramid_swagger
public
public
0
0
validation_error
def validation_error(exc_class):def decorator(f):@functools.wraps(f)def _validate(*args, **kwargs):try:return f(*args, **kwargs)except (jsonschema.exceptions.ValidationError,SwaggerMappingError,) as exc:# This will alter our stack trace slightly, but Pyramid knows# how to render it. And the real value is in the message...
1
3
1
9
1
484
503
484
exc_class
['e']
Returns
{"Assign": 2, "Return": 3, "Try": 1}
5
20
5
["f", "exc_class", "str", "sys.exc_info", "functools.wraps"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.swaggerize_request", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.swaggerize_response", "_.content.gdriv...
The function (validation_error) defined within the public class called public.The function start at line 484 and ends at 503. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 5.0 functions, It has 5.0 functions ...
Yelp_pyramid_swagger
public
public
0
0
cast_request_param
def cast_request_param(param_type, param_name, param_value):"""Try to cast a request param (e.g. query arg, POST data) from a string toits specified type in the schema. This allows validating non-string params.:param param_type: name of the type to be casted to:typeparam_type: string:param param_name: param name:typepa...
2
7
3
44
0
514
531
514
param_type,param_name,param_value
[]
Returns
{"Expr": 2, "Return": 2, "Try": 1}
2
18
2
["CAST_TYPE_TO_FUNC.get", "log.warn"]
13
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3692721_yelp_bravado_core.bravado_core.param_py.unmarshal_collection_format", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3692721_yelp_bravado_core.tests.param.cast_request_param_test_py.test_cast_failures_return_...
The function (cast_request_param) defined within the public class called public.The function start at line 514 and ends at 531. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [514.0], and this function return a value. It declares 2.0 functions, It has 2.0 func...
Yelp_pyramid_swagger
public
public
0
0
validate_request
def validate_request(validation_pairs):for validator, values in validation_pairs:validator.validate(values)
2
3
1
18
0
535
537
535
validation_pairs
[]
None
{"Expr": 1, "For": 1}
2
3
2
["validator.validate", "validation_error"]
26
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3636567_pipermerriam_flex.flex.core_py.validate_api_call", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3636567_pipermerriam_flex.flex.core_py.validate_api_request", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Cre...
The function (validate_request) defined within the public class called public.The function start at line 535 and ends at 537. 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 declares 2.0 functions, It has 2.0 functions call...
Yelp_pyramid_swagger
public
public
0
0
cast_params.get_type
def get_type(param_name):return schema['properties'].get(param_name, {}).get('type')
1
2
1
23
0
544
545
544
null
[]
None
null
0
0
0
null
0
null
The function (cast_params.get_type) defined within the public class called public.The function start at line 544 and ends at 545. 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..
Yelp_pyramid_swagger
public
public
0
0
cast_params
def cast_params(schema, values):if not schema:return {}def get_type(param_name):return schema['properties'].get(param_name, {}).get('type')return dict((k, cast_request_param(get_type(k), k, v))for k, v in values.items())
3
8
2
45
0
540
550
540
schema,values
[]
Returns
{"If": 1, "Return": 3}
6
11
6
["get", "get", "dict", "cast_request_param", "get_type", "values.items"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.handle_request"]
The function (cast_params) defined within the public class called public.The function start at line 540 and ends at 550. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [540.0], and this function return a value. It declares 6.0 functions, It has 6.0 functions c...
Yelp_pyramid_swagger
public
public
0
0
validate_response
def validate_response(response, validator_map):"""Validates response against our schemas.:param response: the response object to validate:type response: :class:`pyramid.response.Response`:type validator_map: :class:`pyramid_swagger.load_schema.ValidatorMap`"""validator = validator_map.response# Short circuit if we are ...
4
9
2
69
3
554
573
554
response,validator_map
['returns_nothing', 'body_empty', 'validator']
None
{"Assign": 3, "Expr": 2, "If": 2, "Return": 2}
4
20
4
["validator.schema.get", "validator.validate", "prepare_body", "validation_error"]
36
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3636567_pipermerriam_flex.flex.core_py.validate_api_call", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3636567_pipermerriam_flex.flex.core_py.validate_api_response", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Cr...
The function (validate_response) defined within the public class called public.The function start at line 554 and ends at 573. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [554.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions...
Yelp_pyramid_swagger
public
public
0
0
prepare_body
def prepare_body(response):# content_type must be set to access response.textif not response.content_type:raise ResponseValidationError('Response validation error: Content-Type must be set')if 'application/json' in response.content_type:return simplejson.loads(response.text)else:return response.text
3
9
1
38
0
576
586
576
response
[]
Returns
{"If": 2, "Return": 2}
2
11
2
["ResponseValidationError", "simplejson.loads"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.validate_response", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_response_content_type_missing_raises_5x...
The function (prepare_body) defined within the public class called public.The function start at line 576 and ends at 586. It contains 9 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, It has 2.0 functions call...
Yelp_pyramid_swagger
public
public
0
0
swaggerize_request
def swaggerize_request(request, op, **kwargs):"""Delegate handling the Swagger concerns of the request to bravado-core.Post-invocation, the Swagger request parameters are available as a dictnamed `swagger_data` on the Pyramid request.:type request: :class:`pyramid.request.Request`:type op: :class:`bravado_core.operatio...
2
6
3
39
1
590
604
590
request,op,**kwargs
['request_data']
Returns
{"Assign": 1, "Expr": 2, "Return": 1, "Try": 1}
4
15
4
["unmarshal_request", "six.raise_from", "RequestAuthenticationError", "validation_error"]
0
[]
The function (swaggerize_request) defined within the public class called public.The function start at line 590 and ends at 604. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [590.0], and this function return a value. It declares 4.0 functions, and It has 4.0...
Yelp_pyramid_swagger
public
public
0
0
swaggerize_response
def swaggerize_response(response, op):"""Delegate handling the Swagger concerns of the response to bravado-core.:type response: :class:`pyramid.response.Response`:type op: :class:`bravado_core.operation.Operation`"""response_spec = get_response_spec(response.status_int, op)bravado_core.response.validate_response(respon...
1
4
2
33
1
608
617
608
response,op
['response_spec']
None
{"Assign": 1, "Expr": 2}
4
10
4
["get_response_spec", "bravado_core.response.validate_response", "PyramidSwaggerResponse", "validation_error"]
0
[]
The function (swaggerize_response) defined within the public class called public.The function start at line 608 and ends at 617. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [608.0] and does not return any value. It declares 4.0 functions, and It has 4.0 fu...
Yelp_pyramid_swagger
public
public
0
0
get_op_for_request
def get_op_for_request(request, route_info, spec):"""Find out which operation in the Swagger schema corresponds to the givenpyramid request.:type request: :class:`pyramid.request.Request`:type route_info: dict (usually has 'match' and 'route' keys):type spec: :class:`bravado_core.spec.Spec`:rtype: :class:`bravado_core....
4
19
3
100
3
620
650
620
request,route_info,spec
['route', 'route_path', 'op']
Returns
{"Assign": 4, "Expr": 1, "If": 3, "Return": 1}
6
31
6
["hasattr", "spec.get_op_for_request", "PathNotMatchedError", "format", "PathNotMatchedError", "format"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_get_op_for_request_found", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_get_op_for_request_not_found_rou...
The function (get_op_for_request) defined within the public class called public.The function start at line 620 and ends at 650. It contains 19 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [620.0], and this function return a value. It declares 6.0 functions, It has 6.0 fun...
Yelp_pyramid_swagger
public
public
0
0
get_swagger_versions
def get_swagger_versions(settings):"""Validates and returns the versions of the Swagger Spec that this pyramidapplication supports.:type settings: dict:return: list of strings. eg ['1.2', '2.0']:raises: ValueError when an unsupported Swagger version is encountered."""swagger_versions = set(aslist(settings.get('pyramid_...
4
10
1
58
1
653
672
653
settings
['swagger_versions']
Returns
{"Assign": 1, "Expr": 1, "For": 1, "If": 2, "Return": 1}
7
20
7
["set", "aslist", "settings.get", "len", "ValueError", "ValueError", "format"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.__init___py.includeme", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.tween_py.get_swagger_objects", "_.content.gdrive.MyDr...
The function (get_swagger_versions) defined within the public class called public.The function start at line 653 and ends at 672. It contains 10 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 7.0 functions, It has 7.0 funct...
Yelp_pyramid_swagger
public
public
0
0
test_basepath_rewriting
def test_basepath_rewriting():resource_json = {'basePath': 'bar'}view = build_swagger_12_api_declaration_view(resource_json)request = DummyRequest(application_url='foo')result = view(request)assert result['basePath'] == request.application_urlassert result['basePath'] != resource_json['basePath']
1
7
0
50
4
22
28
22
['resource_json', 'result', 'view', 'request']
None
{"Assign": 4}
3
7
3
["build_swagger_12_api_declaration_view", "DummyRequest", "view"]
0
[]
The function (test_basepath_rewriting) defined within the public class called public.The function start at line 22 and ends at 28. 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 3.0 functions, and It has 3.0 func...
Yelp_pyramid_swagger
public
public
0
0
build_config
def build_config(schema_dir):return mock.Mock(registry=get_registry({'swagger_schema': get_swagger_schema(schema_dir),}))
1
6
1
25
0
31
36
31
schema_dir
[]
Returns
{"Return": 1}
3
6
3
["mock.Mock", "get_registry", "get_swagger_schema"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.api_test_py.test_proper_error_on_missing_api_declaration", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.api_test_py.test_proper_error_on_missi...
The function (build_config) defined within the public class called public.The function start at line 31 and ends at 36. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 3.0 functions, It has 3.0 functions called...
Yelp_pyramid_swagger
public
public
0
0
test_proper_error_on_missing_resource_listing
def test_proper_error_on_missing_resource_listing():with pytest.raises(ResourceListingNotFoundError) as exc:register_api_doc_endpoints(build_config('tests/sample_schemas/missing_resource_listing/api_docs.json'),)assert('tests/sample_schemas/missing_resource_listing/' in str(exc.value))assert 'must be named {0}'.format(...
1
10
0
47
0
39
48
39
[]
None
{"Expr": 1, "With": 1}
6
10
6
["pytest.raises", "register_api_doc_endpoints", "build_config", "str", "format", "str"]
0
[]
The function (test_proper_error_on_missing_resource_listing) defined within the public class called public.The function start at line 39 and ends at 48. 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 function...
Yelp_pyramid_swagger
public
public
0
0
test_proper_error_on_missing_api_declaration
def test_proper_error_on_missing_api_declaration():with pytest.raises(ApiDeclarationNotFoundError) as exc:register_api_doc_endpoints(build_config('tests/sample_schemas/missing_api_declaration/'),)assert ('tests/sample_schemas/missing_api_declaration/missing.json'in str(exc.value))
1
9
0
33
0
51
59
51
[]
None
{"Expr": 1, "With": 1}
4
9
4
["pytest.raises", "register_api_doc_endpoints", "build_config", "str"]
0
[]
The function (test_proper_error_on_missing_api_declaration) defined within the public class called public.The function start at line 51 and ends at 59. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions,...
Yelp_pyramid_swagger
public
public
0
0
test_ignore_absolute_paths
def test_ignore_absolute_paths():"""we don't have the ability to automagically translate these externalresources from yaml to json and vice versa, so ignore them altogether."""assert get_path_if_relative('http://www.google.com/some/special/schema.json',) is Noneassert get_path_if_relative('//www.google.com/some/schema....
1
10
0
29
0
62
77
62
[]
None
{"Expr": 1}
3
16
3
["get_path_if_relative", "get_path_if_relative", "get_path_if_relative"]
0
[]
The function (test_ignore_absolute_paths) defined within the public class called public.The function start at line 62 and ends at 77. 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 3.0 functions, and It has 3.0 ...
Yelp_pyramid_swagger
public
public
0
0
test_resolve_nested_refs
def test_resolve_nested_refs():"""Make sure we resolve nested refs gracefully and not get lost inthe recursion. Also make sure we don't rely on dictionary order"""os.environ["PYTHONHASHSEED"] = str(1)with open('tests/sample_schemas/nested_defns/swagger.yaml') as swagger_spec:spec_dict = yaml.safe_load(swagger_spec)spec...
1
6
0
46
2
80
89
80
['spec_dict', 'spec']
None
{"Assign": 3, "Expr": 1, "With": 1}
4
10
4
["str", "open", "yaml.safe_load", "Spec.from_dict"]
0
[]
The function (test_resolve_nested_refs) defined within the public class called public.The function start at line 80 and ends at 89. 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 fun...
Yelp_pyramid_swagger
public
public
0
0
traverse_spec
def traverse_spec(swagger_spec):for k, v in swagger_spec.items():if k == "":raise Exception('Empty key detected in the swagger spec.')elif isinstance(v, dict):return traverse_spec(v)elif isinstance(v, list):for item in v:if isinstance(item, dict):return traverse_spec(item)return
7
11
1
66
0
92
102
92
swagger_spec
[]
Returns
{"For": 2, "If": 4, "Return": 3}
7
11
7
["swagger_spec.items", "Exception", "isinstance", "traverse_spec", "isinstance", "isinstance", "traverse_spec"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.api_test_py.test_extenal_refs_no_empty_keys", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.api_test_py.traverse_spec"]
The function (traverse_spec) defined within the public class called public.The function start at line 92 and ends at 102. It contains 11 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 7.0 functions, It has 7.0 functions cal...
Yelp_pyramid_swagger
public
public
0
0
test_extenal_refs_no_empty_keys
def test_extenal_refs_no_empty_keys():"""This test ensures that we never use empty strings askeys swagger specs."""with open('tests/sample_schemas/external_refs/swagger.json') as swagger_spec:spec_dict = yaml.safe_load(swagger_spec)path = 'file:' + os.getcwd() + '/tests/sample_schemas/external_refs/swagger.json'spec = ...
1
7
0
51
4
105
115
105
['flattened_spec', 'spec_dict', 'path', 'spec']
None
{"Assign": 4, "Expr": 2, "With": 1}
5
11
5
["open", "yaml.safe_load", "os.getcwd", "Spec.from_dict", "traverse_spec"]
0
[]
The function (test_extenal_refs_no_empty_keys) defined within the public class called public.The function start at line 105 and ends at 115. 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 5.0 functions, and It ha...
Yelp_pyramid_swagger
public
public
0
0
_set_current_directory_to_git_repo_root
def _set_current_directory_to_git_repo_root():"""During tests execution make sure that current working directoryis set accordingly to git repository root.It will allow to run tests with relative file import with thesame reference path."""repo_root_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))cur...
2
8
0
55
2
10
23
10
['curdir', 'repo_root_path']
None
{"Assign": 2, "Expr": 4, "Try": 1}
7
14
7
["os.path.abspath", "os.path.join", "os.path.dirname", "os.getcwd", "os.chdir", "os.chdir", "pytest.yield_fixture"]
0
[]
The function (_set_current_directory_to_git_repo_root) defined within the public class called public.The function start at line 10 and ends at 23. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 7.0 functions, and ...
Yelp_pyramid_swagger
public
public
0
0
test_disable_api_doc_views
def test_disable_api_doc_views(_1, _2, mock_register):settings = {'pyramid_swagger.enable_api_doc_views': False,'pyramid_swagger.enable_swagger_spec_validation': False,}mock_config = mock.Mock(spec=Configurator,registry=mock.Mock(spec=Registry, settings=settings))pyramid_swagger.includeme(mock_config)assert not mock_re...
1
10
3
57
2
18
29
18
_1,_2,mock_register
['settings', 'mock_config']
None
{"Assign": 2, "Expr": 1}
6
12
6
["mock.Mock", "mock.Mock", "pyramid_swagger.includeme", "mock.patch", "mock.patch", "mock.patch"]
0
[]
The function (test_disable_api_doc_views) defined within the public class called public.The function start at line 18 and ends at 29. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [18.0] and does not return any value. It declares 6.0 functions, and It has 6...
Yelp_pyramid_swagger
public
public
0
0
test_bad_schema_validated_on_include
def test_bad_schema_validated_on_include():settings = {'pyramid_swagger.schema_directory': 'tests/sample_schemas/bad_app/','pyramid_swagger.enable_swagger_spec_validation': True,}mock_config = mock.Mock(registry=mock.Mock(settings=settings))with pytest.raises(SwaggerValidationError):pyramid_swagger.includeme(mock_confi...
1
8
0
47
2
32
39
32
['settings', 'mock_config']
None
{"Assign": 2, "Expr": 1, "With": 1}
4
8
4
["mock.Mock", "mock.Mock", "pytest.raises", "pyramid_swagger.includeme"]
0
[]
The function (test_bad_schema_validated_on_include) defined within the public class called public.The function start at line 32 and ends at 39. 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...
Yelp_pyramid_swagger
public
public
0
0
test_bad_schema_not_validated_if_spec_validation_is_disabled
def test_bad_schema_not_validated_if_spec_validation_is_disabled(_):settings = {'pyramid_swagger.schema_directory': 'tests/sample_schemas/bad_app/','pyramid_swagger.enable_swagger_spec_validation': False,'pyramid_swagger.enable_api_doc_views': False,}mock_config = mock.Mock(spec=Configurator, registry=mock.Mock(setting...
1
9
1
48
2
45
53
45
_
['settings', 'mock_config']
None
{"Assign": 2, "Expr": 1}
4
9
4
["mock.Mock", "mock.Mock", "pyramid_swagger.includeme", "mock.patch"]
0
[]
The function (test_bad_schema_not_validated_if_spec_validation_is_disabled) defined within the public class called public.The function start at line 45 and ends at 53. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare...
Yelp_pyramid_swagger
public
public
0
0
test_swagger_12_only
def test_swagger_12_only(mock_register):settings = {'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/','pyramid_swagger.swagger_versions': ['1.2']}mock_config = mock.Mock(registry=mock.Mock(settings=settings))pyramid_swagger.includeme(mock_config)assert isinstance(settings['pyramid_swagger.schema12'],...
1
9
1
57
2
58
66
58
mock_register
['settings', 'mock_config']
None
{"Assign": 2, "Expr": 1}
6
9
6
["mock.Mock", "mock.Mock", "pyramid_swagger.includeme", "isinstance", "pytest.mark.skip", "mock.patch"]
0
[]
The function (test_swagger_12_only) defined within the public class called public.The function start at line 58 and ends at 66. 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 6.0 functions, and It has 6.0 functio...
Yelp_pyramid_swagger
public
public
0
0
test_swagger_20_only
def test_swagger_20_only(mock_register):settings = {'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/','pyramid_swagger.swagger_versions': ['2.0']}mock_config = mock.Mock(registry=mock.Mock(settings=settings))pyramid_swagger.includeme(mock_config)assert isinstance(settings['pyramid_swagger.schema20'],...
1
10
1
63
2
70
79
70
mock_register
['settings', 'mock_config']
None
{"Assign": 2, "Expr": 1}
5
10
5
["mock.Mock", "mock.Mock", "pyramid_swagger.includeme", "isinstance", "mock.patch"]
0
[]
The function (test_swagger_20_only) defined within the public class called public.The function start at line 70 and ends at 79. 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 5.0 functions, and It has 5.0 functi...
Yelp_pyramid_swagger
public
public
0
0
test_swagger_12_and_20
def test_swagger_12_and_20(mock_register):settings = {'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/','pyramid_swagger.swagger_versions': ['1.2', '2.0']}mock_config = mock.Mock(registry=mock.Mock(settings=settings))pyramid_swagger.includeme(mock_config)assert isinstance(settings['pyramid_swagger.sc...
1
10
1
69
2
84
93
84
mock_register
['settings', 'mock_config']
None
{"Assign": 2, "Expr": 1}
7
10
7
["mock.Mock", "mock.Mock", "pyramid_swagger.includeme", "isinstance", "isinstance", "pytest.mark.skip", "mock.patch"]
0
[]
The function (test_swagger_12_and_20) defined within the public class called public.The function start at line 84 and ends at 93. 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 7.0 functions, and It has 7.0 func...
Yelp_pyramid_swagger
public
public
0
0
test_proper_error_on_missing_resource_listing
def test_proper_error_on_missing_resource_listing():filename = 'tests/sample_schemas/missing_resource_listing/api_docs.json'with pytest.raises(ResourceListingNotFoundError) as exc:_load_resource_listing(filename)assert filename in str(exc.value)assert 'must be named {0}'.format(API_DOCS_FILENAME) in str(exc.value)
1
6
0
44
1
25
30
25
['filename']
None
{"Assign": 1, "Expr": 1, "With": 1}
5
6
5
["pytest.raises", "_load_resource_listing", "str", "format", "str"]
0
[]
The function (test_proper_error_on_missing_resource_listing) defined within the public class called public.The function start at line 25 and ends at 30. 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 5.0 functions...
Yelp_pyramid_swagger
public
public
0
0
test_proper_error_on_missing_api_declaration
def test_proper_error_on_missing_api_declaration():with pytest.raises(ApiDeclarationNotFoundError) as exc:ingest_resources({'sample_resource': 'fake/sample_resource.json'},'fake',)assert 'fake/sample_resource.json' in str(exc.value)
1
7
0
34
0
33
39
33
[]
None
{"Expr": 1, "With": 1}
3
7
3
["pytest.raises", "ingest_resources", "str"]
0
[]
The function (test_proper_error_on_missing_api_declaration) defined within the public class called public.The function start at line 33 and ends at 39. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions,...
Yelp_pyramid_swagger
public
public
0
0
test_get_swagger_spec_passes_absolute_url
def test_get_swagger_spec_passes_absolute_url(mock_spec, mock_abs, mock_http_handlers,):get_swagger_spec({'pyramid_swagger.schema_directory': 'foo/'})mock_abs.assert_called_once_with('foo/swagger.json')expected_url = "file:///bar/foo/swagger.json"mock_spec.assert_called_once_with(mock.ANY, config=mock.ANY,origin_url=ex...
1
8
3
45
1
46
53
46
mock_spec,mock_abs,mock_http_handlers
['expected_url']
None
{"Assign": 1, "Expr": 3}
7
8
7
["get_swagger_spec", "mock_abs.assert_called_once_with", "mock_spec.assert_called_once_with", "mock.patch", "mock.Mock", "mock.patch", "mock.patch"]
0
[]
The function (test_get_swagger_spec_passes_absolute_url) defined within the public class called public.The function start at line 46 and ends at 53. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [46.0] and does not return any value. It declares 7.0 functions,...
Yelp_pyramid_swagger
public
public
0
0
test_get_swagger_schema_default
def test_get_swagger_schema_default():settings = {'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',}swagger_schema = get_swagger_schema(settings)assert len(swagger_schema.pyramid_endpoints) == 6assert swagger_schema.resource_validators
1
7
0
31
2
57
64
57
['swagger_schema', 'settings']
None
{"Assign": 2}
3
8
3
["get_swagger_schema", "len", "pytest.mark.skip"]
0
[]
The function (test_get_swagger_schema_default) defined within the public class called public.The function start at line 57 and ends at 64. 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 3.0 functions, and It has ...
Yelp_pyramid_swagger
public
public
0
0
test_get_swagger_schema_no_validation
def test_get_swagger_schema_no_validation():settings = {'pyramid_swagger.schema_directory': 'tests/sample_schemas/bad_app/','pyramid_swagger.enable_swagger_spec_validation': False,}# No error means we skipped validation of the bad schemaget_swagger_schema(settings)
1
6
0
20
1
68
74
68
['settings']
None
{"Assign": 1, "Expr": 1}
2
7
2
["get_swagger_schema", "pytest.mark.skip"]
0
[]
The function (test_get_swagger_schema_no_validation) defined within the public class called public.The function start at line 68 and ends at 74. 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 2.0 functions, and I...
Yelp_pyramid_swagger
public
public
0
0
test_generate_resource_listing
def test_generate_resource_listing():listing = {'swaggerVersion': 1.2}listing = generate_resource_listing('tests/sample_schemas/good_app/',listing)expected = {'swaggerVersion': 1.2,'apis': [{'path': '/echo_date'},{'path': '/no_models'},{'path': '/other_sample'},{'path': '/post_endpoint_with_optional_body'},{'path': '/s...
1
17
0
69
2
78
96
78
['expected', 'listing']
None
{"Assign": 3}
2
19
2
["generate_resource_listing", "pytest.mark.skip"]
0
[]
The function (test_generate_resource_listing) defined within the public class called public.The function start at line 78 and ends at 96. 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 2.0 functions, and It has ...
Yelp_pyramid_swagger
public
public
0
0
test_generate_resource_listing_with_existing_listing
def test_generate_resource_listing_with_existing_listing():listing = {'apis': [{'path': '/something'}]}with pytest.raises(ResourceListingGenerationError) as exc:generate_resource_listing('tests/sample_schemas/good_app/', listing)assert 'Generating a listing would override' in str(exc.value)
1
7
0
42
1
99
106
99
['listing']
None
{"Assign": 1, "Expr": 1, "With": 1}
3
8
3
["pytest.raises", "generate_resource_listing", "str"]
0
[]
The function (test_generate_resource_listing_with_existing_listing) defined within the public class called public.The function start at line 99 and ends at 106. 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 3.0 f...
Yelp_pyramid_swagger
public
public
0
0
test_get_resource_listing_generated
def test_get_resource_listing_generated(mock_load, mock_generate):schema_dir = '/api_docs'resource_listing = get_resource_listing(schema_dir, True)mock_generate.assert_called_once_with(schema_dir, mock_load.return_value)assert resource_listing == mock_generate.return_value
1
5
2
34
2
111
115
111
mock_load,mock_generate
['resource_listing', 'schema_dir']
None
{"Assign": 2, "Expr": 1}
4
5
4
["get_resource_listing", "mock_generate.assert_called_once_with", "mock.patch", "mock.patch"]
0
[]
The function (test_get_resource_listing_generated) defined within the public class called public.The function start at line 111 and ends at 115. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [111.0] and does not return any value. It declares 4.0 functions, an...
Yelp_pyramid_swagger
public
public
0
0
test_get_resource_listing_default
def test_get_resource_listing_default():schema_dir = 'tests/sample_schemas/good_app/'resource_listing = get_resource_listing(schema_dir, False)with open(os.path.join(schema_dir, 'api_docs.json')) as fh:assert resource_listing == simplejson.load(fh)
1
5
0
41
2
118
123
118
['resource_listing', 'schema_dir']
None
{"Assign": 2, "With": 1}
4
6
4
["get_resource_listing", "open", "os.path.join", "simplejson.load"]
0
[]
The function (test_get_resource_listing_default) defined within the public class called public.The function start at line 118 and ends at 123. 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 ...
Yelp_pyramid_swagger
public
public
0
0
test_create_bravado_core_config_with_defaults
def test_create_bravado_core_config_with_defaults():assert {'use_models': False} == create_bravado_core_config({})
1
2
0
16
0
126
127
126
[]
None
{}
1
2
1
["create_bravado_core_config"]
0
[]
The function (test_create_bravado_core_config_with_defaults) defined within the public class called public.The function start at line 126 and ends at 127. 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...
Yelp_pyramid_swagger
public
public
0
0
bravado_core_formats
def bravado_core_formats():return [mock.Mock(spec=SwaggerFormat)]
1
2
0
15
0
131
132
131
[]
Returns
{"Return": 1}
1
2
1
["mock.Mock"]
0
[]
The function (bravado_core_formats) defined within the public class called public.The function start at line 131 and ends at 132. 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 fun...
Yelp_pyramid_swagger
public
public
0
0
bravado_core_configs
def bravado_core_configs(bravado_core_formats):return {'validate_requests': True,'validate_responses': False,'validate_swagger_spec': True,'use_models': True,'formats': bravado_core_formats,'include_missing_properties': False}
1
9
1
31
0
136
144
136
bravado_core_formats
[]
Returns
{"Return": 1}
0
9
0
[]
0
[]
The function (bravado_core_configs) defined within the public class called public.The function start at line 136 and ends at 144. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value..
Yelp_pyramid_swagger
public
public
0
0
test_create_bravado_core_config_non_empty_deprecated_configs
def test_create_bravado_core_config_non_empty_deprecated_configs(bravado_core_formats, bravado_core_configs,):pyramid_swagger_config = {'pyramid_swagger.enable_request_validation': True,'pyramid_swagger.enable_response_validation': False,'pyramid_swagger.enable_swagger_spec_validation': True,'pyramid_swagger.use_models...
1
13
2
46
2
147
161
147
bravado_core_formats,bravado_core_configs
['bravado_core_config', 'pyramid_swagger_config']
None
{"Assign": 2}
1
15
1
["create_bravado_core_config"]
0
[]
The function (test_create_bravado_core_config_non_empty_deprecated_configs) defined within the public class called public.The function start at line 147 and ends at 161. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [147.0] and does not return any value. It ...
Yelp_pyramid_swagger
public
public
0
0
test_create_bravado_core_config_with_passthrough_configs
def test_create_bravado_core_config_with_passthrough_configs(bravado_core_formats, bravado_core_configs):pyramid_swagger_config = {'{}validate_requests'.format(BRAVADO_CORE_CONFIG_PREFIX): True,'{}validate_responses'.format(BRAVADO_CORE_CONFIG_PREFIX): False,'{}validate_swagger_spec'.format(BRAVADO_CORE_CONFIG_PREFIX):...
1
11
2
74
2
164
176
164
bravado_core_formats,bravado_core_configs
['bravado_core_config', 'pyramid_swagger_config']
None
{"Assign": 2}
7
13
7
["format", "format", "format", "format", "format", "format", "create_bravado_core_config"]
0
[]
The function (test_create_bravado_core_config_with_passthrough_configs) defined within the public class called public.The function start at line 164 and ends at 176. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [164.0] and does not return any value. It decl...
Yelp_pyramid_swagger
public
public
0
0
mock_validator
def mock_validator():return mock.Mock(spec=['validate', 'is_type'])
1
2
0
17
0
11
12
11
[]
Returns
{"Return": 1}
1
2
1
["mock.Mock"]
0
[]
The function (mock_validator) defined within the public class called public.The function start at line 11 and ends at 12. 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 function ca...
Yelp_pyramid_swagger
public
public
0
0
test_required_validator_bool_is_missing
def test_required_validator_bool_is_missing():schema = {'paramType': 'body', 'name': 'body'}errors = list(load_schema.required_validator(None, True, {}, schema))assert len(errors) == 1assert 'body is required' in str(errors[0])
1
5
0
50
2
15
19
15
['schema', 'errors']
None
{"Assign": 2}
4
5
4
["list", "load_schema.required_validator", "len", "str"]
0
[]
The function (test_required_validator_bool_is_missing) defined within the public class called public.The function start at line 15 and ends at 19. 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 ...
Yelp_pyramid_swagger
public
public
0
0
test_required_validator_bool_is_present
def test_required_validator_bool_is_present():schema = {'paramType': 'body', 'name': 'body'}inst = {'foo': 1}errors = list(load_schema.required_validator(None, True, inst, schema))assert len(errors) == 0
1
5
0
46
3
22
26
22
['schema', 'errors', 'inst']
None
{"Assign": 3}
3
5
3
["list", "load_schema.required_validator", "len"]
0
[]
The function (test_required_validator_bool_is_present) defined within the public class called public.The function start at line 22 and ends at 26. 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 ...
Yelp_pyramid_swagger
public
public
0
0
test_required_validator_bool_not_required
def test_required_validator_bool_not_required():schema = {'paramType': 'body', 'name': 'body'}errors = list(load_schema.required_validator(None, False, {}, schema))assert len(errors) == 0
1
4
0
40
2
29
32
29
['schema', 'errors']
None
{"Assign": 2}
3
4
3
["list", "load_schema.required_validator", "len"]
0
[]
The function (test_required_validator_bool_not_required) defined within the public class called public.The function start at line 29 and ends at 32. 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, an...
Yelp_pyramid_swagger
public
public
0
0
test_required_validator_list
def test_required_validator_list(mock_validator):required = ['one', 'two']errors = list(load_schema.required_validator(mock_validator, required, {}, {}))assert len(errors) == 2
1
5
1
38
2
35
39
35
mock_validator
['required', 'errors']
None
{"Assign": 2}
3
5
3
["list", "load_schema.required_validator", "len"]
0
[]
The function (test_required_validator_list) defined within the public class called public.The function start at line 35 and ends at 39. 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...
Yelp_pyramid_swagger
public
public
0
0
test_type_validator_skips_File
def test_type_validator_skips_File():schema = {'paramType': 'form', 'type': 'File'}errors = list(load_schema.type_validator(None, "File", '<blah>', schema))assert len(errors) == 0
1
4
0
39
2
42
45
42
['schema', 'errors']
None
{"Assign": 2}
3
4
3
["list", "load_schema.type_validator", "len"]
0
[]
The function (test_type_validator_skips_File) defined within the public class called public.The function start at line 42 and ends at 45. 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...
Yelp_pyramid_swagger
public
public
0
0
test_type_validator_calls_draft3_type_validator_when_not_File
def test_type_validator_calls_draft3_type_validator_when_not_File(mock_type_draft3):schema = {'paramType': 'form', 'type': 'number'}list(load_schema.type_validator(None, "number", 99, schema))assert mock_type_draft3.call_count == 1
1
4
1
37
1
49
52
49
mock_type_draft3
['schema']
None
{"Assign": 1, "Expr": 1}
3
4
3
["list", "load_schema.type_validator", "mock.patch"]
0
[]
The function (test_type_validator_calls_draft3_type_validator_when_not_File) defined within the public class called public.The function start at line 49 and ends at 52. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declar...
Yelp_pyramid_swagger
public
public
0
0
schema
def schema():schema_dir = 'tests/sample_schemas/good_app/'return compile_swagger_schema(schema_dir,get_resource_listing(schema_dir, False))
1
6
0
19
1
17
22
17
['schema_dir']
Returns
{"Assign": 1, "Return": 1}
2
6
2
["compile_swagger_schema", "get_resource_listing"]
45
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3964638_python_restx_flask_restx.flask_restx.fields_py.DateTime.schema", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3964638_python_restx_flask_restx.flask_restx.fields_py.List.schema", "_.content.gdrive.MyDrive.P...
The function (schema) defined within the public class called public.The function start at line 17 and ends at 22. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0 functions called insid...
Yelp_pyramid_swagger
public
public
0
0
test_swagger_schema_for_request_different_methods
def test_swagger_schema_for_request_different_methods(schema):"""Tests that validators_for_request() checks the requestmethod."""# There exists a GET and POST for this endpoint. We should be able to call# either and have them pass validation.value = schema.validators_for_request(request=mock.Mock(path_info="/sample",me...
1
21
1
96
1
26
51
26
schema
['value']
None
{"Assign": 2, "Expr": 1}
5
26
5
["schema.validators_for_request", "mock.Mock", "schema.validators_for_request", "mock.Mock", "pytest.mark.skip"]
0
[]
The function (test_swagger_schema_for_request_different_methods) defined within the public class called public.The function start at line 26 and ends at 51. 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 5.0 func...
Yelp_pyramid_swagger
public
public
0
0
test_swagger_schema_for_request_not_found
def test_swagger_schema_for_request_not_found(schema):"""Tests that validators_for_request() raises exceptions whena path is not found."""# There exists a GET and POST for this endpoint. We should be able to call# either and have them pass validation.with pytest.raises(PathNotMatchedError) as excinfo:schema.validators_...
1
10
1
54
0
55
69
55
schema
[]
None
{"Expr": 2, "With": 1}
6
15
6
["pytest.raises", "schema.validators_for_request", "mock.Mock", "str", "str", "pytest.mark.skip"]
0
[]
The function (test_swagger_schema_for_request_not_found) defined within the public class called public.The function start at line 55 and ends at 69. 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, a...
Yelp_pyramid_swagger
public
public
0
0
test_partial_path_match
def test_partial_path_match():assert partial_path_match('/v1/bing/forward_unstructured','/v1/bing/forward_unstructured')assert partial_path_match('/v1/{api_provider}/forward_unstructured','/v1/bing/forward_unstructured')assert not partial_path_match('/v1/google/forward_unstructured','/v1/bing/forward_unstructured')
1
13
0
26
0
72
84
72
[]
None
{}
3
13
3
["partial_path_match", "partial_path_match", "partial_path_match"]
0
[]
The function (test_partial_path_match) defined within the public class called public.The function start at line 72 and ends at 84. 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 3.0 functions, and It has 3.0 fun...
Yelp_pyramid_swagger
public
public
0
0
test_swagger_schema_for_request_virtual_subpath
def test_swagger_schema_for_request_virtual_subpath(schema):# There exists a GET and POST for this endpoint. We should be able to call# either and have them pass validation.value = schema.validators_for_request(request=mock.Mock(path="/subpath/sample",script_name="/subpath",path_info="/sample",method="GET"),)assert val...
1
10
1
43
1
88
100
88
schema
['value']
None
{"Assign": 1}
3
13
3
["schema.validators_for_request", "mock.Mock", "pytest.mark.skip"]
0
[]
The function (test_swagger_schema_for_request_virtual_subpath) defined within the public class called public.The function start at line 88 and ends at 100. 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 3.0 funct...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryUnitTest
public
0
1
mock_marshal_schema_object
def mock_marshal_schema_object(self):with mock.patch('pyramid_swagger.renderer.marshal_schema_object') as _mock:yield _mock
1
3
1
17
0
22
24
22
self
[]
None
{"Expr": 1, "With": 1}
1
3
1
["mock.patch"]
0
[]
The function (mock_marshal_schema_object) defined within the public class called TestPyramidSwaggerRendererFactoryUnitTest, that inherit another class.The function start at line 22 and ends at 24. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryUnitTest
public
0
1
mock_get_response_spec
def mock_get_response_spec(self):with mock.patch('pyramid_swagger.renderer.get_response_spec') as _mock:yield _mock
1
3
1
17
0
27
29
27
self
[]
None
{"Expr": 1, "With": 1}
1
3
1
["mock.patch"]
0
[]
The function (mock_get_response_spec) defined within the public class called TestPyramidSwaggerRendererFactoryUnitTest, that inherit another class.The function start at line 27 and ends at 29. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not ret...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryUnitTest
public
0
1
setup_method
def setup_method(self, method):self.info = mock.Mock(name='info')self.value_to_render = mock.Mock(name='value_to_render')self.mock_spec = mock.Mock(spec=Spec)self.mock_request = DummyRequest(swagger_data=mock.Mock(spec=dict),operation=mock.Mock(spec=Operation),)self.mock_request.registry.settings = {'pyramid_swagger.sc...
1
11
2
110
0
31
41
31
self,method
[]
None
{"Assign": 7}
7
11
7
["mock.Mock", "mock.Mock", "mock.Mock", "DummyRequest", "mock.Mock", "mock.Mock", "mock.Mock"]
13
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3952644_pkgcore_snakeoil.tests.cli.test_arghparse_py.ParseStdinTest.setup_method", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3952644_pkgcore_snakeoil.tests.cli.test_arghparse_py.TestCommaSeparatedElementsAction....
The function (setup_method) defined within the public class called TestPyramidSwaggerRendererFactoryUnitTest, that inherit another class.The function start at line 31 and ends at 41. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [31.0] and does not return an...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryUnitTest
public
0
1
test_successiful_rendering_flow
def test_successiful_rendering_flow(self, mock_get_response_spec, mock_marshal_schema_object):renderer_factory = PyramidSwaggerRendererFactory(renderer_factory=self.external_renderer_factory)renderer = renderer_factory(info=self.info)rendered_value = renderer(self.value_to_render, self.mock_system)self.external_rendere...
1
19
3
128
0
43
63
43
self,mock_get_response_spec,mock_marshal_schema_object
[]
None
{"Assign": 3, "Expr": 4}
7
21
7
["PyramidSwaggerRendererFactory", "renderer_factory", "renderer", "self.external_renderer_factory.assert_called_once_with", "mock_get_response_spec.assert_called_once_with", "mock_marshal_schema_object.assert_called_once_with", "self.external_renderer_factory.return_value.assert_called_once_with"]
0
[]
The function (test_successiful_rendering_flow) defined within the public class called TestPyramidSwaggerRendererFactoryUnitTest, that inherit another class.The function start at line 43 and ends at 63. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [43.0] and...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryUnitTest
public
0
1
test_rendering_operation_not_found
def test_rendering_operation_not_found(self, mock_get_response_spec, mock_marshal_schema_object):renderer_factory = PyramidSwaggerRendererFactory(renderer_factory=self.external_renderer_factory)self.mock_request.operation = Nonerenderer = renderer_factory(info=self.info)rendered_value = renderer(self.value_to_render, s...
1
13
3
95
0
65
79
65
self,mock_get_response_spec,mock_marshal_schema_object
[]
None
{"Assign": 4, "Expr": 2}
5
15
5
["PyramidSwaggerRendererFactory", "renderer_factory", "renderer", "self.external_renderer_factory.assert_called_once_with", "self.external_renderer_factory.return_value.assert_called_once_with"]
0
[]
The function (test_rendering_operation_not_found) defined within the public class called TestPyramidSwaggerRendererFactoryUnitTest, that inherit another class.The function start at line 65 and ends at 79. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [65.0] ...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryUnitTest
public
0
1
test_rendering_response_spec_not_found
def test_rendering_response_spec_not_found(self, mock_get_response_spec, mock_marshal_schema_object):renderer_factory = PyramidSwaggerRendererFactory(renderer_factory=self.external_renderer_factory)mock_get_response_spec.side_effect = MatchingResponseNotFoundrenderer = renderer_factory(info=self.info)rendered_value = r...
1
16
3
111
0
81
98
81
self,mock_get_response_spec,mock_marshal_schema_object
[]
None
{"Assign": 4, "Expr": 3}
6
18
6
["PyramidSwaggerRendererFactory", "renderer_factory", "renderer", "self.external_renderer_factory.assert_called_once_with", "mock_get_response_spec.assert_called_once_with", "self.external_renderer_factory.return_value.assert_called_once_with"]
0
[]
The function (test_rendering_response_spec_not_found) defined within the public class called TestPyramidSwaggerRendererFactoryUnitTest, that inherit another class.The function start at line 81 and ends at 98. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [81...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryUnitTest
public
0
1
test_rendering_response_without_schema
def test_rendering_response_without_schema(self, mock_get_response_spec, mock_marshal_schema_object):renderer_factory = PyramidSwaggerRendererFactory(renderer_factory=self.external_renderer_factory)mock_get_response_spec.return_value = {'200': {'description': ''}}renderer = renderer_factory(info=self.info)rendered_valu...
1
16
3
119
0
100
117
100
self,mock_get_response_spec,mock_marshal_schema_object
[]
None
{"Assign": 4, "Expr": 3}
6
18
6
["PyramidSwaggerRendererFactory", "renderer_factory", "renderer", "self.external_renderer_factory.assert_called_once_with", "mock_get_response_spec.assert_called_once_with", "self.external_renderer_factory.return_value.assert_called_once_with"]
0
[]
The function (test_rendering_response_without_schema) defined within the public class called TestPyramidSwaggerRendererFactoryUnitTest, that inherit another class.The function start at line 100 and ends at 117. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryUnitTest
public
0
1
test_rendering_error_during_marshaling
def test_rendering_error_during_marshaling(self, mock_get_response_spec, mock_marshal_schema_object):renderer_factory = PyramidSwaggerRendererFactory(renderer_factory=self.external_renderer_factory)mock_marshal_schema_object.side_effect = SwaggerMappingErrorrenderer = renderer_factory(info=self.info)rendered_value = re...
1
20
3
133
0
119
140
119
self,mock_get_response_spec,mock_marshal_schema_object
[]
None
{"Assign": 4, "Expr": 4}
7
22
7
["PyramidSwaggerRendererFactory", "renderer_factory", "renderer", "self.external_renderer_factory.assert_called_once_with", "mock_get_response_spec.assert_called_once_with", "mock_marshal_schema_object.assert_called_once_with", "self.external_renderer_factory.return_value.assert_called_once_with"]
0
[]
The function (test_rendering_error_during_marshaling) defined within the public class called TestPyramidSwaggerRendererFactoryUnitTest, that inherit another class.The function start at line 119 and ends at 140. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryIntegrationTest
public
0
1
swagger_spec
def swagger_spec(self):spec = Spec.from_dict(self.swagger_spec_dict)yield spec
1
3
1
17
0
173
175
173
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["Spec.from_dict", "pytest.yield_fixture"]
0
[]
The function (swagger_spec) defined within the public class called TestPyramidSwaggerRendererFactoryIntegrationTest, that inherit another class.The function start at line 173 and ends at 175. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not retu...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryIntegrationTest
public
0
1
mock_request
def mock_request(self, swagger_spec):mock_request = DummyRequest(swagger_data={},operation=swagger_spec.resources['endpoint'].get_endpoint,)mock_request.registry.settings = {'pyramid_swagger.schema20': swagger_spec}yield mock_request
1
7
2
41
0
178
184
178
self,swagger_spec
[]
None
{"Assign": 2, "Expr": 1}
1
7
1
["DummyRequest"]
0
[]
The function (mock_request) defined within the public class called TestPyramidSwaggerRendererFactoryIntegrationTest, that inherit another class.The function start at line 178 and ends at 184. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [178.0] and does not ...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryIntegrationTest
public
0
1
spy_marshal_schema_object
def spy_marshal_schema_object(self):with mock.patch.object(renderer, 'marshal_schema_object', wraps=renderer.marshal_schema_object) as _mock:yield _mock
1
3
1
27
0
187
189
187
self
[]
None
{"Expr": 1, "With": 1}
1
3
1
["mock.patch.object"]
0
[]
The function (spy_marshal_schema_object) defined within the public class called TestPyramidSwaggerRendererFactoryIntegrationTest, that inherit another class.The function start at line 187 and ends at 189. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and ...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryIntegrationTest
public
0
1
spy_get_response_spec
def spy_get_response_spec(self):with mock.patch.object(renderer, 'get_response_spec', wraps=renderer.get_response_spec) as _mock:yield _mock
1
3
1
27
0
192
194
192
self
[]
None
{"Expr": 1, "With": 1}
1
3
1
["mock.patch.object"]
0
[]
The function (spy_get_response_spec) defined within the public class called TestPyramidSwaggerRendererFactoryIntegrationTest, that inherit another class.The function start at line 192 and ends at 194. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryUnitTest
public
0
1
setup_method
def setup_method(self, method):self.info = mock.Mock(name='info')self.renderer_factory = PyramidSwaggerRendererFactory()
1
3
2
26
0
196
198
196
self,method
[]
None
{"Assign": 7}
7
11
7
["mock.Mock", "mock.Mock", "mock.Mock", "DummyRequest", "mock.Mock", "mock.Mock", "mock.Mock"]
13
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3952644_pkgcore_snakeoil.tests.cli.test_arghparse_py.ParseStdinTest.setup_method", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3952644_pkgcore_snakeoil.tests.cli.test_arghparse_py.TestCommaSeparatedElementsAction....
The function (setup_method) defined within the public class called TestPyramidSwaggerRendererFactoryUnitTest, that inherit another class.The function start at line 196 and ends at 198. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [196.0] and does not return ...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryIntegrationTest
public
0
1
test_no_errors
def test_no_errors(self, spy_get_response_spec, spy_marshal_schema_object,swagger_spec, mock_request, view_response, expected_rendered_value,):system = {'request': mock_request}renderer = self.renderer_factory(info=self.info)rendered_value = renderer(view_response, system)spy_get_response_spec.assert_called_once_with(o...
1
17
7
105
0
209
227
209
self,spy_get_response_spec,spy_marshal_schema_object,swagger_spec,mock_request,view_response,expected_rendered_value
[]
None
{"Assign": 3, "Expr": 2}
8
19
8
["self.renderer_factory", "renderer", "spy_get_response_spec.assert_called_once_with", "spy_marshal_schema_object.assert_called_once_with", "pytest.mark.parametrize", "datetime.date.today", "isoformat", "datetime.date.today"]
0
[]
The function (test_no_errors) defined within the public class called TestPyramidSwaggerRendererFactoryIntegrationTest, that inherit another class.The function start at line 209 and ends at 227. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [209.0] and does n...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryIntegrationTest
public
0
1
test_response_spec_not_found
def test_response_spec_not_found(self, spy_get_response_spec, spy_marshal_schema_object,mock_request, view_response, expect_exernal_renderer_exception,):mock_request.response.status_code = 400system = {'request': mock_request}renderer = self.renderer_factory(info=self.info)rendered_value = Noneexpected_rendered_value =...
2
21
6
113
0
238
261
238
self,spy_get_response_spec,spy_marshal_schema_object,mock_request,view_response,expect_exernal_renderer_exception
[]
None
{"Assign": 8, "Expr": 1, "If": 1, "With": 1}
8
24
8
["self.renderer_factory", "pytest.raises", "renderer", "renderer", "json.dumps", "spy_get_response_spec.assert_called_once_with", "pytest.mark.parametrize", "datetime.date.today"]
0
[]
The function (test_response_spec_not_found) defined within the public class called TestPyramidSwaggerRendererFactoryIntegrationTest, that inherit another class.The function start at line 238 and ends at 261. It contains 21 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [238...
Yelp_pyramid_swagger
TestPyramidSwaggerRendererFactoryIntegrationTest
public
0
1
test_marshaling_raise_exception
def test_marshaling_raise_exception(self, spy_get_response_spec, spy_marshal_schema_object, swagger_spec, mock_request,):system = {'request': mock_request}value_to_renderer = {'date': datetime.date.today().isoformat()}renderer = self.renderer_factory(info=self.info)rendered_value = renderer(value_to_renderer, system)sp...
1
17
5
123
0
263
281
263
self,spy_get_response_spec,spy_marshal_schema_object,swagger_spec,mock_request
[]
None
{"Assign": 4, "Expr": 2}
7
19
7
["isoformat", "datetime.date.today", "self.renderer_factory", "renderer", "spy_get_response_spec.assert_called_once_with", "spy_marshal_schema_object.assert_called_once_with", "json.dumps"]
0
[]
The function (test_marshaling_raise_exception) defined within the public class called TestPyramidSwaggerRendererFactoryIntegrationTest, that inherit another class.The function start at line 263 and ends at 281. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [...
Yelp_pyramid_swagger
public
public
0
0
test_success_for_good_app
def test_success_for_good_app():dir_path = 'tests/sample_schemas/good_app/'.replace('/', os.path.sep)with open(os.path.join(dir_path, API_DOCS_FILENAME)) as f:resource_listing = simplejson.load(f)validate_swagger_schema(dir_path, resource_listing)
1
5
0
49
2
14
18
14
['dir_path', 'resource_listing']
None
{"Assign": 2, "Expr": 1, "With": 1}
5
5
5
["replace", "open", "os.path.join", "simplejson.load", "validate_swagger_schema"]
0
[]
The function (test_success_for_good_app) defined within the public class called public.The function start at line 14 and ends at 18. 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 fu...
Yelp_pyramid_swagger
public
public
0
0
test_proper_error_on_missing_api_declaration
def test_proper_error_on_missing_api_declaration():with pytest.raises(ValidationError) as exc:dir_path = 'tests/sample_schemas/missing_api_declaration/'.replace('/', os.path.sep)with open(os.path.join(dir_path, API_DOCS_FILENAME)) as f:resource_listing = simplejson.load(f)validate_swagger_schema(dir_path, resource_list...
1
8
0
91
2
21
29
21
['dir_path', 'resource_listing']
None
{"Assign": 2, "Expr": 1, "With": 2}
10
9
10
["pytest.raises", "replace", "open", "os.path.join", "simplejson.load", "validate_swagger_schema", "os.path.basename", "str", "os.path.basename", "str"]
0
[]
The function (test_proper_error_on_missing_api_declaration) defined within the public class called public.The function start at line 21 and ends at 29. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 10.0 functions...
Yelp_pyramid_swagger
public
public
0
0
assert_eq_regex_lists
def assert_eq_regex_lists(left, right):assert [r.pattern for r in left] == [r.pattern for r in right]
3
2
2
27
0
42
43
42
left,right
[]
None
{}
0
2
0
[]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_default_exclude_paths", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.tween_test_py.test_exclude_path_with_old_setting", "_....
The function (assert_eq_regex_lists) defined within the public class called public.The function start at line 42 and ends at 43. It contains 2 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [42.0] and does not return any value. It has 4.0 functions calling this function whi...
Yelp_pyramid_swagger
public
public
0
0
test_default_exclude_paths
def test_default_exclude_paths():assert_eq_regex_lists(get_exclude_paths(Mock(settings={})),[re.compile(r) for r in DEFAULT_EXCLUDED_PATHS])
2
5
0
30
0
46
50
46
[]
None
{"Expr": 1}
4
5
4
["assert_eq_regex_lists", "get_exclude_paths", "Mock", "re.compile"]
0
[]
The function (test_default_exclude_paths) defined within the public class called public.The function start at line 46 and ends at 50. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 f...
Yelp_pyramid_swagger
public
public
0
0
test_exclude_path_with_string
def test_exclude_path_with_string():path_string = r'/foo/'registry = Mock(settings={'pyramid_swagger.exclude_paths': path_string})assert_eq_regex_lists(get_exclude_paths(registry),[re.compile(r) for r in [path_string]])
2
7
0
42
2
53
59
53
['path_string', 'registry']
None
{"Assign": 2, "Expr": 1}
4
7
4
["Mock", "assert_eq_regex_lists", "get_exclude_paths", "re.compile"]
0
[]
The function (test_exclude_path_with_string) defined within the public class called public.The function start at line 53 and ends at 59. 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. It declares 4.0 functions, and It has 4....
Yelp_pyramid_swagger
public
public
0
0
test_exclude_path_with_overrides
def test_exclude_path_with_overrides():paths = [r'/foo/', r'/bar/']compiled = get_exclude_paths(Mock(settings={'pyramid_swagger.exclude_paths': paths}))assert_eq_regex_lists(compiled,[re.compile(r) for r in paths])
2
8
0
45
2
62
69
62
['compiled', 'paths']
None
{"Assign": 2, "Expr": 1}
4
8
4
["get_exclude_paths", "Mock", "assert_eq_regex_lists", "re.compile"]
0
[]
The function (test_exclude_path_with_overrides) defined within the public class called public.The function start at line 62 and ends at 69. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has...