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
Sema4AI_actions
_Checker
protected
0
0
__init__
def __init__(self, expected_value):self.x = 0self.expected_value = expected_value
1
3
2
17
0
5
7
5
self,expected_value
[]
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 protected class called _Checker.The function start at line 5 and ends at 7. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [5.0] and does not return any value. It has 6243.0 functions calling this function which are [...
Sema4AI_actions
_Checker
protected
0
0
generate_error_or_none
def generate_error_or_none(self):self.x += 1return ("X is not %s" % self.expected_valueif self.x != self.expected_valueelse None)
2
7
1
28
0
9
15
9
self
[]
Returns
{"AugAssign": 1, "Return": 1}
0
7
0
[]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.common.src.sema4ai.common.wait_for_py.wait_for_non_error_condition", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.devutils.src.devutils.fixtures_py.wait_for_non_err...
The function (generate_error_or_none) defined within the protected class called _Checker.The function start at line 9 and ends at 15. 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 has 2.0 functions calling this functi...
Sema4AI_actions
public
public
0
0
test_wait_for_non_error_condition
def test_wait_for_non_error_condition():import sysfrom sema4ai.common.wait_for import wait_for_non_error_conditionwait_for_non_error_condition(_Checker(10).generate_error_or_none)with pytest.raises(TimeoutError):wait_for_non_error_condition(_Checker(sys.maxsize).generate_error_or_none, timeout=0.5, sleep=1 / 30.0)
1
8
0
56
0
18
28
18
[]
None
{"Expr": 2, "With": 1}
5
11
5
["wait_for_non_error_condition", "_Checker", "pytest.raises", "wait_for_non_error_condition", "_Checker"]
0
[]
The function (test_wait_for_non_error_condition) defined within the public class called public.The function start at line 18 and ends at 28. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It ha...
Sema4AI_actions
public
public
0
0
test_wait_for_condition.check
def check():checker.x += 1return checker.x == checker.expected_value
1
3
0
17
0
38
40
38
null
[]
None
null
0
0
0
null
0
null
The function (test_wait_for_condition.check) defined within the public class called public.The function start at line 38 and ends at 40. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
test_wait_for_condition
def test_wait_for_condition():import sysfrom sema4ai.common.wait_for import wait_for_conditionchecker = _Checker(10)def check():checker.x += 1return checker.x == checker.expected_valuewait_for_condition(check,msg=lambda: "X (%s) is not %s" % (checker.x, checker.expected_value),)checker = _Checker(sys.maxsize)with pytes...
1
18
0
115
1
31
55
31
['checker']
Returns
{"Assign": 2, "AugAssign": 1, "Expr": 2, "Return": 1, "With": 1}
6
25
6
["_Checker", "wait_for_condition", "_Checker", "pytest.raises", "wait_for_condition", "str"]
0
[]
The function (test_wait_for_condition) defined within the public class called public.The function start at line 31 and ends at 55. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 6.0 functions, and It has 6.0...
Sema4AI_actions
Null
public
0
0
__init__
def __init__(self, *args, **kwargs):return None
1
2
3
13
0
10
11
10
self,*args,**kwargs
[]
Returns
{"Return": 1}
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 Null.The function start at line 10 and ends at 11. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [10.0], and this function return a value. It has 6243.0 functions calling this function which are [...
Sema4AI_actions
Null
public
0
0
__call__
def __call__(self, *args, **kwargs):return self
1
2
3
13
0
13
14
13
self,*args,**kwargs
[]
Returns
{"Return": 1}
0
2
0
[]
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 Null.The function start at line 13 and ends at 14. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [13.0], and this function return a value. It has 50.0 functions calling this function which are ["_...
Sema4AI_actions
Null
public
0
0
__enter__
def __enter__(self, *args, **kwargs):return self
1
2
3
13
0
16
17
16
self,*args,**kwargs
[]
Returns
{"Return": 1}
0
2
0
[]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3662468_esss_jobs_done10.tests.server.test_server_py.test_error_handling", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3687355_datarobot_batch_scoring.datarobot_batch_scoring.writer_py.NewRunContext.__enter__", "_...
The function (__enter__) defined within the public class called Null.The function start at line 16 and ends at 17. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [16.0], and this function return a value. It has 4.0 functions calling this function which are ["_...
Sema4AI_actions
Null
public
0
0
__exit__
def __exit__(self, *args, **kwargs):return self
1
2
3
13
0
19
20
19
self,*args,**kwargs
[]
Returns
{"Return": 1}
0
2
0
[]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3544998_workiva_furious.furious.context.auto_context_py.AutoContext.__exit__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3687355_datarobot_batch_scoring.datarobot_batch_scoring.writer_py.NewRunContext.__exit__",...
The function (__exit__) defined within the public class called Null.The function start at line 19 and ends at 20. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [19.0], and this function return a value. It has 5.0 functions calling this function which are ["_....
Sema4AI_actions
Null
public
0
0
__getattr__
def __getattr__(self, mname):if len(mname) > 4 and mname[:2] == "__" and mname[-2:] == "__":# Don't pretend to implement special method names.raise AttributeError(mname)return self
4
4
2
39
0
22
26
22
self,mname
[]
Returns
{"If": 1, "Return": 1}
2
5
2
["len", "AttributeError"]
12
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625043_uber_tchannel_python.tchannel.event_py.EventRegistrar.__getattr__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69528069_adrotog_pandasgui.pandasgui.datasets_py.__getattr__", "_.content.gdrive.MyDrive.Phd_...
The function (__getattr__) defined within the public class called Null.The function start at line 22 and ends at 26. It contains 4 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [22.0], and this function return a value. It declares 2.0 functions, It has 2.0 functions called...
Sema4AI_actions
Null
public
0
0
__setattr__
def __setattr__(self, name, value):return self
1
2
3
11
0
28
29
28
self,name,value
[]
Returns
{"Return": 1}
0
2
0
[]
30
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3670790_opencivicdata_pupa.pupa.scrape.base_py.BaseModel.__setattr__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3676862_pecan_pecan.pecan.configuration_py.Config.__setattr__", "_.content.gdrive.MyDrive.Phd_Thes...
The function (__setattr__) defined within the public class called Null.The function start at line 28 and ends at 29. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [28.0], and this function return a value. It has 30.0 functions calling this function which are ...
Sema4AI_actions
Null
public
0
0
__delattr__
def __delattr__(self, name):return self
1
2
2
9
0
31
32
31
self,name
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (__delattr__) defined within the public class called Null.The function start at line 31 and ends at 32. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [31.0], and this function return a value..
Sema4AI_actions
Null
public
0
0
__repr__
def __repr__(self):return "<Null>"
1
2
1
7
0
34
35
34
self
[]
Returns
{"Return": 1}
0
2
0
[]
54
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3581153_zetaops_pyoko.pyoko.listnode_py.ListNode.__repr__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3585282_geier_pycarddav.pycarddav.model_py.VCard.serialize", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Cre...
The function (__repr__) defined within the public class called Null.The function start at line 34 and ends at 35. 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 54.0 functions calling this function which are ["_.co...
Sema4AI_actions
Null
public
0
0
__str__
def __str__(self):return "Null"
1
2
1
7
0
37
38
37
self
[]
Returns
{"Return": 1}
0
2
0
[]
83
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3675814_usyd_blockchain_vandal.src.evm_cfg_py.EVMBasicBlock.__str__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3675814_usyd_blockchain_vandal.src.tac_cfg_py.TACBasicBlock.__str__", "_.content.gdrive.MyDrive.Phd...
The function (__str__) defined within the public class called Null.The function start at line 37 and ends at 38. 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 83.0 functions calling this function which are ["_.con...
Sema4AI_actions
Null
public
0
0
__len__
def __len__(self):return 0
1
2
1
7
0
40
41
40
self
[]
Returns
{"Return": 1}
0
2
0
[]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3987994_yoshiko2_av_data_capture.number_parser_py.get_number", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69765524_openshift_elliott.elliottlib.model_py.ListModel.__getitem__", "_.content.gdrive.MyDrive.Phd_Thesi...
The function (__len__) defined within the public class called Null.The function start at line 40 and ends at 41. 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 3.0 functions calling this function which are ["_.cont...
Sema4AI_actions
Null
public
0
0
__getitem__
def __getitem__(self):return self
1
2
1
7
0
43
44
43
self
[]
Returns
{"Return": 1}
0
2
0
[]
33
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3392496_unipitechnology_evok.evok.devices_py.DeviceList.__getitem__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3535398_idsia_brainstorm.brainstorm.structure.buffer_views_py.BufferView.__getitem__", "_.content.g...
The function (__getitem__) defined within the public class called Null.The function start at line 43 and ends at 44. 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 33.0 functions calling this function which are ["_...
Sema4AI_actions
Null
public
0
0
__setitem__
def __setitem__(self, *args, **kwargs):pass
1
2
3
12
0
46
47
46
self,*args,**kwargs
[]
None
{}
0
2
0
[]
32
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3392496_unipitechnology_evok.evok.devices_py.DeviceList.__setitem__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3544475_chromium_web_page_replay.third_party.dns.namedict_py.NameDict.__setitem__", "_.content.gdri...
The function (__setitem__) defined within the public class called Null.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 3 parameters, represented as [46.0] and does not return any value. It has 32.0 functions calling this function which are ["_....
Sema4AI_actions
Null
public
0
0
write
def write(self, *args, **kwargs):pass
1
2
3
12
0
49
50
49
self,*args,**kwargs
[]
None
{}
0
2
0
[]
120
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3495544_aio_libs_multidict.tests.gen_pickles_py.generate", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3511986_dart_archive_pub_dartlang.third_party.cherrypy.process.plugins_py.PIDFile.start", "_.content.gdrive.My...
The function (write) defined within the public class called Null.The function start at line 49 and ends at 50. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [49.0] and does not return any value. It has 120.0 functions calling this function which are ["_.conte...
Sema4AI_actions
Null
public
0
0
__nonzero__
def __nonzero__(self):return 0
1
2
1
7
0
52
53
52
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (__nonzero__) defined within the public class called Null.The function start at line 52 and ends at 53. 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..
Sema4AI_actions
Null
public
0
0
__iter__
def __iter__(self):return iter(())
1
2
1
11
0
55
56
55
self
[]
Returns
{"Return": 1}
1
2
1
["iter"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3708218_marshallward_f90nml.f90nml.namelist_py.Namelist.__iter__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3720174_mozilla_bleach.bleach.html5lib_shim_py.BleachHTMLTokenizer.__iter__", "_.content.gdrive.MyDriv...
The function (__iter__) defined within the public class called Null.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 declare 1.0 function, It has 1.0 function called inside w...
Sema4AI_actions
public
public
0
0
check_valid_mutex_name
def check_valid_mutex_name(mutex_name):# To be windows/linux compatible we can't use non-valid filesystem names# (as on linux it's a file-based lock).regexp = re.compile(r'[\*\?"<>|/\\:]')result = regexp.findall(mutex_name)if result is not None and len(result) > 0:raise AssertionError("Mutex name is invalid: %s" % (mut...
3
5
1
45
2
42
49
42
mutex_name
['regexp', 'result']
None
{"Assign": 2, "If": 1}
4
8
4
["re.compile", "regexp.findall", "len", "AssertionError"]
0
[]
The function (check_valid_mutex_name) defined within the public class called public.The function start at line 42 and ends at 49. It contains 5 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 funct...
Sema4AI_actions
public
public
0
0
get_tid
def get_tid():return threading.get_ident()# @UndefinedVariable
1
2
0
10
0
58
59
58
[]
Returns
{"Return": 1}
1
2
1
["threading.get_ident"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._robo_utils.system_mutex_py._verify_prev_acquired_in_thread", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.common.src.sema4a...
The function (get_tid) defined within the public class called public.The function start at line 58 and ends at 59. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, It has 1.0 function called inside ...
Sema4AI_actions
public
public
0
0
_mark_prev_acquired_in_thread
def _mark_prev_acquired_in_thread(system_mutex):with _lock:_mutex_name_to_info[system_mutex.mutex_name] = system_mutex
1
3
1
16
0
62
64
62
system_mutex
[]
None
{"Assign": 1, "With": 1}
0
3
0
[]
0
[]
The function (_mark_prev_acquired_in_thread) defined within the public class called public.The function start at line 62 and ends at 64. 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..
Sema4AI_actions
public
public
0
0
_verify_prev_acquired_in_thread
def _verify_prev_acquired_in_thread(mutex_name):with _lock:system_mutex = _mutex_name_to_info.get(mutex_name)if (system_mutex is not Noneand system_mutex.get_mutex_aquired()and not system_mutex.disposedand system_mutex.thread_id == get_tid()):raise RuntimeError("Error: this thread has already acquired a SystemMutex(%s)...
5
13
1
53
1
67
79
67
mutex_name
['system_mutex']
None
{"Assign": 1, "If": 1, "With": 1}
4
13
4
["_mutex_name_to_info.get", "system_mutex.get_mutex_aquired", "get_tid", "RuntimeError"]
0
[]
The function (_verify_prev_acquired_in_thread) defined within the public class called public.The function start at line 67 and ends at 79. It contains 13 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has...
Sema4AI_actions
public
public
0
0
_collect_mutex_allocation_msg
def _collect_mutex_allocation_msg(mutex_name):try:write_contents = []try:write_contents.append(f"PID: {os.getpid()}")except Exception:write_contents.append("PID: unable to get pid")write_contents.append("\nMutex name:")write_contents.append(mutex_name)s = io.StringIO()traceback.print_stack(file=s, f=sys._getframe().f_b...
4
19
1
110
2
82
102
82
mutex_name
['write_contents', 's']
Returns
{"Assign": 2, "Expr": 7, "Return": 3, "Try": 3}
14
21
14
["write_contents.append", "os.getpid", "write_contents.append", "write_contents.append", "write_contents.append", "io.StringIO", "traceback.print_stack", "sys._getframe", "write_contents.append", "write_contents.append", "s.getvalue", "join", "str", "os.getpid"]
0
[]
The function (_collect_mutex_allocation_msg) defined within the public class called public.The function start at line 82 and ends at 102. It contains 19 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 14.0 functions, and It...
Sema4AI_actions
public
public
0
0
__init__.release_mutex
def release_mutex(*args, **kwargs):# Note: can't use self here!if not getattr(release_mutex, "called", False):release_mutex.called = Truetry:os.close(handle)except Exception:traceback.print_exc()try:# Removing is optional as we'll try to remove on startup anyways (but# let's do it to keep the filesystem cleaner).os.unl...
4
11
2
53
0
150
163
150
null
[]
None
null
0
0
0
null
0
null
The function (__init__.release_mutex) defined within the public class called public.The function start at line 150 and ends at 163. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [150.0] and does not return any value..
Sema4AI_actions
_MutexHandle
protected
0
1
__init__
def __init__(self, mutex_name, check_reentrant=True, log_info=False, base_dir=None):""":param check_reentrant:Should only be False if this mutex is expected to be released ina different thread."""if base_dir is None:base_dir = tempfile.gettempdir()os.makedirs(base_dir, exist_ok=True)check_valid_mutex_name(mutex_name)se...
7
38
5
213
0
109
170
109
self,system_mutex,mutex_name
[]
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 protected class called _MutexHandle, that inherit another class.The function start at line 109 and ends at 170. It contains 38 lines of code and it has a cyclomatic complexity of 7. It takes 5 parameters, represented as [109.0] and does not return any value. It has 6243.0 func...
Sema4AI_actions
public
public
0
0
disposed
def disposed(self):if not self._acquired:return Truerelease_mutex = self._release_mutexif release_mutex is NULL:return Trueif getattr(release_mutex, "called", False):return Truereturn False
4
9
1
39
0
173
181
173
null
[]
None
null
0
0
0
null
0
null
The function (disposed) defined within the public class called public.The function start at line 173 and ends at 181. It contains 9 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
get_mutex_aquired
def get_mutex_aquired(self):return self._acquired
1
2
1
9
0
183
184
183
null
[]
None
null
0
0
0
null
0
null
The function (get_mutex_aquired) defined within the public class called public.The function start at line 183 and ends at 184. 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..
Sema4AI_actions
public
public
0
0
release_mutex
def release_mutex(self):self._release_mutex()
1
2
1
10
0
186
187
186
null
[]
None
null
0
0
0
null
0
null
The function (release_mutex) defined within the public class called public.The function start at line 186 and ends at 187. 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..
Sema4AI_actions
public
public
0
0
__init__.release_mutex
def release_mutex(*args, **kwargs):# Note: can't use self here!if not getattr(release_mutex, "called", False):release_mutex.called = Truetry:handle.seek(0)handle.truncate()handle.write("Releasing lock\n")handle.flush()except Exception:traceback.print_exc()try:fcntl.flock(handle, fcntl.LOCK_UN)except Exception:traceback...
5
18
2
92
0
257
275
257
null
[]
None
null
0
0
0
null
0
null
The function (__init__.release_mutex) defined within the public class called public.The function start at line 257 and ends at 275. It contains 18 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [257.0] and does not return any value..
Sema4AI_actions
_MutexHandle
protected
0
1
__init__
def __init__(self, mutex_name, check_reentrant=True, log_info=False, base_dir=None):""":param check_reentrant:Should only be False if this mutex is expected to be released ina different thread."""if base_dir is None:base_dir = tempfile.gettempdir()os.makedirs(base_dir, exist_ok=True)check_valid_mutex_name(mutex_name)se...
10
58
5
301
0
194
287
194
self,system_mutex,mutex_name
[]
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 protected class called _MutexHandle, that inherit another class.The function start at line 194 and ends at 287. It contains 58 lines of code and it has a cyclomatic complexity of 10. It takes 5 parameters, represented as [194.0] and does not return any value. It has 6243.0 fun...
Sema4AI_actions
public
public
0
0
disposed
def disposed(self):if not self._acquired:return Truerelease_mutex = self._release_mutexif release_mutex is NULL:return Trueif getattr(release_mutex, "called", False):return Truereturn False
4
9
1
39
0
290
298
173
null
[]
None
null
0
0
0
null
0
null
The function (disposed) defined within the public class called public.The function start at line 290 and ends at 298. It contains 9 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
get_mutex_aquired
def get_mutex_aquired(self):return self._acquired
1
2
1
9
0
300
301
183
null
[]
None
null
0
0
0
null
0
null
The function (get_mutex_aquired) defined within the public class called public.The function start at line 300 and ends at 301. 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..
Sema4AI_actions
public
public
0
0
release_mutex
def release_mutex(self):self._release_mutex()
1
2
1
10
0
303
304
186
null
[]
None
null
0
0
0
null
0
null
The function (release_mutex) defined within the public class called public.The function start at line 303 and ends at 304. 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..
Sema4AI_actions
_MutexHandle
protected
0
1
__init__
def __init__(self, system_mutex, mutex_name):self._system_mutex = system_mutexself._mutex_name = mutex_name
1
3
3
19
0
308
310
308
self,system_mutex,mutex_name
[]
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 protected class called _MutexHandle, that inherit another class.The function start at line 308 and ends at 310. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [308.0] and does not return any value. It has 6243.0 funct...
Sema4AI_actions
_MutexHandle
protected
0
1
__enter__
def __enter__(self, *args, **kwargs):return self
1
2
3
13
0
313
314
313
self,*args,**kwargs
[]
Returns
{"Return": 1}
0
2
0
[]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3662468_esss_jobs_done10.tests.server.test_server_py.test_error_handling", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3687355_datarobot_batch_scoring.datarobot_batch_scoring.writer_py.NewRunContext.__enter__", "_...
The function (__enter__) defined within the protected class called _MutexHandle, that inherit another class.The function start at line 313 and ends at 314. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [313.0], and this function return a value. It has 4.0 fun...
Sema4AI_actions
_MutexHandle
protected
0
1
__exit__
def __exit__(self, *args, **kwargs):self._system_mutex.release_mutex()
1
2
3
18
0
316
317
316
self,*args,**kwargs
[]
None
{"Expr": 1}
1
2
1
["self._system_mutex.release_mutex"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3544998_workiva_furious.furious.context.auto_context_py.AutoContext.__exit__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3687355_datarobot_batch_scoring.datarobot_batch_scoring.writer_py.NewRunContext.__exit__",...
The function (__exit__) defined within the protected class called _MutexHandle, that inherit another class.The function start at line 316 and ends at 317. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [316.0] and does not return any value. It declare 1.0 func...
Sema4AI_actions
public
public
0
0
timed_acquire_mutex
def timed_acquire_mutex(mutex_name,timeout=20,sleep_time=0.15,check_reentrant=True,base_dir=None,raise_error_on_timeout=False,) -> ContextManager:"""Acquires the mutex given its name, a number of attempts and a time to sleep between each attempt.:throws RuntimeError if it was not possible to get the mutex in the given ...
7
40
6
145
5
321
380
321
mutex_name,timeout,sleep_time,check_reentrant,base_dir,raise_error_on_timeout
['finish_at', 'logged', 'last_attempt', 'will_retry_msg', 'mutex']
ContextManager
{"Assign": 7, "Expr": 3, "If": 5, "Return": 1, "While": 1}
8
60
8
["time.monotonic", "time.monotonic", "SystemMutex", "mutex.get_mutex_aquired", "log.info", "RuntimeError", "time.sleep", "_MutexHandle"]
7
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._rcc_py.Rcc._run_rcc", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tests.action_server_tests.robo_utils.test_...
The function (timed_acquire_mutex) defined within the public class called public.The function start at line 321 and ends at 380. It contains 40 lines of code and it has a cyclomatic complexity of 7. It takes 6 parameters, represented as [321.0] and does not return any value. It declares 8.0 functions, It has 8.0 functi...
Sema4AI_actions
public
public
0
0
generate_mutex_name
def generate_mutex_name(target_name, prefix=""):"""A mutex name must be a valid filesystem path, so, this generates a hashthat can be used in case the original name would have conflicts."""import hashlibif not isinstance(target_name, bytes):target_name = target_name.encode("utf-8")return prefix + (hashlib.sha224(target...
2
5
2
48
1
383
393
383
target_name,prefix
['target_name']
Returns
{"Assign": 1, "Expr": 1, "If": 1, "Return": 1}
4
11
4
["isinstance", "target_name.encode", "hexdigest", "hashlib.sha224"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tests.action_server_tests.robo_utils.test_system_mutex_py.test_gen_mutex_name_from_path", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.common.tests.se...
The function (generate_mutex_name) defined within the public class called public.The function start at line 383 and ends at 393. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [383.0], and this function return a value. It declares 4.0 functions, It has 4.0 fun...
Sema4AI_actions
public
public
0
0
ci_endpoint
def ci_endpoint() -> str:ci_endpoint = os.environ.get("CI_ENDPOINT")if ci_endpoint is None:raise AssertionError("CI_ENDPOINT env variable must be specified for tests.")return ci_endpoint
2
5
0
28
1
13
17
13
['ci_endpoint']
str
{"Assign": 1, "If": 1, "Return": 1}
3
5
3
["os.environ.get", "AssertionError", "pytest.fixture"]
0
[]
The function (ci_endpoint) defined within the public class called public.The function start at line 13 and ends at 17. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions called...
Sema4AI_actions
public
public
0
0
ci_credentials
def ci_credentials() -> str:ci_credentials = os.environ.get("CI_CREDENTIALS")if ci_credentials is None:raise AssertionError("CI_CREDENTIALS env variable must be specified for tests.")return ci_credentials
2
5
0
28
1
21
25
21
['ci_credentials']
str
{"Assign": 1, "If": 1, "Return": 1}
3
5
3
["os.environ.get", "AssertionError", "pytest.fixture"]
0
[]
The function (ci_credentials) defined within the public class called public.The function start at line 21 and ends at 25. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions cal...
Sema4AI_actions
public
public
0
0
rcc_loc
def rcc_loc(tmpdir_factory):from devutils._system_mutex_in_tests import timed_acquire_mutexwith timed_acquire_mutex("download_rcc_in_tests"):tests_rcc_dir = os.path.expanduser("~/.sema4ai_tests_rcc")os.makedirs(tests_rcc_dir, exist_ok=True)# tests_rcc_dir = tmpdir_factory.mktemp("rcc_dir")location = os.path.join(str(te...
2
12
1
99
2
29
47
29
tmpdir_factory
['location', 'tests_rcc_dir']
Returns
{"Assign": 2, "AugAssign": 1, "Expr": 3, "If": 1, "Return": 1, "With": 1}
11
19
11
["timed_acquire_mutex", "os.path.expanduser", "os.makedirs", "os.path.join", "str", "_download_rcc", "os.path.exists", "subprocess.check_call", "split", "Path", "pytest.fixture"]
0
[]
The function (rcc_loc) defined within the public class called public.The function start at line 29 and ends at 47. It contains 12 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 11.0 functions, and It has 11.0 functions cal...
Sema4AI_actions
public
public
0
0
rcc
def rcc(rcc_loc, sema4ai_home, ci_endpoint):from devutils.rcc import Rccreturn Rcc(rcc_loc, sema4ai_home, ci_endpoint)
1
3
3
24
0
51
54
51
rcc_loc,sema4ai_home,ci_endpoint
[]
Returns
{"Return": 1}
1
4
1
["Rcc"]
0
[]
The function (rcc) defined within the public class called public.The function start at line 51 and ends at 54. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [51.0], and this function return a value. It declare 1.0 function, and It has 1.0 function called ins...
Sema4AI_actions
public
public
0
0
run_in_rcc
def run_in_rcc(rcc_loc: Path, cwd: Path, args: Sequence[str] = (), expect_error=False):from subprocess import CalledProcessErrorenv = os.environ.copy()env.pop("PYTHONPATH", "")env.pop("PYTHONHOME", "")env.pop("VIRTUAL_ENV", "")env["PYTHONIOENCODING"] = "utf-8"env["PYTHONUNBUFFERED"] = "1"if expect_error:ctx: Any = pyte...
2
16
3
127
2
57
75
57
rcc_loc,cwd,args,expect_error
['env', 'ctx']
None
{"AnnAssign": 1, "Assign": 4, "Expr": 4, "If": 1, "With": 1}
9
19
9
["os.environ.copy", "env.pop", "env.pop", "env.pop", "pytest.raises", "nullcontext", "subprocess.check_call", "str", "list"]
0
[]
The function (run_in_rcc) defined within the public class called public.The function start at line 57 and ends at 75. It contains 16 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [57.0] and does not return any value. It declares 9.0 functions, and It has 9.0 functions cal...
Sema4AI_actions
public
public
0
0
sema4ai_home
def sema4ai_home(tmpdir_factory) -> str:# import shutil## ret = "c:/temp/tests_robohome"# shutil.rmtree(os.path.join(ret, ".robocorp_code"), ignore_errors=True)# return retdirname = tmpdir_factory.mktemp("sema4ai_home")return str(dirname)
1
3
1
20
1
79
88
79
tmpdir_factory
['dirname']
str
{"Assign": 1, "Return": 1}
3
10
3
["tmpdir_factory.mktemp", "str", "pytest.fixture"]
0
[]
The function (sema4ai_home) defined within the public class called public.The function start at line 79 and ends at 88. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions calle...
Sema4AI_actions
public
public
0
0
_download_rcc
def _download_rcc(location: str, force: bool = False) -> None:"""Downloads rcc to the given location. Note that we don't overwrite it if italready exists (unless force == True).:param location:The location to store the rcc executable in the filesystem.:param force:Whether we should overwrite an existing installation.""...
12
38
2
203
7
94
155
94
location,force
['prefix', 'relative_path', 'machine', 'url', 'is_64', 'response', 'data']
None
{"Assign": 11, "Expr": 5, "If": 6, "Try": 2, "With": 1}
14
62
14
["os.path.exists", "os.path.exists", "platform.machine", "urllib.request.urlopen", "urllib.request.Request", "response.read", "os.makedirs", "os.path.dirname", "open", "stream.write", "os.chmod", "sys.stderr.write", "os.path.exists", "os.path.dirname"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.build_py.build", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.devutils.src.devutils.fixtures_py.rcc_loc"]
The function (_download_rcc) defined within the public class called public.The function start at line 94 and ends at 155. It contains 38 lines of code and it has a cyclomatic complexity of 12. It takes 2 parameters, represented as [94.0] and does not return any value. It declares 14.0 functions, It has 14.0 functions c...
Sema4AI_actions
StrRegression
public
0
0
__init__
def __init__(self, datadir, original_datadir, request):""":type datadir: Path:type original_datadir: Path:type request: FixtureRequest"""self.request = requestself.datadir = datadirself.original_datadir = original_datadirself.force_regen = False
1
5
4
32
0
159
168
159
self,datadir,original_datadir,request
[]
None
{"Assign": 4, "Expr": 1}
0
10
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 StrRegression.The function start at line 159 and ends at 168. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [159.0] and does not return any value. It has 6243.0 functions calling this function whi...
Sema4AI_actions
public
public
0
0
check.dump
def dump(f):# Change the binary chars for its repr.new_obtained = "".join((x if (x.isprintable() or x in ("\r", "\n")) else repr(x))for x in obtained)f.write_bytes("\n".join(new_obtained.splitlines(keepends=False)).encode("utf-8"))
4
8
1
63
0
192
200
192
null
[]
None
null
0
0
0
null
0
null
The function (check.dump) defined within the public class called public.The function start at line 192 and ends at 200. It contains 8 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
check.check_fn
def check_fn(obtained_path, expected_path):from io import StringIOfrom itertools import zip_longestobtained = obtained_path.read_bytes().decode("utf-8", "replace")expected = expected_path.read_bytes().decode("utf-8", "replace")lines1 = obtained.strip().splitlines(keepends=False)lines2 = expected.strip().splitlines(keep...
5
36
2
184
0
202
240
202
null
[]
None
null
0
0
0
null
0
null
The function (check.check_fn) defined within the public class called public.The function start at line 202 and ends at 240. It contains 36 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [202.0] and does not return any value..
Sema4AI_actions
StrRegression
public
0
0
check
def check(self, obtained: str, basename=None, fullpath=None):"""Checks the given str against a previously recorded version, or generatea new file.:param str obtained: The contents obtained:param str basename: basename of the file to test/record. If not given the nameof the test is used.Use either `basename` or `fullpat...
1
16
4
78
0
170
252
170
self,obtained,basename,fullpath
[]
None
{"Assign": 11, "Expr": 5, "For": 1, "If": 2}
26
83
26
["join", "x.isprintable", "repr", "f.write_bytes", "encode", "join", "new_obtained.splitlines", "decode", "obtained_path.read_bytes", "decode", "expected_path.read_bytes", "splitlines", "obtained.strip", "splitlines", "expected.strip", "max", "len", "StringIO", "print", "format", "zip_longest", "print", "format", "Asse...
873
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3546011_hashdist_hashdist.hashdist.spec.tests.test_utils_py.test_substitute", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3569128_timothycrosley_deprecated_frosted.frosted.api_py.check_path", "_.content.gdrive.MyD...
The function (check) defined within the public class called StrRegression.The function start at line 170 and ends at 252. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [170.0] and does not return any value. It declares 26.0 functions, It has 26.0 functions c...
Sema4AI_actions
StrRegression
public
0
0
check_until_header
def check_until_header(self, found: str):header_end = "=" * 80header_end_i = found.rfind(header_end)assert header_end_i > 0found = found[: header_end_i + len(header_end)]self.check(found)
1
6
2
44
0
254
260
254
self,found
[]
None
{"Assign": 3, "Expr": 1}
3
7
3
["found.rfind", "len", "self.check"]
0
[]
The function (check_until_header) defined within the public class called StrRegression.The function start at line 254 and ends at 260. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [254.0] and does not return any value. It declares 3.0 functions, and It has ...
Sema4AI_actions
public
public
0
0
str_regression
def str_regression(datadir, original_datadir, request):return StrRegression(datadir, original_datadir, request)
1
2
3
18
0
264
265
264
datadir,original_datadir,request
[]
Returns
{"Return": 1}
1
2
1
["StrRegression"]
0
[]
The function (str_regression) defined within the public class called public.The function start at line 264 and ends at 265. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [264.0], and this function return a value. It declare 1.0 function, and It has 1.0 funct...
Sema4AI_actions
public
public
0
0
sema4ai_actions_run
def sema4ai_actions_run(cmdline,returncode: Union[Literal["error"], Literal["any"], int],cwd=None,additional_env: Optional[Dict[str, str]] = None,timeout=None,) -> CompletedProcess:return python_run(["-m", "sema4ai.actions"] + cmdline, returncode, cwd, additional_env, timeout)
1
10
6
66
0
268
277
268
cmdline,returncode,cwd,additional_env,timeout
[]
CompletedProcess
{"Return": 1}
1
10
1
["python_run"]
76
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.actions.tests.actions_core_tests.test_collect_tasks_glob_py.test_collect_tasks_glob", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.actions.tests.actions_core_tests....
The function (sema4ai_actions_run) defined within the public class called public.The function start at line 268 and ends at 277. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [268.0] and does not return any value. It declare 1.0 function, It has 1.0 function...
Sema4AI_actions
public
public
0
0
python_run
def python_run(cmdline,returncode: Union[Literal["error"], Literal["any"], int],cwd=None,additional_env: Optional[Dict[str, str]] = None,timeout=None,) -> CompletedProcess:cp = os.environ.copy()cp["PYTHONPATH"] = os.pathsep.join([x for x in sys.path if x])if additional_env:cp.update(additional_env)args = [sys.executabl...
8
21
6
154
3
280
318
280
cmdline,returncode,cwd,additional_env,timeout
['result', 'args', 'cp']
CompletedProcess
{"Assign": 4, "Expr": 1, "If": 4, "Return": 3}
7
39
7
["os.environ.copy", "os.pathsep.join", "cp.update", "subprocess.run", "AssertionError", "result.stdout.decode", "result.stderr.decode"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.devutils.src.devutils.fixtures_py.sema4ai_actions_run"]
The function (python_run) defined within the public class called public.The function start at line 280 and ends at 318. It contains 21 lines of code and it has a cyclomatic complexity of 8. It takes 6 parameters, represented as [280.0] and does not return any value. It declares 7.0 functions, It has 7.0 functions calle...
Sema4AI_actions
StrRegression
public
0
0
__init__
def __init__(self) -> None:self.log_html: Optional[Path] = None
1
2
1
17
0
322
323
322
self,datadir,original_datadir,request
[]
None
{"Assign": 4, "Expr": 1}
0
10
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 StrRegression.The function start at line 322 and ends at 323. 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 calling this function which a...
Sema4AI_actions
Sema4AITaskRunner
public
0
0
open_log_html
def open_log_html(self):if self.log_html is None:raise AssertionError("Log target is still None.")import webbrowserwebbrowser.open(self.log_html.as_uri())
2
5
1
31
0
325
331
325
self
[]
None
{"Expr": 1, "If": 1}
3
7
3
["AssertionError", "webbrowser.open", "self.log_html.as_uri"]
0
[]
The function (open_log_html) defined within the public class called Sema4AITaskRunner.The function start at line 325 and ends at 331. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 f...
Sema4AI_actions
Sema4AITaskRunner
public
0
0
run_tasks
def run_tasks(self,cmdline,returncode,cwd=None,additional_env: Optional[Dict[str, str]] = None,) -> None:result = sema4ai_actions_run(cmdline, returncode, cwd, additional_env)decoded = result.stdout.decode("utf-8", "replace")if not cwd:cwd = "."curr_dir = Path(cwd).absolute()log_html = curr_dir / "output" / "log.html"s...
5
29
5
147
0
333
368
333
self,cmdline,returncode,cwd,additional_env
[]
None
{"Assign": 8, "AugAssign": 5, "If": 4}
10
36
10
["sema4ai_actions_run", "result.stdout.decode", "absolute", "Path", "log_html.exists", "curr_dir.exists", "os.listdir", "output_dir.exists", "os.listdir", "AssertionError"]
0
[]
The function (run_tasks) defined within the public class called Sema4AITaskRunner.The function start at line 333 and ends at 368. It contains 29 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [333.0] and does not return any value. It declares 10.0 functions, and It has 10....
Sema4AI_actions
public
public
0
0
sema4ai_task_runner
def sema4ai_task_runner():return Sema4AITaskRunner()
1
2
0
8
0
372
373
372
[]
Returns
{"Return": 1}
1
2
1
["Sema4AITaskRunner"]
0
[]
The function (sema4ai_task_runner) defined within the public class called public.The function start at line 372 and ends at 373. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, and It has 1.0 func...
Sema4AI_actions
public
public
0
0
pyfile.factory
def factory(source) -> str:assert isinstance(source, types.FunctionType)name = source.__name__source, _ = inspect.getsourcelines(source)# First, find the "def" line.def_lineno = 0for line in source:line = line.strip()if line.startswith("def") and line.endswith(":"):breakdef_lineno += 1else:raise ValueError("Failed to l...
8
25
1
192
0
413
449
413
null
[]
None
null
0
0
0
null
0
null
The function (pyfile.factory) defined within the public class called public.The function start at line 413 and ends at 449. It contains 25 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
pyfile
def pyfile(request, datadir):"""Based on debugpy pyfile fixture.A fixture providing a factory function that generates .py files.The returned factory takes a single function with an empty argument list,generates a temporary file that contains the code corresponding to thefunction body, and returns the full path to the g...
1
5
2
16
6
377
451
377
request,datadir
['line', 'tmpfile', 'source', 'indent', 'name', 'def_lineno']
Returns
{"Assign": 9, "AugAssign": 1, "Expr": 2, "For": 2, "If": 2, "Return": 2, "With": 1}
17
75
17
["isinstance", "inspect.getsourcelines", "line.strip", "line.startswith", "line.endswith", "ValueError", "line.strip", "len", "len", "line.lstrip", "line.strip", "join", "os.path.join", "str", "os.path.exists", "open", "stream.write"]
0
[]
The function (pyfile) defined within the public class called public.The function start at line 377 and ends at 451. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [377.0], and this function return a value. It declares 17.0 functions, and It has 17.0 functions...
Sema4AI_actions
public
public
0
0
wait_for_condition
def wait_for_condition(condition, msg=None, timeout=DEFAULT_TIMEOUT, sleep=1 / 20.0):"""Note: wait_for_expected_func_return is usually a better API to use asthe error message is automatically built."""import timecurtime = time.monotonic()while True:if condition():breakif timeout is not None and (time.monotonic() - curt...
7
16
4
101
2
457
479
457
condition,msg,timeout,sleep
['error_msg', 'curtime']
None
{"Assign": 2, "AugAssign": 3, "Expr": 2, "If": 4, "While": 1}
8
23
8
["time.monotonic", "condition", "time.monotonic", "callable", "msg", "str", "TimeoutError", "time.sleep"]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tests.action_server_tests.mcp.test_mcp_integration_py.mcp_server_port", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tests.action_server...
The function (wait_for_condition) defined within the public class called public.The function start at line 457 and ends at 479. It contains 16 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [457.0] and does not return any value. It declares 8.0 functions, It has 8.0 functio...
Sema4AI_actions
public
public
0
0
wait_for_non_error_condition
def wait_for_non_error_condition(generate_error_or_none, timeout=DEFAULT_TIMEOUT, sleep=1 / 20.0):import timecurtime = time.monotonic()while True:try:error_msg = generate_error_or_none()except Exception as e:error_msg = str(e)if error_msg is None:breakif timeout is not None and (time.monotonic() - curtime > timeout):ra...
6
17
3
83
2
482
502
482
generate_error_or_none,timeout,sleep
['error_msg', 'curtime']
None
{"Assign": 3, "Expr": 1, "If": 2, "Try": 1, "While": 1}
6
21
6
["time.monotonic", "generate_error_or_none", "str", "time.monotonic", "TimeoutError", "time.sleep"]
9
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tests.action_server_tests.test_server_async_py.test_server_async_api_requests_while_waiting_for_action_to_complete", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema...
The function (wait_for_non_error_condition) defined within the public class called public.The function start at line 482 and ends at 502. It contains 17 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [482.0] and does not return any value. It declares 6.0 functions, It has 6...
Sema4AI_actions
public
public
0
0
wait_for_expected_func_return.check
def check():found = func()if found != expected_return:return "Expected: %s. Found: %s" % (expected_return, found)return None
2
5
0
24
0
508
513
508
null
[]
None
null
0
0
0
null
0
null
The function (wait_for_expected_func_return.check) defined within the public class called public.The function start at line 508 and ends at 513. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
wait_for_expected_func_return
def wait_for_expected_func_return(func, expected_return, timeout=DEFAULT_TIMEOUT, sleep=1 / 20.0):def check():found = func()if found != expected_return:return "Expected: %s. Found: %s" % (expected_return, found)return Nonewait_for_non_error_condition(check, timeout, sleep)
1
5
4
29
1
505
515
505
func,expected_return,timeout,sleep
['found']
Returns
{"Assign": 1, "Expr": 1, "If": 1, "Return": 2}
2
11
2
["func", "wait_for_non_error_condition"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.common.tests.sema4ai_common_tests.test_app_locked_startup_py.test_obtain_app_mutex"]
The function (wait_for_expected_func_return) defined within the public class called public.The function start at line 505 and ends at 515. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [505.0], and this function return a value. It declares 2.0 functions, It h...
Sema4AI_actions
RoundtripPyProject
public
0
0
__init__
def __init__(self, pyproject: Path):self.pyproject = pyprojectself.original = pyproject.read_bytes()self.poetry_lock = pyproject.parent / "poetry.lock"self.poetry_lock_original = self.poetry_lock.read_bytes()
1
5
2
43
0
23
28
23
self,pyproject
[]
None
{"Assign": 4}
2
6
2
["pyproject.read_bytes", "self.poetry_lock.read_bytes"]
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 RoundtripPyProject.The function start at line 23 and ends at 28. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [23.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions...
Sema4AI_actions
RoundtripPyProject
public
0
0
update
def update(self):import tomlkit# allows roundtrip of toml filescontents = tomlkit.loads(self.original.decode("utf-8"))yield contentsnew = tomlkit.dumps(contents).encode("utf-8")self.pyproject.write_bytes(new)
1
6
1
45
0
31
37
31
self
[]
None
{"Assign": 2, "Expr": 2}
5
7
5
["tomlkit.loads", "self.original.decode", "encode", "tomlkit.dumps", "self.pyproject.write_bytes"]
1,190
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3511986_dart_archive_pub_dartlang.third_party.cherrypy._cpconfig_py.merge", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3537748_rainerf_ricodebug.src.datagraph.htmlvariableview_py.HtmlVariableView.render", "_.cont...
The function (update) defined within the public class called RoundtripPyProject.The function start at line 31 and ends at 37. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, It has 5.0 functions call...
Sema4AI_actions
RoundtripPyProject
public
0
0
restore
def restore(self):self.pyproject.write_bytes(self.original)self.poetry_lock.write_bytes(self.poetry_lock_original)
1
3
1
25
0
39
41
39
self
[]
None
{"Expr": 2}
2
3
2
["self.pyproject.write_bytes", "self.poetry_lock.write_bytes"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3916900_edf_hpc_clara.clara.plugins.clara_easybuild_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3916900_edf_hpc_clara.clara.plugins.clara_easybuild_py.restore", "_.content.gdrive.MyDrive.Phd_Thesis.Datas...
The function (restore) defined within the public class called RoundtripPyProject.The function start at line 39 and ends at 41. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions cal...
Sema4AI_actions
public
public
0
0
collect_deps_pyprojects
def collect_deps_pyprojects(root_pyproject: Path, found=None) -> Iterator[Path]:if found is None:found = set()import tomlkit# allows roundtrip of toml filescontents: dict = tomlkit.loads(root_pyproject.read_bytes().decode("utf-8"))dependencies = contents["tool"]["poetry"]["dependencies"]for key in dependencies:if key.s...
6
20
2
144
4
44
68
44
root_pyproject,found
['dep_pyproject', 'dep_name', 'found', 'dependencies']
Iterator[Path]
{"AnnAssign": 1, "Assign": 5, "Expr": 3, "For": 1, "If": 4}
9
25
9
["set", "tomlkit.loads", "decode", "root_pyproject.read_bytes", "key.startswith", "len", "dep_pyproject.exists", "found.add", "collect_deps_pyprojects"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions._github.workflows._gen_workflows_py.BaseWorkflow.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions._github.workflows._gen_workflows_py.collect_deps_pyprojects...
The function (collect_deps_pyprojects) defined within the public class called public.The function start at line 44 and ends at 68. It contains 20 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [44.0] and does not return any value. It declares 9.0 functions, It has 9.0 funct...
Sema4AI_actions
public
public
0
0
get_tag
def get_tag(tag_prefix: str) -> str:"""Args:tag_prefix: The tag prefix to match (i.e.: "sema4ai-actions")"""# Get the last tagged version.cmd = f"git describe --tags --abbrev=0 --match {tag_prefix}-[0-9]*"proc = subprocess.run(shlex.split(cmd), capture_output=True, text=True)# Something like 'sema4ai-actions-0.0.1'retu...
1
4
1
43
2
71
80
71
tag_prefix
['proc', 'cmd']
str
{"Assign": 2, "Expr": 1, "Return": 1}
3
10
3
["subprocess.run", "shlex.split", "proc.stdout.strip"]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3689772_zalando_stups_senza.senza.cli_py.console", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3689772_zalando_stups_senza.senza.cli_py.images", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_...
The function (get_tag) defined within the public class called public.The function start at line 71 and ends at 80. 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, It has 3.0 functions called inside w...
Sema4AI_actions
public
public
0
0
get_all_tags
def get_all_tags(tag_prefix: str) -> List[str]:cmd = "git tag"proc = subprocess.run(shlex.split(cmd), capture_output=True, text=True)tags = proc.stdout.strip().splitlines()regex = re.compile(rf"{tag_prefix}-[\d.]+$")return [tag for tag in tags if regex.match(tag)]
3
6
1
73
4
83
88
83
tag_prefix
['regex', 'proc', 'cmd', 'tags']
List[str]
{"Assign": 4, "Return": 1}
6
6
6
["subprocess.run", "shlex.split", "splitlines", "proc.stdout.strip", "re.compile", "regex.match"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.devutils.src.devutils.invoke_utils_py.build_common_tasks"]
The function (get_all_tags) defined within the public class called public.The function start at line 83 and ends at 88. It contains 6 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 6.0 functions, It has 6.0 functions called ins...
Sema4AI_actions
public
public
0
0
to_identifier
def to_identifier(value: str) -> str:value = re.sub(r"[^\w\s_]", "", value.lower())value = re.sub(r"[_\s]+", "_", value).strip("_")return value
1
4
1
46
1
91
94
91
value
['value']
str
{"Assign": 2, "Return": 1}
4
4
4
["re.sub", "value.lower", "strip", "re.sub"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.devutils.src.devutils.invoke_utils_py.build_common_tasks"]
The function (to_identifier) defined within the public class called public.The function start at line 91 and ends at 94. 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 4.0 functions, It has 4.0 functions called in...
Sema4AI_actions
public
public
0
0
_use_conda
def _use_conda() -> bool:"""Determines whether conda should be used for the env."""use_conda_flag = os.environ.get("RC_USE_CONDA", "")if use_conda_flag:if use_conda_flag.lower() in ("1", "true"):return Trueif use_conda_flag.lower() in ("0", "false"):return Falseraise RuntimeError(f'Unrecognized value for "RC_USE_CONDA"...
6
16
0
88
2
98
116
98
['conda_exe', 'use_conda_flag']
bool
{"Assign": 2, "Expr": 1, "If": 5, "Return": 5}
7
19
7
["os.environ.get", "use_conda_flag.lower", "use_conda_flag.lower", "RuntimeError", "os.environ.get", "exists", "Path"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.devutils.src.devutils.invoke_utils_py.build_common_tasks"]
The function (_use_conda) defined within the public class called public.The function start at line 98 and ends at 116. It contains 16 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 7.0 functions, It has 7.0 functions called ins...
Sema4AI_actions
public
public
0
0
_conda_env_name_to_conda_prefix
def _conda_env_name_to_conda_prefix() -> Dict[str, str]:ret = {}cmd = "conda env list"output = subprocess.check_output(shlex.split(cmd), encoding="utf-8")for line in output.splitlines():line = line.strip()if line.startswith("#") or not line:continuetry:name, prefix = line.split()except Exception:continue# Not all lines...
5
15
0
93
5
119
133
119
['line', 'output', 'ret', 'cmd', 'name']
Dict[str, str]
{"Assign": 7, "For": 1, "If": 1, "Return": 1, "Try": 1}
7
15
7
["subprocess.check_output", "shlex.split", "output.splitlines", "line.strip", "line.startswith", "line.split", "name.strip"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.devutils.src.devutils.invoke_utils_py._env_in_conda"]
The function (_conda_env_name_to_conda_prefix) defined within the public class called public.The function start at line 119 and ends at 133. It contains 15 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 7.0 functions, It has 7....
Sema4AI_actions
public
public
0
0
_activated_conda_env
def _activated_conda_env() -> Optional[str]:if os.environ.get("CONDA_PREFIX"):return os.environ.get("CONDA_DEFAULT_ENV", "").strip()return None
2
4
0
36
0
136
139
136
[]
Optional[str]
{"If": 1, "Return": 2}
3
4
3
["os.environ.get", "strip", "os.environ.get"]
0
[]
The function (_activated_conda_env) defined within the public class called public.The function start at line 136 and ends at 139. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 funct...
Sema4AI_actions
public
public
0
0
_env_in_conda
def _env_in_conda(env_name) -> bool:"""If the given environment name exists in conda, return True, otherwise False.:param env_name:The name of the env to check (example: 'sema4ai-actions')."""return env_name in _conda_env_name_to_conda_prefix()
1
2
1
14
0
142
149
142
env_name
[]
bool
{"Expr": 1, "Return": 1}
1
8
1
["_conda_env_name_to_conda_prefix"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.devutils.src.devutils.invoke_utils_py.build_common_tasks"]
The function (_env_in_conda) defined within the public class called public.The function start at line 142 and ends at 149. 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 ins...
Sema4AI_actions
public
public
0
0
build_common_tasks.run
def run(ctx,*cmd,env: Optional[dict] = None,cwd: Optional[str | Path] = None,**options,):options.setdefault("pty", sys.platform != "win32")options.setdefault("echo", True)if cwd is None:cwd = rootos.chdir(cwd)if env is not None:options["env"] = envargs = " ".join(cmd)return ctx.run(args, **options)
3
16
5
96
0
181
199
181
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.run) defined within the public class called public.The function start at line 181 and ends at 199. It contains 16 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [181.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.poetry
def poetry(ctx,*cmd,verbose: bool = False,cwd: Optional[str] = None,env: Optional[dict] = None,):prefix = []if _use_conda():prefix.extend(["conda", "run", "--no-capture-output", "-n", CONDA_ENV_NAME])prefix.append("poetry")if verbose:prefix.append("-vv")return run(ctx, *prefix, *cmd, env=env, cwd=cwd)
3
14
5
92
0
201
216
201
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.poetry) defined within the public class called public.The function start at line 201 and ends at 216. It contains 14 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [201.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks._make_conda_env_if_needed
def _make_conda_env_if_needed():if _use_conda():if not _env_in_conda(CONDA_ENV_NAME):print(f"Conda env: {CONDA_ENV_NAME} not found. Creating now.")cmd = f"conda create -c conda-forge -n {CONDA_ENV_NAME} python=3.10 -y"subprocess.check_call(shlex.split(cmd))
3
6
0
36
0
218
223
218
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks._make_conda_env_if_needed) defined within the public class called public.The function start at line 218 and ends at 223. It contains 6 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.install
def install(ctx, local: Optional[str] = None, update: bool = False, verbose: bool = False):"""Optionally updates then also installs dependencies.This also supports specifying local dependencies installed in development modethrough the `local` argument. Enable `verbose` to increase logging. Passing`-u` / `--update` will...
5
17
4
107
0
226
256
226
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.install) defined within the public class called public.The function start at line 226 and ends at 256. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [226.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.devinstall
def devinstall(ctx, verbose: bool = False):"""Install the package in develop mode and its dependencies.Args:verbose: Whether to run in verbose mode."""_make_conda_env_if_needed()with mark_as_develop_mode(all_packages=True):poetry(ctx, "lock")poetry(ctx, "install", verbose=verbose)
1
5
2
39
0
259
270
259
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.devinstall) defined within the public class called public.The function start at line 259 and ends at 270. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [259.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.mark_as_develop_mode
def mark_as_develop_mode(projects: Optional[List[str]] = None, all_packages: bool = False):root_pyproject = root / "pyproject.toml"assert root_pyproject.exists(), f"Expected {root_pyproject} to exist."all_pyprojects = list(collect_deps_pyprojects(root_pyproject))all_pyprojects.append(root_pyproject)roundtrips = []try:f...
10
27
2
177
0
273
310
273
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.mark_as_develop_mode) defined within the public class called public.The function start at line 273 and ends at 310. It contains 27 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [273.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks._collect_docs_to_lint
def _collect_docs_to_lint() -> List[Union[str, Path]]:# Collects Markdown documents paths to be passed to the Markdown lint tool.# FIXME(cmin764; 3 Apr 2024): Improve this into a dynamic path list by keeping#only the *.md files not containing the linting-ignore HTML comment tag as#observed with the generated API ones.d...
1
8
0
46
0
312
326
312
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks._collect_docs_to_lint) defined within the public class called public.The function start at line 312 and ends at 326. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.lint
def lint(ctx, strict: bool = False):"""Run static analysis and formatting checks.Currently, it runs the following in this order:- Ruff basic checks, then the formatting ones- isort for sorting the imports- Optionally Pylint if enabled through the `strict` switch- Markdown lint if available in the systemArgs:strict: Whe...
3
17
2
95
0
329
359
329
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.lint) defined within the public class called public.The function start at line 329 and ends at 359. It contains 17 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [329.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.typecheck
def typecheck(ctx, strict: bool = False):"""Type check code"""cmd = [ctx,"run mypy","--follow-imports=silent","--show-column-numbers","--namespace-packages","--explicit-package-bases",]cmd.extend(source_directories)if strict:cmd.append("--strict")poetry(*cmd)
2
13
2
48
0
362
375
362
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.typecheck) defined within the public class called public.The function start at line 362 and ends at 375. It contains 13 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [362.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.pretty
def pretty(ctx):"""Auto-format code and sort imports"""poetry(ctx, f"run ruff --fix {TARGETS}")poetry(ctx, f"run ruff format {RUFF_ARGS} {TARGETS}")poetry(ctx, f"run isort {TARGETS}")
1
4
1
27
0
378
382
378
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.pretty) defined within the public class called public.The function start at line 378 and ends at 382. 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..
Sema4AI_actions
public
public
0
0
build_common_tasks.test
def test(ctx, test: Optional[str] = None):"""Run unittests"""cmd = "run pytest -rfE -vv --force-regen"if test:cmd += f" {test}"if parallel_tests:cmd += " -n auto"poetry(ctx, cmd)
3
7
2
37
0
385
395
385
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.test) defined within the public class called public.The function start at line 385 and ends at 395. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [385.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.doctest
def doctest(ctx):"""Statically verify documentation examples."""pattern = re.compile(r"^\s*```python([\s\S]*?)\s*```", re.MULTILINE)files = [(root / "src").rglob("*.py"),(root / "docs" / "guides").rglob("*.md"),]output = ""for path in chain(*files):dirname = to_identifier(path.parent.name)filename = to_identifier(path....
6
31
1
212
0
398
435
398
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.doctest) defined within the public class called public.The function start at line 398 and ends at 435. It contains 31 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.build
def build(ctx):"""Build distributable .tar.gz and .wheel files"""poetry(ctx, "build")
1
2
1
12
0
438
440
438
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.build) defined within the public class called public.The function start at line 438 and ends at 440. 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..
Sema4AI_actions
public
public
0
0
build_common_tasks.publish
def publish(ctx, token: str):"""Publish to PyPI"""poetry(ctx, f"config pypi-token.pypi {token}")poetry(ctx, "publish")
1
3
2
23
0
443
446
443
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.publish) defined within the public class called public.The function start at line 443 and ends at 446. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [443.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.docs
def docs(ctx, check: bool = False, validate: bool = False):"""Build API documentation"""if validate:poetry(ctx, "run lazydocs", "--validate", package_name)returnoutput_path = root / "docs" / "api"if not output_path.exists():print("Docs output path does not exist. Skipping...")returnfor path in output_path.iterdir():pat...
6
26
3
110
0
449
479
449
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.docs) defined within the public class called public.The function start at line 449 and ends at 479. It contains 26 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [449.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.check_document_changes
def check_document_changes(ctx):"""Check if there were new document changes generated by lazydocs andare uncommited.Returns:True if there are new changes, False otherwise."""changed_files = (run(ctx, "git --no-pager diff --name-only -- docs/api", hide=True).stdout.strip().splitlines())return bool(changed_files)
1
7
1
35
0
481
495
481
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.check_document_changes) defined within the public class called public.The function start at line 481 and ends at 495. 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..
Sema4AI_actions
public
public
0
0
build_common_tasks.check_all
def check_all(ctx):"""Run all checks"""ctx.run("inv docs --check")
1
2
1
12
0
498
500
498
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.check_all) defined within the public class called public.The function start at line 498 and ends at 500. 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..
Sema4AI_actions
public
public
0
0
build_common_tasks._get_module_version
def _get_module_version(ctx) -> str:command = f'"import {package_name}; print({package_name}.__version__)"'return poetry(ctx, f"run python -c {command}").stdout.strip()
1
3
1
25
0
502
504
502
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks._get_module_version) defined within the public class called public.The function start at line 502 and ends at 504. 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..
Sema4AI_actions
public
public
0
0
build_common_tasks.make_release
def make_release(ctx):"""Create a release tag"""import semverresult = run(ctx, "git rev-parse --abbrev-ref HEAD", hide=True)branch = result.stdout.strip()if branch != "master":sys.stderr.write(f"Not on master branch: {branch}\n")sys.exit(1)current_version = _get_module_version(ctx)previous_tag = get_tag(tag_prefix)prev...
5
32
1
157
0
507
544
507
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.make_release) defined within the public class called public.The function start at line 507 and ends at 544. It contains 32 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.check_tag_version
def check_tag_version(ctx):"""Checks if the current tag matches the latest version (exits with 1 if itdoes not match and with 0 if it does match)."""module_version = _get_module_version(ctx)tag = get_tag(tag_prefix)version = tag[tag.rfind("-") + 1 :]if module_version == version:sys.stderr.write(f"Version matches ({vers...
2
13
1
71
0
547
564
547
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.check_tag_version) defined within the public class called public.The function start at line 547 and ends at 564. It contains 13 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.update_changelog_file
def update_changelog_file(file: Path, version: str):"""Update the changelog file with the new version and changes"""if not file.exists():# usually happening with the meta oneprint(f"No CHANGELOG file found, skipping update.\nExpected path: {file}")returnwith open(file, "r+") as stream:content = stream.read()new_version...
5
35
2
187
0
566
609
566
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.update_changelog_file) defined within the public class called public.The function start at line 566 and ends at 609. It contains 35 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [566.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks.build_common_tasks.set_version.update_version
def update_version(version, filepath):with open(filepath, "r") as stream:before = stream.read()after = beforefor pattern in version_patterns:after = re.sub(pattern, r'\1"%s' % (version,), after)if before != after:print("Changed: ", filepath)with open(filepath, "w") as stream:stream.write(after)
3
10
2
77
0
627
638
627
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.build_common_tasks.set_version.update_version) defined within the public class called public.The function start at line 627 and ends at 638. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [627.0] and does not return any value....
Sema4AI_actions
public
public
0
0
build_common_tasks.set_version
def set_version(ctx, version):"""Sets a new version for the project in all the needed files"""valid_version_pattern = re.compile(r"^\d+\.\d+\.\d+$")if not valid_version_pattern.match(version):print(f"Invalid version: {version}. Must be in the format major.minor.hotfix")returnversion_patterns = (re.compile(r"(version\s*...
2
18
2
108
0
612
648
612
null
[]
None
null
0
0
0
null
0
null
The function (build_common_tasks.set_version) defined within the public class called public.The function start at line 612 and ends at 648. It contains 18 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [612.0] and does not return any value..
Sema4AI_actions
public
public
0
0
build_common_tasks
def build_common_tasks(root: Path,package_name: str,tag_prefix: Optional[str] = None,ruff_format_arguments: str = "",parallel_tests: bool = True,source_directories: Tuple[str, ...] = ("src", "tests"),):"""Builds the common tasks in every task.py file of the inheriting packages.Args:root: The path to the package root. (...
2
52
6
187
53
152
650
152
root,package_name,tag_prefix,ruff_format_arguments,parallel_tests,source_directories
['args', 'content', 'released_content', 'new_version', 'double_newline', 'files', 'changelog_start_match', 'new_content', 'unreleased_match', 'valid_version_pattern', 'output_path', 'previous_version', 'pattern', 'module_version', 'filename', 'cwd', 'changed_files', 'init_file', 'version_patterns', 'current_version', '...
Returns
{"AnnAssign": 1, "Assign": 61, "AugAssign": 8, "Expr": 93, "For": 8, "If": 33, "Return": 11, "Try": 1, "With": 7}
166
499
166
["package_name.replace", "replace", "package_name.replace", "join", "strip", "options.setdefault", "options.setdefault", "os.chdir", "join", "ctx.run", "_use_conda", "prefix.extend", "prefix.append", "prefix.append", "run", "_use_conda", "_env_in_conda", "print", "subprocess.check_call", "shlex.split", "_make_conda_env...
0
[]
The function (build_common_tasks) defined within the public class called public.The function start at line 152 and ends at 650. It contains 52 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [152.0], and this function return a value. It declares 166.0 functions, and It has ...