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
nasa_fprime-tools
public
public
0
0
style_file
def style_file(tmp_path):"""Pytest fixture for a style file"""clang_format_file = tmp_path / ".clang-format"clang_format_file.write_text("BasedOnStyle: LLVM\n")return clang_format_file
1
4
1
19
1
96
100
96
null
['clang_format_file']
None
null
0
0
0
null
0
null
The function (style_file) defined within the public class called public.The function start at line 96 and ends at 100. 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..
nasa_fprime-tools
public
public
0
0
test_execute_format
def test_execute_format(tmp_path, mock_build, style_file):"""Test that execute formats a file"""malformed_src = DATA_DIR / "malformed.cpp"malformed_dst = tmp_path / "malformed.cpp"shutil.copy(malformed_src, malformed_dst)options = {"backup": False, "verbose": False, "quiet": True, "check": False}formatter = ClangFormat...
1
11
3
104
6
103
117
103
null
['well_formed_content', 'formatter', 'malformed_src', 'malformed_dst', 'result', 'options']
None
null
0
0
0
null
0
null
The function (test_execute_format) defined within the public class called public.The function start at line 103 and ends at 117. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [103.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
test_execute_check_fail
def test_execute_check_fail(tmp_path, mock_build, style_file):"""Test that execute with --check fails on a malformed file"""malformed_src = DATA_DIR / "malformed.cpp"malformed_dst = tmp_path / "malformed.cpp"shutil.copy(malformed_src, malformed_dst)options = {"backup": False, "verbose": False, "quiet": True, "check": T...
1
9
3
85
5
120
131
120
null
['formatter', 'malformed_src', 'malformed_dst', 'result', 'options']
None
null
0
0
0
null
0
null
The function (test_execute_check_fail) defined within the public class called public.The function start at line 120 and ends at 131. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [120.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
test_execute_check_pass
def test_execute_check_pass(tmp_path, mock_build, style_file):"""Test that execute with --check passes on a well-formed file"""well_formed_src = DATA_DIR / "well-formed.cpp"well_formed_dst = tmp_path / "well-formed.cpp"shutil.copy(well_formed_src, well_formed_dst)options = {"backup": False, "verbose": False, "quiet": T...
1
9
3
85
5
134
145
134
null
['well_formed_src', 'formatter', 'well_formed_dst', 'result', 'options']
None
null
0
0
0
null
0
null
The function (test_execute_check_pass) defined within the public class called public.The function start at line 134 and ends at 145. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [134.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
file_structure
def file_structure(tmp_path):"""Pytest fixture for a temporary file structure"""proj_root = tmp_pathcomponent_dir = proj_root / "component"component_subdir = component_dir / "sub"deployment_dir = proj_root / "deployment"component_dir.mkdir()component_subdir.mkdir()deployment_dir.mkdir()(proj_root / "project.cmake").tou...
1
11
1
65
4
11
25
11
null
['deployment_dir', 'component_subdir', 'proj_root', 'component_dir']
None
null
0
0
0
null
0
null
The function (file_structure) defined within the public class called public.The function start at line 11 and ends at 25. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
test_find_nearest_cmake_in_component_parent
def test_find_nearest_cmake_in_component_parent(file_structure):"""Test finding CMakeLists.txt in a component's parent directory"""proj_root, component_dir, component_subdir, deployment_dir = file_structure(component_dir / "CMakeLists.txt").touch()found_path = find_nearest_cmake_file(component_subdir, deployment_dir, p...
1
5
1
42
1
28
34
28
null
['found_path']
None
null
0
0
0
null
0
null
The function (test_find_nearest_cmake_in_component_parent) defined within the public class called public.The function start at line 28 and ends at 34. 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..
nasa_fprime-tools
public
public
0
0
test_find_nearest_cmake_project_cmake
def test_find_nearest_cmake_project_cmake(file_structure):"""Test falling back to project.cmake"""proj_root, component_dir, component_subdir, deployment_dir = file_structurefound_path = find_nearest_cmake_file(component_subdir, deployment_dir, proj_root)assert found_path == (proj_root / "project.cmake")
1
4
1
33
1
37
42
37
null
['found_path']
None
null
0
0
0
null
0
null
The function (test_find_nearest_cmake_project_cmake) defined within the public class called public.The function start at line 37 and ends at 42. 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..
nasa_fprime-tools
public
public
0
0
test_find_nearest_cmake_no_file
def test_find_nearest_cmake_no_file(file_structure):"""Test returning None when no file is found"""proj_root, component_dir, component_subdir, deployment_dir = file_structure(proj_root / "project.cmake").unlink()(proj_root / "CMakeLists.txt").unlink()found_path = find_nearest_cmake_file(component_subdir, deployment_dir...
1
6
1
47
1
45
52
45
null
['found_path']
None
null
0
0
0
null
0
null
The function (test_find_nearest_cmake_no_file) defined within the public class called public.The function start at line 45 and ends at 52. 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..
nasa_fprime-tools
public
public
0
0
mock_build
def mock_build():"""Create a mock Build object for testing"""mock = MagicMock(spec=Build)return mock
1
3
0
15
1
19
22
19
null
['mock']
None
null
0
0
0
null
0
null
The function (mock_build) defined within the public class called public.The function start at line 19 and ends at 22. 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..
nasa_fprime-tools
public
public
0
0
test_current_dir_is_root
def test_current_dir_is_root(mock_build):"""Test when current directory is the project root"""# Setupmock_build.get_settings.return_value = str(Path.cwd())# Executeresult = get_directory_path_relative_to_root(mock_build)# Verifyassert result == ""mock_build.get_settings.assert_called_once_with("project_root", None)
1
5
1
40
1
25
35
25
null
['result']
None
null
0
0
0
null
0
null
The function (test_current_dir_is_root) defined within the public class called public.The function start at line 25 and ends at 35. 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..
nasa_fprime-tools
public
public
0
0
test_current_dir_is_subdirectory
def test_current_dir_is_subdirectory(mock_cwd, mock_build):"""Test when current directory is a subdirectory of the project root"""# Setuproot_path = Path("/path/to/project")current_path = root_path / "subdir1" / "subdir2"mock_build.get_settings.return_value = str(root_path)mock_cwd.return_value = current_path# Executer...
1
7
2
55
3
39
52
39
null
['root_path', 'result', 'current_path']
None
null
0
0
0
null
0
null
The function (test_current_dir_is_subdirectory) defined within the public class called public.The function start at line 39 and ends at 52. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [39.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
test_current_dir_outside_project
def test_current_dir_outside_project(mock_cwd, mock_build):"""Test when current directory is outside the project root"""# Setuproot_path = Path("/path/to/project")current_path = Path("/different/path")mock_build.get_settings.return_value = str(root_path)mock_cwd.return_value = current_path# Executeresult = get_director...
1
7
2
45
3
56
69
56
null
['root_path', 'result', 'current_path']
None
null
0
0
0
null
0
null
The function (test_current_dir_outside_project) defined within the public class called public.The function start at line 56 and ends at 69. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [56.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
test_with_nested_directories
def test_with_nested_directories(mock_cwd, mock_build):"""Test with deeply nested directories"""# Setuproot_path = Path("/path/to/project")current_path = root_path / "a" / "b" / "c" / "d"mock_build.get_settings.return_value = str(root_path)mock_cwd.return_value = current_path# Executeresult = get_directory_path_relativ...
1
7
2
59
3
73
86
73
null
['root_path', 'result', 'current_path']
None
null
0
0
0
null
0
null
The function (test_with_nested_directories) defined within the public class called public.The function start at line 73 and ends at 86. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [73.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
test_with_nonexistent_project_root
def test_with_nonexistent_project_root(mock_build):"""Test behavior when project_root setting doesn't exist"""# Setupmock_build.get_settings.return_value = None# This should return Noneresult = get_directory_path_relative_to_root(mock_build)assert result is None
1
4
1
23
1
89
96
89
null
['result']
None
null
0
0
0
null
0
null
The function (test_with_nonexistent_project_root) defined within the public class called public.The function start at line 89 and ends at 96. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
test_with_relative_path_in_settings
def test_with_relative_path_in_settings(mock_cwd, mock_build):"""Test with a relative path in the settings"""# Setuproot_path = Path("project")# Relative pathabs_root_path = Path("/path/to/project")# What it resolves tocurrent_path = abs_root_path / "subdir"# Mock resolve to return the absolute pathwith patch.object(Pa...
1
9
2
64
4
100
116
100
null
['root_path', 'result', 'current_path', 'abs_root_path']
None
null
0
0
0
null
0
null
The function (test_with_relative_path_in_settings) defined within the public class called public.The function start at line 100 and ends at 116. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [100.0] and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
includeme
def includeme(config):""":type config: :class:`pyramid.config.Configurator`"""settings = config.registry.settingsswagger_versions = get_swagger_versions(settings)# for rendering /swagger.yamlconfig.add_renderer('yaml', 'pyramid_swagger.api.YamlRendererFactory',)# Add the SwaggerSchema to settings to make it available t...
6
27
1
145
2
19
60
19
config
['settings', 'swagger_versions']
None
{"Assign": 6, "Expr": 6, "If": 5}
13
42
13
["get_swagger_versions", "config.add_renderer", "get_swagger_schema", "get_swagger_spec", "config.add_tween", "config.add_renderer", "PyramidSwaggerRendererFactory", "settings.get", "register_api_doc_endpoints", "get_api_doc_endpoints", "register_api_doc_endpoints", "build_swagger_20_swagger_schema_views", "settings.ge...
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3963889_stevearc_pypicloud.tests.test_access_backends_py.TestBaseBackend.test_load_arbitrary_backend", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3963889_stevearc_pypicloud.tests.test_access_backends_py.TestBaseB...
The function (includeme) defined within the public class called public.The function start at line 19 and ends at 60. It contains 27 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 13.0 functions, It has 13.0 functions called ins...
Yelp_pyramid_swagger
public
public
0
0
register_api_doc_endpoints
def register_api_doc_endpoints(config, endpoints, base_path='/api-docs'):"""Create and register pyramid endpoints to service swagger api docs.Routes and views will be registered on the `config` at `path`.:param config: a pyramid configuration to register the new views and routes:typeconfig: :class:`pyramid.config.Confi...
2
8
3
59
1
21
39
21
config,endpoints,base_path
['path']
None
{"Assign": 1, "Expr": 3, "For": 1}
3
19
3
["base_path.rstrip", "config.add_route", "config.add_view"]
3
["_.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.tests.api_test_py.test_proper_error_on_missing_api_declaration", "_.c...
The function (register_api_doc_endpoints) defined within the public class called public.The function start at line 21 and ends at 39. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [21.0] and does not return any value. It declares 3.0 functions, It has 3.0 fun...
Yelp_pyramid_swagger
public
public
0
0
build_swagger_12_endpoints
def build_swagger_12_endpoints(resource_listing, api_declarations):""":param resource_listing: JSON representing a Swagger 1.2 resource listing:type resource_listing: dict:param api_declarations: JSON representing Swagger 1.2 api declarations:type api_declarations: dict:rtype: iterable of :class:`pyramid_swagger.model....
2
6
2
44
0
42
55
42
resource_listing,api_declarations
[]
None
{"Expr": 3, "For": 1, "With": 1}
5
14
5
["build_swagger_12_resource_listing", "api_declarations.items", "open", "build_swagger_12_api_declaration", "simplejson.load"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.compile_swagger_schema"]
The function (build_swagger_12_endpoints) defined within the public class called public.The function start at line 42 and ends at 55. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [42.0] and does not return any value. It declares 5.0 functions, It has 5.0 fun...
Yelp_pyramid_swagger
public
public
0
0
build_swagger_12_resource_listing.view_for_resource_listing
def view_for_resource_listing(request):# Thanks to the magic of closures, this means we gracefully return JSON# without file IO at request time.return resource_listing
1
2
1
7
0
64
67
64
null
[]
None
null
0
0
0
null
0
null
The function (build_swagger_12_resource_listing.view_for_resource_listing) defined within the public class called public.The function start at line 64 and ends at 67. 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
build_swagger_12_resource_listing
def build_swagger_12_resource_listing(resource_listing):""":param resource_listing: JSON representing a Swagger 1.2 resource listing:type resource_listing: dict:rtype: :class:`pyramid_swagger.model.PyramidEndpoint`"""def view_for_resource_listing(request):# Thanks to the magic of closures, this means we gracefully retu...
1
7
1
27
0
58
73
58
resource_listing
[]
Returns
{"Expr": 1, "Return": 2}
1
16
1
["PyramidEndpoint"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.api_py.build_swagger_12_endpoints"]
The function (build_swagger_12_resource_listing) defined within the public class called public.The function start at line 58 and ends at 73. It contains 7 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...
Yelp_pyramid_swagger
public
public
0
0
build_swagger_12_api_declaration
def build_swagger_12_api_declaration(resource_name, api_declaration):""":param resource_name: The `path` parameter from the resource listing forthis resource.:type resource_name: string:param api_declaration: JSON representing a Swagger 1.2 api declaration:type api_declaration: dict:rtype: :class:`pyramid_swagger.model...
1
7
2
43
1
76
92
76
resource_name,api_declaration
['route_name']
Returns
{"Assign": 1, "Expr": 1, "Return": 1}
4
17
4
["format", "PyramidEndpoint", "format", "build_swagger_12_api_declaration_view"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.api_py.build_swagger_12_endpoints"]
The function (build_swagger_12_api_declaration) defined within the public class called public.The function start at line 76 and ends at 92. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [76.0], and this function return a value. It declares 4.0 functions, It h...
Yelp_pyramid_swagger
public
public
0
0
build_swagger_12_api_declaration_view.view_for_api_declaration
def view_for_api_declaration(request):# Note that we rewrite basePath to always point at this server's root.return dict(api_declaration_json,basePath=str(request.application_url),)
1
5
1
20
0
99
104
99
null
[]
None
null
0
0
0
null
0
null
The function (build_swagger_12_api_declaration_view.view_for_api_declaration) defined within the public class called public.The function start at line 99 and ends at 104. 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..
Yelp_pyramid_swagger
public
public
0
0
build_swagger_12_api_declaration_view
def build_swagger_12_api_declaration_view(api_declaration_json):"""Thanks to the magic of closures, this means we gracefully return JSONwithout file IO at request time."""def view_for_api_declaration(request):# Note that we rewrite basePath to always point at this server's root.return dict(api_declaration_json,basePath...
1
3
1
10
0
95
105
95
api_declaration_json
[]
Returns
{"Expr": 1, "Return": 2}
2
11
2
["dict", "str"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.api_py.build_swagger_12_api_declaration", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.api_test_py.test_basepath_rewriting"]
The function (build_swagger_12_api_declaration_view) defined within the public class called public.The function start at line 95 and ends at 105. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 2.0 functions, I...
Yelp_pyramid_swagger
NodeWalker
public
0
1
__init__
def __init__(self):pass
1
2
1
6
0
109
110
109
self
[]
None
{}
0
2
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 NodeWalker, that inherit another class.The function start at line 109 and ends at 110. 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 6243.0 functions call...
Yelp_pyramid_swagger
NodeWalker
public
0
1
walk
def walk(self, item, *args, **kwargs):dupe = copy.deepcopy(item)return self._walk(dupe, *args, **kwargs)
1
3
4
34
0
112
114
112
self,item,*args,**kwargs
[]
Returns
{"Assign": 1, "Return": 1}
2
3
2
["copy.deepcopy", "self._walk"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3567358_coursera_dataduct.examples.resources.scripts.s3_profiler_py.recurse_directory", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3575929_ministryofjustice_bootstrap_cfn.tests.test_mime_packer_py.TestMimePacker....
The function (walk) defined within the public class called NodeWalker, that inherit another class.The function start at line 112 and ends at 114. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [112.0], and this function return a value. It declares 2.0 function...
Yelp_pyramid_swagger
NodeWalker
public
0
1
_walk
def _walk(self, item, *args, **kwargs):if isinstance(item, list):return self._walk_list(item, *args, **kwargs)elif isinstance(item, dict):return self._walk_dict(item, *args, **kwargs)else:return self._walk_item(item, *args, **kwargs)
3
7
4
70
0
116
124
116
self,item,*args,**kwargs
[]
Returns
{"If": 2, "Return": 3}
5
9
5
["isinstance", "self._walk_list", "isinstance", "self._walk_dict", "self._walk_item"]
0
[]
The function (_walk) defined within the public class called NodeWalker, that inherit another class.The function start at line 116 and ends at 124. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [116.0], and this function return a value. It declares 5.0 functio...
Yelp_pyramid_swagger
NodeWalker
public
0
1
_walk_list
def _walk_list(self, item, *args, **kwargs):for index, subitem in enumerate(item):item[index] = self._walk(subitem, *args, **kwargs)return item
2
4
4
42
0
126
129
126
self,item,*args,**kwargs
[]
Returns
{"Assign": 1, "For": 1, "Return": 1}
2
4
2
["enumerate", "self._walk"]
0
[]
The function (_walk_list) defined within the public class called NodeWalker, that inherit another class.The function start at line 126 and ends at 129. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [126.0], and this function return a value. It declares 2.0 fu...
Yelp_pyramid_swagger
NodeWalker
public
0
1
_walk_dict
def _walk_dict(self, item, *args, **kwargs):for key, value in item.items():item[key] = self._walk_dict_item(key, value, *args, **kwargs)return item
2
4
4
45
0
131
134
131
self,item,*args,**kwargs
[]
Returns
{"Assign": 1, "For": 1, "Return": 1}
2
4
2
["item.items", "self._walk_dict_item"]
0
[]
The function (_walk_dict) defined within the public class called NodeWalker, that inherit another class.The function start at line 131 and ends at 134. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [131.0], and this function return a value. It declares 2.0 fu...
Yelp_pyramid_swagger
NodeWalker
public
0
1
_walk_dict_item
def _walk_dict_item(self, key, value, *args, **kwargs):return self._walk(value, *args, **kwargs)
1
2
5
28
0
136
137
136
self,key,value,*args,**kwargs
[]
Returns
{"Return": 1}
1
2
1
["self._walk"]
0
[]
The function (_walk_dict_item) defined within the public class called NodeWalker, that inherit another class.The function start at line 136 and ends at 137. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [136.0], and this function return a value. It declare 1....
Yelp_pyramid_swagger
NodeWalker
public
0
1
_walk_item
def _walk_item(self, value, *args, **kwargs):return value
1
2
4
15
0
139
140
139
self,value,*args,**kwargs
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (_walk_item) defined within the public class called NodeWalker, that inherit another class.The function start at line 139 and ends at 140. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [139.0], and this function return a value..
Yelp_pyramid_swagger
public
public
0
0
get_path_if_relative
def get_path_if_relative(url):parts = urlparse(url)if parts.scheme or parts.netloc:# only rewrite relative pathsreturnif not parts.path:# don't rewrite internal refsreturnif parts.path.startswith('/'):# don't rewrite absolute refsreturnreturn parts
5
9
1
41
1
143
158
143
url
['parts']
Returns
{"Assign": 1, "If": 3, "Return": 4}
2
16
2
["urlparse", "parts.path.startswith"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.api_py.NodeWalkerForCleaningRefs.fix_ref", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.api_py.NodeWalkerForRefFiles._walk...
The function (get_path_if_relative) defined within the public class called public.The function start at line 143 and ends at 158. It contains 9 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 2.0 functions, It has 2.0 functi...
Yelp_pyramid_swagger
NodeWalker
public
0
1
walk
def walk(self, spec):all_refs = []spec_fname = spec.origin_urlif spec_fname.startswith('file://'):spec_fname = spec_fname.replace('file://', '')spec_dirname = os.path.dirname(spec_fname)parent = super(NodeWalkerForRefFiles, self)parent.walk(spec.client_spec_dict, spec, spec_dirname, all_refs)all_refs = [os.path.relpath...
3
13
2
110
0
162
179
162
self,item,*args,**kwargs
[]
Returns
{"Assign": 1, "Return": 1}
2
3
2
["copy.deepcopy", "self._walk"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3567358_coursera_dataduct.examples.resources.scripts.s3_profiler_py.recurse_directory", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3575929_ministryofjustice_bootstrap_cfn.tests.test_mime_packer_py.TestMimePacker....
The function (walk) defined within the public class called NodeWalker, that inherit another class.The function start at line 162 and ends at 179. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [162.0], and this function return a value. It declares 2.0 functio...
Yelp_pyramid_swagger
NodeWalker
public
0
1
_walk_dict_item
def _walk_dict_item(self, key, value, spec, dirname, all_refs):if key != '$ref':parent = super(NodeWalkerForRefFiles, self)return parent._walk_dict_item(key, value, spec, dirname, all_refs)# assume $ref is the only key in the dictparts = get_path_if_relative(value)if not parts:return valuefull_fname = os.path.join(dirn...
3
13
6
124
0
181
197
181
self,key,value,*args,**kwargs
[]
Returns
{"Return": 1}
1
2
1
["self._walk"]
0
[]
The function (_walk_dict_item) defined within the public class called NodeWalker, that inherit another class.The function start at line 181 and ends at 197. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 6 parameters, represented as [181.0], and this function return a value. It declare 1...
Yelp_pyramid_swagger
NodeWalker
public
0
1
walk
def walk(self, item, schema_format):parent = super(NodeWalkerForCleaningRefs, self)return parent.walk(item, schema_format)
1
3
3
26
0
201
203
201
self,item,*args,**kwargs
[]
Returns
{"Assign": 1, "Return": 1}
2
3
2
["copy.deepcopy", "self._walk"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3567358_coursera_dataduct.examples.resources.scripts.s3_profiler_py.recurse_directory", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3575929_ministryofjustice_bootstrap_cfn.tests.test_mime_packer_py.TestMimePacker....
The function (walk) defined within the public class called NodeWalker, that inherit another class.The function start at line 201 and ends at 203. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [201.0], and this function return a value. It declares 2.0 function...
Yelp_pyramid_swagger
NodeWalkerForCleaningRefs
public
0
1
fix_ref
def fix_ref(ref, schema_format):parts = get_path_if_relative(ref)if not parts:returnpath, ext = os.path.splitext(parts.path)return urlunparse([parts.scheme,parts.netloc,'{0}.{1}'.format(path, schema_format),parts.params,parts.query,parts.fragment,])
2
13
2
67
0
206
219
206
ref,schema_format
[]
Returns
{"Assign": 2, "If": 1, "Return": 2}
4
14
4
["get_path_if_relative", "os.path.splitext", "urlunparse", "format"]
0
[]
The function (fix_ref) defined within the public class called NodeWalkerForCleaningRefs, that inherit another class.The function start at line 206 and ends at 219. It contains 13 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [206.0], and this function return a value. It de...
Yelp_pyramid_swagger
NodeWalker
public
0
1
_walk_dict_item
def _walk_dict_item(self, key, value, schema_format):if key != '$ref':parent = super(NodeWalkerForCleaningRefs, self)return parent._walk_dict_item(key, value, schema_format)return self.fix_ref(value, schema_format) or value
3
5
4
46
0
221
226
221
self,key,value,*args,**kwargs
[]
Returns
{"Return": 1}
1
2
1
["self._walk"]
0
[]
The function (_walk_dict_item) defined within the public class called NodeWalker, that inherit another class.The function start at line 221 and ends at 226. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [221.0], and this function return a value. It declare 1....
Yelp_pyramid_swagger
NodeWalker
public
0
1
__init__
def __init__(self, info):pass
1
2
2
8
0
230
231
230
self
[]
None
{}
0
2
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 NodeWalker, that inherit another class.The function start at line 230 and ends at 231. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [230.0] and does not return any value. It has 6243.0 functions ...
Yelp_pyramid_swagger
YamlRendererFactory
public
0
1
__call__
def __call__(self, value, system):response = system['request'].responseresponse.headers['Content-Type'] = 'application/x-yaml; charset=UTF-8'return yaml.safe_dump(value).encode('utf-8')
1
4
3
37
0
233
236
233
self,value,system
[]
Returns
{"Assign": 2, "Return": 1}
2
4
2
["encode", "yaml.safe_dump"]
50
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3561509_collective_solgema_fullcalendar.Solgema.fullcalendar.browser.views_py.SolgemaFullcalendarEventJS.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3598540_saltstack_salt_testing.salttesting.runtests_p...
The function (__call__) defined within the public class called YamlRendererFactory, that inherit another class.The function start at line 233 and ends at 236. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [233.0], and this function return a value. It declares...
Yelp_pyramid_swagger
public
public
0
0
build_swagger_20_swagger_schema_views
def build_swagger_20_swagger_schema_views(config):settings = config.registry.settingsif settings.get('pyramid_swagger.dereference_served_schema'):views = _build_dereferenced_swagger_20_schema_views(config)else:views = _build_swagger_20_schema_views(config)return views
2
7
1
36
2
239
245
239
config
['settings', 'views']
Returns
{"Assign": 3, "If": 1, "Return": 1}
3
7
3
["settings.get", "_build_dereferenced_swagger_20_schema_views", "_build_swagger_20_schema_views"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.__init___py.includeme"]
The function (build_swagger_20_swagger_schema_views) defined within the public class called public.The function start at line 239 and ends at 245. 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 declares 3.0 functions, ...
Yelp_pyramid_swagger
public
public
0
0
_build_dereferenced_swagger_20_schema_views.view_for_swagger_schema
def view_for_swagger_schema(request):settings = config.registry.settingsresolved_dict = settings.get('pyramid_swagger.schema20_resolved')if not resolved_dict:resolved_dict = settings['pyramid_swagger.schema20'].flattened_specsettings['pyramid_swagger.schema20_resolved'] = resolved_dictreturn resolved_dict
2
7
1
40
0
249
255
249
null
[]
None
null
0
0
0
null
0
null
The function (_build_dereferenced_swagger_20_schema_views.view_for_swagger_schema) defined within the public class called public.The function start at line 249 and ends at 255. 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..
Yelp_pyramid_swagger
public
public
0
0
_build_dereferenced_swagger_20_schema_views
def _build_dereferenced_swagger_20_schema_views(config):def view_for_swagger_schema(request):settings = config.registry.settingsresolved_dict = settings.get('pyramid_swagger.schema20_resolved')if not resolved_dict:resolved_dict = settings['pyramid_swagger.schema20'].flattened_specsettings['pyramid_swagger.schema20_reso...
2
11
1
50
3
248
265
248
config
['route_name', 'settings', 'resolved_dict']
Returns
{"Assign": 5, "Expr": 1, "For": 1, "If": 1, "Return": 1}
4
18
4
["settings.get", "format", "PyramidEndpoint", "format"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.api_py.build_swagger_20_swagger_schema_views"]
The function (_build_dereferenced_swagger_20_schema_views) defined within the public class called public.The function start at line 248 and ends at 265. It contains 11 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 4.0 func...
Yelp_pyramid_swagger
public
public
0
0
_build_swagger_20_schema_views.view_for_swagger_schema
def view_for_swagger_schema(request):_, ext = os.path.splitext(request.path)ext = ext.lstrip('.')base_path = config.registry.settings\.get('pyramid_swagger.base_path_api_docs', '').rstrip('/')key_path = request.path_info[len(base_path):]actual_fname = file_map[key_path]with spec.resolver.resolving(actual_fname) as spec...
1
12
1
100
0
276
291
276
null
[]
None
null
0
0
0
null
0
null
The function (_build_swagger_20_schema_views.view_for_swagger_schema) defined within the public class called public.The function start at line 276 and ends at 291. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
_build_swagger_20_schema_views
def _build_swagger_20_schema_views(config):spec = config.registry.settings['pyramid_swagger.schema20']walker = NodeWalkerForRefFiles()all_files = walker.walk(spec)file_map = {}def view_for_swagger_schema(request):_, ext = os.path.splitext(request.path)ext = ext.lstrip('.')base_path = config.registry.settings\.get('pyra...
3
19
1
118
14
268
305
268
config
['ref_fname_parts', 'base_path', 'key_path', 'walker', 'all_files', 'actual_fname', 'file_map', 'spec', 'clean_response', 'ref_walker', 'route_name', 'ext', 'path', 'fixed_spec']
Returns
{"Assign": 16, "Expr": 1, "For": 2, "Return": 1, "With": 1}
17
38
17
["NodeWalkerForRefFiles", "walker.walk", "os.path.splitext", "ext.lstrip", "rstrip", "config.registry.settings.get", "len", "spec.resolver.resolving", "strip_xscope", "NodeWalkerForCleaningRefs", "ref_walker.walk", "os.path.splitext", "pathname2url", "format", "ref_fname.replace", "format", "PyramidEndpoint"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.api_py.build_swagger_20_swagger_schema_views"]
The function (_build_swagger_20_schema_views) defined within the public class called public.The function start at line 268 and ends at 305. It contains 19 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 17.0 functions, It ha...
Yelp_pyramid_swagger
RequestValidationError
public
0
1
__init__
def __init__(self, *args, **kwargs):self.child = kwargs.pop('child', None)super(RequestValidationError, self).__init__(*args, **kwargs)
1
3
3
38
0
14
16
14
self,*args,**kwargs
[]
None
{"Assign": 1, "Expr": 1}
3
3
3
["kwargs.pop", "__init__", "super"]
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 RequestValidationError, that inherit another class.The function start at line 14 and ends at 16. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [14.0] and does not return any value. It declares 3.0...
Yelp_pyramid_swagger
RequestValidationError
public
0
1
__init__
def __init__(self, *args, **kwargs):self.child = kwargs.pop('child', None)super(RequestValidationError, self).__init__(*args, **kwargs)
1
3
3
38
0
20
22
14
self,*args,**kwargs
[]
None
{"Assign": 1, "Expr": 1}
3
3
3
["kwargs.pop", "__init__", "super"]
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 RequestValidationError, that inherit another class.The function start at line 20 and ends at 22. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [14.0] and does not return any value. It declares 3.0...
Yelp_pyramid_swagger
RequestValidationError
public
0
1
__init__
def __init__(self, *args, **kwargs):self.child = kwargs.pop('child', None)super(RequestValidationError, self).__init__(*args, **kwargs)
1
3
3
38
0
26
28
14
self,*args,**kwargs
[]
None
{"Assign": 1, "Expr": 1}
3
3
3
["kwargs.pop", "__init__", "super"]
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 RequestValidationError, that inherit another class.The function start at line 26 and ends at 28. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [14.0] and does not return any value. It declares 3.0...
Yelp_pyramid_swagger
RequestValidationError
public
0
1
__init__
def __init__(self, *args, **kwargs):self.child = kwargs.pop('child', None)super(RequestValidationError, self).__init__(*args, **kwargs)
1
3
3
38
0
32
34
14
self,*args,**kwargs
[]
None
{"Assign": 1, "Expr": 1}
3
3
3
["kwargs.pop", "__init__", "super"]
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 RequestValidationError, that inherit another class.The function start at line 32 and ends at 34. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [14.0] and does not return any value. It declares 3.0...
Yelp_pyramid_swagger
public
public
0
0
wrap_exception.wrap_exception.generic_exception.wrapper
def wrapper(*args, **kwargs):try:method(*args, **kwargs)except Exception as e:six.reraise(exception_class,exception_class(str(e)),sys.exc_info()[2])
2
8
2
47
0
39
46
39
null
[]
None
null
0
0
0
null
0
null
The function (wrap_exception.wrap_exception.generic_exception.wrapper) defined within the public class called public.The function start at line 39 and ends at 46. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [39.0] and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
wrap_exception.generic_exception
def generic_exception(method):def wrapper(*args, **kwargs):try:method(*args, **kwargs)except Exception as e:six.reraise(exception_class,exception_class(str(e)),sys.exc_info()[2])return wrapper
1
3
1
9
0
38
47
38
null
[]
None
null
0
0
0
null
0
null
The function (wrap_exception.generic_exception) defined within the public class called public.The function start at line 38 and ends at 47. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
wrap_exception
def wrap_exception(exception_class):def generic_exception(method):def wrapper(*args, **kwargs):try:method(*args, **kwargs)except Exception as e:six.reraise(exception_class,exception_class(str(e)),sys.exc_info()[2])return wrapperreturn generic_exception
1
3
1
9
0
37
48
37
exception_class
[]
Returns
{"Expr": 2, "Return": 2, "Try": 1}
5
12
5
["method", "six.reraise", "exception_class", "str", "sys.exc_info"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3692721_yelp_bravado_core.tests.exception.wrap_exception_test_py.test_exception_gets_correctly_wrapped", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3692721_yelp_bravado_core.tests.exception.wrap_exception_test_py...
The function (wrap_exception) defined within the public class called public.The function start at line 37 and ends at 48. 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 call...
Yelp_pyramid_swagger
public
public
0
0
find_resource_names
def find_resource_names(api_docs_json):return [api['path'].lstrip('/') for api in api_docs_json['apis']]
2
2
1
24
0
38
39
38
api_docs_json
[]
Returns
{"Return": 1}
1
2
1
["lstrip"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.build_schema_mapping"]
The function (find_resource_names) defined within the public class called public.The function start at line 38 and ends at 39. 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 function, It has 1.0 function ca...
Yelp_pyramid_swagger
public
public
0
0
find_resource_paths.not_api_doc_file
def not_api_doc_file(filename):return not filename.endswith(API_DOCS_FILENAME)
1
2
1
13
0
46
47
46
null
[]
None
null
0
0
0
null
0
null
The function (find_resource_paths.not_api_doc_file) defined within the public class called public.The function start at line 46 and ends at 47. 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
find_resource_paths.not_swagger_dot_json
def not_swagger_dot_json(filename):# Exclude a Swagger 2.0 schema file if it happens to exist.return not os.path.basename(filename) == 'swagger.json'
1
2
1
17
0
49
51
49
null
[]
None
null
0
0
0
null
0
null
The function (find_resource_paths.not_swagger_dot_json) defined within the public class called public.The function start at line 49 and ends at 51. 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
find_resource_paths.filename_to_path
def filename_to_path(filename):filename, _ext = os.path.splitext(os.path.basename(filename))return '/' + filename
1
3
1
28
0
53
55
53
null
[]
None
null
0
0
0
null
0
null
The function (find_resource_paths.filename_to_path) defined within the public class called public.The function start at line 53 and ends at 55. 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..
Yelp_pyramid_swagger
public
public
0
0
find_resource_paths
def find_resource_paths(schema_dir):"""The inverse of :func:`find_resource_names` used to generatea resource listing from a directory of swagger api docs."""def not_api_doc_file(filename):return not filename.endswith(API_DOCS_FILENAME)def not_swagger_dot_json(filename):# Exclude a Swagger 2.0 schema file if it happens ...
1
8
1
45
1
42
60
42
schema_dir
['filenames']
Returns
{"Assign": 2, "Expr": 1, "Return": 4}
10
19
10
["filename.endswith", "os.path.basename", "os.path.splitext", "os.path.basename", "glob.glob", "format", "map", "filter", "filter", "sorted"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.generate_resource_listing"]
The function (find_resource_paths) defined within the public class called public.The function start at line 42 and ends at 60. 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 10.0 functions, It has 10.0 functio...
Yelp_pyramid_swagger
public
public
0
0
build_schema_mapping.resource_name_to_filepath
def resource_name_to_filepath(name):return os.path.join(schema_dir, '{0}.json'.format(name))
1
2
1
21
0
73
74
73
null
[]
None
null
0
0
0
null
0
null
The function (build_schema_mapping.resource_name_to_filepath) defined within the public class called public.The function start at line 73 and ends at 74. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
build_schema_mapping
def build_schema_mapping(schema_dir, resource_listing):"""Discovers schema file locations and relations.:param schema_dir: the directory schema files live inside:type schema_dir: string:param resource_listing: A swagger resource listing:typeresource_listing: dict:returns: a mapping from resource name to file path:rtype...
2
6
2
29
0
63
79
63
schema_dir,resource_listing
[]
Returns
{"Expr": 1, "Return": 2}
5
17
5
["os.path.join", "format", "dict", "resource_name_to_filepath", "find_resource_names"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.compile_swagger_schema"]
The function (build_schema_mapping) defined within the public class called public.The function start at line 63 and ends at 79. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [63.0], and this function return a value. It declares 5.0 functions, It has 5.0 funct...
Yelp_pyramid_swagger
public
public
0
0
_load_resource_listing
def _load_resource_listing(resource_listing):"""Load the resource listing from file, handling errors.:param resource_listing: path to the api-docs resource listing file:typeresource_listing: string:returns: contents of the resource listing file:rtype: dict"""try:with open(resource_listing) as resource_listing_file:retu...
2
9
1
39
0
82
98
82
resource_listing
[]
Returns
{"Expr": 1, "Return": 1, "Try": 1, "With": 1}
4
17
4
["open", "simplejson.load", "ResourceListingNotFoundError", "format"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.get_resource_listing", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.ingest_test_py.test_proper_error_on_missing_resource_l...
The function (_load_resource_listing) defined within the public class called public.The function start at line 82 and ends at 98. 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 declares 4.0 functions, It has 4.0 functi...
Yelp_pyramid_swagger
public
public
0
0
generate_resource_listing
def generate_resource_listing(schema_dir, listing_base):if 'apis' in listing_base:raise ResourceListingGenerationError("{0}/{1} has an `apis` listing. Generating a listing would ""override this listing.".format(schema_dir, API_DOCS_FILENAME))return dict(listing_base,apis=[{'path': path} for path in find_resource_paths(...
3
9
2
47
0
101
110
101
schema_dir,listing_base
[]
Returns
{"If": 1, "Return": 1}
4
10
4
["ResourceListingGenerationError", "format", "dict", "find_resource_paths"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.get_resource_listing", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.ingest_test_py.test_generate_resource_listing", "_.con...
The function (generate_resource_listing) defined within the public class called public.The function start at line 101 and ends at 110. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [101.0], and this function return a value. It declares 4.0 functions, It has 4...
Yelp_pyramid_swagger
public
public
0
0
get_resource_listing
def get_resource_listing(schema_dir, should_generate_resource_listing):"""Return the resource listing document.:param schema_dir: the directory which contains swagger spec files:typeschema_dir: string:param should_generate_resource_listing: when True a resource listing willbe generated from the list of *.json files in ...
2
6
2
39
2
113
129
113
schema_dir,should_generate_resource_listing
['resource_listing', 'listing_filename']
Returns
{"Assign": 2, "Expr": 1, "If": 1, "Return": 2}
3
17
3
["os.path.join", "_load_resource_listing", "generate_resource_listing"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.get_swagger_schema", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.response_test_py.get_swagger_schema", "_.cont...
The function (get_resource_listing) defined within the public class called public.The function start at line 113 and ends at 129. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [113.0], and this function return a value. It declares 3.0 functions, It has 3.0 fu...
Yelp_pyramid_swagger
public
public
0
0
compile_swagger_schema
def compile_swagger_schema(schema_dir, resource_listing):"""Build a SwaggerSchema from various files.:param schema_dir: the directory schema files live inside:type schema_dir: string:returns: a SwaggerSchema object"""mapping = build_schema_mapping(schema_dir, resource_listing)resource_validators = ingest_resources(mapp...
1
5
2
42
3
132
142
132
schema_dir,resource_listing
['mapping', 'resource_validators', 'endpoints']
Returns
{"Assign": 3, "Expr": 1, "Return": 1}
5
11
5
["build_schema_mapping", "ingest_resources", "list", "build_swagger_12_endpoints", "SwaggerSchema"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.get_swagger_schema", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.response_test_py.get_swagger_schema", "_.cont...
The function (compile_swagger_schema) defined within the public class called public.The function start at line 132 and ends at 142. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [132.0], and this function return a value. It declares 5.0 functions, It has 5.0 ...
Yelp_pyramid_swagger
public
public
0
0
get_swagger_schema
def get_swagger_schema(settings):"""Return a :class:`pyramid_swagger.model.SwaggerSchema` constructed fromthe swagger specs in `pyramid_swagger.schema_directory`. If`pyramid_swagger.enable_swagger_spec_validation` is enabled the schemawill be validated before returning it.:param settings: a pyramid registry settings wi...
2
9
1
54
2
145
165
145
settings
['resource_listing', 'schema_dir']
Returns
{"Assign": 2, "Expr": 2, "If": 1, "Return": 1}
6
21
6
["settings.get", "get_resource_listing", "settings.get", "settings.get", "validate_swagger_schema", "compile_swagger_schema"]
5
["_.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.tests.acceptance.response_test_py._validate_against_tween", "_.conten...
The function (get_swagger_schema) defined within the public class called public.The function start at line 145 and ends at 165. 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 declares 6.0 functions, It has 6.0 function...
Yelp_pyramid_swagger
public
public
0
0
get_swagger_spec
def get_swagger_spec(settings):"""Return a :class:`bravado_core.spec.Spec` constructed fromthe swagger specs in `pyramid_swagger.schema_directory`. If`pyramid_swagger.enable_swagger_spec_validation` is enabled the schemawill be validated before returning it.:param settings: a pyramid registry settings with configuratio...
1
13
1
94
7
168
192
168
settings
['schema_url', 'spec_dict', 'schema_dir', 'handlers', 'file_handler', 'schema_filename', 'schema_path']
Returns
{"Assign": 7, "Expr": 1, "Return": 1}
10
25
10
["settings.get", "settings.get", "os.path.join", "urlparse.urljoin", "pathname2url", "os.path.abspath", "build_http_handlers", "file_handler", "Spec.from_dict", "create_bravado_core_config"]
3
["_.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.tests.acceptance.response20_test_py._validate_against_tween", "_.cont...
The function (get_swagger_spec) defined within the public class called public.The function start at line 168 and ends at 192. It contains 13 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 10.0 functions, It has 10.0 functio...
Yelp_pyramid_swagger
public
public
0
0
create_bravado_core_config
def create_bravado_core_config(settings):"""Create a configuration dict for bravado_core based on pyramid_swaggersettings.:param settings: pyramid registry settings with configuration forbuilding a swagger schema:type settings: dict:returns: config dict suitable for passing intobravado_core.spec.Spec.from_dict(..):rtyp...
5
23
1
103
2
195
230
195
settings
['configs', 'config_keys']
Returns
{"Assign": 2, "Expr": 3, "Return": 1}
6
36
6
["configs.update", "iteritems", "configs.update", "key.replace", "iteritems", "key.startswith"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.get_swagger_spec", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.ingest_test_py.test_create_bravado_core_config_non_empty_d...
The function (create_bravado_core_config) defined within the public class called public.The function start at line 195 and ends at 230. It contains 23 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 6.0 functions, It has 6.0...
Yelp_pyramid_swagger
public
public
0
0
ingest_resources
def ingest_resources(mapping, schema_dir):"""Consume the Swagger schemas and produce a queryable datastructure.:param mapping: Map from resource name to filepath of its api declaration:type mapping: dict:param schema_dir: the directory schema files live inside:type schema_dir: string:returns: A list of mapping from :cl...
3
13
2
55
1
233
256
233
mapping,schema_dir
['ingested_resources']
Returns
{"Assign": 1, "Expr": 2, "For": 1, "Return": 1, "Try": 1}
5
24
5
["iteritems", "ingested_resources.append", "load_schema", "ApiDeclarationNotFoundError", "format"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.compile_swagger_schema", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.ingest_test_py.test_proper_error_on_missing_api_decl...
The function (ingest_resources) defined within the public class called public.The function start at line 233 and ends at 256. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [233.0], and this function return a value. It declares 5.0 functions, It has 5.0 funct...
Yelp_pyramid_swagger
public
public
0
0
build_param_schema
def build_param_schema(schema, param_type):"""Turn a swagger endpoint schema into an equivalent one to validate ourrequest.As an example, this would take this swagger schema:{"paramType": "query","name": "query","description": "Location to query","type": "string","required": true}To this jsonschema:{"type": "object","a...
3
9
2
52
1
37
74
37
schema,param_type
['properties']
Returns
{"Assign": 1, "Expr": 1, "If": 1, "Return": 2}
2
38
2
["filter_params_by_type", "dict"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.ValidatorMap.from_operation"]
The function (build_param_schema) defined within the public class called public.The function start at line 37 and ends at 74. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [37.0], and this function return a value. It declares 2.0 functions, It has 2.0 functio...
Yelp_pyramid_swagger
public
public
0
0
filter_params_by_type
def filter_params_by_type(schema, param_type):return [s for s in schema['parameters'] if s['paramType'] == param_type]
3
2
2
25
0
77
78
77
schema,param_type
[]
Returns
{"Return": 1}
0
2
0
[]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.build_param_schema", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.extract_body_schema"]
The function (filter_params_by_type) defined within the public class called public.The function start at line 77 and ends at 78. It contains 2 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [77.0], and this function return a value. It has 2.0 functions calling this function...
Yelp_pyramid_swagger
public
public
0
0
extract_body_schema
def extract_body_schema(schema):"""Return the body parameter schema from an operation schema."""matching_body_schemas = filter_params_by_type(schema, 'body')# There can be only one body paramreturn matching_body_schemas[0] if matching_body_schemas else None
2
3
1
23
1
81
85
81
schema
['matching_body_schemas']
Returns
{"Assign": 1, "Expr": 1, "Return": 1}
1
5
1
["filter_params_by_type"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.ValidatorMap.from_operation"]
The function (extract_body_schema) defined within the public class called public.The function start at line 81 and ends at 85. 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 declare 1.0 function, It has 1.0 function ca...
Yelp_pyramid_swagger
public
public
0
0
ignore
def ignore(_validator, *args):"""A validator which performs no validation. Used to `ignore` some schemafields during validation."""return
1
2
2
10
0
88
92
88
_validator,*args
[]
None
{"Expr": 1, "Return": 1}
0
5
0
[]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3957748_hotdoc_hotdoc.hotdoc.utils.utils_py.recursive_overwrite"]
The function (ignore) defined within the public class called public.The function start at line 88 and ends at 92. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [88.0] and does not return any value. It has 1.0 function calling this function which is ["_.conten...
Yelp_pyramid_swagger
public
public
0
0
build_swagger_type_validator.swagger_type_validator
def swagger_type_validator(validator, ref, instance, schema):if ref in models:return _ref_validator(validator, ref, instance, schema)else:return _draft4_type_validator(validator, ref, instance, schema)
2
5
4
40
0
96
100
96
null
[]
None
null
0
0
0
null
0
null
The function (build_swagger_type_validator.swagger_type_validator) defined within the public class called public.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 4 parameters, represented as [96.0] and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
build_swagger_type_validator
def build_swagger_type_validator(models):def swagger_type_validator(validator, ref, instance, schema):if ref in models:return _ref_validator(validator, ref, instance, schema)else:return _draft4_type_validator(validator, ref, instance, schema)return swagger_type_validator
1
3
1
9
0
95
102
95
models
[]
Returns
{"If": 1, "Return": 3}
2
8
2
["_ref_validator", "_draft4_type_validator"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.get_body_validator"]
The function (build_swagger_type_validator) defined within the public class called public.The function start at line 95 and ends at 102. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 2.0 functions, It has 2.0...
Yelp_pyramid_swagger
public
public
0
0
type_validator
def type_validator(validator, types, instance, schema):"""Swagger 1.2 supports parameters of 'type': 'File'. Skip validation ofthe 'type' field in this case."""if schema.get('type') == 'File':return []return _draft3_type_validator(validator, types, instance, schema)
2
4
4
36
0
105
111
105
validator,types,instance,schema
[]
Returns
{"Expr": 1, "If": 1, "Return": 2}
2
7
2
["schema.get", "_draft3_type_validator"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3692721_yelp_bravado_core.tests.swagger20_validator.type_validator_test_py.test_skip_when_nullable_property_schema_and_value_is_None", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3692721_yelp_bravado_core.tests.sw...
The function (type_validator) defined within the public class called public.The function start at line 105 and ends at 111. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [105.0], and this function return a value. It declares 2.0 functions, It has 2.0 function...
Yelp_pyramid_swagger
public
public
0
0
required_validator
def required_validator(validator, req, instance, schema):"""Swagger 1.2 expects `required` to be a bool in the Parameter object, buta list of properties in a Model object."""if schema.get('paramType'):if req is True and not instance:return [ValidationError("%s is required" % schema['name'])]return []return _draft4_requ...
4
6
4
54
0
114
122
114
validator,req,instance,schema
[]
Returns
{"Expr": 1, "If": 2, "Return": 3}
3
9
3
["schema.get", "ValidationError", "_draft4_required_validator"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3692721_yelp_bravado_core.tests.swagger20_validator.required_validator_test_py.test_call_to_jsonschema_if_not_param", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3692721_yelp_bravado_core.tests.swagger20_validator...
The function (required_validator) defined within the public class called public.The function start at line 114 and ends at 122. It contains 6 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [114.0], and this function return a value. It declares 3.0 functions, It has 3.0 func...
Yelp_pyramid_swagger
public
public
0
0
get_body_validator
def get_body_validator(models):"""Returns a validator for the request body, based on a:class:`jsonschema.validators.Draft4Validator`, with extra validationsadded for swaggers extensions to jsonschema.:param models: a mapping of reference to models:returns: a :class:`jsonschema.validators.Validator` which can validateth...
1
10
1
35
0
125
142
125
models
[]
Returns
{"Expr": 1, "Return": 1}
2
18
2
["validators.extend", "build_swagger_type_validator"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.ValidatorMap.from_operation"]
The function (get_body_validator) defined within the public class called public.The function start at line 125 and ends at 142. It contains 10 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 functio...
Yelp_pyramid_swagger
ValidatorMap
public
0
1
from_operation
def from_operation(cls, operation, models, resolver):args = []for schema, validator in [(build_param_schema(operation, 'query'), Swagger12ParamValidator),(build_param_schema(operation, 'path'), Swagger12ParamValidator),(build_param_schema(operation, 'form'), Swagger12ParamValidator),(build_param_schema(operation, 'head...
2
16
4
111
0
165
181
165
cls,operation,models,resolver
[]
Returns
{"Assign": 1, "Expr": 1, "For": 1, "Return": 1}
10
17
10
["build_param_schema", "build_param_schema", "build_param_schema", "build_param_schema", "extract_body_schema", "get_body_validator", "extract_response_body_schema", "args.append", "SchemaValidator.from_schema", "cls"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.build_request_to_validator_map"]
The function (from_operation) defined within the public class called ValidatorMap, that inherit another class.The function start at line 165 and ends at 181. It contains 16 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [165.0], and this function return a value. It declares...
Yelp_pyramid_swagger
SchemaValidator
public
0
1
__init__
def __init__(self, schema, validator):self.schema = schemaself.validator = validator
1
3
3
19
0
195
197
195
self,schema,validator
[]
None
{"Assign": 2}
0
3
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 SchemaValidator, that inherit another class.The function start at line 195 and ends at 197. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [195.0] and does not return any value. It has 6243.0 funct...
Yelp_pyramid_swagger
SchemaValidator
public
0
1
from_schema
def from_schema(cls, schema, resolver, validator_class):type_checker = deepcopy(validator_class.TYPE_CHECKER)type_checker.redefine_many({type_name: lambda checker, value: all(check(value) for check in checks)for type_name, checks in iteritems(EXTENDED_TYPES)})extended_validator_class = jsonschema.validators.extend(vali...
3
13
4
82
0
200
212
200
cls,schema,resolver,validator_class
[]
Returns
{"Assign": 2, "Expr": 1, "Return": 1}
8
13
8
["deepcopy", "type_checker.redefine_many", "all", "check", "iteritems", "jsonschema.validators.extend", "cls", "extended_validator_class"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.ValidatorMap.from_operation"]
The function (from_schema) defined within the public class called SchemaValidator, that inherit another class.The function start at line 200 and ends at 212. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [200.0], and this function return a value. It declares...
Yelp_pyramid_swagger
SchemaValidator
public
0
1
validate
def validate(self, values):"""Validate a :class:`dict` of values. If `self.schema` is falsy thisis a noop."""if not self.schema or (values is None and not self.schema.get('required', False)):returnself.validator.validate(values)
4
4
2
41
0
214
220
214
self,values
[]
None
{"Expr": 2, "If": 1, "Return": 1}
2
7
2
["self.schema.get", "self.validator.validate"]
266
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3527220_mitar_django_mongo_auth.mongo_auth.contrib.fields_py.LimitedDateTimeField.validate", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537748_rainerf_ricodebug.src.lib.formlayout_py.is_edit_valid", "_.content.g...
The function (validate) defined within the public class called SchemaValidator, that inherit another class.The function start at line 214 and ends at 220. It contains 4 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [214.0] and does not return any value. It declares 2.0 fun...
Yelp_pyramid_swagger
public
public
0
0
build_request_to_validator_map
def build_request_to_validator_map(schema, resolver):"""Build a mapping from :class:`RequestMatcher` to :class:`ValidatorMap`for each operation in the API spec. This mapping may be used to retrievethe appropriate validators for a request."""schema_models = schema.get('models', {})return dict((RequestMatcher(api['path']...
3
10
2
62
1
223
236
223
schema,resolver
['schema_models']
Returns
{"Assign": 1, "Expr": 1, "Return": 1}
4
14
4
["schema.get", "dict", "RequestMatcher", "ValidatorMap.from_operation"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.load_schema"]
The function (build_request_to_validator_map) defined within the public class called public.The function start at line 223 and ends at 236. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [223.0], and this function return a value. It declares 4.0 functions, It...
Yelp_pyramid_swagger
SchemaValidator
public
0
1
__init__
def __init__(self, schema, validator):self.schema = schemaself.validator = validator
1
3
3
19
0
242
244
195
self,schema,validator
[]
None
{"Assign": 2}
0
3
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 SchemaValidator, that inherit another class.The function start at line 242 and ends at 244. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [195.0] and does not return any value. It has 6243.0 funct...
Yelp_pyramid_swagger
RequestMatcher
public
0
1
matches
def matches(self, request):""":param request: a :class:`pyramid.request.Request`:returns: True if this matcher matches the request, False otherwise"""return partial_path_match(request.path_info, self.path) and request.method == self.method
2
2
2
27
0
246
251
246
self,request
[]
Returns
{"Expr": 1, "Return": 1}
1
6
1
["partial_path_match"]
9
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3535398_idsia_brainstorm.brainstorm.layers.base_layer_py.Layer._validate_in_shapes", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3607851_andsens_bootstrap_vz.bootstrapvz.remote.build_servers.__init___py.pick_build...
The function (matches) defined within the public class called RequestMatcher, that inherit another class.The function start at line 246 and ends at 251. It contains 2 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [246.0], and this function return a value. It declare 1.0 fu...
Yelp_pyramid_swagger
public
public
0
0
extract_response_body_schema
def extract_response_body_schema(operation, schema_models):if operation['type'] in schema_models:return extract_validatable_type(operation['type'], schema_models)acceptable_fields = ('type', '$ref', 'format', 'defaultValue', 'enum', 'minimum','maximum', 'items', 'uniqueItems')return dict((field, operation[field])for fi...
4
12
2
66
1
254
267
254
operation,schema_models
['acceptable_fields']
Returns
{"Assign": 1, "If": 1, "Return": 2}
2
14
2
["extract_validatable_type", "dict"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.ValidatorMap.from_operation"]
The function (extract_response_body_schema) defined within the public class called public.The function start at line 254 and ends at 267. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [254.0], and this function return a value. It declares 2.0 functions, It h...
Yelp_pyramid_swagger
public
public
0
0
extract_validatable_type
def extract_validatable_type(type_name, models):"""Returns a jsonschema-compatible typename from the Swagger type.This is necessary because for our Swagger specs to be compatible withswagger-ui, they must not use a $ref to internal models.:returns: A key-value that jsonschema can validate. Key will be either'type' or '...
2
5
2
27
0
270
283
270
type_name,models
[]
Returns
{"Expr": 1, "If": 1, "Return": 2}
0
14
0
[]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.extract_response_body_schema"]
The function (extract_validatable_type) defined within the public class called public.The function start at line 270 and ends at 283. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [270.0], and this function return a value. It has 1.0 function calling this fun...
Yelp_pyramid_swagger
public
public
0
0
load_schema
def load_schema(schema_path):"""Prepare the api specification for request and response validation.:returns: a mapping from :class:`RequestMatcher` to :class:`ValidatorMap`for every operation in the api specification.:rtype: dict"""with open(schema_path, 'r') as schema_file:schema = simplejson.load(schema_file)resolver ...
1
5
1
49
2
286
296
286
schema_path
['schema', 'resolver']
Returns
{"Assign": 2, "Expr": 1, "Return": 1, "With": 1}
5
11
5
["open", "simplejson.load", "RefResolver", "schema.get", "build_request_to_validator_map"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.ingest_resources"]
The function (load_schema) defined within the public class called public.The function start at line 286 and ends at 296. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 5.0 functions, It has 5.0 functions calle...
Yelp_pyramid_swagger
SwaggerSchema
public
0
1
__init__
def __init__(self, pyramid_endpoints, resource_validators):self.pyramid_endpoints = pyramid_endpointsself.resource_validators = resource_validators
1
3
3
19
0
37
39
37
self,pyramid_endpoints,resource_validators
[]
None
{"Assign": 2}
0
3
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 SwaggerSchema, that inherit another class.The function start at line 37 and ends at 39. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [37.0] and does not return any value. It has 6243.0 functions ...
Yelp_pyramid_swagger
SwaggerSchema
public
0
1
validators_for_request
def validators_for_request(self, request, **kwargs):"""Takes a request and returns a validator mapping for the request.:param request: A Pyramid request to fetch schemas for:type request: :class:`pyramid.request.Request`:returns: a :class:`pyramid_swagger.load_schema.ValidatorMap` which canbe used to validate `request`...
4
9
3
52
0
41
57
41
self,request,**kwargs
[]
Returns
{"Expr": 1, "For": 2, "If": 1, "Return": 1}
4
17
4
["resource_validator.items", "matcher.matches", "PathNotMatchedError", "format"]
0
[]
The function (validators_for_request) defined within the public class called SwaggerSchema, that inherit another class.The function start at line 41 and ends at 57. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [41.0], and this function return a value. It dec...
Yelp_pyramid_swagger
SwaggerSchema
public
0
1
get_api_doc_endpoints
def get_api_doc_endpoints(self):return self.pyramid_endpoints
1
2
1
9
0
59
60
59
self
[]
Returns
{"Return": 1}
0
2
0
[]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.__init___py.includeme"]
The function (get_api_doc_endpoints) defined within the public class called SwaggerSchema, that inherit another class.The function start at line 59 and ends at 60. 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 1.0...
Yelp_pyramid_swagger
public
public
0
0
partial_path_match
def partial_path_match(path1, path2, kwarg_re=r'\{.*\}'):"""Validates if path1 and path2 matches, ignoring any kwargs in the string.We need this to ensure we can match Swagger patterns like:/foo/{id}against the observed pyramid path/foo/1:param path1: path of a url:type path1: string:param path2: path of a url:type pat...
6
12
3
88
3
63
89
63
path1,path2,kwarg_re
['pat', 'split_p2', 'split_p1']
Returns
{"Assign": 3, "Expr": 1, "For": 1, "If": 3, "Return": 3}
8
27
8
["path1.split", "path2.split", "re.compile", "len", "len", "zip", "pat.match", "pat.match"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.load_schema_py.RequestMatcher.matches", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.model_test_py.test_partial_path_match"]
The function (partial_path_match) defined within the public class called public.The function start at line 63 and ends at 89. It contains 12 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [63.0], and this function return a value. It declares 8.0 functions, It has 8.0 functi...
Yelp_pyramid_swagger
PyramidSwaggerRendererFactory
public
0
1
__init__
def __init__(self, renderer_factory=JSON()):self.renderer_factory = renderer_factory
1
2
2
16
0
17
18
17
self,renderer_factory
[]
None
{"Assign": 1}
1
2
1
["JSON"]
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 PyramidSwaggerRendererFactory, that inherit another class.The function start at line 17 and ends at 18. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [17.0] and does not return any value. It decla...
Yelp_pyramid_swagger
PyramidSwaggerRendererFactory
public
0
1
_marshal_object
def _marshal_object(self, request, response_object):# operation attribute is injected by validator_tween in case the endpoint is served by Swagger 2.0 specsoperation = getattr(request, 'operation', None)if not operation:# If the request is not served by Swagger2.0 endpoint _marshal_object is NO_OPreturn response_object...
3
16
3
83
0
20
40
20
self,request,response_object
[]
Returns
{"Assign": 2, "If": 1, "Return": 3, "Try": 1}
3
21
3
["getattr", "get_response_spec", "marshal_schema_object"]
0
[]
The function (_marshal_object) defined within the public class called PyramidSwaggerRendererFactory, that inherit another class.The function start at line 20 and ends at 40. It contains 16 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [20.0], and this function return a val...
Yelp_pyramid_swagger
PyramidSwaggerRendererFactory
public
0
1
_render
def _render(self, external_renderer, value, system):value = self._marshal_object(system['request'], value)return external_renderer(value, system)
1
3
4
31
0
42
44
42
self,external_renderer,value,system
[]
Returns
{"Assign": 1, "Return": 1}
2
3
2
["self._marshal_object", "external_renderer"]
0
[]
The function (_render) defined within the public class called PyramidSwaggerRendererFactory, that inherit another class.The function start at line 42 and ends at 44. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [42.0], and this function return a value. It de...
Yelp_pyramid_swagger
PyramidSwaggerRendererFactory
public
0
1
__call__
def __call__(self, info):return partial(self._render, self.renderer_factory(info))
1
2
2
21
0
46
47
46
self,info
[]
Returns
{"Return": 1}
2
2
2
["partial", "self.renderer_factory"]
50
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3561509_collective_solgema_fullcalendar.Solgema.fullcalendar.browser.views_py.SolgemaFullcalendarEventJS.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3598540_saltstack_salt_testing.salttesting.runtests_p...
The function (__call__) defined within the public class called PyramidSwaggerRendererFactory, that inherit another class.The function start at line 46 and ends at 47. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [46.0], and this function return a value. It d...
Yelp_pyramid_swagger
public
public
0
0
validate_swagger_schema
def validate_swagger_schema(schema_dir, resource_listing):"""Validate the structure of Swagger schemas against the spec.**Valid only for Swagger v1.2 spec**Note: It is possible that resource_listing is not present inthe schema_dir. The path is passed in the call so that ssvcan fetch the api-declaration files from the p...
1
6
2
48
1
20
39
20
schema_dir,resource_listing
['schema_filepath']
None
{"Assign": 1, "Expr": 2}
6
20
6
["os.path.join", "swagger_spec_validator.validator12.validate_spec", "urlparse.urljoin", "pathname2url", "os.path.abspath", "wrap_exception"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.pyramid_swagger.ingest_py.get_swagger_schema", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.spec_test_py.test_proper_error_on_missing_api_declaratio...
The function (validate_swagger_schema) defined within the public class called public.The function start at line 20 and ends at 39. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [20.0] and does not return any value. It declares 6.0 functions, It has 6.0 functi...
Yelp_pyramid_swagger
public
public
0
0
noop_context
def noop_context(request, response=None):yield
1
2
2
10
0
89
90
89
request,response
[]
None
{"Expr": 1}
0
2
0
[]
0
[]
The function (noop_context) defined within the public class called public.The function start at line 89 and ends at 90. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [89.0] and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
_get_validation_context
def _get_validation_context(registry):validation_context_path = registry.settings.get('pyramid_swagger.validation_context_path',)if validation_context_path:m = re.match(r'(?P<module_path>.*)\.(?P<contextmanager_name>.*)',validation_context_path,)module_path = m.group('module_path')contextmanager_name = m.group('context...
2
17
1
66
4
93
111
93
registry
['m', 'validation_context_path', 'module_path', 'contextmanager_name']
Returns
{"Assign": 4, "If": 1, "Return": 2}
6
19
6
["registry.settings.get", "re.match", "m.group", "m.group", "getattr", "__import__"]
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 (_get_validation_context) defined within the public class called public.The function start at line 93 and ends at 111. It contains 17 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 6.0 functions, It has 6.0 fun...
Yelp_pyramid_swagger
public
public
0
0
get_swagger_objects
def get_swagger_objects(settings, route_info, registry):"""Returns appropriate swagger handler and swagger spec schema.Swagger Handler contains callables that isolate implementation differencesin the tween to handle both Swagger 1.2 and Swagger 2.0.Exception is made when `settings.prefer_20_routes` are non-empty and['1...
8
16
3
96
3
114
147
114
settings,route_info,registry
['schema20', 'schema12', 'enabled_swagger_versions']
Returns
{"Assign": 3, "Expr": 1, "If": 3, "Return": 3}
2
34
2
["get_swagger_versions", "route_info.get"]
7
["_.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_get_swagger12_objects_if_both_pr...
The function (get_swagger_objects) defined within the public class called public.The function start at line 114 and ends at 147. It contains 16 lines of code and it has a cyclomatic complexity of 8. It takes 3 parameters, represented as [114.0], and this function return a value. It declares 2.0 functions, It has 2.0 fu...
Yelp_pyramid_swagger
public
public
0
0
validation_tween_factory.validation_tween_factory.validator_tween.operation
def operation(_):return op_or_validators_map if isinstance(op_or_validators_map, Operation) else None
2
2
1
16
0
182
183
182
null
[]
None
null
0
0
0
null
0
null
The function (validation_tween_factory.validation_tween_factory.validator_tween.operation) defined within the public class called public.The function start at line 182 and ends at 183. It contains 2 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any ...
Yelp_pyramid_swagger
public
public
0
0
validation_tween_factory.validation_tween_factory.validator_tween.swagger_data
def swagger_data(_):return request_data
1
2
1
7
0
194
195
194
null
[]
None
null
0
0
0
null
0
null
The function (validation_tween_factory.validation_tween_factory.validator_tween.swagger_data) defined within the public class called public.The function start at line 194 and ends at 195. 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 a...
Yelp_pyramid_swagger
public
public
0
0
validation_tween_factory.validator_tween
def validator_tween(request):# We don't have access to this yet but let's go ahead and build the# matchdict so we can validate it and use it to exclude routes from# validation.route_info = route_mapper(request)swagger_handler, spec = get_swagger_objects(settings, route_info,registry)if should_exclude_request(settings, ...
7
30
1
177
0
161
205
161
null
[]
None
null
0
0
0
null
0
null
The function (validation_tween_factory.validator_tween) defined within the public class called public.The function start at line 161 and ends at 205. It contains 30 lines of code and it has a cyclomatic complexity of 7. The function does not take any parameters and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
validation_tween_factory
def validation_tween_factory(handler, registry):"""Pyramid tween for performing validation.Note this is very simple -- it validates requests, responses, and pathswhile delegating to the relevant matching view."""settings = load_settings(registry)route_mapper = registry.queryUtility(IRoutesMapper)validation_context = _g...
1
6
2
32
7
150
207
150
handler,registry
['op_or_validators_map', 'request_data', 'settings', 'validation_context', 'route_info', 'response', 'route_mapper']
Returns
{"Assign": 8, "Expr": 4, "If": 4, "Return": 6, "Try": 1, "With": 3}
22
58
22
["load_settings", "registry.queryUtility", "_get_validation_context", "route_mapper", "get_swagger_objects", "should_exclude_request", "handler", "swagger_handler.op_for_request", "validation_context", "PathNotFoundError", "str", "handler", "isinstance", "request.set_property", "validation_context", "swagger_handler.ha...
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.response20_test_py._validate_against_tween", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.response_test_py._validate_aga...
The function (validation_tween_factory) defined within the public class called public.The function start at line 150 and ends at 207. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [150.0], and this function return a value. It declares 22.0 functions, It has 2...