project_name
string
class_name
string
class_modifiers
string
class_implements
int64
class_extends
int64
function_name
string
function_body
string
cyclomatic_complexity
int64
NLOC
int64
num_parameter
int64
num_token
int64
num_variable
int64
start_line
int64
end_line
int64
function_index
int64
function_params
string
function_variable
string
function_return_type
string
function_body_line_type
string
function_num_functions
int64
function_num_lines
int64
outgoing_function_count
int64
outgoing_function_names
string
incoming_function_count
int64
incoming_function_names
string
lexical_representation
string
Yelp_pyramid_swagger
public
public
0
0
test_200_if_path_arg_is_wrong_type_but_castable
def test_200_if_path_arg_is_wrong_type_but_castable(test_app):assert test_app.get('/sample/nonstring/3/1.4/false',).status_code == 200
1
4
1
17
0
199
202
199
test_app
[]
None
{}
1
4
1
["test_app.get"]
0
[]
The function (test_200_if_path_arg_is_wrong_type_but_castable) defined within the public class called public.The function start at line 199 and ends at 202. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 functi...
Yelp_pyramid_swagger
public
public
0
0
test_400_if_required_body_is_missing
def test_400_if_required_body_is_missing(test_app):assert test_app.post_json('/sample',{},expect_errors=True,).status_code == 400
1
6
1
24
0
205
210
205
test_app
[]
None
{}
1
6
1
["test_app.post_json"]
0
[]
The function (test_400_if_required_body_is_missing) defined within the public class called public.The function start at line 205 and ends at 210. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It...
Yelp_pyramid_swagger
public
public
0
0
test_200_on_json_body_without_contenttype_header
def test_200_on_json_body_without_contenttype_header(test_app):"""See https://github.com/striglia/pyramid_swagger/issues/49."""# We use .post to avoid sending a Content Type of application/json.assert test_app.post('/sample?optional_string=bar',simplejson.dumps({'foo': 'test'}),{'Content-Type': ''},).status_code == 200
1
6
1
35
0
213
220
213
test_app
[]
None
{"Expr": 1}
2
8
2
["test_app.post", "simplejson.dumps"]
0
[]
The function (test_200_on_json_body_without_contenttype_header) defined within the public class called public.The function start at line 213 and ends at 220. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 func...
Yelp_pyramid_swagger
public
public
0
0
test_400_if_body_has_missing_required_arg
def test_400_if_body_has_missing_required_arg(test_app):assert test_app.post_json('/sample',{'bar': 'test'},expect_errors=True,).status_code == 400
1
6
1
27
0
223
228
223
test_app
[]
None
{}
1
6
1
["test_app.post_json"]
0
[]
The function (test_400_if_body_has_missing_required_arg) defined within the public class called public.The function start at line 223 and ends at 228. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, an...
Yelp_pyramid_swagger
public
public
0
0
test_200_if_body_has_missing_optional_arg
def test_200_if_body_has_missing_optional_arg(test_app):assert test_app.post_json('/sample',{'foo': 'test'},).status_code == 200
1
5
1
23
0
231
235
231
test_app
[]
None
{}
1
5
1
["test_app.post_json"]
0
[]
The function (test_200_if_body_has_missing_optional_arg) defined within the public class called public.The function start at line 231 and ends at 235. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, an...
Yelp_pyramid_swagger
public
public
0
0
test_200_if_required_body_is_model
def test_200_if_required_body_is_model(test_app):assert test_app.post_json('/sample',{'foo': 'test', 'bar': 'test'},).status_code == 200
1
5
1
27
0
238
242
238
test_app
[]
None
{}
1
5
1
["test_app.post_json"]
0
[]
The function (test_200_if_required_body_is_model) defined within the public class called public.The function start at line 238 and ends at 242. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It h...
Yelp_pyramid_swagger
public
public
0
0
test_200_if_required_body_is_primitives
def test_200_if_required_body_is_primitives(test_app):assert test_app.post_json('/post_with_primitive_body',['foo', 'bar'],).status_code == 200
1
5
1
23
0
245
249
245
test_app
[]
None
{}
1
5
1
["test_app.post_json"]
0
[]
The function (test_200_if_required_body_is_primitives) defined within the public class called public.The function start at line 245 and ends at 249. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and ...
Yelp_pyramid_swagger
public
public
0
0
test_400_if_extra_body_args
def test_400_if_extra_body_args(test_app):assert test_app.post_json('/sample',{'foo': 'test', 'bar': 'test', 'made_up_argument': 1},expect_errors=True,).status_code == 400
1
6
1
35
0
252
257
252
test_app
[]
None
{}
1
6
1
["test_app.post_json"]
0
[]
The function (test_400_if_extra_body_args) defined within the public class called public.The function start at line 252 and ends at 257. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 ...
Yelp_pyramid_swagger
public
public
0
0
test_400_if_extra_query_args
def test_400_if_extra_query_args(test_app):assert test_app.get('/sample/path_arg1/resource?made_up_argument=1',expect_errors=True,).status_code == 400
1
5
1
21
0
260
264
260
test_app
[]
None
{}
1
5
1
["test_app.get"]
0
[]
The function (test_400_if_extra_query_args) defined within the public class called public.The function start at line 260 and ends at 264. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0...
Yelp_pyramid_swagger
public
public
0
0
test_400_if_missing_required_header
def test_400_if_missing_required_header(test_app):assert test_app.get('/sample/header',expect_errors=True,).status_code == 400
1
5
1
21
0
267
271
267
test_app
[]
None
{}
1
5
1
["test_app.get"]
0
[]
The function (test_400_if_missing_required_header) defined within the public class called public.The function start at line 267 and ends at 271. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It ...
Yelp_pyramid_swagger
public
public
0
0
test_200_with_required_header
def test_200_with_required_header(test_app):response = test_app.get('/sample/header',headers={'X-Force': 'True'},expect_errors=True,)assert response.status_code == 200
1
7
1
32
1
274
280
274
test_app
['response']
None
{"Assign": 1}
1
7
1
["test_app.get"]
0
[]
The function (test_200_with_required_header) defined within the public class called public.The function start at line 274 and ends at 280. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1....
Yelp_pyramid_swagger
public
public
0
0
test_200_skip_validation_when_disabled
def test_200_skip_validation_when_disabled():# calling endpoint with required args missingoverrides = {'pyramid_swagger.enable_request_validation': False,'skip_swagger_data_assert': True,}app = build_test_app(swagger_versions=['2.0'],**overrides)response = app.get('/get_with_non_string_query_args', params={})assert res...
1
11
0
48
3
283
294
283
['overrides', 'app', 'response']
None
{"Assign": 3}
2
12
2
["build_test_app", "app.get"]
0
[]
The function (test_200_skip_validation_when_disabled) defined within the public class called public.The function start at line 283 and ends at 294. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, an...
Yelp_pyramid_swagger
public
public
0
0
test_path_validation_context
def test_path_validation_context():app = build_test_app(swagger_versions=['2.0'],**{'pyramid_swagger.validation_context_path': validation_ctx_path})assert app.get('/does_not_exist').status_code == 206
1
6
0
32
1
297
302
297
['app']
None
{"Assign": 1}
2
6
2
["build_test_app", "app.get"]
0
[]
The function (test_path_validation_context) defined within the public class called public.The function start at line 297 and ends at 302. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2...
Yelp_pyramid_swagger
public
public
0
0
test_request_validation_context
def test_request_validation_context():app = build_test_app(swagger_versions=['2.0'],**{'pyramid_swagger.validation_context_path': validation_ctx_path})response = app.get('/get_with_non_string_query_args', params={})assert response.status_code == 206
1
6
0
40
2
305
310
305
['app', 'response']
None
{"Assign": 2}
2
6
2
["build_test_app", "app.get"]
0
[]
The function (test_request_validation_context) defined within the public class called public.The function start at line 305 and ends at 310. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It ha...
Yelp_pyramid_swagger
public
public
0
0
test_request_to_authenticated_endpoint_without_authentication
def test_request_to_authenticated_endpoint_without_authentication():app = build_test_app(swagger_versions=['2.0'])response = app.get('/sample/authentication',expect_errors=True,)assert response.status_code == 401
1
7
0
33
2
313
319
313
['app', 'response']
None
{"Assign": 2}
2
7
2
["build_test_app", "app.get"]
0
[]
The function (test_request_to_authenticated_endpoint_without_authentication) defined within the public class called public.The function start at line 313 and ends at 319. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It decl...
Yelp_pyramid_swagger
public
public
0
0
test_request_to_endpoint_with_no_response_schema
def test_request_to_endpoint_with_no_response_schema():app = build_test_app(swagger_versions=['2.0'])response = app.get('/sample/no_response_schema')assert response.status_code == 200
1
4
0
28
2
322
325
322
['app', 'response']
None
{"Assign": 2}
2
4
2
["build_test_app", "app.get"]
0
[]
The function (test_request_to_endpoint_with_no_response_schema) defined within the public class called public.The function start at line 322 and ends at 325. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 func...
Yelp_pyramid_swagger
public
public
0
0
_validate_against_tween.handler
def handler(request):return response or Response()
2
2
1
11
0
40
41
40
null
[]
None
null
0
0
0
null
0
null
The function (_validate_against_tween.handler) defined within the public class called public.The function start at line 40 and ends at 41. 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 value..
Yelp_pyramid_swagger
public
public
0
0
_validate_against_tween
def _validate_against_tween(request, response=None, path_pattern='/',**overrides):"""Acceptance testing helper for testing the swagger tween with Swagger 2.0responses.:param request: pyramid request:param response: standard fixture by default:param path_pattern: Path pattern eg. /foo/{bar}:param overrides: dict of over...
1
23
4
149
7
29
69
29
request,response,path_pattern,**overrides
['op', 'mock_route', 'settings', 'mock_route_info', 'spec', 'registry', 'mock_route_mapper']
Returns
{"Assign": 10, "Expr": 2, "Return": 1, "With": 2}
10
41
10
["Response", "dict", "get_swagger_spec", "get_registry", "spec.get_op_for_request", "Mock", "Mock", "patch", "patch", "validation_tween_factory"]
17
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.response20_test_py.test_200_for_good_validated_array_response", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.response20_...
The function (_validate_against_tween) defined within the public class called public.The function start at line 29 and ends at 69. It contains 23 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [29.0], and this function return a value. It declares 10.0 functions, It has 10.0...
Yelp_pyramid_swagger
public
public
0
0
test_response_validation_enabled_by_default
def test_response_validation_enabled_by_default():request = EnhancedDummyRequest(method='GET',path='/sample/path_arg1/resource',params={'required_arg': 'test'},matchdict={'path_arg': 'path_arg1'},)# Omit the logging_info key from the response. If response validation# occurs, we'll fail it.response = Response(body=simpl...
1
16
0
79
2
72
89
72
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
5
18
5
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween"]
0
[]
The function (test_response_validation_enabled_by_default) defined within the public class called public.The function start at line 72 and ends at 89. It contains 16 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions,...
Yelp_pyramid_swagger
public
public
0
0
test_500_when_response_is_missing_required_field
def test_500_when_response_is_missing_required_field():request = EnhancedDummyRequest(method='GET',path='/sample/path_arg1/resource',params={'required_arg': 'test'},matchdict={'path_arg': 'path_arg1'},)# Omit the logging_info key from the response to induce failureresponse = Response(body=simplejson.dumps({'raw_respons...
1
17
0
90
2
92
113
92
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
6
22
6
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween", "str"]
0
[]
The function (test_500_when_response_is_missing_required_field) defined within the public class called public.The function start at line 92 and ends at 113. It contains 17 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 func...
Yelp_pyramid_swagger
public
public
0
0
test_200_when_response_is_void_with_none_response
def test_200_when_response_is_void_with_none_response():request = EnhancedDummyRequest(method='GET',path='/sample/nonstring/{int_arg}/{float_arg}/{boolean_arg}',params={'required_arg': 'test'},matchdict={'int_arg': '1', 'float_arg': '2.0', 'boolean_arg': 'true'},)response = Response(body=simplejson.dumps(None),headers=...
1
15
0
75
2
116
130
116
['request', 'response']
None
{"Assign": 2, "Expr": 1}
4
15
4
["EnhancedDummyRequest", "Response", "simplejson.dumps", "_validate_against_tween"]
0
[]
The function (test_200_when_response_is_void_with_none_response) defined within the public class called public.The function start at line 116 and ends at 130. It contains 15 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 fu...
Yelp_pyramid_swagger
public
public
0
0
test_200_when_response_is_void_with_empty_response
def test_200_when_response_is_void_with_empty_response():request = EnhancedDummyRequest(method='GET',path='/sample/nonstring/{int_arg}/{float_arg}/{boolean_arg}',params={'required_arg': 'test'},matchdict={'int_arg': '1', 'float_arg': '2.0', 'boolean_arg': 'true'},)response = Response(body='{}')_validate_against_tween(r...
1
12
0
61
2
133
144
133
['request', 'response']
None
{"Assign": 2, "Expr": 1}
3
12
3
["EnhancedDummyRequest", "Response", "_validate_against_tween"]
0
[]
The function (test_200_when_response_is_void_with_empty_response) defined within the public class called public.The function start at line 133 and ends at 144. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 f...
Yelp_pyramid_swagger
public
public
0
0
test_500_when_response_arg_is_wrong_type
def test_500_when_response_arg_is_wrong_type():request = EnhancedDummyRequest(method='GET',path='/sample/path_arg1/resource',params={'required_arg': 'test'},matchdict={'path_arg': 'path_arg1'},)response = Response(body=simplejson.dumps({'raw_response': 1.0,# <-- is supposed to be a string'logging_info': {'foo': 'bar'}}...
1
20
0
100
2
147
167
147
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
6
21
6
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween", "str"]
0
[]
The function (test_500_when_response_arg_is_wrong_type) defined within the public class called public.The function start at line 147 and ends at 167. It contains 20 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, ...
Yelp_pyramid_swagger
public
public
0
0
test_500_for_bad_validated_array_response
def test_500_for_bad_validated_array_response():request = EnhancedDummyRequest(method='GET',path='/sample_array_response',)response = Response(body=simplejson.dumps([{"enum_value": "bad_enum_value"}]),headers={'Content-Type': 'application/json; charset=UTF-8'},)with pytest.raises(ResponseValidationError) as excinfo:_va...
1
16
0
77
2
170
186
170
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
6
17
6
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween", "str"]
0
[]
The function (test_500_for_bad_validated_array_response) defined within the public class called public.The function start at line 170 and ends at 186. It contains 16 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions,...
Yelp_pyramid_swagger
public
public
0
0
test_response_not_validated_if_route_in_response_validation_exclude_routes
def test_response_not_validated_if_route_in_response_validation_exclude_routes():request = EnhancedDummyRequest(method='GET',path='/sample_array_response',)response = Response(body='{}',headers={'Content-Type': 'application/json; charset=UTF-8'},)_validate_against_tween(request,response=response,path_pattern='/sample_a...
1
14
0
55
2
189
204
189
['request', 'response']
None
{"Assign": 2, "Expr": 1}
3
16
3
["EnhancedDummyRequest", "Response", "_validate_against_tween"]
0
[]
The function (test_response_not_validated_if_route_in_response_validation_exclude_routes) defined within the public class called public.The function start at line 189 and ends at 204. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any ...
Yelp_pyramid_swagger
public
public
0
0
test_200_for_good_validated_array_response
def test_200_for_good_validated_array_response():request = EnhancedDummyRequest(method='GET',path='/sample_array_response',)response = Response(body=simplejson.dumps([{"enum_value": "good_enum_value"}]),headers={'Content-Type': 'application/json; charset=UTF-8'},)_validate_against_tween(request,response=response,path_p...
1
13
0
57
2
207
220
207
['request', 'response']
None
{"Assign": 2, "Expr": 1}
4
14
4
["EnhancedDummyRequest", "Response", "simplejson.dumps", "_validate_against_tween"]
0
[]
The function (test_200_for_good_validated_array_response) defined within the public class called public.The function start at line 207 and ends at 220. It contains 13 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions...
Yelp_pyramid_swagger
public
public
0
0
test_200_for_normal_response_validation
def test_200_for_normal_response_validation():assert build_test_app(swagger_versions=['2.0'],**{'pyramid_swagger.enable_response_validation': True}).post_json('/sample', {'foo': 'test', 'bar': 'test'},).status_code == 200
1
7
0
40
0
223
229
223
[]
None
{}
2
7
2
["post_json", "build_test_app"]
0
[]
The function (test_200_for_normal_response_validation) defined within the public class called public.The function start at line 223 and ends at 229. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, an...
Yelp_pyramid_swagger
public
public
0
0
test_app_error_if_path_not_in_spec_and_path_validation_disabled
def test_app_error_if_path_not_in_spec_and_path_validation_disabled():"""If path missing and validation is disabled we want to let something elsehandle the error. TestApp throws an AppError, but Pyramid would throw aHTTPNotFound exception."""with pytest.raises(AppError):assert build_test_app(swagger_versions=['2.0'],**...
1
6
0
34
0
232
241
232
[]
None
{"Expr": 1, "With": 1}
3
10
3
["pytest.raises", "get", "build_test_app"]
0
[]
The function (test_app_error_if_path_not_in_spec_and_path_validation_disabled) defined within the public class called public.The function start at line 232 and ends at 241. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It de...
Yelp_pyramid_swagger
public
public
0
0
test_response_validation_context
def test_response_validation_context():request = EnhancedDummyRequest(method='GET',path='/sample/path_arg1/resource',params={'required_arg': 'test'},matchdict={'path_arg': 'path_arg1'},)# Omit the logging_info key from the response.response = Response(body=simplejson.dumps({'raw_response': 'foo'}),headers={'Content-Typ...
1
18
0
86
2
244
263
244
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
5
20
5
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween"]
0
[]
The function (test_response_validation_context) defined within the public class called public.The function start at line 244 and ends at 263. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It ...
Yelp_pyramid_swagger
EnhancedDummyRequest
public
0
1
__init__
def __init__(self, **kw):super(EnhancedDummyRequest, self).__init__(**kw)self.GET = MultiDict(self.GET)# Make sure content_type attr exists is not passed in via **kwself.content_type = getattr(self, 'content_type', None)
1
4
2
42
0
36
40
36
self,**kw
[]
None
{"Assign": 2, "Expr": 1}
4
5
4
["__init__", "super", "MultiDict", "getattr"]
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 EnhancedDummyRequest, that inherit another class.The function start at line 36 and ends at 40. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [36.0] and does not return any value. It declares 4.0 f...
Yelp_pyramid_swagger
public
public
0
0
validation_context
def validation_context(request, response=None):try:yieldexcept Exception:raise CustomResponseValidationException
2
5
2
17
0
44
48
44
request,response
[]
None
{"Expr": 1, "Try": 1}
0
5
0
[]
8
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69279284_espressif_idf_component_manager.idf_component_tools.manager_py.ManifestManager.validate", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69279284_espressif_idf_component_manager.tests.manifest.test_validator...
The function (validation_context) defined within the public class called public.The function start at line 44 and ends at 48. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [44.0] and does not return any value. It has 8.0 functions calling this function which ...
Yelp_pyramid_swagger
public
public
0
0
get_registry
def get_registry(settings):registry = Registry('testing')config = Configurator(registry=registry)if getattr(registry, 'settings', None) is None:config._set_settings(settings)registry.registerUtility(RoutesMapper(), IRoutesMapper)config.commit()return registry
2
8
1
54
2
54
61
54
settings
['config', 'registry']
Returns
{"Assign": 2, "Expr": 3, "If": 1, "Return": 1}
7
8
7
["Registry", "Configurator", "getattr", "config._set_settings", "registry.registerUtility", "RoutesMapper", "config.commit"]
41
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69709075_opennmt_nmt_wizard.server.app.routes_py.launch", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69709075_opennmt_nmt_wizard.server.nmtwizard.task_py.TaskBase.get_docker_image_from_db", "_.content.gdrive.MyDr...
The function (get_registry) defined within the public class called public.The function start at line 54 and ends at 61. It contains 8 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 7.0 functions, It has 7.0 functions called...
Yelp_pyramid_swagger
public
public
0
0
get_swagger_schema
def get_swagger_schema(schema_dir='tests/sample_schemas/good_app/'):return compile_swagger_schema(schema_dir,get_resource_listing(schema_dir, False))
1
5
1
19
0
64
68
64
schema_dir
[]
Returns
{"Return": 1}
2
5
2
["compile_swagger_schema", "get_resource_listing"]
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 64 and ends at 68. 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 2.0 functions, It has 2.0 functions ...
Yelp_pyramid_swagger
public
public
0
0
_validate_against_tween.handler
def handler(request):return response or Response()
2
2
1
11
0
79
80
79
null
[]
None
null
0
0
0
null
0
null
The function (_validate_against_tween.handler) defined within the public class called public.The function start at line 79 and ends at 80. 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 value..
Yelp_pyramid_swagger
public
public
0
0
_validate_against_tween
def _validate_against_tween(request, response=None, **overrides):"""Acceptance testing helper for testing the validation tween with Swagger 1.2responses.:param request: pytest fixture:param response: standard fixture by default"""def handler(request):return response or Response()settings = dict({'pyramid_swagger.swagge...
1
13
3
81
2
71
94
71
request,response,**overrides
['settings', 'registry']
Returns
{"Assign": 4, "Expr": 2, "Return": 1, "With": 1}
6
24
6
["Response", "dict", "get_swagger_schema", "get_registry", "mock.patch.object", "validation_tween_factory"]
17
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.response20_test_py.test_200_for_good_validated_array_response", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.response20_...
The function (_validate_against_tween) defined within the public class called public.The function start at line 71 and ends at 94. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [71.0], and this function return a value. It declares 6.0 functions, It has 6.0 f...
Yelp_pyramid_swagger
public
public
0
0
test_response_validation_enabled_by_default
def test_response_validation_enabled_by_default():request = EnhancedDummyRequest(method='GET',path='/sample/path_arg1/resource',params={'required_arg': 'test'},matchdict={'path_arg': 'path_arg1'},)# Omit the logging_info key from the response. If response validation# occurs, we'll fail it.response = Response(body=simpl...
1
14
0
86
2
98
113
98
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
7
16
7
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween", "str", "pytest.mark.skip"]
0
[]
The function (test_response_validation_enabled_by_default) defined within the public class called public.The function start at line 98 and ends at 113. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions...
Yelp_pyramid_swagger
public
public
0
0
test_500_when_response_is_missing_required_field
def test_500_when_response_is_missing_required_field():request = EnhancedDummyRequest(method='GET',path='/sample/path_arg1/resource',params={'required_arg': 'test'},matchdict={'path_arg': 'path_arg1'},)# Omit the logging_info key from the response.response = Response(body=simplejson.dumps({'raw_response': 'foo'}),heade...
1
14
0
86
2
117
131
117
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
7
15
7
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween", "str", "pytest.mark.skip"]
0
[]
The function (test_500_when_response_is_missing_required_field) defined within the public class called public.The function start at line 117 and ends at 131. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 fun...
Yelp_pyramid_swagger
public
public
0
0
test_200_when_response_is_void_with_none_response
def test_200_when_response_is_void_with_none_response():request = EnhancedDummyRequest(method='GET',path='/sample/nonstring/{int_arg}/{float_arg}/{boolean_arg}',params={'required_arg': 'test'},matchdict={'int_arg': '1', 'float_arg': '2.0', 'boolean_arg': 'true'},)response = Response(body=simplejson.dumps(None),headers=...
1
12
0
71
2
135
146
135
['request', 'response']
None
{"Assign": 2, "Expr": 1}
5
12
5
["EnhancedDummyRequest", "Response", "simplejson.dumps", "_validate_against_tween", "pytest.mark.skip"]
0
[]
The function (test_200_when_response_is_void_with_none_response) defined within the public class called public.The function start at line 135 and ends at 146. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 fu...
Yelp_pyramid_swagger
public
public
0
0
test_200_when_response_is_void_with_empty_response
def test_200_when_response_is_void_with_empty_response():request = EnhancedDummyRequest(method='GET',path='/sample/nonstring/{int_arg}/{float_arg}/{boolean_arg}',params={'required_arg': 'test'},matchdict={'int_arg': '1', 'float_arg': '2.0', 'boolean_arg': 'true'},)response = Response(body='{}')_validate_against_tween(r...
1
9
0
57
2
150
158
150
['request', 'response']
None
{"Assign": 2, "Expr": 1}
4
9
4
["EnhancedDummyRequest", "Response", "_validate_against_tween", "pytest.mark.skip"]
0
[]
The function (test_200_when_response_is_void_with_empty_response) defined within the public class called public.The function start at line 150 and ends at 158. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 fu...
Yelp_pyramid_swagger
public
public
0
0
test_500_when_response_arg_is_wrong_type
def test_500_when_response_arg_is_wrong_type():request = EnhancedDummyRequest(method='GET',path='/sample/path_arg1/resource',params={'required_arg': 'test'},matchdict={'path_arg': 'path_arg1'},)response = Response(body=simplejson.dumps({'raw_response': 1.0,'logging_info': {'foo': 'bar'}}),headers={'Content-Type': 'appl...
1
17
0
96
2
162
178
162
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
7
17
7
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween", "str", "pytest.mark.skip"]
0
[]
The function (test_500_when_response_arg_is_wrong_type) defined within the public class called public.The function start at line 162 and ends at 178. It contains 17 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, ...
Yelp_pyramid_swagger
public
public
0
0
test_500_for_bad_validated_array_response
def test_500_for_bad_validated_array_response():request = EnhancedDummyRequest(method='GET',path='/sample_array_response',)response = Response(body=simplejson.dumps([{"enum_value": "bad_enum_value"}]),headers={'Content-Type': 'application/json; charset=UTF-8'},)with pytest.raises(ResponseValidationError) as excinfo:_va...
1
12
0
72
2
182
193
182
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
7
12
7
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween", "str", "pytest.mark.skip"]
0
[]
The function (test_500_for_bad_validated_array_response) defined within the public class called public.The function start at line 182 and ends at 193. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions,...
Yelp_pyramid_swagger
public
public
0
0
test_200_for_good_validated_array_response
def test_200_for_good_validated_array_response():request = EnhancedDummyRequest(method='GET',path='/sample_array_response',)response = Response(body=simplejson.dumps([{"enum_value": "good_enum_value"}]),headers={'Content-Type': 'application/json; charset=UTF-8'},)_validate_against_tween(request, response=response)
1
10
0
53
2
197
207
197
['request', 'response']
None
{"Assign": 2, "Expr": 1}
5
11
5
["EnhancedDummyRequest", "Response", "simplejson.dumps", "_validate_against_tween", "pytest.mark.skip"]
0
[]
The function (test_200_for_good_validated_array_response) defined within the public class called public.The function start at line 197 and ends at 207. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions...
Yelp_pyramid_swagger
public
public
0
0
test_200_for_normal_response_validation
def test_200_for_normal_response_validation():app = build_test_app(swagger_versions=['1.2'],**{'pyramid_swagger.enable_response_validation': True})response = app.post_json('/sample', {'foo': 'test', 'bar': 'test'})assert response.status_code == 200
1
7
0
45
2
211
217
211
['app', 'response']
None
{"Assign": 2}
3
7
3
["build_test_app", "app.post_json", "pytest.mark.skip"]
0
[]
The function (test_200_for_normal_response_validation) defined within the public class called public.The function start at line 211 and ends at 217. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, an...
Yelp_pyramid_swagger
public
public
0
0
test_200_skip_validation_for_excluded_path
def test_200_skip_validation_for_excluded_path():# FIXME(#64): This test is broken and doesn't check anything.app = build_test_app(swagger_versions=['1.2'],**{'pyramid_swagger.exclude_paths': [r'^/sample/?']})response = app.get('/sample/path_arg1/resource',params={'required_arg': 'test'})assert response.status_code == ...
1
10
0
46
2
221
231
221
['app', 'response']
None
{"Assign": 2}
3
11
3
["build_test_app", "app.get", "pytest.mark.skip"]
0
[]
The function (test_200_skip_validation_for_excluded_path) defined within the public class called public.The function start at line 221 and ends at 231. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions...
Yelp_pyramid_swagger
public
public
0
0
test_app_error_if_path_not_in_spec_and_path_validation_disabled
def test_app_error_if_path_not_in_spec_and_path_validation_disabled():"""If path missing and validation is disabled we want to let something elsehandle the error. TestApp throws an AppError, but Pyramid would throw aHTTPNotFound exception."""with pytest.raises(AppError):app = build_test_app(swagger_versions=['1.2'],**{...
1
7
0
37
1
235
245
235
['app']
None
{"Assign": 1, "Expr": 1, "With": 1}
4
11
4
["pytest.raises", "build_test_app", "app.get", "pytest.mark.skip"]
0
[]
The function (test_app_error_if_path_not_in_spec_and_path_validation_disabled) defined within the public class called public.The function start at line 235 and ends at 245. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It de...
Yelp_pyramid_swagger
public
public
0
0
test_error_handling_for_12
def test_error_handling_for_12():app = build_test_app(swagger_versions=['1.2'],**{'pyramid_swagger.enable_response_validation': True})# Should throw 400 and not 500 (500 is thrown by pyramid_swagger when# response_validation is True and response format does not match the# type specified by the operation's swagger spec....
1
6
0
36
1
249
258
249
['app']
None
{"Assign": 1}
3
10
3
["build_test_app", "app.get", "pytest.mark.skip"]
0
[]
The function (test_error_handling_for_12) defined within the public class called public.The function start at line 249 and ends at 258. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0...
Yelp_pyramid_swagger
public
public
0
0
test_response_validation_context
def test_response_validation_context():request = EnhancedDummyRequest(method='GET',path='/sample/path_arg1/resource',params={'required_arg': 'test'},matchdict={'path_arg': 'path_arg1'},)# Omit the logging_info key from the response.response = Response(body=simplejson.dumps({'raw_response': 'foo'}),headers={'Content-Typ...
1
17
0
82
2
262
279
262
['request', 'response']
None
{"Assign": 2, "Expr": 1, "With": 1}
6
18
6
["EnhancedDummyRequest", "Response", "simplejson.dumps", "pytest.raises", "_validate_against_tween", "pytest.mark.skip"]
0
[]
The function (test_response_validation_context) defined within the public class called public.The function start at line 262 and ends at 279. It contains 17 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It ...
Yelp_pyramid_swagger
public
public
0
0
settings
def settings():dir_path = 'tests/sample_schemas/yaml_app/'return {'pyramid_swagger.schema_file': 'swagger.yaml','pyramid_swagger.schema_directory': dir_path,'pyramid_swagger.enable_request_validation': True,'pyramid_swagger.enable_swagger_spec_validation': True,}
1
8
0
26
1
20
27
20
['dir_path']
Returns
{"Assign": 1, "Return": 1}
0
8
0
[]
37
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3613668_guillermooo_dart_sublime_bundle.execute_py.DartExecCommand.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.get_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Datase...
The function (settings) defined within the public class called public.The function start at line 20 and ends at 27. 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 has 37.0 functions calling this function which are ["_....
Yelp_pyramid_swagger
public
public
0
0
yaml_app
def yaml_app():return SwaggerFormat(format='base64', to_wire=base64.b64encode, to_python=base64.b64decode, validate=base64.b64decode, description='base64')
1
6
0
33
0
31
36
31
[]
Returns
{"Return": 1}
1
6
1
["SwaggerFormat"]
0
[]
The function (yaml_app) defined within the public class called public.The function start at line 31 and ends at 36. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, and It has 1.0 function called i...
Yelp_pyramid_swagger
public
public
0
0
testapp_with_base64
def testapp_with_base64(settings, yaml_app):"""Fixture for setting up a Swagger 2.0 version of the test testapp."""settings['pyramid_swagger.swagger_versions'] = ['2.0']settings['pyramid_swagger.user_formats'] = [yaml_app]return App(main({}, **settings))
1
4
2
36
0
40
44
40
settings,yaml_app
[]
Returns
{"Assign": 2, "Expr": 1, "Return": 1}
2
5
2
["App", "main"]
0
[]
The function (testapp_with_base64) defined within the public class called public.The function start at line 40 and ends at 44. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [40.0], and this function return a value. It declares 2.0 functions, and It has 2.0 f...
Yelp_pyramid_swagger
public
public
0
0
test_user_format_happy_case
def test_user_format_happy_case(testapp_with_base64):response = testapp_with_base64.get('/sample/path_arg1/resource', params={'required_arg': 'MQ=='},)assert response.status_code == 200
1
4
1
28
1
47
50
47
testapp_with_base64
['response']
None
{"Assign": 1}
1
4
1
["testapp_with_base64.get"]
0
[]
The function (test_user_format_happy_case) defined within the public class called public.The function start at line 47 and ends at 50. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 fu...
Yelp_pyramid_swagger
public
public
0
0
test_user_format_failure_case
def test_user_format_failure_case(testapp_with_base64):# 'MQ' is not a valid base64 encoded string.with pytest.raises(Exception):testapp_with_base64.get('/sample/path_arg1/resource',params={'required_arg': 'MQ'},)
1
4
1
28
0
53
57
53
testapp_with_base64
[]
None
{"Expr": 1, "With": 1}
2
5
2
["pytest.raises", "testapp_with_base64.get"]
0
[]
The function (test_user_format_failure_case) defined within the public class called public.The function start at line 53 and ends at 57. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2....
Yelp_pyramid_swagger
public
public
0
0
_strip_xmodel.descend
def descend(fragment):if is_dict_like(fragment):fragment.pop('x-model', None)# Removes 'x-model' key if presentfor key in iterkeys(fragment):descend(fragment[key])elif is_list_like(fragment):for element in fragment:descend(element)
5
8
1
49
0
67
74
67
null
[]
None
null
0
0
0
null
0
null
The function (_strip_xmodel.descend) defined within the public class called public.The function start at line 67 and ends at 74. It contains 8 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
Yelp_pyramid_swagger
public
public
0
0
_strip_xmodel
def _strip_xmodel(spec_dict):""":param spec_dict: Swagger spec in dict form. This is treated as read-only.:return: deep copy of spec_dict with the x-model vendor extension stripped out."""result = copy.deepcopy(spec_dict)def descend(fragment):if is_dict_like(fragment):fragment.pop('x-model', None)# Removes 'x-model' ke...
1
5
1
22
1
60
77
60
spec_dict
['result']
Returns
{"Assign": 1, "Expr": 5, "For": 2, "If": 2, "Return": 1}
8
18
8
["copy.deepcopy", "is_dict_like", "fragment.pop", "iterkeys", "descend", "is_list_like", "descend", "descend"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.yaml_test_py.validate_json_response", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.yaml_test_py.validate_yaml_response"]
The function (_strip_xmodel) defined within the public class called public.The function start at line 60 and ends at 77. 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 8.0 functions, It has 8.0 functions calle...
Yelp_pyramid_swagger
public
public
0
0
validate_json_response
def validate_json_response(response, expected_dict):# webob < 1.7 returns the charset, webob >= 1.7 does not# see https://github.com/striglia/pyramid_swagger/issues/185assert response.headers['content-type'] in \('application/json', 'application/json; charset=UTF-8')assert _strip_xmodel(json.loads(response.body.decode(...
1
4
2
40
0
80
85
80
response,expected_dict
[]
None
{}
3
6
3
["_strip_xmodel", "json.loads", "response.body.decode"]
0
[]
The function (validate_json_response) defined within the public class called public.The function start at line 80 and ends at 85. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [80.0] and does not return any value. It declares 3.0 functions, and It has 3.0 fu...
Yelp_pyramid_swagger
public
public
0
0
validate_yaml_response
def validate_yaml_response(response, expected_dict):assert response.headers['content-type'] == 'application/x-yaml; charset=UTF-8'assert _strip_xmodel(yaml.safe_load(response.body)) == expected_dict
1
3
2
30
0
88
90
88
response,expected_dict
[]
None
{}
2
3
2
["_strip_xmodel", "yaml.safe_load"]
0
[]
The function (validate_yaml_response) defined within the public class called public.The function start at line 88 and ends at 90. It contains 3 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 declares 2.0 functions, and It has 2.0 fu...
Yelp_pyramid_swagger
public
public
0
0
_rewrite_ref
def _rewrite_ref(ref, schema_format):if schema_format == 'yaml':return ref# all refs are already yamlreturn ref.replace('.yaml', '.%s' % schema_format)
2
4
2
25
0
93
96
93
ref,schema_format
[]
Returns
{"If": 1, "Return": 2}
1
4
1
["ref.replace"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.yaml_test_py._recursively_rewrite_refs"]
The function (_rewrite_ref) defined within the public class called public.The function start at line 93 and ends at 96. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [93.0], and this function return a value. It declare 1.0 function, It has 1.0 function called...
Yelp_pyramid_swagger
public
public
0
0
_recursively_rewrite_refs
def _recursively_rewrite_refs(schema_item, schema_format):if isinstance(schema_item, dict):for key, value in schema_item.items():if key == '$ref':schema_item[key] = _rewrite_ref(value, schema_format)else:_recursively_rewrite_refs(value, schema_format)elif isinstance(schema_item, list):for item in schema_item:_recursive...
6
10
2
69
0
99
108
99
schema_item,schema_format
[]
None
{"Assign": 1, "Expr": 2, "For": 2, "If": 3}
6
10
6
["isinstance", "schema_item.items", "_rewrite_ref", "_recursively_rewrite_refs", "isinstance", "_recursively_rewrite_refs"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.yaml_test_py._recursively_rewrite_refs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056683_Yelp_pyramid_swagger.tests.acceptance.yaml_test_py.test_swagger_json_api...
The function (_recursively_rewrite_refs) defined within the public class called public.The function start at line 99 and ends at 108. It contains 10 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [99.0] and does not return any value. It declares 6.0 functions, It has 6.0 fu...
Yelp_pyramid_swagger
public
public
0
0
test_swagger_json_api_doc_route
def test_swagger_json_api_doc_route(testapp_with_base64, test_file, schema_format):validation_method = {'yaml': validate_yaml_response,'json': validate_json_response,}url = '/%s.%s' % (test_file, schema_format)response = testapp_with_base64.get(url)assert response.status_code == 200fname = 'tests/sample_schemas/yaml_ap...
1
13
3
82
5
113
129
113
testapp_with_base64,test_file,schema_format
['fname', 'expected_schema', 'validation_method', 'url', 'response']
None
{"Assign": 5, "Expr": 2, "With": 1}
6
17
6
["testapp_with_base64.get", "open", "yaml.safe_load", "_recursively_rewrite_refs", "pytest.mark.parametrize", "pytest.mark.parametrize"]
0
[]
The function (test_swagger_json_api_doc_route) defined within the public class called public.The function start at line 113 and ends at 129. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [113.0] and does not return any value. It declares 6.0 functions, and ...
Yelp_pyramid_swagger
public
public
0
0
throw_error
def throw_error(request):request.response.status = webob.exc.HTTPBadRequest.codereturn dict(error=dict(details='Throwing error!'))
1
3
1
30
0
13
15
13
request
[]
Returns
{"Assign": 1, "Return": 1}
3
3
3
["dict", "dict", "view_config"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95068886_backend_developers_ltd_ComputeHorde.validator.app.src.compute_horde_validator.validator.tests.test_other.test_set_scores_py.test_set_scores__set_weight__commit__exception"]
The function (throw_error) defined within the public class called public.The function start at line 13 and ends at 15. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 3.0 functions, It has 3.0 functions called ...
Yelp_pyramid_swagger
public
public
0
0
standard
def standard(request, path_arg):return {'raw_response': 'foo','logging_info': {},}
1
5
2
19
0
19
23
19
request,path_arg
[]
Returns
{"Return": 1}
1
5
1
["view_config"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70315194_timdettmers_bitsandbytes.tests.test_triton_py.test_switchback"]
The function (standard) defined within the public class called public.The function start at line 19 and ends at 23. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [19.0], and this function return a value. It declare 1.0 function, It has 1.0 function called ins...
Yelp_pyramid_swagger
public
public
0
0
sample
def sample(request):if not request.registry.settings.get('skip_swagger_data_assert'):assert request.swagger_datareturn {}
2
4
1
25
0
34
37
34
request
[]
Returns
{"If": 1, "Return": 1}
9
4
9
["request.registry.settings.get", "view_config", "view_config", "view_config", "view_config", "view_config", "view_config", "view_config", "view_config"]
7
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3659638_climbsrocks_auto_ml.auto_ml.utils_data_cleaning_py.BasicDataCleaning.fit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3951377_blueqat_blueqat.blueqat.backends.quimb_py.Quimb._postprocess_run", "_.content....
The function (sample) defined within the public class called public.The function start at line 34 and ends at 37. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 9.0 functions, It has 9.0 functions called insid...
Yelp_pyramid_swagger
public
public
0
0
date_view
def date_view(request):if '2.0' in request.registry.settings['pyramid_swagger.swagger_versions']:# Swagger 2.0 endpoint handlingassert isinstance(request.swagger_data['body']['date'], datetime.date)else:assert isinstance(request.swagger_data['body']['date'], six.string_types)return request.swagger_data['body']
2
6
1
60
0
42
50
42
request
[]
Returns
{"If": 1, "Return": 1}
4
9
4
["isinstance", "isinstance", "view_config", "view_config"]
0
[]
The function (date_view) defined within the public class called public.The function start at line 42 and ends at 50. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 4.0 functions, and It has 4.0 functions call...
Yelp_pyramid_swagger
public
public
0
0
post_endpoint_with_optional_body
def post_endpoint_with_optional_body(request):return request.content_length
1
2
1
9
0
55
56
55
request
[]
Returns
{"Return": 1}
2
2
2
["view_config", "view_config"]
0
[]
The function (post_endpoint_with_optional_body) defined within the public class called public.The function start at line 55 and ends at 56. 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 declares 2.0 functions, and It...
Yelp_pyramid_swagger
public
public
0
0
swagger_undefined
def swagger_undefined(request):return {}
1
2
1
8
0
60
61
60
request
[]
Returns
{"Return": 1}
1
2
1
["view_config"]
0
[]
The function (swagger_undefined) defined within the public class called public.The function start at line 60 and ends at 61. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, and It has 1.0 function...
Yelp_pyramid_swagger
public
public
0
0
main
def main(global_config, **settings):""" Very basic pyramid app """config = Configurator(settings=settings)config.include('pyramid_swagger')config.add_route('sample_nonstring','/sample/nonstring/{int_arg}/{float_arg}/{boolean_arg}',)config.add_route('standard', '/sample/{path_arg}/resource')config.add_route('get_with_no...
1
21
2
141
1
64
89
64
global_config,**settings
['config']
Returns
{"Assign": 1, "Expr": 16, "Return": 1}
17
26
17
["Configurator", "config.include", "config.add_route", "config.add_route", "config.add_route", "config.add_route", "config.add_route", "config.add_route", "config.add_route", "config.include", "config.add_route", "config.add_route", "config.add_route", "config.add_route", "config.add_route", "config.scan", "config.make...
199
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3511986_dart_archive_pub_dartlang.third_party.pystache.tests.test_commands_py.CommandsTestCase.callScript", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3518760_makerbot_pyserial.ez_setup_py.main", "_.content.gdriv...
The function (main) defined within the public class called public.The function start at line 64 and ends at 89. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [64.0], and this function return a value. It declares 17.0 functions, It has 17.0 functions called i...
Yelp_pyramid_swagger
public
public
0
0
include_samples
def include_samples(config):config.add_route('sample_header', '/header')config.add_route('sample_authentication', '/authentication')config.add_route('sample_no_response_schema', '/no_response_schema')
1
4
1
29
0
92
95
92
config
[]
None
{"Expr": 3}
3
4
3
["config.add_route", "config.add_route", "config.add_route"]
0
[]
The function (include_samples) defined within the public class called public.The function start at line 92 and ends at 95. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions ca...
CAREamics_careamics
CAREamist
public
0
0
__init__
def __init__(self,source: Union[Path, str, Configuration],work_dir: Union[Path, str] | None = None,callbacks: list[Callback] | None = None,enable_progress_bar: bool = True,) -> None:"""Initialize CAREamist with a configuration object or a path.A configuration object can be created using directly by calling `Configurati...
12
69
5
397
0
96
220
96
self,source,work_dir,callbacks,enable_progress_bar
[]
None
{"Expr": 1}
0
7
0
[]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called CAREamist.The function start at line 96 and ends at 220. It contains 69 lines of code and it has a cyclomatic complexity of 12. It takes 5 parameters, represented as [96.0] and does not return any value. It has 8182.0 functions calling this function which a...
CAREamics_careamics
CAREamist
public
0
0
_define_callbacks
def _define_callbacks(self, callbacks: list[Callback] | None, enable_progress_bar: bool) -> None:"""Define the callbacks for the training loop.Parameters----------callbacks : list of Callback, optionalList of callbacks to use during training and prediction, by default None.enable_progress_bar : boolWhether a progress b...
9
34
3
174
0
222
273
222
self,callbacks,enable_progress_bar
[]
None
{"Assign": 1, "Expr": 4, "For": 1, "If": 4}
15
52
15
["isinstance", "isinstance", "ValueError", "isinstance", "isinstance", "ValueError", "self.callbacks.extend", "HyperParametersCallback", "ModelCheckpoint", "Path", "self.cfg.training_config.checkpoint_callback.model_dump", "self.callbacks.append", "ProgressBarCallback", "self.callbacks.append", "EarlyStopping"]
0
[]
The function (_define_callbacks) defined within the public class called CAREamist.The function start at line 222 and ends at 273. It contains 34 lines of code and it has a cyclomatic complexity of 9. It takes 3 parameters, represented as [222.0] and does not return any value. It declares 15.0 functions, and It has 15....
CAREamics_careamics
CAREamist
public
0
0
stop_training
def stop_training(self) -> None:"""Stop the training loop."""# raise stop training flagself.trainer.should_stop = Trueself.trainer.limit_val_batches = 0# skipvalidation
1
3
1
22
0
275
279
275
self
[]
None
{"Assign": 2, "Expr": 1}
0
5
0
[]
0
[]
The function (stop_training) defined within the public class called CAREamist.The function start at line 275 and ends at 279. 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..
CAREamics_careamics
CAREamist
public
0
0
train
def train(self,*,datamodule: TrainDataModule | None = None,train_source: Union[Path, str, NDArray] | None = None,val_source: Union[Path, str, NDArray] | None = None,train_target: Union[Path, str, NDArray] | None = None,val_target: Union[Path, str, NDArray] | None = None,use_in_memory: bool = True,val_percentage: float ...
21
73
9
365
0
282
416
282
self,datamodule,train_source,val_source,train_target,val_target,use_in_memory,val_percentage,val_minimum_split
[]
None
{"Assign": 1, "Expr": 4, "If": 7}
22
135
22
["ValueError", "type", "len", "ValueError", "self._train_on_datamodule", "ValueError", "isinstance", "isinstance", "isinstance", "isinstance", "self._train_on_array", "isinstance", "isinstance", "isinstance", "isinstance", "isinstance", "isinstance", "isinstance", "isinstance", "self._train_on_path", "ValueError", "typ...
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3665918_alvinwan_neural_backed_decision_trees.main_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69485146_mgaido91_fbk_fairseq_st.fairseq_cli.train_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Cr...
The function (train) defined within the public class called CAREamist.The function start at line 282 and ends at 416. It contains 73 lines of code and it has a cyclomatic complexity of 21. It takes 9 parameters, represented as [282.0] and does not return any value. It declares 22.0 functions, It has 22.0 functions call...
CAREamics_careamics
CAREamist
public
0
0
_train_on_datamodule
def _train_on_datamodule(self, datamodule: TrainDataModule) -> None:"""Train the model on the provided datamodule.Parameters----------datamodule : TrainDataModuleDatamodule to train on."""# register datamoduleself.train_datamodule = datamodule# set defaults (in case `stop_training` was called before)self.trainer.should...
1
5
2
47
0
418
435
418
self,datamodule
[]
None
{"Assign": 3, "Expr": 2}
1
18
1
["self.trainer.fit"]
0
[]
The function (_train_on_datamodule) defined within the public class called CAREamist.The function start at line 418 and ends at 435. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [418.0] and does not return any value. It declare 1.0 function, and It has 1.0 ...
CAREamics_careamics
CAREamist
public
0
0
_train_on_array
def _train_on_array(self,train_data: NDArray,val_data: NDArray | None = None,train_target: NDArray | None = None,val_target: NDArray | None = None,val_percentage: float = 0.1,val_minimum_split: int = 5,) -> None:"""Train the model on the provided data arrays.Parameters----------train_data : NDArrayTraining data.val_dat...
1
19
7
96
0
437
476
437
self,train_data,val_data,train_target,val_target,val_percentage,val_minimum_split
[]
None
{"Assign": 1, "Expr": 2}
2
40
2
["TrainDataModule", "self.train"]
0
[]
The function (_train_on_array) defined within the public class called CAREamist.The function start at line 437 and ends at 476. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [437.0] and does not return any value. It declares 2.0 functions, and It has 2.0 fu...
CAREamics_careamics
CAREamist
public
0
0
_train_on_path
def _train_on_path(self,path_to_train_data: Union[Path, str],path_to_val_data: Union[Path, str] | None = None,path_to_train_target: Union[Path, str] | None = None,path_to_val_target: Union[Path, str] | None = None,use_in_memory: bool = True,val_percentage: float = 0.1,val_minimum_split: int = 1,) -> None:"""Train the m...
4
28
8
168
0
478
533
478
self,path_to_train_data,path_to_val_data,path_to_train_target,path_to_val_target,use_in_memory,val_percentage,val_minimum_split
[]
None
{"Assign": 5, "Expr": 2, "If": 3}
6
56
6
["check_path_exists", "check_path_exists", "check_path_exists", "check_path_exists", "TrainDataModule", "self.train"]
0
[]
The function (_train_on_path) defined within the public class called CAREamist.The function start at line 478 and ends at 533. It contains 28 lines of code and it has a cyclomatic complexity of 4. It takes 8 parameters, represented as [478.0] and does not return any value. It declares 6.0 functions, and It has 6.0 fun...
CAREamics_careamics
CAREamist
public
0
0
predict
def predict(# numpydoc ignore=GL08self,source: Union[Path, str],*,batch_size: int = 1,tile_size: tuple[int, ...] | None = None,tile_overlap: tuple[int, ...] | None = (48, 48),axes: str | None = None,data_type: Literal["tiff", "custom"] | None = None,tta_transforms: bool = False,dataloader_params: dict | None = None,rea...
1
14
6
113
0
541
554
541
self,source
[]
Union[list[NDArray], NDArray]
{"Expr": 1}
0
3
0
[]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707916_nicodv_kmodes.kmodes.kmodes_py.KModes.fit_predict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707916_nicodv_kmodes.kmodes.tests.test_kmodes_py.TestKModes.test_kmodes_fit_predict", "_.content.gdrive.MyDr...
The function (predict) defined within the public class called CAREamist.The function start at line 541 and ends at 554. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [541.0] and does not return any value. It has 6.0 functions calling this function which are ...
CAREamics_careamics
CAREamist
public
0
0
predict
def predict(# numpydoc ignore=GL08self,source: NDArray,*,batch_size: int = 1,tile_size: tuple[int, ...] | None = None,tile_overlap: tuple[int, ...] | None = (48, 48),axes: str | None = None,data_type: Literal["array"] | None = None,tta_transforms: bool = False,dataloader_params: dict | None = None,) -> Union[list[NDArr...
1
12
6
92
0
557
568
557
self,source
[]
Union[list[NDArray], NDArray]
{"Expr": 1}
0
3
0
[]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707916_nicodv_kmodes.kmodes.kmodes_py.KModes.fit_predict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707916_nicodv_kmodes.kmodes.tests.test_kmodes_py.TestKModes.test_kmodes_fit_predict", "_.content.gdrive.MyDr...
The function (predict) defined within the public class called CAREamist.The function start at line 557 and ends at 568. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [557.0] and does not return any value. It has 6.0 functions calling this function which are ...
CAREamics_careamics
CAREamist
public
0
0
predict
def predict(self,source: Union[PredictDataModule, Path, str, NDArray],*,batch_size: int = 1,tile_size: tuple[int, ...] | None = None,tile_overlap: tuple[int, ...] | None = (48, 48),axes: str | None = None,data_type: Literal["array", "tiff", "custom"] | None = None,tta_transforms: bool = False,dataloader_params: dict | ...
11
53
6
349
0
570
694
570
self,source
[]
Union[list[NDArray], NDArray]
{"Expr": 1}
0
3
0
[]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707916_nicodv_kmodes.kmodes.kmodes_py.KModes.fit_predict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707916_nicodv_kmodes.kmodes.tests.test_kmodes_py.TestKModes.test_kmodes_fit_predict", "_.content.gdrive.MyDr...
The function (predict) defined within the public class called CAREamist.The function start at line 570 and ends at 694. It contains 53 lines of code and it has a cyclomatic complexity of 11. It takes 6 parameters, represented as [570.0] and does not return any value. It has 6.0 functions calling this function which are...
CAREamics_careamics
CAREamist
public
0
0
predict_to_disk
def predict_to_disk(self,source: Union[PredictDataModule, Path, str],*,batch_size: int = 1,tile_size: tuple[int, ...] | None = None,tile_overlap: tuple[int, ...] | None = (48, 48),axes: str | None = None,data_type: Literal["tiff", "custom"] | None = None,tta_transforms: bool = False,dataloader_params: dict | None = Non...
12
82
6
501
0
696
872
696
self,source,batch_size,tile_size,tile_overlap,axes,data_type,tta_transforms,dataloader_params,read_source_func,extension_filter,write_type,write_extension,write_func,write_func_kwargs,prediction_dir,**kwargs
[]
None
{"AnnAssign": 2, "Assign": 18, "Expr": 4, "For": 1, "If": 9}
25
177
25
["is_absolute", "Path", "Path", "write_dir.mkdir", "ValueError", "ValueError", "get_write_func", "SupportedData.get_extension", "isinstance", "isinstance", "SupportedData.get_extension_pattern", "SupportedData", "ValueError", "type", "ValueError", "isinstance", "Path", "list_files", "self.predict", "np.concatenate", "s...
0
[]
The function (predict_to_disk) defined within the public class called CAREamist.The function start at line 696 and ends at 872. It contains 82 lines of code and it has a cyclomatic complexity of 12. It takes 6 parameters, represented as [696.0] and does not return any value. It declares 25.0 functions, and It has 25.0...
CAREamics_careamics
CAREamist
public
0
0
export_to_bmz
def export_to_bmz(self,path_to_archive: Union[Path | str],friendly_model_name: str,input_array: NDArray,authors: list[dict],general_description: str,data_description: str,covers: list[Union[Path, str]] | None = None,channel_names: list[str] | None = None,model_version: str = "0.1.0",) -> None:"""Export the model to the...
1
33
10
176
0
874
948
874
self,path_to_archive,friendly_model_name,input_array,authors,general_description,data_description,covers,channel_names,model_version
[]
None
{"Assign": 3, "Expr": 2}
4
75
4
["self.predict", "np.concatenate", "reshape_array", "export_to_bmz"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.careamist_py.CAREamist.export_to_bmz", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.conftest_py.pre_trained_bmz", "_.content.gdrive.MyDr...
The function (export_to_bmz) defined within the public class called CAREamist.The function start at line 874 and ends at 948. It contains 33 lines of code and it has a cyclomatic complexity of 1. It takes 10 parameters, represented as [874.0] and does not return any value. It declares 4.0 functions, It has 4.0 function...
CAREamics_careamics
CAREamist
public
0
0
get_losses
def get_losses(self) -> dict[str, list]:"""Return data that can be used to plot train and validation loss curves.Returns-------dict of str: listDictionary containing the losses for each epoch."""return read_csv_logger(self.cfg.experiment_name, self.work_dir / "csv_logs")
1
2
1
28
0
950
958
950
self
[]
dict[str, list]
{"Expr": 1, "Return": 1}
1
9
1
["read_csv_logger"]
0
[]
The function (get_losses) defined within the public class called CAREamist.The function start at line 950 and ends at 958. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function calle...
CAREamics_careamics
public
public
0
0
my_path
def my_path(tmpdir_factory: TempPathFactory) -> Path:"""Fixture used in doctest to create a temporary directory.Parameters----------tmpdir_factory : TempPathFactoryTemporary path factory from pytest.Returns-------PathTemporary directory path."""return tmpdir_factory.mktemp("my_path")
1
2
1
17
0
16
29
16
tmpdir_factory
[]
Path
{"Expr": 1, "Return": 1}
2
14
2
["tmpdir_factory.mktemp", "pytest.fixture"]
0
[]
The function (my_path) defined within the public class called public.The function start at line 16 and ends at 29. 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 declares 2.0 functions, and It has 2.0 functions called ins...
CAREamics_careamics
public
public
0
0
_config_builder_exit
def _config_builder_exit(ctx: typer.Context, config: Configuration) -> None:"""Function to be called at the end of a CLI configuration builder.Saves the `config` object and performs other functionality depending on the commandcontext.Parameters----------ctx : typer.ContextTyper Context.config : ConfigurationCAREamics c...
2
5
2
66
1
26
43
26
ctx,config
['conf_path']
None
{"Assign": 1, "Expr": 3, "If": 1}
5
18
5
["with_suffix", "save_configuration", "print", "yaml.dump", "config.model_dump"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.cli.conf_py.care", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.cli.conf_py.n2n", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_C...
The function (_config_builder_exit) defined within the public class called public.The function start at line 26 and ends at 43. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [26.0] and does not return any value. It declares 5.0 functions, It has 5.0 functions...
CAREamics_careamics
public
public
0
0
conf_options
def conf_options(# numpydoc ignore=PR01ctx: typer.Context,dir: Annotated[Path,typer.Option("--dir", "-d", exists=True, help="Directory to save the config file to."),] = WORK_DIR,name: Annotated[str, typer.Option("--name", "-n", help="The config file name.")] = "config",force: Annotated[bool,typer.Option("--force", "-f"...
4
32
5
157
1
57
92
57
ctx,dir,name,force,print
['conf_path']
None
{"Assign": 2, "Expr": 1, "If": 2, "Return": 1}
9
36
9
["typer.Option", "typer.Option", "typer.Option", "typer.Option", "with_suffix", "conf_path.exists", "FileExistsError", "ConfOptions", "app.callback"]
0
[]
The function (conf_options) defined within the public class called public.The function start at line 57 and ends at 92. It contains 32 lines of code and it has a cyclomatic complexity of 4. It takes 5 parameters, represented as [57.0] and does not return any value. It declares 9.0 functions, and It has 9.0 functions c...
CAREamics_careamics
public
public
0
0
care
def care(# numpydoc ignore=PR01ctx: typer.Context,experiment_name: Annotated[str, typer.Option(help="Name of the experiment.")],axes: Annotated[str, typer.Option(help="Axes of the data (e.g. SYX).")],patch_size: Annotated[click.Tuple,typer.Option(help=("Size of the patches along the spatial dimensions (if the data ""is...
1
14
4
80
0
103
116
103
ctx,experiment_name,axes,patch_size,batch_size,num_epochs,num_steps,data_type,use_augmentations,independent_channels,loss,n_channels_in,n_channels_out,logger
[]
None
{"Assign": 1, "Expr": 2}
20
89
20
["typer.Option", "typer.Option", "typer.Option", "click.Tuple", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "click.Choice", "typer.Option", "typer.Option", "typer.Option", "click.Choice", "typer.Option", "typer.Option", "typer.Option", "click.Choice", "create_care_configuration", "_config_builder_ex...
0
[]
The function (care) defined within the public class called public.The function start at line 103 and ends at 116. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [103.0] and does not return any value. It declares 20.0 functions, and It has 20.0 functions call...
CAREamics_careamics
public
public
0
0
n2n
def n2n(# numpydoc ignore=PR01ctx: typer.Context,experiment_name: Annotated[str, typer.Option(help="Name of the experiment.")],axes: Annotated[str, typer.Option(help="Axes of the data (e.g. SYX).")],patch_size: Annotated[click.Tuple,typer.Option(help=("Size of the patches along the spatial dimensions (if the data ""is ...
1
14
4
80
0
195
208
195
ctx,experiment_name,axes,patch_size,batch_size,num_epochs,num_steps,data_type,use_augmentations,independent_channels,loss,n_channels_in,n_channels_out,logger
[]
None
{"Assign": 1, "Expr": 2}
20
86
20
["typer.Option", "typer.Option", "typer.Option", "click.Tuple", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "click.Choice", "typer.Option", "typer.Option", "typer.Option", "click.Choice", "typer.Option", "typer.Option", "typer.Option", "click.Choice", "create_n2n_configuration", "_config_builder_exi...
0
[]
The function (n2n) defined within the public class called public.The function start at line 195 and ends at 208. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [195.0] and does not return any value. It declares 20.0 functions, and It has 20.0 functions calle...
CAREamics_careamics
public
public
0
0
n2v
def n2v(# numpydoc ignore=PR01ctx: typer.Context,experiment_name: Annotated[str, typer.Option(help="Name of the experiment.")],axes: Annotated[str, typer.Option(help="Axes of the data (e.g. SYX).")],patch_size: Annotated[click.Tuple,typer.Option(help=("Size of the patches along the spatial dimensions (if the data ""is ...
1
14
4
80
0
284
297
284
ctx,experiment_name,axes,patch_size,batch_size,num_epochs,num_steps,data_type,use_augmentations,independent_channels,use_n2v2,n_channels,roi_size,masked_pixel_percentage,struct_n2v_axis,struct_n2v_span,logger
[]
None
{"Assign": 1, "Expr": 2}
23
111
23
["typer.Option", "typer.Option", "typer.Option", "click.Tuple", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "click.Choice", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "click.Choice", "typer.Option", "typer.Option", "click.Choice", ...
0
[]
The function (n2v) defined within the public class called public.The function start at line 284 and ends at 297. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [284.0] and does not return any value. It declares 23.0 functions, and It has 23.0 functions calle...
CAREamics_careamics
public
public
0
0
train
def train(# numpydoc ignore=PR01source: Annotated[Path,typer.Argument(help="Path to a configuration file or a trained model.",exists=True,file_okay=True,dir_okay=False,),],train_source: Annotated[Path,typer.Option("--train-source","-ts",help="Path to the training data.",exists=True,file_okay=True,dir_okay=True,),],trai...
1
92
9
332
1
28
120
28
source,train_source,train_target,val_source,val_target,use_in_memory,val_percentage,val_minimum_split,work_dir
['engine']
None
{"Assign": 1, "Expr": 2}
12
93
12
["typer.Argument", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "typer.Option", "CAREamist", "engine.train", "app.command"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3665918_alvinwan_neural_backed_decision_trees.main_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69485146_mgaido91_fbk_fairseq_st.fairseq_cli.train_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Cr...
The function (train) defined within the public class called public.The function start at line 28 and ends at 120. It contains 92 lines of code and it has a cyclomatic complexity of 1. It takes 9 parameters, represented as [28.0] and does not return any value. It declares 12.0 functions, It has 12.0 functions called ins...
CAREamics_careamics
public
public
0
0
predict
def predict(# numpydoc ignore=PR01model: Annotated[Path,typer.Argument(help="Path to a configuration file or a trained model.",exists=True,file_okay=True,dir_okay=False,),],source: Annotated[Path,typer.Argument(help="Path to the training data. Can be a directory or single file.",exists=True,file_okay=True,dir_okay=True...
1
30
4
122
0
124
153
124
model,source,batch_size,tile_size,tile_overlap,axes,data_type,tta_transforms,write_type,work_dir,prediction_dir
[]
None
{"Assign": 1, "Expr": 2}
19
106
19
["typer.Argument", "typer.Argument", "typer.Option", "typer.Option", "click.Tuple", "typer.Option", "click.Tuple", "typer.Option", "typer.Option", "click.Choice", "typer.Option", "typer.Option", "click.Choice", "typer.Option", "typer.Option", "Path", "CAREamist", "engine.predict_to_disk", "app.command"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707916_nicodv_kmodes.kmodes.kmodes_py.KModes.fit_predict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3707916_nicodv_kmodes.kmodes.tests.test_kmodes_py.TestKModes.test_kmodes_fit_predict", "_.content.gdrive.MyDr...
The function (predict) defined within the public class called public.The function start at line 124 and ends at 153. It contains 30 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [124.0] and does not return any value. It declares 19.0 functions, It has 19.0 functions called...
CAREamics_careamics
public
public
0
0
run
def run():"""CLI Entry point."""app()
1
2
0
8
0
232
234
232
[]
None
{"Expr": 2}
1
3
1
["app"]
668
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_directories", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_project_to_path", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation...
The function (run) defined within the public class called public.The function start at line 232 and ends at 234. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside which ...
CAREamics_careamics
public
public
0
0
handle_2D_3D_callback
def handle_2D_3D_callback(value: tuple[int, int, int] | None,) -> tuple[int, ...] | None:"""Callback for options that require 2D or 3D inputs.In the case of 2D, the 3rd element should be set to -1.Parameters----------value : (int, int, int)Tile size value.Returns-------(int, int, int) | (int, int)If the last element in...
3
8
1
51
0
4
27
4
value
[]
tuple[int, ...] | None
{"Expr": 1, "If": 2, "Return": 3}
0
24
0
[]
0
[]
The function (handle_2D_3D_callback) defined within the public class called public.The function start at line 4 and ends at 27. It contains 8 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
CAREamics_careamics
Configuration
public
0
1
no_symbol
def no_symbol(cls, name: str) -> str:"""Validate experiment name.A valid experiment name is a non-empty string with only contains letters,numbers, underscores, dashes and spaces.Parameters----------name : strName to validate.Returns-------strValidated name.Raises------ValueErrorIf the name is empty or contains invalid ...
4
9
2
53
0
154
187
154
cls,name
[]
str
{"Expr": 1, "If": 2, "Return": 1}
6
34
6
["len", "name.isspace", "ValueError", "re.match", "ValueError", "field_validator"]
0
[]
The function (no_symbol) defined within the public class called Configuration, that inherit another class.The function start at line 154 and ends at 187. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [154.0] and does not return any value. It declares 6.0 func...
CAREamics_careamics
Configuration
public
0
1
validate_n2v_mask_pixel_perc
def validate_n2v_mask_pixel_perc(self: Self) -> Self:"""Validate that there will always be at least one blind-spot pixel in every patch.The probability of creating a blind-spot pixel is a function of the chosenmasked pixel percentage and patch size.Returns-------SelfValidated configuration.Raises------ValueErrorIf the ...
5
21
1
147
0
190
231
190
self
[]
Self
{"Assign": 7, "Expr": 1, "If": 2, "Return": 2}
13
42
13
["isinstance", "self.algorithm_config.model.is_3D", "int", "np.ceil", "tuple", "int", "np.ceil", "np.log2", "range", "np.prod", "np.prod", "ValueError", "model_validator"]
0
[]
The function (validate_n2v_mask_pixel_perc) defined within the public class called Configuration, that inherit another class.The function start at line 190 and ends at 231. It contains 21 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It d...
CAREamics_careamics
Configuration
public
0
1
validate_3D
def validate_3D(self: Self) -> Self:"""Change algorithm dimensions to match data.axes.Returns-------SelfValidated configuration."""if "Z" in self.data_config.axes and not self.algorithm_config.model.is_3D():# change algorithm to 3Dself.algorithm_config.model.set_3D(True)elif "Z" not in self.data_config.axes and self.al...
5
6
1
72
0
234
250
234
self
[]
Self
{"Expr": 3, "If": 2, "Return": 1}
5
17
5
["self.algorithm_config.model.is_3D", "self.algorithm_config.model.set_3D", "self.algorithm_config.model.is_3D", "self.algorithm_config.model.set_3D", "model_validator"]
0
[]
The function (validate_3D) defined within the public class called Configuration, that inherit another class.The function start at line 234 and ends at 250. It contains 6 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 5.0 functi...
CAREamics_careamics
Configuration
public
0
1
__str__
def __str__(self) -> str:"""Pretty string reprensenting the configuration.Returns-------strPretty string."""return pformat(self.model_dump())
1
2
1
17
0
252
261
252
self
[]
str
{"Expr": 1, "Return": 1}
2
10
2
["pformat", "self.model_dump"]
19
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646959_kristianoellegaard_django_hvad.hvad.test_utils.project.app.models_py.NormalProxy.__str__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646959_kristianoellegaard_django_hvad.hvad.test_utils.project.app.mod...
The function (__str__) defined within the public class called Configuration, that inherit another class.The function start at line 252 and ends at 261. 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 declares 2.0 functions,...
CAREamics_careamics
Configuration
public
0
1
set_3D
def set_3D(self, is_3D: bool, axes: str, patch_size: list[int]) -> None:"""Set 3D flag and axes.Parameters----------is_3D : boolWhether the algorithm is 3D or not.axes : strAxes of the data.patch_size : list[int]Patch size."""# set the flag and axes (this will not trigger validation at the config level)self.algorithm_c...
1
4
4
50
0
263
281
263
self,is_3D,axes,patch_size
[]
None
{"Assign": 1, "Expr": 3}
2
19
2
["self.algorithm_config.model.set_3D", "self.data_config.set_3D"]
0
[]
The function (set_3D) defined within the public class called Configuration, that inherit another class.The function start at line 263 and ends at 281. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [263.0] and does not return any value. It declares 2.0 functio...
CAREamics_careamics
Configuration
public
0
1
get_algorithm_friendly_name
def get_algorithm_friendly_name(self) -> str:"""Get the algorithm name.Returns-------strAlgorithm name."""return self.algorithm_config.get_algorithm_friendly_name()
1
2
1
16
0
283
292
283
self
[]
str
{"Expr": 1, "Return": 1}
1
10
1
["self.algorithm_config.get_algorithm_friendly_name"]
0
[]
The function (get_algorithm_friendly_name) defined within the public class called Configuration, that inherit another class.The function start at line 283 and ends at 292. 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 dec...
CAREamics_careamics
Configuration
public
0
1
get_algorithm_description
def get_algorithm_description(self) -> str:"""Return a description of the algorithm.This method is used to generate the README of the BioImage Model Zoo export.Returns-------strDescription of the algorithm."""return self.algorithm_config.get_algorithm_description()
1
2
1
16
0
294
305
294
self
[]
str
{"Expr": 1, "Return": 1}
1
12
1
["self.algorithm_config.get_algorithm_description"]
0
[]
The function (get_algorithm_description) defined within the public class called Configuration, that inherit another class.The function start at line 294 and ends at 305. 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 decla...
CAREamics_careamics
Configuration
public
0
1
get_algorithm_citations
def get_algorithm_citations(self) -> list[CiteEntry]:"""Return a list of citation entries of the current algorithm.This is used to generate the model description for the BioImage Model Zoo.Returns-------List[CiteEntry]List of citation entries."""return self.algorithm_config.get_algorithm_citations()
1
2
1
19
0
307
318
307
self
[]
list[CiteEntry]
{"Expr": 1, "Return": 1}
1
12
1
["self.algorithm_config.get_algorithm_citations"]
0
[]
The function (get_algorithm_citations) defined within the public class called Configuration, that inherit another class.The function start at line 307 and ends at 318. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare...
CAREamics_careamics
Configuration
public
0
1
get_algorithm_references
def get_algorithm_references(self) -> str:"""Get the algorithm references.This is used to generate the README of the BioImage Model Zoo export.Returns-------strAlgorithm references."""return self.algorithm_config.get_algorithm_references()
1
2
1
16
0
320
331
320
self
[]
str
{"Expr": 1, "Return": 1}
1
12
1
["self.algorithm_config.get_algorithm_references"]
0
[]
The function (get_algorithm_references) defined within the public class called Configuration, that inherit another class.The function start at line 320 and ends at 331. 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 declar...
CAREamics_careamics
Configuration
public
0
1
get_algorithm_keywords
def get_algorithm_keywords(self) -> list[str]:"""Get algorithm keywords.Returns-------list[str]List of keywords."""return self.algorithm_config.get_algorithm_keywords()
1
2
1
19
0
333
342
333
self
[]
list[str]
{"Expr": 1, "Return": 1}
1
10
1
["self.algorithm_config.get_algorithm_keywords"]
0
[]
The function (get_algorithm_keywords) defined within the public class called Configuration, that inherit another class.The function start at line 333 and ends at 342. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare ...